Skip to content

Commit dbc30c1

Browse files
committed
Update tests to run on 5.3
1 parent a928fa1 commit dbc30c1

File tree

6 files changed

+54
-6
lines changed

6 files changed

+54
-6
lines changed

mdx.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ depends: [
2828
"logs" {>= "0.7.0"}
2929
"cmdliner" {>= "1.1.0"}
3030
"re" {>= "1.7.2"}
31-
"ocaml-version" {>= "3.6.5"}
31+
"ocaml-version" {>= "2.3.0"}
3232
"lwt" {with-test}
3333
"camlp-streams"
3434
"result"

test/bin/mdx-test/expect/errors/test-case.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,18 @@ first
6464
Exception: Failure "second".
6565
```
6666

67-
```ocaml version>=4.08
67+
```ocaml version>=4.08,version<5.3
6868
# let x =
6969
1 + "42";;
7070
Line 2, characters 7-11:
7171
Error: This expression has type string but an expression was expected of type
7272
int
7373
```
74+
75+
```ocaml version>=5.3
76+
# let x =
77+
1 + "42";;
78+
Line 2, characters 7-11:
79+
Error: This constant has type string but an expression was expected of type
80+
int
81+
```

test/bin/mdx-test/expect/lines/test-case.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Error: This expression has type string but an expression was expected of type
5656
int
5757
```
5858

59-
```ocaml version>=4.08
59+
```ocaml version>=4.08,version<5.3
6060
# let f x = function
6161
| 0 -> 1
6262
| n ->
@@ -66,6 +66,16 @@ Error: This expression has type string but an expression was expected of type
6666
int
6767
```
6868

69+
```ocaml version>=5.3
70+
# let f x = function
71+
| 0 -> 1
72+
| n ->
73+
n + "foo";;
74+
Line 4, characters 7-12:
75+
Error: This constant has type string but an expression was expected of type
76+
int
77+
```
78+
6979
Line directives work for `sh` blocks as well:
7080

7181
```sh version=4.08.1

test/bin/mdx-test/expect/mlt/test-case.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Error: This expression has type string but an expression was expected of type
3030
int
3131
```
3232

33-
```ocaml version>=4.08
33+
```ocaml version>=4.08,version<5.3
3434
# #require "fmt";;
3535
# let x = 3;;
3636
val x : int = 3
@@ -39,3 +39,13 @@ Line 1, characters 5-10:
3939
Error: This expression has type string but an expression was expected of type
4040
int
4141
```
42+
43+
```ocaml version>=5.3
44+
# #require "fmt";;
45+
# let x = 3;;
46+
val x : int = 3
47+
# x + "foo";;
48+
Line 1, characters 5-10:
49+
Error: This constant has type string but an expression was expected of type
50+
int
51+
```

test/bin/mdx-test/expect/simple-mld/test-case.mld

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,20 @@ Indentation test:
5959
val x : int = 1
6060
]}
6161

62-
{delim@ocaml[
62+
{delim@ocaml version<5.3[
6363
let f = 1 + "2"
6464
]delim[
6565
{err@mdx-error[
6666
Line 1, characters 15-18:
6767
Error: This expression has type string but an expression was expected of type
6868
int
6969
]err}]}
70+
71+
{delim@ocaml version>=5.3[
72+
let f = 1 + "2"
73+
]delim[
74+
{err@mdx-error[
75+
Line 1, characters 15-18:
76+
Error: This constant has type string but an expression was expected of type
77+
int
78+
]err}]}

test/bin/mdx-test/expect/simple-mli/test-case.mli

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ val bar : string
5151
val baz : string
5252

5353
(**
54-
{[
54+
{@ocaml version<5.3[
5555
let f = 1 + "2"
5656
][
5757
{err@mdx-error[
@@ -61,6 +61,17 @@ Error: This expression has type string but an expression was expected of type
6161
]err}]}
6262
*)
6363

64+
(**
65+
{@ocaml version>=5.3[
66+
let f = 1 + "2"
67+
][
68+
{err@mdx-error[
69+
Line 1, characters 15-18:
70+
Error: This constant has type string but an expression was expected of type
71+
int
72+
]err}]}
73+
*)
74+
6475
(**
6576
{@ocaml skip[
6677
let f = 1 + "2"

0 commit comments

Comments
 (0)