✓
Passing This code compiles and runs correctly.
Code
// Test 310_006: Event Taps (Library Syntax)
// Validates that ~tap() observes and reacts to event transitions
const std = @import("std");
~import std/taps
// Event with an identity branch — taps work by observing TRANSITIONS,
// so the event needs a real branch to fire on.
~event hello {}
| greeted []const u8
~proc hello|zig {
std.debug.print("Main flow executed\n", .{});
return .{ .greeted = "go" };
}
// Void observer event
~event tap-action {}
~proc tap-action|zig {
std.debug.print("TAP observed!\n", .{});
}
// Tap that observes hello's `greeted` branch and logs via tap-action
~tap(hello -> *)
| greeted _ |> tap-action()
// Main flow that triggers the tap
~hello()
| greeted _ |> _
Actual
Main flow executed
TAP observed!
Expected output
Main flow executed
TAP observed!Test Configuration
MUST_RUN