Skip to content

Commit ebca1dd

Browse files
committed
Continue on fail when max_fail is gt 0
1 parent 1201198 commit ebca1dd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/core/QCheck2.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ module Gen = struct
884884
make_primitive
885885
~gen:(fun st -> gen st |> Tree.root)
886886
~shrink
887-
887+
888888
let no_shrink (gen: 'a t) : 'a t = set_shrink (fun _ -> Seq.empty) gen
889889

890890
let (let+) = (>|=)
@@ -1868,6 +1868,7 @@ module Test = struct
18681868
state.step state.test.name state.test input Failure;
18691869
state.cur_max_fail <- state.cur_max_fail - 1;
18701870
R.fail state.res ~steps ~msg_l input;
1871+
if state.cur_max_fail > 0 then CR_continue else
18711872
CR_yield state.res
18721873

18731874
(* [check_state state] applies [state.test] repeatedly ([iter] times)

0 commit comments

Comments
 (0)