✗
Failing This test is currently failing.
Failed: backend-exec
Error Details
output_emitted.zig:676:28: error: no field named 'response' in struct 'output_emitted.koru_orisha.Response'
Failure Output
Showing last 10 of 21 lines
Error: output_emitted.zig:676:28: error: no field named 'response' in struct 'output_emitted.koru_orisha.Response'
return .{ .response = .{ .status = 200, .body = "ok", .content_type = "application/json" } };
^~~~~~~~
output_emitted.zig:177:26: note: struct declared here
pub const Response = struct {
^~~~~~
referenced by:
handler: output_emitted.zig:815:50
arrived: output_emitted.zig:720:67
8 reference(s) hidden; use '-freference-trace=10' to see all references 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)
Flows
flow ~static click a branch to expand · @labels scroll to their anchor
static (name: "site", root: "testdata")
subflow ~handler click a branch to expand · @labels scroll to their anchor
router (req)
flow ~serve click a branch to expand · @labels scroll to their anchor
serve (port: 3099)
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