aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/SQLTester/SQLTester.run.mjs
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2023-08-29 13:28:36 +0000
committerstephan <stephan@noemail.net>2023-08-29 13:28:36 +0000
commit0fc20a32c0fce51c34714363173c8a93771c1425 (patch)
treed63394071ea6f7191f83b1adf5f5305ae0072311 /ext/wasm/SQLTester/SQLTester.run.mjs
parent524ddc940d47184bd83771781a6dbd472ccc6365 (diff)
downloadsqlite-0fc20a32c0fce51c34714363173c8a93771c1425.tar.gz
sqlite-0fc20a32c0fce51c34714363173c8a93771c1425.zip
Get the basic parsing pieces and command dispatching in place in the JS SQLTester.
FossilOrigin-Name: 8fcc2a553c1e26734902bbdee0c38183ee22b7b5c75f07405529bb79db34145a
Diffstat (limited to 'ext/wasm/SQLTester/SQLTester.run.mjs')
-rw-r--r--ext/wasm/SQLTester/SQLTester.run.mjs22
1 files changed, 20 insertions, 2 deletions
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);