From 0fc20a32c0fce51c34714363173c8a93771c1425 Mon Sep 17 00:00:00 2001 From: stephan Date: Tue, 29 Aug 2023 13:28:36 +0000 Subject: Get the basic parsing pieces and command dispatching in place in the JS SQLTester. FossilOrigin-Name: 8fcc2a553c1e26734902bbdee0c38183ee22b7b5c75f07405529bb79db34145a --- ext/wasm/SQLTester/SQLTester.run.mjs | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'ext/wasm/SQLTester/SQLTester.run.mjs') diff --git a/ext/wasm/SQLTester/SQLTester.run.mjs b/ext/wasm/SQLTester/SQLTester.run.mjs index 0a0f8903b..4efd068e3 100644 --- a/ext/wasm/SQLTester/SQLTester.run.mjs +++ b/ext/wasm/SQLTester/SQLTester.run.mjs @@ -1,8 +1,26 @@ import {default as ns} from './SQLTester.mjs'; -const log = (...args)=>{ +const log = function f(...args){ console.log('SQLTester.run:',...args); + return f; }; +console.log("Loaded",ns); +const out = function f(...args){ return f.outer.out(...args) }; +out.outer = new ns.Outer(); +out.outer.getOutputPrefix = ()=>'SQLTester.run: '; +const outln = (...args)=>{ return out.outer.outln(...args) }; -log("SQLTester is ostensibly ready."); +log("ns =",ns); +out("Hi there. ").outln("SQLTester is ostensibly ready."); + +let ts = new ns.TestScript('/foo.test', ns.Util.utf8Encode(` +# comment line +select 1; +--testcase 0.0 +#--result 1 +`)); + +const sqt = new ns.SQLTester(); +sqt.verbosity(3); +ts.run(sqt); -- cgit v1.2.3