Tests¶
Template::HAML has two parallel test suites:
t/—prove6-driven.rakutestfiles, one per feature area.specs/— BDD-Behave specs grouped by feature directory (specs/attrs/,specs/codegen/, ...). Each.rakutestundert/has a paired*-spec.rakuunderspecs/.
The two suites cover the same behavior from different angles: the
.rakutest files test the public API at the unit level; the BDD specs
describe expected behavior in a describe/context/it form and are
the source of truth for the documented syntax.
Run¶
The canonical way to run the full suite is the project's driver script:
1 | |
It runs three stages in order:
prove6 -j<cores> -Ilib t/against the default direct-emit codegen.prove6 -j<cores> -Ilib t/withHAML_DEFAULT_EMIT=astso every test also runs against the AST walker.behave --exclude-tag benchmarkfor the BDD specs (benchmarks are excluded from the default run; see Benchmarks).
Author-only checks are gated behind AUTHOR_TESTING=1; test.raku sets
that automatically, so the META validation in t/0000-meta.rakutest and
t/0010-meta-provides.rakutest runs as part of the local suite.
To run a single stage manually:
1 2 3 | |
Install test-depends from META6.json first if you don't have them:
1 | |
Golden-file tests¶
t/0410-golden-files.rakutest iterates t/fixtures/golden/*.haml against
t/fixtures/golden/*.html and asserts the rendered output matches the
recorded golden output. Add a new fixture by dropping a matched
.haml/.html pair into that directory.
CI¶
Every push and every pull request runs the workflow at
.github/workflows/ci.yml on ubuntu-latest. The workflow installs
Rakudo, BDD-Behave, project test-deps, and App::Prove6, then runs
./test.raku followed by behave --benchmark specs/bench/ to exercise
the benchmark harness as a smoke test (with HAML_BENCH_ITERS=10).