diff options
Diffstat (limited to 'test')
| -rwxr-xr-x | test/dt.js | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -1,5 +1,5 @@ //usr/bin/env node "$0" $@;exit $? -const exec = require('child_process').exec +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() @@ -8,7 +8,7 @@ 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 = exec(__dirname+'/../spec/dzref', function (error, stdout, stderr) { +var compiler = execFile(__dirname+'/../spec/dzref',[__dirname+'/../dc.bqn','{•←Compile𝕩}¨⟨'+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]) @@ -20,5 +20,3 @@ var compiler = exec(__dirname+'/../spec/dzref', function (error, stdout, stderr) ) process.exit(+(fail.length>0)) }); -compiler.stdin.write(load('../dc.bqn').concat('{•←Compile𝕩}¨⟨'+test+'⟩')) -compiler.stdin.end() |
