Skip to content

test: add comptime smoke checks#325

Open
forketyfork wants to merge 1 commit into
mainfrom
codex/improve-comptime-code-coverage
Open

test: add comptime smoke checks#325
forketyfork wants to merge 1 commit into
mainfrom
codex/improve-comptime-code-coverage

Conversation

@forketyfork
Copy link
Copy Markdown
Owner

Motivation

  • Add a lightweight, dedicated compile-time smoke suite to detect regressions in helpers that are expected to remain evaluable at comptime, such as configuration color parsing and grid/layout math.
  • Ensure invariants used by generated/comptime code (colors, palette lookup, grid dimension calculations, and index/position math) are checked proactively during CI/test runs.
  • Provide a convenient place to extend comptime coverage for future pure helpers without conflating those checks with runtime tests.

Description

  • Add src/comptime_checks.zig, a test root containing comptime-scoped checks for Color.fromHex, ThemeConfig fallback getters, PaletteConfig.getColor, GridLayout.calculateDimensions bounds, and GridPosition index/position mapping.
  • Wire the new suite into the build by adding a comptime_checks_mod in build.zig, importing the shared toml module where needed, and adding the module to zig build test as a test artifact so it runs alongside the existing application and MCP unit tests.
  • Update docs/development.md to document that zig build test now runs the compile-time smoke suite and guidance on when to extend it.

Testing

  • Ran git diff --check which passed (no whitespace/format issues reported).
  • Attempted zig build and zig build test but these were not run because zig is not installed in this environment (so the new test target was not executed here).
  • Attempted just lint / zig fmt via the dev shell but just/nix/zig were not available in the sandbox, so formatting/lint steps were not executed here.

Codex Task

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.zig with compile-time checks for color parsing, theme/palette fallbacks, grid dimension invariants, and grid index/position mapping.
  • Registers the new test root in build.zig and includes it in the test step.
  • 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants