Skip to content

Commit

Permalink
Avoid deprecated Gen.small_int which silently changed distribution c-…
Browse files Browse the repository at this point in the history
  • Loading branch information
jmid committed Sep 23, 2021
1 parent 8db9129 commit b0e0d77
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ tests an `int ref` against a model consisting of a single `int`:
type sut = int ref
let arb_cmd _ =
let int_gen = Gen.oneof [Gen.int; Gen.small_int] in
let int_gen = Gen.oneof [Gen.int; Gen.nat] in
QCheck.make ~print:show_cmd
(Gen.oneof [Gen.return Incr;
Gen.return Decr;
Expand Down
2 changes: 1 addition & 1 deletion examples/counter.ml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ struct
type sut = int ref

let arb_cmd _ =
let int_gen = Gen.oneof [Gen.int; Gen.small_int] in
let int_gen = Gen.oneof [Gen.int; Gen.nat] in
QCheck.make ~print:show_cmd
(Gen.oneof [Gen.return Incr;
Gen.return Decr;
Expand Down
2 changes: 1 addition & 1 deletion examples/hashtable.ml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ struct

(* gen_cmd : state -> command Gen.t *)
let gen_cmd s =
let int_gen = Gen.small_int in
let int_gen = Gen.nat in
let str_gen =
if s=[]
then Gen.oneof [Gen.small_string;
Expand Down
2 changes: 1 addition & 1 deletion examples/putget.ml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ struct
type sut = Dl.library * (int -> unit) * (unit -> int)

let arb_cmd s =
let int_gen = Gen.oneof [Gen.map Int32.to_int int32.gen; Gen.small_int] in
let int_gen = Gen.oneof [Gen.map Int32.to_int int32.gen; Gen.nat] in
let shrink c = match c with
| Put i -> Iter.map (fun i' -> Put i') (Shrink.int i)
| Get -> Iter.empty in
Expand Down
2 changes: 1 addition & 1 deletion examples/q.ml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ struct
type sut = int Queue.t

let gen_cmd s =
let int_gen = Gen.oneof [Gen.int; Gen.small_int] in
let int_gen = Gen.oneof [Gen.int; Gen.nat] in
if s = []
then Gen.oneof (* don't generate pop/tops from empty *)
[Gen.map (fun i -> Push i) int_gen;
Expand Down

0 comments on commit b0e0d77

Please sign in to comment.