testing

Tests

Template::HAML has two parallel test suites:

  • t/ — prove6-driven .rakutest files, one per feature area.

  • specs/ — BDD-Behave specs grouped by feature directory (specs/attrs/, specs/codegen/, ...). Each .rakutest under t/ has a paired *-spec.raku under specs/.

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:

./test.raku

It runs three stages in order:

  1. prove6 -j<cores> -Ilib t/ against the default direct-emit codegen.

  2. prove6 -j<cores> -Ilib t/ with HAML_DEFAULT_EMIT=ast so every test also runs against the AST walker.

  3. behave --exclude-tag benchmark for 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:

prove6 -Ilib t/                                  # direct emit
HAML_DEFAULT_EMIT=ast prove6 -Ilib t/            # AST walker
behave --exclude-tag benchmark                   # BDD specs

Install test-depends from META6.json first if you don't have them:

zef install --deps-only --/test --test-depends .

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).

Template::HAML v0.9.5

HAML template engine

Authors

  • Greg Donald

License

Artistic-2.0

Dependencies

Provides

  • Template::HAML
  • Template::HAML::Actions
  • Template::HAML::CLI
  • Template::HAML::Cache
  • Template::HAML::Codegen
  • Template::HAML::Comment
  • Template::HAML::Config
  • Template::HAML::Context
  • Template::HAML::DirectCodegen
  • Template::HAML::DirectEmit
  • Template::HAML::Doctype
  • Template::HAML::Eval
  • Template::HAML::Filter
  • Template::HAML::Filters
  • Template::HAML::Format
  • Template::HAML::Grammar
  • Template::HAML::Helpers
  • Template::HAML::HelpersRole
  • Template::HAML::Interpolation
  • Template::HAML::Lint
  • Template::HAML::Multiline
  • Template::HAML::Node
  • Template::HAML::Plain
  • Template::HAML::Plugin
  • Template::HAML::Renderer
  • Template::HAML::Statement
  • Template::HAML::Tag
  • Template::HAML::TagTransformers
  • Template::HAML::ViewContext
  • Template::HAML::Visitor
  • Template::HAML::Watch
  • Template::HAML::X

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.