○
Planned This feature is planned but not yet implemented.
OWED: nested static router dispatches.
Error Details
install
Failure Output
Showing last 10 of 35 lines
error: the following command failed with 1 compilation errors:
/opt/homebrew/Cellar/zig/0.15.2_1/bin/zig build-exe -I/opt/homebrew/Cellar/openssl@3/3.6.3/include -L/opt/homebrew/Cellar/openssl@3/3.6.3/lib -lssl -I/opt/homebrew/Cellar/openssl@3/3.6.3/include -L/opt/homebrew/Cellar/openssl@3/3.6.3/lib -lcrypto -ODebug -I /opt/homebrew/opt/openssl@3/include -L /opt/homebrew/opt/openssl@3/lib -Mroot=/Users/larsde/src/koru/tests/regression/300_ADVANCED_FEATURES/350_SUBFLOWS/350_005_static_router_nested/output_emitted.zig -lc --cache-dir .zig-cache --global-cache-dir /Users/larsde/.cache/zig --name output --zig-lib-dir /opt/homebrew/Cellar/zig/0.15.2_1/lib/zig/ --listen=-
Build Summary: 0/3 steps succeeded; 1 failed
install transitive failure
+- install output transitive failure
+- compile exe output Debug native 1 errors
error: the following build command failed with exit code 1:
.zig-cache/o/ad4f096596c686b50ae39e33e6d09b48/build /opt/homebrew/Cellar/zig/0.15.2_1/bin/zig /opt/homebrew/Cellar/zig/0.15.2_1/lib/zig /Users/larsde/src/koru/tests/regression/300_ADVANCED_FEATURES/350_SUBFLOWS/350_005_static_router_nested .zig-cache /Users/larsde/.cache/zig --seed 0xe61fe0b2 -Zbd235eaa66814bce -Doptimize=Debug 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
koru.json:
{
"name": "static_router_nested",
"version": "0.1.0",
"paths": {
"std": "../../../../../koru_std",
"orisha": "../../../../../../orisha/lib"
}
}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