noir-frontend-tests
Installation
SKILL.md
Writing noirc_frontend Unit Tests
Tests live under compiler/noirc_frontend/src/tests/. The root module tests.rs defines helpers and declares submodules organized by topic.
Helpers in tests.rs
Importable from submodules via use crate::tests::{...}.
Compilation
| Helper | Use when |
|---|---|
assert_no_errors(src) |
Program should compile without errors. Panics with "Expected no errors" and prints diagnostics. Returns Context. |
assert_no_errors_without_report(src) |
Same but doesn't print diagnostics on failure. |
get_program_errors(src) -> Vec<CompilationError> |
Get raw error list for manual inspection. |
get_program_using_features(src, &[UnstableFeature]) |
Compile with specific unstable features enabled. |