Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →HashQL testing guide covering compiletest UI tests, unit tests, snapshot tests, //~ annotations, and --bless.
26% 87%+61 ptsof test cases passed
Passed 20 of 23 test cases with the skill, and 6 of 23 without it.
3 of 3 safety checks passed
Not used yet
HashQL uses three testing approaches. compiletest is the default for testing compiler behavior.
| Scenario | Test Type | Location |
|---|---|---|
| Diagnostics/error messages | compiletest | tests/ui/ |
| Compiler pipeline phases | compiletest | tests/ui/ |
| MIR/HIR/AST pass integration | compiletest | tests/ui/ |
| MIR/HIR/AST pass edge cases | insta | tests/ui/<category>/ |
| MIR pass unit tests | MIR builder | src/**/tests.rs |
| Core crate (where needed) | insta | src/**/snapshots/ |
| Parser fragments (syntax-jexpr) | insta | src/*/snapshots/ |
| Internal functions/logic | Unit tests | src/*.rs |
Test parsing, type checking, and error reporting using J-Expr files with diagnostic annotations.
Structure:
package/tests/ui/
category/
.spec.toml # Suite specification (required)
test.jsonc # Test input
test.stdout # Expected output (run: pass)
test.stderr # Expected errors (run: fail)
test.aux.svg # Auxiliary output (some suites)
Commands:
cargo run -p hashql-compiletest run # Run all
cargo run -p hashql-compiletest run --filter "test(name)" # Filter
cargo run -p hashql-compiletest run --bless # Update expected
Next to this one in the catalogue, plus more from the same author.