Skip to content

Commit

Permalink
Realign shrinker benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
jmid committed May 1, 2023
1 parent 063c1d7 commit 00d4d43
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion test/core/QCheck2_tests.ml
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ module Shrink = struct
Gen.char (fun c -> not (List.mem c ['a';'b';'c';'d';'e';'f']))

let printable_is_never_sign = (* should shrink towards '!' with lowest ascii code 33 *)
Test.make ~name:"printable never produces '!\"#$%&''" ~count:1000 ~print:Print.char
Test.make ~name:"printable never produces '!\"#$%&'" ~count:1000 ~print:Print.char
Gen.printable (fun c -> not (List.mem c ['!';'@';'#';'$';'%']))

let numeral_is_never_less_5 =
Expand Down
6 changes: 6 additions & 0 deletions test/core/QCheck_tests.ml
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,11 @@ module Shrink = struct
IntTree.(make ~print:print_tree ~shrink:shrink_tree gen_tree)
(fun tree -> IntTree.contains_only_n tree 42)

let test_gen_no_shrink =
Test.make ~name:"sum list = 0"
(set_shrink Shrink.nil (list small_int))
(fun xs -> List.fold_left (+) 0 xs = 0)

let tests = [
(*test_fac_issue59;*)
big_bound_issue59;
Expand Down Expand Up @@ -748,6 +753,7 @@ module Shrink = struct
(*list_equal_dupl;*)
list_unique_elems;
tree_contains_only_42;
test_gen_no_shrink;
]
end

Expand Down

0 comments on commit 00d4d43

Please sign in to comment.