✗
Failing This test is currently failing.
Failed: frontend
Failure Output
error[PARSE003]: Koru constructs in host-embedded files (`.kz`, `.kjs`, etc.) must start with `~` — the host→Koru switch
--> /Users/larsde/src/orisha/lib/routing.kz:13:1
|
13 | import std/testing
| ^
error[PARSE001]: parse error
--> tests/regression/300_ADVANCED_FEATURES/350_SUBFLOWS/350_012_nested_router/input.kz:15:0 Code
// ============================================================================
// REGRESSION TEST - Nested Router (Tree-Structured Routing)
// ============================================================================
// Test: Can orisha:router be nested inside another orisha:router's catch-all?
// This is the foundation for tree-structured routing where:
// ~orisha:router(req)
// | [GET /api/health] |> response { ... }
// | [*] |> orisha:router(req) <-- nested router
// | [GET /other] |> response { ... }
// | [*] |> response { ... } <-- inner catch-all
// ============================================================================
~import orisha
~import std/io
const std = @import("std");
const TestRequest = struct {
method: []const u8,
path: []const u8,
};
// Test 1: Hits outer route
const req1 = TestRequest{ .method = "GET", .path = "/api/health" };
~orisha:router(req: &req1)
! [GET /api/health] |> std/io:print.ln("outer: /api/health")
! [*] |> orisha:router(req: &req1)
! [GET /other] |> std/io:print.ln("inner: /other")
! [*] |> std/io:print.ln("inner: catch-all")
// Test 2: Falls through to inner route
const req2 = TestRequest{ .method = "GET", .path = "/other" };
~orisha:router(req: &req2)
! [GET /api/health] |> std/io:print.ln("outer: /api/health")
! [*] |> orisha:router(req: &req2)
! [GET /other] |> std/io:print.ln("inner: /other")
! [*] |> std/io:print.ln("inner: catch-all")
// Test 3: Falls through to inner catch-all
const req3 = TestRequest{ .method = "POST", .path = "/unknown" };
~orisha:router(req: &req3)
! [GET /api/health] |> std/io:print.ln("outer: /api/health")
! [*] |> orisha:router(req: &req3)
! [GET /other] |> std/io:print.ln("inner: /other")
! [*] |> std/io:print.ln("inner: catch-all")
Expected output
outer: /api/health
inner: /other
inner: catch-all
Test Configuration
MUST_RUN