✗
Failing This test is currently failing.
Failed: frontend
Failure Output
error[PARSE003]: 'event' is not a Koru keyword - a declaration is introduced with 'tor' (e.g. 'tor jump { how-high: i32 }')
--> /Users/larsde/src/orisha/lib/routing.kz:57:1
|
57 | ~pub event match { path: []const u8, pattern: []const u8 }
| ^ Code
// NEGATIVE TEST — orisha:router must reject TERMINAL (`|`) pattern branches.
//
// The router dispatches INTO the matched route — effect semantics — so its
// pattern branches must be effect branches (`!`). The `[GET /path]` bracket
// syntax is just a branch-name escape, orthogonal to `|`/`!` kind. Orisha
// predates `BranchKind` and was kind-blind, silently accepting `| [pattern]`.
// This pins that the transform is now kind-aware and rejects `|` loudly.
~import orisha
~import std/io
const std = @import("std");
const TestRequest = struct {
method: []const u8,
path: []const u8,
};
const req = TestRequest{ .method = "GET", .path = "/" };
// `|` here is WRONG — these are dispatch handlers, must be `!`.
~orisha:router(req: &req)
| [GET /] |> std/io:print.ln("matched GET /")
| [*] |> std/io:print.ln("catch-all")
Must contain:
orisha:router pattern branches must use effectFlows
flow ~router click a branch to expand · @labels scroll to their anchor
router (req: &req)