-
Notifications
You must be signed in to change notification settings - Fork 465
/
Copy pathinput.js
28 lines (21 loc) · 964 Bytes
/
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
// @ts-check
var p = require("child_process");
var assert = require("assert");
var fs = require("fs");
var path = require("path");
var rescript_exe = require("../../../scripts/bin_path").rescript_exe;
p.execSync(rescript_exe, { cwd: __dirname });
var content = fs.readFileSync(path.join(__dirname, "src", "demo.js"), "utf8");
assert.ok(content.match(/A0_a1_main/g).length === 3);
assert.ok(content.match(/B0_b1_main/g).length === 3);
assert.ok(content.match(/A0_main/g).length === 2);
assert.ok(content.match(/a0_main/g).length === 1);
assert.ok(content.match(/B0_main/g).length === 2);
assert.ok(content.match(/b0_main/g).length === 1);
assert.ok(require("./src/demo.js").v === 4, "nested");
// var testWarnError = /warnings\s*=\s*[^\r\n]*-warn-error/;
// function hasWarnError(file) {
// var content = fs.readFileSync(file, "utf8");
// return testWarnError.test(content);
// }
// assert.ok(hasWarnError(path.join(__dirname,'lib','bs','build.ninja')))