ajhahn.de
← Flash
Markdown 22 lines
# tests/

Integration tests for `flashc` — they exercise the compiler over real Flash
sources, distinct from the per-module unit tests that live in each
`src/*.zig` `test` block.

- `lex_examples.zig` — lexes every `examples/*.flash` program (embedded at
  comptime) and asserts a clean token stream.
- `fmt_examples.zig` — formats every example, asserting success, idempotence
  (`fmt(fmt(s)) == fmt(s)`), and comment preservation.
- `eval_probes.zig` — drives the checker over the probe corpus in `eval/`:
  every `eval/pass/*.flash` probe must check clean, and every
  `eval/reject/*.flash` probe must produce exactly the diagnostics its
  `// expect-error:` markers declare, on the marked lines.
- `flash/` — the Flash-source test suite: each file is transpiled by the
  freshly built `flashc` and its `test "name" { }` blocks run as ordinary
  Zig tests (`zig build test-flash`).

Run with `zig build test`; the step runs the unit tests, all of these, and
the selfhost test suite (`zig build test-selfhost` — the same harness as
`flash/`, over the `selfhost/*.flash` modules) together.