✓
Passing This code compiles and runs correctly.
Code
// Test 621: Scoped Pattern Matching
// Validates that unqualified patterns match local events by name
// Pattern ~file.* should match both file.read and file.write in current scope
const std = @import("std");
~import "$std/taps"
~event file.read {}
| done {}
~event file.write {}
| done {}
~event logger {}
~proc file.read {
std.debug.print("Reading file\n", .{});
return .{ .done = .{} };
}
~proc file.write {
std.debug.print("Writing file\n", .{});
return .{ .done = .{} };
}
~proc logger {
std.debug.print("File operation observed!\n", .{});
}
// Scoped pattern - matches BOTH local file.* events
~tap(file.* -> *)
| Transition |> logger()
~file.read()
| done |> file.write()
| done |> _
Expected Output
Reading file
File operation observed!
Writing file
File operation observed!
Test Configuration
MUST_RUN