Skip to content

Commit

Permalink
cmd data shrinking example for neg_test/ref_test.ml
Browse files Browse the repository at this point in the history
  • Loading branch information
jmid committed Jun 15, 2022
1 parent 26a0088 commit 3fe1f7c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/neg_tests/ref_test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ struct

let arb_cmd _s =
let int_gen = Gen.nat in
QCheck.make ~print:show_cmd
let shrink_cmd c = match c with
| Set i -> Iter.map (fun i -> Set i) (Shrink.int i)
| Add i -> Iter.map (fun i -> Add i) (Shrink.int i)
| _ -> Iter.empty in
QCheck.make ~print:show_cmd ~shrink:shrink_cmd
(Gen.oneof
[Gen.return Get;
Gen.map (fun i -> Set i) int_gen;
Expand Down

0 comments on commit 3fe1f7c

Please sign in to comment.