✓
Passing This code compiles and runs correctly.
Code
// Test: std.runtime:run returns parse_error when no flow exists
~import "$std/runtime"
~import "$std/io"
~pub event ping {}
| ok { value: u64 }
~proc ping {
return .{ .ok = .{ .value = 1 } };
}
~std.runtime:register(scope: "api") {
ping(1)
}
const TEST_SOURCE = "ping()"; // missing leading ~, so no flow
~std.runtime:run(source: TEST_SOURCE, scope: "api")
| result _ |> std.io:print.ln("OK")
| exhausted _ |> std.io:print.ln("EXHAUSTED")
| parse_error _ |> std.io:print.ln("PARSE ERROR")
| validation_error _ |> std.io:print.ln("VALIDATION ERROR")
| event_denied _ |> std.io:print.ln("EVENT DENIED")
| dispatch_error _ |> std.io:print.ln("DISPATCH ERROR")
| scope_not_found _ |> std.io:print.ln("SCOPE NOT FOUND")
Expected Output
PARSE ERROR
Test Configuration
MUST_RUN