Fix testing pages: move read-spec-file into :data for client routing
read-spec-file is a server-only page helper. When the client router tried to evaluate :content, it couldn't find the function. Move all file reads into the :data expression (evaluated server-side) so :content only references data bindings. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -744,7 +744,7 @@ def _run_modular_tests(spec_name: str) -> dict:
|
||||
|
||||
elapsed = round((time.monotonic() - t0) * 1000)
|
||||
|
||||
return {
|
||||
result = {
|
||||
"server-results": {
|
||||
"passed": passed,
|
||||
"failed": failed,
|
||||
@@ -752,9 +752,23 @@ def _run_modular_tests(spec_name: str) -> dict:
|
||||
"elapsed-ms": elapsed,
|
||||
"output": "\n".join(lines),
|
||||
"spec": spec_name,
|
||||
}
|
||||
},
|
||||
"framework-source": _read_spec_file("test-framework.sx"),
|
||||
}
|
||||
|
||||
# Include spec sources so :content can reference them from data
|
||||
if spec_name == "all":
|
||||
result["eval-source"] = _read_spec_file("test-eval.sx")
|
||||
result["parser-source"] = _read_spec_file("test-parser.sx")
|
||||
result["router-source"] = _read_spec_file("test-router.sx")
|
||||
result["render-source"] = _read_spec_file("test-render.sx")
|
||||
else:
|
||||
spec = SPECS.get(spec_name)
|
||||
if spec:
|
||||
result["spec-source"] = _read_spec_file(spec["file"])
|
||||
|
||||
return result
|
||||
|
||||
|
||||
def _data_test_data() -> dict:
|
||||
"""Return test data for the client-side data rendering test page.
|
||||
|
||||
Reference in New Issue
Block a user