Skip to content

Commit

Permalink
More test
Browse files Browse the repository at this point in the history
  • Loading branch information
Alain Frisch committed May 4, 2021
1 parent f5b312d commit f90daf0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions testsuite/tests/basic/boxedints.ml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ module type TESTSIG = sig
val div: t -> t -> t
val unsigned_div: t -> t -> t
val rem: t -> t -> t
val min: t -> t -> t
val max: t -> t -> t
val logand: t -> t -> t
val logor: t -> t -> t
val logxor: t -> t -> t
Expand Down Expand Up @@ -227,6 +229,10 @@ struct
11, 1234567, -12345678];
test 12 (rem min_int (of_int (-1))) (of_int 0);

testing_function "min/max";
test 1 (max (of_int 2) (of_int 3)) (of_int 3);
test 2 (min (of_int 2) (of_int 3)) (of_int 2);

testing_function "and";
List.iter
(fun (n, a, b, c) -> test n (logand (of_string a) (of_string b))
Expand Down Expand Up @@ -487,6 +493,10 @@ struct
11, 1234567, -12345678];
test 12 (rem min_int (of_int (-1))) (of_int 0);

testing_function "min/max";
test 1 (max (of_int 2) (of_int 3)) (of_int 3);
test 2 (min (of_int 2) (of_int 3)) (of_int 2);

testing_function "and";
List.iter
(fun (n, a, b, c) -> test n (logand (of_string a) (of_string b))
Expand Down
6 changes: 6 additions & 0 deletions testsuite/tests/basic/boxedints.reference
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ unsigned_div
1... 2... 3... 4... 5... 6... 7... 8... 9... 10... 11...
mod
1... 2... 3... 4... 5... 6... 7... 8... 9... 10... 11... 12...
min/max
1... 2...
and
1... 2... 3... 4... 5...
or
Expand Down Expand Up @@ -66,6 +68,8 @@ unsigned_div
1... 2... 3... 4... 5... 6... 7... 8... 9... 10... 11...
mod
1... 2... 3... 4... 5... 6... 7... 8... 9... 10... 11... 12...
min/max
1... 2...
and
1... 2... 3... 4... 5...
or
Expand Down Expand Up @@ -105,6 +109,8 @@ unsigned_div
1... 2... 3... 4... 5... 6... 7... 8... 9... 10... 11...
mod
1... 2... 3... 4... 5... 6... 7... 8... 9... 10... 11... 12...
min/max
1... 2...
and
1... 2... 3... 4... 5...
or
Expand Down

0 comments on commit f90daf0

Please sign in to comment.