forked from rescript-lang/rescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinput.js
41 lines (34 loc) · 1.03 KB
/
input.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//@ts-check
var p = require('child_process')
var path = require('path')
var fs = require('fs')
var assert = require('assert')
p.execSync(`bsb`,{cwd: __dirname, stdio:[0,1,2],encoding : 'utf8'})
var check_file = path.join(__dirname,'tests','check.bs.js')
var xs = p.spawnSync('node',
[check_file],
{ encoding: 'utf8'}
).output
var ys= fs.readFileSync(path.join(__dirname,'tests','check.ref'),'utf8')
// console.log(fs.readFileSync(check_file,'utf8'))
// console.log(`output begin ...`)
// console.log(xs)
// console.log(`output end...`)
assert.equal(xs[1],ys)
var xs = p.spawnSync('node',
[path.join(__dirname,'tests','test_topsort.bs.js')],
{ encoding: 'ascii'}
).output
var ys = fs.readFileSync(path.join(__dirname,'tests','test_topsort.ref'),'ascii')
assert.equal(
xs[1] , ys
)
var xs = p.spawnSync('node',
[path.join(__dirname,'tests','test_johnson.bs.js')],
{ encoding: 'ascii'}
).output
var ys = fs.readFileSync(path.join(__dirname,'tests','test_johnson.ref'),'ascii')
assert.equal(
xs[1], ys
)
// debugger