TESTS

TESTS

Compiler correctness is verified by deterministic fixture tests. Given a known GOV input, the compiler MUST produce the expected JSON output.

FIXTURE CONTRACT

Fixture Contract

Each fixture directory MUST contain:

Optional: any additional .md files referenced by the scope.

FilePurpose
CANON.mdScope governance with axiom and inherits
VOCAB.mdTerm definitions
README.mdScope description
TEST RUNNER CONTRACT

Test Runner Contract

Discover: Walk ~/.canonic/tests/fixtures/, each dir with CANON.md is a fixture Compile: Call build-surfaces on fixture dir into tempdir Strip: Remove volatile fields (_generated timestamp, _tier) Diff: Compare JSON output against ~/.canonic/tests/expected/{fixture}/CANON.json Report: Pass/fail per fixture, exit 1 on any failure

VOLATILE FIELDS

Volatile Fields

These fields change between runs and MUST be stripped before comparison:

  • _generated (contains timestamp and contract path)
  • generated (ISO timestamp)
*TESTS SPEC TOOLCHAIN*
TALK AUTO