✓
Passing This code compiles and runs correctly.
Code
// Test: Impure event with override works
//
// Pair to 395_005 (impure event without override errors).
// Verifies that the mock substitution replaces the impure
// proc body and the mocked branch value propagates through
// the binding.
~import std/testing
~tor fetch-user { id: u32 } -> string
~proc fetch-user|zig {
return "Alice";
}
~test(Impure event with override works) {
~fetch-user -> "TestUser"
~fetch-user(id: 1): u |> assert(u.len == 8)
}
Flows
flow ~test click a branch to expand · @labels scroll to their anchor
test (Impure event with override works, source: ~fetch-user -> "TestUser"
~fetch-user(id: 1): u |> assert(u.len == 8))
Test Configuration
Post-validation Script:
#!/bin/bash
# Run the actual Zig tests to verify impure events work WITH mocks
cd "$(dirname "$0")"
# Run zig test on the generated output
zig test output_emitted.zig 2>&1
exit $?