test: add comptime smoke checks#325
Open
forketyfork wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a lightweight compile-time smoke test suite to ensure selected pure helpers remain usable during Zig comptime evaluation, and wires that suite into the existing zig build test workflow.
Changes:
- Adds
src/comptime_checks.zigwith compile-time checks for color parsing, theme/palette fallbacks, grid dimension invariants, and grid index/position mapping. - Registers the new test root in
build.zigand includes it in theteststep. - Documents the compile-time smoke suite in the development testing instructions.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/comptime_checks.zig |
Adds dedicated comptime smoke tests for config and grid helper invariants. |
build.zig |
Creates and runs the new comptime checks test artifact as part of zig build test. |
docs/development.md |
Documents that zig build test includes the compile-time smoke suite and when to extend it. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
comptime, such as configuration color parsing and grid/layout math.Description
src/comptime_checks.zig, a test root containingcomptime-scoped checks forColor.fromHex,ThemeConfigfallback getters,PaletteConfig.getColor,GridLayout.calculateDimensionsbounds, andGridPositionindex/position mapping.comptime_checks_modinbuild.zig, importing the sharedtomlmodule where needed, and adding the module tozig build testas a test artifact so it runs alongside the existing application and MCP unit tests.docs/development.mdto document thatzig build testnow runs the compile-time smoke suite and guidance on when to extend it.Testing
git diff --checkwhich passed (no whitespace/format issues reported).zig buildandzig build testbut these were not run becausezigis not installed in this environment (so the new test target was not executed here).just lint/zig fmtvia the dev shell butjust/nix/zigwere not available in the sandbox, so formatting/lint steps were not executed here.Codex Task