This directory contains the conformance test corpus for AffineScript. The tests here are binding - changes to expected outputs require explicit justification.
conformance/
├── valid/ # Programs that must parse successfully (exit 0)
│ ├── *.affine # Source files
│ └── *.expected # Expected parser output
├── invalid/ # Programs that must fail with diagnostics (exit non-zero)
│ ├── *.affine # Source files
│ └── *.expected # Expected error diagnostics
└── README.md # This file
- Must parse without error
- CLI command:
affinescript parse <file> - Expected exit code: 0
- Output must match
.expectedfile exactly
- Must produce a parse/lex error
- CLI command:
affinescript parse <file>oraffinescript lex <file> - Expected exit code: non-zero (1 for parse errors)
- Error diagnostic must match
.expectedfile pattern
# Run all conformance tests
just conformance
# Or directly with dune
dune runtest conformance- Add
.affinesource file tovalid/orinvalid/ - Run the compiler to generate expected output
- Review and save as
.expectedfile - Commit both files together
- Format:
conformance-vN.M - Breaking changes (modified .expected): increment major version
- New tests only: increment minor version
Per the scope arrest directive:
- Minimum 10 valid programs
- Minimum 10 invalid programs
- Stable exit-code contract
- Deterministic diagnostics
