Add deps and engine test specs, bootstrap engine to Python
New test specs (test-deps.sx: 33 tests, test-engine.sx: 37 tests) covering component dependency analysis and engine pure functions. All 6 spec modules now have formal SX tests: eval (81), parser (39), router (18), render (23), deps (33), engine (37) = 231 total. - Add engine as spec module in bootstrap_py.py (alongside deps) - Add primitive aliases (trim, replace, parse_int, upper) for engine functions - Fix parse-int to match JS parseInt semantics (strip trailing non-digits) - Regenerate sx_ref.py with --spec-modules deps,engine - Update all three test runners (run.js, run.py, sx-test-runner.js) - Add Dependencies and Engine nav items and testing page entries - Wire deps-source/engine-source through testing overview UI Node.js: 231/231 pass. Python: 226/231 (5 pre-existing parser/router gaps). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -131,6 +131,35 @@
|
||||
}
|
||||
}
|
||||
|
||||
function loadDepsFromBootstrap(env) {
|
||||
if (Sx.scanRefs) {
|
||||
env["scan-refs"] = Sx.scanRefs;
|
||||
env["scan-components-from-source"] = Sx.scanComponentsFromSource;
|
||||
env["transitive-deps"] = Sx.transitiveDeps;
|
||||
env["compute-all-deps"] = Sx.computeAllDeps;
|
||||
env["components-needed"] = Sx.componentsNeeded;
|
||||
env["page-component-bundle"] = Sx.pageComponentBundle;
|
||||
env["page-css-classes"] = Sx.pageCssClasses;
|
||||
env["scan-io-refs"] = Sx.scanIoRefs;
|
||||
env["transitive-io-refs"] = Sx.transitiveIoRefs;
|
||||
env["compute-all-io-refs"] = Sx.computeAllIoRefs;
|
||||
env["component-pure?"] = Sx.componentPure_p;
|
||||
env["test-env"] = function() { return env; };
|
||||
}
|
||||
}
|
||||
|
||||
function loadEngineFromBootstrap(env) {
|
||||
if (Sx.parseTime) {
|
||||
env["parse-time"] = Sx.parseTime;
|
||||
env["parse-trigger-spec"] = Sx.parseTriggerSpec;
|
||||
env["default-trigger"] = Sx.defaultTrigger;
|
||||
env["parse-swap-spec"] = Sx.parseSwapSpec;
|
||||
env["parse-retry-spec"] = Sx.parseRetrySpec;
|
||||
env["next-retry-ms"] = function(cur, cap) { return Math.min(cur * 2, cap); };
|
||||
env["filter-params"] = Sx.filterParams;
|
||||
}
|
||||
}
|
||||
|
||||
// --- Legacy runner (monolithic test.sx) ---
|
||||
window.sxRunTests = function(srcId, outId, btnId) {
|
||||
var src = document.getElementById(srcId).textContent;
|
||||
@@ -169,6 +198,8 @@
|
||||
"parser": { needs: ["sx-parse"] },
|
||||
"router": { needs: [] },
|
||||
"render": { needs: ["render-html"] },
|
||||
"deps": { needs: [] },
|
||||
"engine": { needs: [] },
|
||||
};
|
||||
|
||||
window.sxRunModularTests = function(specName, outId, btnId) {
|
||||
@@ -190,8 +221,10 @@
|
||||
var sn = specs[si];
|
||||
if (!SPECS[sn]) continue;
|
||||
|
||||
// Load router from bootstrap if needed
|
||||
// Load module functions from bootstrap
|
||||
if (sn === "router") loadRouterFromBootstrap(ctx.env);
|
||||
if (sn === "deps") loadDepsFromBootstrap(ctx.env);
|
||||
if (sn === "engine") loadEngineFromBootstrap(ctx.env);
|
||||
|
||||
// Find spec source — either per-spec textarea or embedded in overview
|
||||
var specEl = document.getElementById("test-spec-" + sn);
|
||||
|
||||
Reference in New Issue
Block a user