Skip to content

Commit 6348df5

Browse files
committed
test: demonstrate syntax error with empty %raw
1 parent 2dbd098 commit 6348df5

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

test/blackbox-tests/empty-raw.t

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
2+
$ . ./setup.sh
3+
$ cat > x.ml <<EOF
4+
> [%%raw {||}]
5+
> EOF
6+
$ melc -ppx melppx x.ml
7+
// Generated by Melange
8+
9+
'use strict';
10+
11+
12+
/* No side effect */
13+
14+
$ cat > x.ml <<EOF
15+
> let () = [%raw {||}]
16+
> EOF
17+
$ melc -ppx melppx x.ml
18+
File "x.ml", line 1, characters 17-17:
19+
Warning 103 [melange-ffi-warning]: FFI warning: Unexpected end of input
20+
// Generated by Melange
21+
'use strict';
22+
23+
24+
();
25+
/* Not a pure module */
26+
27+
$ cat > x.ml <<EOF
28+
> let x = [%raw {||}]
29+
> EOF
30+
$ melc -ppx melppx x.ml
31+
File "x.ml", line 1, characters 16-16:
32+
Warning 103 [melange-ffi-warning]: FFI warning: Unexpected end of input
33+
// Generated by Melange
34+
'use strict';
35+
36+
37+
const x = ;
38+
39+
module.exports = {
40+
x,
41+
}
42+
/* x Not a pure module */

0 commit comments

Comments
 (0)