Skip to content

Commit 9a52f02

Browse files
authored
Merge pull request #4907 from rescript-lang/add_test
add a test case to test both nodejs and es6 format; themes default to rescript syntax
2 parents d04e07c + 0114405 commit 9a52f02

File tree

12 files changed

+49
-18
lines changed

12 files changed

+49
-18
lines changed

jscomp/bsb/bsb_templates.ml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ let root = ([
5757
\ \"sources\": {\n\
5858
\ \"dir\" : \"src\",\n\
5959
\ \"subdirs\" : true\n\
60-
\ },\n\
61-
\ \"warnings\": {\n\
62-
\ \"error\" : \"+101\"\n\
6360
\ }\n\
6461
}\n\
6562
"
@@ -84,10 +81,9 @@ let root = ([
8481
}"
8582
);
8683
Dir("src",[
87-
File("demo.ml",
84+
File("demo.res",
8885
"\n\
89-
\n\
90-
let () = Js.log \"Hello, BuckleScript\""
86+
Js.log(\"Hello, ReScript\")"
9187
)
9288
])
9389
]);

jscomp/bsb/templates/basic/bsconfig.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,5 @@
44
"sources": {
55
"dir" : "src",
66
"subdirs" : true
7-
},
8-
"warnings": {
9-
"error" : "+101"
107
}
118
}

jscomp/bsb/templates/basic/src/demo.ml

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
Js.log("Hello, ReScript")

jscomp/test/build.ninja

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ o test/epsilon_test.cmi test/epsilon_test.cmj : cc test/epsilon_test.ml | test/m
168168
o test/equal_box_test.cmi test/equal_box_test.cmj : cc test/equal_box_test.ml | test/mt.cmj $stdlib
169169
o test/equal_exception_test.cmi test/equal_exception_test.cmj : cc test/equal_exception_test.ml | test/mt.cmj $stdlib
170170
o test/equal_test.cmi test/equal_test.cmj : cc test/equal_test.ml | $stdlib
171+
o test/es6_export.cmi test/es6_export.cmj : cc test/es6_export.ml | $stdlib
172+
o test/es6_import.cmi test/es6_import.cmj : cc test/es6_import.ml | test/es6_export.cmj $stdlib
171173
o test/es6_module_test.cmi test/es6_module_test.cmj : cc test/es6_module_test.ml | test/mt.cmj $stdlib
172174
o test/escape_esmodule.cmi test/escape_esmodule.cmj : cc test/escape_esmodule.ml | $stdlib
173175
o test/esmodule_ref.cmi test/esmodule_ref.cmj : cc test/esmodule_ref.ml | test/escape_esmodule.cmj $stdlib

jscomp/test/es6_export.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
'use strict';
2+
3+
4+
var $$default = 3;
5+
6+
exports.$$default = $$default;
7+
exports.default = $$default;
8+
exports.__esModule = true;
9+
/* No side effect */

jscomp/test/es6_export.mjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
3+
4+
var $$default = 3;
5+
6+
export {
7+
$$default ,
8+
$$default as default,
9+
10+
}
11+
/* No side effect */

jscomp/test/es6_export.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[@@@config{flags = [|"-bs-package-output"; "es6:jscomp/test:.mjs"|]}]
2+
let default = 3

jscomp/test/es6_import.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict';
2+
3+
var Es6_export = require("./es6_export.js");
4+
5+
console.log(Es6_export.$$default);
6+
7+
/* Not a pure module */

jscomp/test/es6_import.mjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
3+
import * as Es6_export from "./es6_export.mjs";
4+
5+
console.log(Es6_export.$$default);
6+
7+
export {
8+
9+
}
10+
/* Not a pure module */

0 commit comments

Comments
 (0)