aboutsummaryrefslogtreecommitdiff
path: root/test/t.js
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2020-09-05 22:51:15 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2020-09-05 22:58:40 -0400
commit9327d48ba01c4d44f38745b6b907b93f49b54622 (patch)
tree11639538cb3267a701029afec4e94ec6cd11e3b8 /test/t.js
parent01b2c731cda913f78955024137c0468a03622358 (diff)
Separate WebAssembly prototype wc.bqn from dzaima/BQN backend dc.bqn
Diffstat (limited to 'test/t.js')
-rwxr-xr-xtest/t.js27
1 files changed, 0 insertions, 27 deletions
diff --git a/test/t.js b/test/t.js
deleted file mode 100755
index c11bcc01..00000000
--- a/test/t.js
+++ /dev/null
@@ -1,27 +0,0 @@
-#! /usr/bin/env node
-
-const execFile = require('child_process').execFile
- , load=f=>require('fs').readFileSync(__dirname+'/'+f,'utf8')
- , runWasm=w=>new WebAssembly.Instance(new WebAssembly.Module(Uint8Array.from(w)))
- .exports.fn()
-
-const t=load('cases.bqn').split('\n').filter(x=>x).map(x=>x.split(' % '))
- , test=t.map(e=>'"'+e[1]+'"').join('\n')
- , expt=t.map(e=>+e[0])
-
-var compiler = execFile(
- __dirname+'/../cshim.bqn',
- [ '{•←WCompile𝕩}¨⟨'+test+'⟩' ],
- function (error, stdout, stderr) {
- const rslt=stdout.split('\n').filter(a=>a.length)
- .map(a=>runWasm(a.split("‿").map(n=>+n)))
- , pass=rslt.map((r,i)=>r===expt[i])
- , fail=pass.map((p,i)=>p?-1:i).filter(i=>i>=0)
- console.log(
- fail.length
- ? fail.map(i=>'"'+t[i][1]+'": expected '+expt[i]+' but received '+rslt[i])
- : "All passed!"
- )
- process.exit(+(fail.length>0))
- }
-);