✓
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.
~tor hello {} -> string
~proc hello|zig {
std.debug.print("Main flow executed\n", .{});
return "go";
}
// Void observer event
~tor 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 -> *): v |> tap-action()
// Main flow that triggers the tap
~hello()
Actual
Main flow executed
TAP observed!
Expected output
Main flow executed
TAP observed!Flows
flow ~tap click a branch to expand · @labels scroll to their anchor
tap (hello -> *)
flow ~hello click a branch to expand · @labels scroll to their anchor
hello
Test Configuration
MUST_RUN