Skip to content

Commit

Permalink
upadate tests
Browse files Browse the repository at this point in the history
  • Loading branch information
paulpatault committed Jun 5, 2022
1 parent c015925 commit 640dae0
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/patmat.ml
Original file line number Diff line number Diff line change
Expand Up @@ -568,4 +568,4 @@ let checks ~loc ty cases =
let tyl = ty :: bools in
check_exhaustive ~loc tyl pmat q bools;
check_redundancy ~loc tyl pmat
with W.Warning e -> Fmt.epr "%a@." W.pp_warn e
with W.Warning e -> Fmt.pr "%a@." W.pp_warn e
11 changes: 6 additions & 5 deletions test/patterns/negative/redundant1.mli
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ val f : int -> int
| _ -> true
| 1i -> false *)
(* {gospel_expected|
[125] File "redundant1.mli", line 3, characters 12-58:
3 | ............match x with
4 | | _ -> true
5 | | 1i -> false...
Error: The pattern-matching is redundant.
[0] File "redundant1.mli", line 3, characters 12-58:
3 | ............match x with
4 | | _ -> true
5 | | 1i -> false...
Warning: The pattern-matching is redundant.
Here is a case that is unused:
1i.
OK
|gospel_expected} *)
15 changes: 8 additions & 7 deletions test/patterns/negative/redundant2.mli
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ val f : t -> int
| B (B A) -> false
| _ -> true *)
(* {gospel_expected|
[125] File "redundant2.mli", line 5, characters 12-103:
5 | ............match x with
6 | | A -> false
7 | | B (B _) -> false
8 | | B (B A) -> false
9 | | _ -> true...
Error: The pattern-matching is redundant.
[0] File "redundant2.mli", line 5, characters 12-103:
5 | ............match x with
6 | | A -> false
7 | | B (B _) -> false
8 | | B (B A) -> false
9 | | _ -> true...
Warning: The pattern-matching is redundant.
Here is a case that is unused:
B B A.
OK
|gospel_expected} *)
13 changes: 7 additions & 6 deletions test/patterns/negative/redundant3.mli
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ val f : t -> int
| B (B A) -> false
| _ -> true *)
(* {gospel_expected|
[125] File "redundant3.mli", line 5, characters 12-86:
5 | ............match x with
6 | | A | B _ -> false
7 | | B (B A) -> false
8 | | _ -> true...
Error: The pattern-matching is redundant.
[0] File "redundant3.mli", line 5, characters 12-86:
5 | ............match x with
6 | | A | B _ -> false
7 | | B (B A) -> false
8 | | _ -> true...
Warning: The pattern-matching is redundant.
Here is a case that is unused:
B B A.
OK
|gospel_expected} *)

0 comments on commit 640dae0

Please sign in to comment.