Skip to content

Add weird names not found bug test #6367

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions jscomp/build_tests/weird_names/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ var rescript_exe = require("../../../scripts/bin_path").rescript_exe;

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

console.log(out.stdout);
if (out.stderr !== "") {
assert.fail(out.stderr);
}
Expand All @@ -17,11 +16,11 @@ let files = [
"[[...params]].res",
"[slug_or_ID].res",
"404.res",
"utils.test.res",
];

for (let f of files) {
let { name } = path.parse(f);
let m = `./lib/js/src/${name}.js`;
// console.log(m);
assert.deepEqual(require(m).a, 1);
}
2 changes: 2 additions & 0 deletions jscomp/build_tests/weird_names/src/utils.test.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module A = Demo
let a = 1
8 changes: 8 additions & 0 deletions jscomp/build_tests/weird_names_not_found_bug/bsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "weird_names",
"version": "0.1.0",
"sources": {
"dir" : "src",
"subdirs" : true
}
}
12 changes: 12 additions & 0 deletions jscomp/build_tests/weird_names_not_found_bug/input.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
var cp = require("child_process");
var assert = require("assert");
var rescript_exe = require("../../../scripts/bin_path").rescript_exe;

var out = cp.spawnSync(rescript_exe, { encoding: "utf8" });
if (out.stderr !== "") {
assert.fail(out.stderr);
}

if (!out.stdout.includes(`The module or file Demo can't be found.`)) {
assert.fail(out.stdout);
}
1 change: 1 addition & 0 deletions jscomp/build_tests/weird_names_not_found_bug/src/demo.res
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let a = 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module A = Demo
let a = 1
4 changes: 2 additions & 2 deletions scripts/ciTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ function runTests() {
console.log(stdout);

if (error !== null) {
console.log(stderr);
throw new Error(`❌ error in ${file}: \n${error} `);
console.log(`❌ error in ${file} with stderr:\n`, stderr);
throw error;
} else {
console.log("✅ success in", file);
}
Expand Down