Skip to content

Commit 2d3060e

Browse files
cannorincristianoc
authored andcommitted
add jscomp/build_tests/cycle1
Signed-off-by: Yuta Sato <[email protected]>
1 parent 417c576 commit 2d3060e

File tree

8 files changed

+98
-0
lines changed

8 files changed

+98
-0
lines changed

jscomp/build_tests/cycle1/.gitignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
*.exe
2+
*.obj
3+
*.out
4+
*.compile
5+
*.native
6+
*.byte
7+
*.cmo
8+
*.annot
9+
*.cmi
10+
*.cmx
11+
*.cmt
12+
*.cmti
13+
*.cma
14+
*.a
15+
*.cmxa
16+
*.obj
17+
*~
18+
*.annot
19+
*.cmj
20+
*.bak
21+
lib/bs
22+
*.mlast
23+
*.mliast
24+
.vscode
25+
.merlin
26+
.bsb.lock

jscomp/build_tests/cycle1/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
3+
# Build
4+
```
5+
npm run build
6+
```
7+
8+
# Watch
9+
10+
```
11+
npm run watch
12+
```
13+
14+
15+
# Editor
16+
If you use `vscode`, Press `Windows + Shift + B` it will build automatically
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "cycle1",
3+
"namespace": true,
4+
"version": "0.1.0",
5+
"sources": {
6+
"dir" : "src",
7+
"subdirs" : true
8+
},
9+
"package-specs": {
10+
"module": "es6",
11+
"in-source": true
12+
},
13+
"suffix": ".bs.js"
14+
}

jscomp/build_tests/cycle1/input.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//@ts-check
2+
const cp = require("child_process");
3+
const assert = require("assert");
4+
const fs = require('fs')
5+
const path = require('path')
6+
7+
var output = cp.spawnSync(`rescript`, { encoding: "utf8", shell: true });
8+
9+
assert(/is dangling/.test(output.stdout));
10+
11+
var compilerLogFile = path.join(__dirname, 'lib', 'bs', '.compiler.log');
12+
var compilerLog = fs.readFileSync(compilerLogFile, 'utf8');
13+
assert(/is dangling/.test(compilerLog));
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "cycle1",
3+
"version": "0.1.0",
4+
"scripts": {
5+
"clean": "rescript clean",
6+
"build": "rescript build",
7+
"watch": "rescript build -w"
8+
},
9+
"keywords": [
10+
"ReScript"
11+
],
12+
"author": "",
13+
"license": "MIT",
14+
"devDependencies": {
15+
"rescript": "^10.0.0"
16+
}
17+
}

jscomp/build_tests/cycle1/src/A.res

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
include A
2+
3+
let x = 42

jscomp/build_tests/cycle1/src/A.resi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
let x : int

jscomp/build_tests/pinned/input.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ function checkSpawnOut(out) {
99
assert.fail(out.stderr + "\n" + out.stdout);
1010
}
1111
}
12+
13+
// Clean beforehand to force its dependency to be rebuilt
14+
var out = cp.spawnSync(`npx rescript clean`, {
15+
encoding: "utf-8",
16+
shell: true,
17+
});
18+
checkSpawnOut(out);
19+
1220
var out = cp.spawnSync(`npx rescript build`, {
1321
encoding: "utf-8",
1422
shell: true,

0 commit comments

Comments
 (0)