✓
Passing This code compiles and runs correctly.
Code
// Test: Universal Wildcard Tap with Metatype
//
// Demonstrates that universal wildcard taps (*:*) must use metatypes
// like Profile, Transition, or Audit (not concrete branches).
//
// With metatype, the tap can observe any event/branch combination
// and access the Profile metadata (source, branch, destination).
const std = @import("std");
~import std/taps
~import app/test_lib/logger
~event hello {}
~event goodbye {}
~proc goodbye|zig {
std.debug.print("Goodbye\n", .{});
}
~proc goodbye|zig {
std.debug.print("Goodbye\n", .{});
return .{ .done = .{} };
}
// Universal tap using metatype - observes ALL events
~tap(* -> *)
| Profile p |> app/test_lib/logger:log(msg: p.source)
~hello() |> goodbye()
Actual
[TAP] koru:start
[TAP] std.taps:tap
[TAP] koru:start
[TAP] app.test_lib.logger:log
[TAP] input:hello
[TAP] std.taps:tap
[TAP] input:hello
[TAP] app.test_lib.logger:log
Goodbye
[TAP] input:goodbye
[TAP] std.taps:tap
[TAP] input:goodbye
[TAP] app.test_lib.logger:log
[TAP] koru:end
[TAP] std.taps:tap
[TAP] koru:end
[TAP] app.test_lib.logger:log
Expected output
[TAP] koru:start
[TAP] std.taps:tap
[TAP] koru:start
[TAP] app.test_lib.logger:log
[TAP] input:hello
[TAP] std.taps:tap
[TAP] input:hello
[TAP] app.test_lib.logger:log
Goodbye
[TAP] input:goodbye
[TAP] std.taps:tap
[TAP] input:goodbye
[TAP] app.test_lib.logger:log
[TAP] koru:end
[TAP] std.taps:tap
[TAP] koru:end
[TAP] app.test_lib.logger:log
Imported Files
// Logger for wildcard tap test
const std = @import("std");
~import std/taps
~pub event log { msg: []const u8 }
~proc log|zig {
std.debug.print("[TAP] {s}\n", .{msg});
}
// Universal wildcard tap using metatype (valid usage)
~tap(* -> *)
| Profile p |> log(msg: p.source)
Test Configuration
MUST_RUN