Skip to content

Commit dfb5b0d

Browse files
authored
Add weird names not found bug test (rescript-lang#6367)
1 parent d121e9f commit dfb5b0d

File tree

7 files changed

+28
-4
lines changed

7 files changed

+28
-4
lines changed

jscomp/build_tests/weird_names/input.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ var rescript_exe = require("../../../scripts/bin_path").rescript_exe;
55

66
var out = cp.spawnSync(rescript_exe, { encoding: "utf8" });
77

8-
console.log(out.stdout);
98
if (out.stderr !== "") {
109
assert.fail(out.stderr);
1110
}
@@ -17,11 +16,11 @@ let files = [
1716
"[[...params]].res",
1817
"[slug_or_ID].res",
1918
"404.res",
19+
"utils.test.res",
2020
];
2121

2222
for (let f of files) {
2323
let { name } = path.parse(f);
2424
let m = `./lib/js/src/${name}.js`;
25-
// console.log(m);
2625
assert.deepEqual(require(m).a, 1);
2726
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module A = Demo
2+
let a = 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "weird_names",
3+
"version": "0.1.0",
4+
"sources": {
5+
"dir" : "src",
6+
"subdirs" : true
7+
}
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
var cp = require("child_process");
2+
var assert = require("assert");
3+
var rescript_exe = require("../../../scripts/bin_path").rescript_exe;
4+
5+
var out = cp.spawnSync(rescript_exe, { encoding: "utf8" });
6+
if (out.stderr !== "") {
7+
assert.fail(out.stderr);
8+
}
9+
10+
if (!out.stdout.includes(`The module or file Demo can't be found.`)) {
11+
assert.fail(out.stdout);
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
let a = 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module A = Demo
2+
let a = 1

scripts/ciTest.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ function runTests() {
7979
console.log(stdout);
8080

8181
if (error !== null) {
82-
console.log(stderr);
83-
throw new Error(`❌ error in ${file}: \n${error} `);
82+
console.log(`❌ error in ${file} with stderr:\n`, stderr);
83+
throw error;
8484
} else {
8585
console.log("✅ success in", file);
8686
}

0 commit comments

Comments
 (0)