✗
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_005_static_router_nested/input.kz:20:0 Code
// ============================================================================
// REGRESSION TEST - Static Router Nested in Dynamic Router
// ============================================================================
// Test: Can orisha:static_router be used as a catch-all inside orisha:router?
// This tests the tree-structured routing pattern:
// ~orisha:handler = orisha:router(req)
// | [GET /api/health] |> response { ... }
// | [*] |> orisha:static_router(name: "site")
//
// Compile-only test — verifies the transform pipeline:
// 1. ~orisha:static(name: ...) declaration is found
// 2. Route collection processes the directory
// 3. generated/site_routes.zig is created
// 4. static_router generates inline import + lookup code
// 5. The whole thing compiles as a nested catch-all in router
// ============================================================================
~import orisha
~import std/io
~orisha:static(name: "site", root: "testdata")
~orisha:handler = orisha:router(req)
! [GET /api/health] => response { status: 200, body: "ok", content_type: "application/json" }
! [*] |> orisha:static_router(name: "site")
~orisha:serve(port: 3099)
| shutdown s |> std/io:print.ln(s)
| failed f |> std/io:print.ln(f)
Test Configuration
Post-validation Script:
#!/bin/bash
# Post-validation: verify the static_router transform generated the routes file
if [ ! -f "generated/site_routes.zig" ]; then
echo "FAIL: generated/site_routes.zig was not created"
exit 1
fi
# Verify it contains route entries for our testdata files
if ! grep -q "index.html" "generated/site_routes.zig"; then
echo "FAIL: generated/site_routes.zig missing index.html route"
exit 1
fi
if ! grep -q "about.html" "generated/site_routes.zig"; then
echo "FAIL: generated/site_routes.zig missing about.html route"
exit 1
fi
echo "PASS: generated routes file contains expected routes"
exit 0