✓
Passing This code compiles and runs correctly.
Code
// Pins: multi-Expression transform handlers fire inside test blocks.
//
// `assert.eq`/`assert.contains` declare two Expression params — the
// transform-runner's call site must extract each by name (positional
// fallback), qualify the multi-segment keyword path, and replace the
// invocation with the emitted inline check. If any of those steps miss,
// the invocation survives to emission as a raw `.handler(.{ ... })` call
// with arg-text field names.
import std/testing
import std/io
test(eq positional args) {
assert.eq(1, 1)
|> assert.ok()
}
test(eq named args) {
assert.eq(expected: 2, actual: 2)
|> assert.ok()
}
test(contains fires) {
assert.contains("hello world", "wor")
|> assert.ok()
}
// Run-flow surface: the same transforms fire outside test blocks —
// a passing assert.eq is silent, the print proves the flow continued.
assert.eq(expected: 3, actual: 3)
std/io:print.ln("run-flow asserts passed")
Flows
flow ~test click a branch to expand · @labels scroll to their anchor
test (eq positional args, source: assert.eq(1, 1)
|> assert.ok())
flow ~test click a branch to expand · @labels scroll to their anchor
test (eq named args, source: assert.eq(expected: 2, actual: 2)
|> assert.ok())
flow ~test click a branch to expand · @labels scroll to their anchor
test (contains fires, source: assert.contains("hello world", "wor")
|> assert.ok())
flow ~assert.eq click a branch to expand · @labels scroll to their anchor
assert.eq (expected: 3, actual: 3)
flow ~print.ln click a branch to expand · @labels scroll to their anchor
print.ln (expr: "run-flow asserts passed")
Test Configuration
Post-validation Script:
#!/bin/bash
# The emitted test decls only execute under `zig test` — run them.
cd "$(dirname "$0")"
zig test output_emitted.zig 2>&1
exit $?