Skip to content

Commit 27f5b38

Browse files
committed
Fix test for OCaml 5
The format of the error that this test checks for is printed a little differently by the OCaml 5 compiler (the name of the tag is now quoted). Adapt the test a little to make it work both for OCaml 4 and 5. Signed-off-by: Rob Hoes <[email protected]>
1 parent 3366f0c commit 27f5b38

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

ocaml/libs/xapi-stdext/lib/xapi-fdcaps/test/properties.t

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ Check that we get compile errors when trying to use a read-only or write-only pr
44
> open Xapi_fdcaps.Properties
55
> let _ = as_readable (make `wronly `reg)
66
> EOF
7-
$ ocamlfind ocamlc -package xapi-stdext-unix.fdcaps -c t.ml 2>&1 | tail -n 1
8-
The second variant type does not allow tag(s) `wronly
7+
$ ocamlfind ocamlc -package xapi-stdext-unix.fdcaps -c t.ml 2>&1 |
8+
> grep -c "The second variant type does not allow tag(s)"
9+
1
910

1011
$ cat >t.ml <<'EOF'
1112
> open Xapi_fdcaps.Properties
1213
> let _ = as_writable (make `rdonly `reg)
1314
> EOF
14-
$ ocamlfind ocamlc -package xapi-stdext-unix.fdcaps -c t.ml 2>&1 | tail -n 1
15-
The second variant type does not allow tag(s) `rdonly
15+
$ ocamlfind ocamlc -package xapi-stdext-unix.fdcaps -c t.ml 2>&1 |
16+
> grep -c "The second variant type does not allow tag(s)"
17+
1

0 commit comments

Comments
 (0)