Skip to content

Commit 99dbc51

Browse files
committed
Added test showcasing the output of RPC failures
Signed-off-by: Ambre Austen Suhamy <[email protected]>
1 parent bcfcf55 commit 99dbc51

File tree

7 files changed

+46
-0
lines changed

7 files changed

+46
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(lang dune 3.8)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
let y = "type error" + 3
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
let y = "unknown variable" ^ what
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
(library
2+
(name bar)
3+
(modules bar))
4+
5+
(library
6+
(name baz)
7+
(modules baz))
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
We test the output of the watch mode client when we have multiple errors
2+
3+
$ . ../helpers.sh
4+
5+
$ start_dune
6+
7+
$ dune rpc ping --wait
8+
Server appears to be responding normally
9+
10+
$ dune build
11+
File "$TESTCASE_ROOT/libs/bar.ml", line 1, characters 8-20:
12+
1 | let y = "type error" + 3
13+
^^^^^^^^^^^^
14+
This constant has type string but an expression was expected of type
15+
int
16+
File "$TESTCASE_ROOT/libs/baz.ml", line 1, characters 29-33:
17+
1 | let y = "unknown variable" ^ what
18+
^^^^
19+
Unbound value what
20+
Build failed with 2 errors.
21+
22+
$ stop_dune
23+
File "libs/bar.ml", line 1, characters 8-20:
24+
1 | let y = "type error" + 3
25+
^^^^^^^^^^^^
26+
Error: This constant has type string but an expression was expected of type
27+
int
28+
File "libs/baz.ml", line 1, characters 29-33:
29+
1 | let y = "unknown variable" ^ what
30+
^^^^
31+
Error: Unbound value what
32+
Had 2 errors, waiting for filesystem changes...
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
(executable
2+
(name foo)
3+
(libraries bar baz))
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
let f = Bar.x + Baz.y + invalid_syntax : ? = !

0 commit comments

Comments
 (0)