std.testing Katana Harness
std.testing Katana Harness
Section titled “std.testing Katana Harness”Janus now ships the SPEC-241 std.testing Katana harness.
The completed surface keeps testing inside ordinary Janus:
use std.testing
test "reread count is preserved" do const reread = try read_index(...) try testing.expect_equal[usize](1, reread.count)endThe shipped harness covers:
test "..." do ... enddiscovery throughjanus test- core assertions:
expect,expect_equal,expect_not_equal,expect_equal_slices,expect_error,expect_no_error,expect_approx_abs, andexpect_approx_rel - Zig-heritage migration aliases for
expectEqualandexpectEqualSlices - source-location diagnostics with expected/actual values
- slice mismatch diagnostics with length and first differing index
TestCtxand capability-backed resource helpers- subtest paths selectable with
--only - dynamic skips, tag skips, xfail, and xpass reporting
- compile-fail tests with structured diagnostic checks
- explicit golden updates through
--update-golden - opt-in benchmarks through
--bench - runner-enforced
TestingAllocatorleak detection
The runner now fails a test when allocator accounting is unbalanced at test
end, even if the test body forgot to call expect_no_leaks.
leak detected allocations: 1 frees: 0 outstanding: 1That is the right default for a systems language. Leaks are not vibes; they are observable evidence.
Runner Surface
Section titled “Runner Surface”janus test <source.jan>janus test <source.jan> --only "suite/case"janus test <source.jan> --skip-tag slowjanus test <source.jan> --seed 12345janus test <source.jan> --jobs 8janus test <source.jan> --benchjanus test <source.jan> --jsonjanus test <source.jan> --update-goldenjanus test --helpjanus test --help now reports command help instead of treating --help as a
file path.
Verification Gates
Section titled “Verification Gates”./scripts/zb./scripts/zb test-std-testing./scripts/zb test-gap38-testing-allocatorgit diff --checkThe dedicated test-std-testing gate proves assertions, error helpers,
diagnostics, subtest filtering, skips, xfail/xpass, compile-fail tests,
goldens, benchmark reporting, service authority checks, and leak reporting.