Skip to content

Commit b575913

Browse files
committed
wip: Add (failing) test
Signed-off-by: Olivier Nicole <[email protected]>
1 parent 2f43059 commit b575913

File tree

9 files changed

+67
-0
lines changed

9 files changed

+67
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
let name = "bin1"
2+
let hello name = print_endline ("Hi " ^ name)
3+
4+
let () = Library1.hello name
5+
6+
let () = hello Library1.name
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
let name = "bin2"
2+
let hello name = print_endline ("Hi " ^ name)
3+
4+
let () = Library1.hello name
5+
6+
let () = hello Library1.name
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
let name = "bin3"
2+
let hello name = print_endline ("Hi " ^ name)
3+
4+
let () = Library1.hello name
5+
6+
let () = hello Library1.name
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
(executable
2+
(name bin1)
3+
(modules bin1)
4+
(modes js)
5+
(libraries library1)
6+
(js_of_ocaml
7+
(flags (:standard --enable use-js-string))))
8+
9+
(executable
10+
(name bin2)
11+
(modules bin2)
12+
(modes js)
13+
(libraries library1)
14+
(js_of_ocaml
15+
(flags (:standard --disable use-js-string))))
16+
17+
(executable
18+
(name bin3)
19+
(modules bin3)
20+
(modes js)
21+
(libraries library1)
22+
(js_of_ocaml
23+
(flags (:standard --effects=cps))))
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
(env
2+
(_
3+
(js_of_ocaml
4+
(flags (:standard --quiet))
5+
(compilation_mode separate))))
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(lang dune 3.0)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
(library
2+
(name library1)
3+
(js_of_ocaml
4+
(flags (:standard --effects=double-translation))))
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
let name = "library1"
2+
3+
let hello name = print_endline ("Hello " ^ name)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
This tests an erroneous js_of_ocaml config with incompatible `--effects` flags
2+
3+
$ dune build --verbose bin/bin1.bc.js bin/bin2.bc.js bin/bin3.bc.js
4+
INSERT LINK STEP ERROR HERE (it should fail but it doesn't)
5+
$ node _build/default/bin/bin1.bc.js
6+
Hello bin1
7+
Hi library1
8+
$ node _build/default/bin/bin2.bc.js
9+
Hello bin2
10+
Hi library1
11+
$ node _build/default/bin/bin3.bc.js
12+
Hello bin3
13+
Hi library1

0 commit comments

Comments
 (0)