Phase 4: Move web framework files to web/ and web/tests/
signals.sx, engine.sx, orchestration.sx, boot.sx, router.sx, deps.sx, forms.sx, page-helpers.sx, adapters, boundary files → web/ Web tests → web/tests/ Test runners updated with _SPEC_TESTS and _WEB_TESTS paths. All 89 tests pass (20 signal + 43 CEK + 26 CEK reactive). Both bootstrappers build fully (5993 Python lines, 387KB JS). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1440,7 +1440,7 @@ def compile_ref_to_py(
|
|||||||
prim_modules.append(m)
|
prim_modules.append(m)
|
||||||
|
|
||||||
ref_dir = os.path.join(os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..")), "shared", "sx", "ref")
|
ref_dir = os.path.join(os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..")), "shared", "sx", "ref")
|
||||||
_project = os.path.abspath(os.path.join(ref_dir, "..", ".."))
|
_project = os.path.abspath(os.path.join(ref_dir, "..", "..", ".."))
|
||||||
_source_dirs = [
|
_source_dirs = [
|
||||||
os.path.join(_project, "spec"),
|
os.path.join(_project, "spec"),
|
||||||
os.path.join(_project, "web"),
|
os.path.join(_project, "web"),
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import os, sys
|
|||||||
|
|
||||||
_HERE = os.path.dirname(os.path.abspath(__file__))
|
_HERE = os.path.dirname(os.path.abspath(__file__))
|
||||||
_PROJECT = os.path.abspath(os.path.join(_HERE, "..", "..", ".."))
|
_PROJECT = os.path.abspath(os.path.join(_HERE, "..", "..", ".."))
|
||||||
|
_SPEC_TESTS = os.path.join(_PROJECT, "spec", "tests")
|
||||||
|
_WEB_TESTS = os.path.join(_PROJECT, "web", "tests")
|
||||||
sys.path.insert(0, _PROJECT)
|
sys.path.insert(0, _PROJECT)
|
||||||
sys.setrecursionlimit(20000)
|
sys.setrecursionlimit(20000)
|
||||||
|
|
||||||
@@ -212,25 +214,25 @@ for name in ["sf-defhandler", "sf-defpage", "sf-defquery", "sf-defaction"]:
|
|||||||
env[name] = lambda args, e, _n=name: NIL
|
env[name] = lambda args, e, _n=name: NIL
|
||||||
|
|
||||||
# Load test framework
|
# Load test framework
|
||||||
with open(os.path.join(_HERE, "test-framework.sx")) as f:
|
with open(os.path.join(_SPEC_TESTS, "test-framework.sx")) as f:
|
||||||
for expr in parse_all(f.read()):
|
for expr in parse_all(f.read()):
|
||||||
trampoline(eval_expr(expr, env))
|
trampoline(eval_expr(expr, env))
|
||||||
|
|
||||||
# Load signals module
|
# Load signals module
|
||||||
print("Loading signals.sx ...")
|
print("Loading signals.sx ...")
|
||||||
with open(os.path.join(_HERE, "signals.sx")) as f:
|
with open(os.path.join(_PROJECT, "web", "signals.sx")) as f:
|
||||||
for expr in parse_all(f.read()):
|
for expr in parse_all(f.read()):
|
||||||
trampoline(eval_expr(expr, env))
|
trampoline(eval_expr(expr, env))
|
||||||
|
|
||||||
# Load frames module
|
# Load frames module
|
||||||
print("Loading frames.sx ...")
|
print("Loading frames.sx ...")
|
||||||
with open(os.path.join(_HERE, "frames.sx")) as f:
|
with open(os.path.join(_PROJECT, "spec", "frames.sx")) as f:
|
||||||
for expr in parse_all(f.read()):
|
for expr in parse_all(f.read()):
|
||||||
trampoline(eval_expr(expr, env))
|
trampoline(eval_expr(expr, env))
|
||||||
|
|
||||||
# Load CEK module
|
# Load CEK module
|
||||||
print("Loading cek.sx ...")
|
print("Loading cek.sx ...")
|
||||||
with open(os.path.join(_HERE, "cek.sx")) as f:
|
with open(os.path.join(_PROJECT, "spec", "cek.sx")) as f:
|
||||||
for expr in parse_all(f.read()):
|
for expr in parse_all(f.read()):
|
||||||
trampoline(eval_expr(expr, env))
|
trampoline(eval_expr(expr, env))
|
||||||
|
|
||||||
@@ -239,7 +241,7 @@ print("=" * 60)
|
|||||||
print("Running test-cek-reactive.sx")
|
print("Running test-cek-reactive.sx")
|
||||||
print("=" * 60)
|
print("=" * 60)
|
||||||
|
|
||||||
with open(os.path.join(_HERE, "test-cek-reactive.sx")) as f:
|
with open(os.path.join(_WEB_TESTS, "test-cek-reactive.sx")) as f:
|
||||||
for expr in parse_all(f.read()):
|
for expr in parse_all(f.read()):
|
||||||
trampoline(eval_expr(expr, env))
|
trampoline(eval_expr(expr, env))
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import os, sys
|
|||||||
|
|
||||||
_HERE = os.path.dirname(os.path.abspath(__file__))
|
_HERE = os.path.dirname(os.path.abspath(__file__))
|
||||||
_PROJECT = os.path.abspath(os.path.join(_HERE, "..", "..", ".."))
|
_PROJECT = os.path.abspath(os.path.join(_HERE, "..", "..", ".."))
|
||||||
|
_SPEC_TESTS = os.path.join(_PROJECT, "spec", "tests")
|
||||||
|
_WEB_TESTS = os.path.join(_PROJECT, "web", "tests")
|
||||||
sys.path.insert(0, _PROJECT)
|
sys.path.insert(0, _PROJECT)
|
||||||
|
|
||||||
from shared.sx.ref.sx_ref import sx_parse as parse_all
|
from shared.sx.ref.sx_ref import sx_parse as parse_all
|
||||||
@@ -223,19 +225,19 @@ for name in ["sf-defhandler", "sf-defpage", "sf-defquery", "sf-defaction"]:
|
|||||||
env[name] = lambda args, e, _n=name: NIL
|
env[name] = lambda args, e, _n=name: NIL
|
||||||
|
|
||||||
# Load test framework
|
# Load test framework
|
||||||
with open(os.path.join(_HERE, "test-framework.sx")) as f:
|
with open(os.path.join(_SPEC_TESTS, "test-framework.sx")) as f:
|
||||||
for expr in parse_all(f.read()):
|
for expr in parse_all(f.read()):
|
||||||
trampoline(eval_expr(expr, env))
|
trampoline(eval_expr(expr, env))
|
||||||
|
|
||||||
# Load frames module
|
# Load frames module
|
||||||
print("Loading frames.sx ...")
|
print("Loading frames.sx ...")
|
||||||
with open(os.path.join(_HERE, "frames.sx")) as f:
|
with open(os.path.join(_PROJECT, "spec", "frames.sx")) as f:
|
||||||
for expr in parse_all(f.read()):
|
for expr in parse_all(f.read()):
|
||||||
trampoline(eval_expr(expr, env))
|
trampoline(eval_expr(expr, env))
|
||||||
|
|
||||||
# Load CEK module
|
# Load CEK module
|
||||||
print("Loading cek.sx ...")
|
print("Loading cek.sx ...")
|
||||||
with open(os.path.join(_HERE, "cek.sx")) as f:
|
with open(os.path.join(_PROJECT, "spec", "cek.sx")) as f:
|
||||||
for expr in parse_all(f.read()):
|
for expr in parse_all(f.read()):
|
||||||
trampoline(eval_expr(expr, env))
|
trampoline(eval_expr(expr, env))
|
||||||
|
|
||||||
@@ -255,7 +257,7 @@ print("=" * 60)
|
|||||||
print("Running test-cek.sx")
|
print("Running test-cek.sx")
|
||||||
print("=" * 60)
|
print("=" * 60)
|
||||||
|
|
||||||
with open(os.path.join(_HERE, "test-cek.sx")) as f:
|
with open(os.path.join(_SPEC_TESTS, "test-cek.sx")) as f:
|
||||||
for expr in parse_all(f.read()):
|
for expr in parse_all(f.read()):
|
||||||
trampoline(eval_expr(expr, env))
|
trampoline(eval_expr(expr, env))
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import os, sys, subprocess, tempfile
|
|||||||
|
|
||||||
_HERE = os.path.dirname(os.path.abspath(__file__))
|
_HERE = os.path.dirname(os.path.abspath(__file__))
|
||||||
_PROJECT = os.path.abspath(os.path.join(_HERE, "..", "..", ".."))
|
_PROJECT = os.path.abspath(os.path.join(_HERE, "..", "..", ".."))
|
||||||
|
_SPEC_TESTS = os.path.join(_PROJECT, "spec", "tests")
|
||||||
|
_WEB_TESTS = os.path.join(_PROJECT, "web", "tests")
|
||||||
sys.path.insert(0, _PROJECT)
|
sys.path.insert(0, _PROJECT)
|
||||||
|
|
||||||
# Bootstrap a fresh sx_ref with continuations enabled
|
# Bootstrap a fresh sx_ref with continuations enabled
|
||||||
@@ -87,7 +89,7 @@ env["push-suite"] = _push_suite
|
|||||||
env["pop-suite"] = _pop_suite
|
env["pop-suite"] = _pop_suite
|
||||||
|
|
||||||
# Load test framework
|
# Load test framework
|
||||||
with open(os.path.join(_HERE, "test-framework.sx")) as f:
|
with open(os.path.join(_SPEC_TESTS, "test-framework.sx")) as f:
|
||||||
for expr in parse_all(f.read()):
|
for expr in parse_all(f.read()):
|
||||||
trampoline(eval_expr(expr, env))
|
trampoline(eval_expr(expr, env))
|
||||||
|
|
||||||
@@ -96,7 +98,7 @@ print("=" * 60)
|
|||||||
print("Running test-continuations.sx")
|
print("Running test-continuations.sx")
|
||||||
print("=" * 60)
|
print("=" * 60)
|
||||||
|
|
||||||
with open(os.path.join(_HERE, "test-continuations.sx")) as f:
|
with open(os.path.join(_SPEC_TESTS, "test-continuations.sx")) as f:
|
||||||
for expr in parse_all(f.read()):
|
for expr in parse_all(f.read()):
|
||||||
trampoline(eval_expr(expr, env))
|
trampoline(eval_expr(expr, env))
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ import os, sys
|
|||||||
|
|
||||||
_HERE = os.path.dirname(os.path.abspath(__file__))
|
_HERE = os.path.dirname(os.path.abspath(__file__))
|
||||||
_PROJECT = os.path.abspath(os.path.join(_HERE, "..", "..", ".."))
|
_PROJECT = os.path.abspath(os.path.join(_HERE, "..", "..", ".."))
|
||||||
|
_SPEC_TESTS = os.path.join(_PROJECT, "spec", "tests")
|
||||||
|
_WEB_TESTS = os.path.join(_PROJECT, "web", "tests")
|
||||||
sys.path.insert(0, _PROJECT)
|
sys.path.insert(0, _PROJECT)
|
||||||
|
|
||||||
from shared.sx.ref.sx_ref import sx_parse as parse_all
|
from shared.sx.ref.sx_ref import sx_parse as parse_all
|
||||||
@@ -143,7 +145,7 @@ env["register-in-scope"] = sx_ref.register_in_scope
|
|||||||
env["callable?"] = sx_ref.is_callable
|
env["callable?"] = sx_ref.is_callable
|
||||||
|
|
||||||
# Load test framework
|
# Load test framework
|
||||||
with open(os.path.join(_HERE, "test-framework.sx")) as f:
|
with open(os.path.join(_SPEC_TESTS, "test-framework.sx")) as f:
|
||||||
for expr in parse_all(f.read()):
|
for expr in parse_all(f.read()):
|
||||||
trampoline(eval_expr(expr, env))
|
trampoline(eval_expr(expr, env))
|
||||||
|
|
||||||
@@ -152,7 +154,7 @@ print("=" * 60)
|
|||||||
print("Running test-signals.sx")
|
print("Running test-signals.sx")
|
||||||
print("=" * 60)
|
print("=" * 60)
|
||||||
|
|
||||||
with open(os.path.join(_HERE, "test-signals.sx")) as f:
|
with open(os.path.join(_WEB_TESTS, "test-signals.sx")) as f:
|
||||||
for expr in parse_all(f.read()):
|
for expr in parse_all(f.read()):
|
||||||
trampoline(eval_expr(expr, env))
|
trampoline(eval_expr(expr, env))
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import os, sys
|
|||||||
|
|
||||||
_HERE = os.path.dirname(os.path.abspath(__file__))
|
_HERE = os.path.dirname(os.path.abspath(__file__))
|
||||||
_PROJECT = os.path.abspath(os.path.join(_HERE, "..", "..", ".."))
|
_PROJECT = os.path.abspath(os.path.join(_HERE, "..", "..", ".."))
|
||||||
|
_SPEC_TESTS = os.path.join(_PROJECT, "spec", "tests")
|
||||||
|
_WEB_TESTS = os.path.join(_PROJECT, "web", "tests")
|
||||||
sys.path.insert(0, _PROJECT)
|
sys.path.insert(0, _PROJECT)
|
||||||
|
|
||||||
from shared.sx.ref.sx_ref import sx_parse as parse_all
|
from shared.sx.ref.sx_ref import sx_parse as parse_all
|
||||||
@@ -167,7 +169,7 @@ env["env-has?"] = env_has
|
|||||||
env["env-set!"] = env_set
|
env["env-set!"] = env_set
|
||||||
|
|
||||||
# Load test framework (macros + assertion helpers)
|
# Load test framework (macros + assertion helpers)
|
||||||
with open(os.path.join(_HERE, "test-framework.sx")) as f:
|
with open(os.path.join(_SPEC_TESTS, "test-framework.sx")) as f:
|
||||||
for expr in parse_all(f.read()):
|
for expr in parse_all(f.read()):
|
||||||
trampoline(eval_expr(expr, env))
|
trampoline(eval_expr(expr, env))
|
||||||
|
|
||||||
@@ -181,7 +183,7 @@ print("=" * 60)
|
|||||||
print("Running test-types.sx")
|
print("Running test-types.sx")
|
||||||
print("=" * 60)
|
print("=" * 60)
|
||||||
|
|
||||||
with open(os.path.join(_HERE, "test-types.sx")) as f:
|
with open(os.path.join(_SPEC_TESTS, "test-types.sx")) as f:
|
||||||
for expr in parse_all(f.read()):
|
for expr in parse_all(f.read()):
|
||||||
trampoline(eval_expr(expr, env))
|
trampoline(eval_expr(expr, env))
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
// =========================================================================
|
// =========================================================================
|
||||||
|
|
||||||
var NIL = Object.freeze({ _nil: true, toString: function() { return "nil"; } });
|
var NIL = Object.freeze({ _nil: true, toString: function() { return "nil"; } });
|
||||||
var SX_VERSION = "2026-03-15T02:18:33Z";
|
var SX_VERSION = "2026-03-15T02:24:46Z";
|
||||||
|
|
||||||
function isNil(x) { return x === NIL || x === null || x === undefined; }
|
function isNil(x) { return x === NIL || x === null || x === undefined; }
|
||||||
function isSxTruthy(x) { return x !== false && !isNil(x); }
|
function isSxTruthy(x) { return x !== false && !isNil(x); }
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user