✓
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
~event fetch-user { id: u32 }
| found []const u8
~proc fetch-user|zig {
return .{ .found = "Alice" };
}
~test(Impure event with override works) {
~fetch-user => found "TestUser"
~fetch-user(id: 1)
| found 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 $?