✓
Passing This code compiles and runs correctly.
Code
// Test: Basic test transform with mock substitution
//
// Tests that:
// 1. Mocks are substituted inline (flow pruning)
// 2. Bindings are extracted from mocked branch values
// 3. Assert can verify actual values
import std/testing
// Impure event - needs mock in tests (no proc = impure by default)
tor get-balance {} -> u32
// Test: Mock value is inlined, binding extracted, value verified
test(Mock value inlined with binding) {
get-balance -> 100
get-balance(): a |> assert(a == 100)
}
Flows
flow ~test click a branch to expand · @labels scroll to their anchor
test (Mock value inlined with binding, source: get-balance -> 100
get-balance(): a |> assert(a == 100))
Test Configuration
Post-validation Script:
#!/bin/bash
# Run the actual Zig tests to verify mocks work correctly
cd "$(dirname "$0")"
# Run zig test on the generated output
zig test output_emitted.zig 2>&1
exit $?