From b0e0d7730231b04f524150e3c8c3b6887604746f Mon Sep 17 00:00:00 2001 From: Jan Midtgaard Date: Fri, 24 Sep 2021 00:28:22 +0200 Subject: [PATCH] Avoid deprecated Gen.small_int which silently changed distribution https://github.com/c-cube/qcheck/issues/184 --- README.md | 2 +- examples/counter.ml | 2 +- examples/hashtable.ml | 2 +- examples/putget.ml | 2 +- examples/q.ml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7d176c5..b64625f 100644 --- a/README.md +++ b/README.md @@ -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; diff --git a/examples/counter.ml b/examples/counter.ml index e9b30f8..3bb2477 100644 --- a/examples/counter.ml +++ b/examples/counter.ml @@ -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; diff --git a/examples/hashtable.ml b/examples/hashtable.ml index 7de755b..961949c 100644 --- a/examples/hashtable.ml +++ b/examples/hashtable.ml @@ -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; diff --git a/examples/putget.ml b/examples/putget.ml index 5dc8e23..fd79989 100644 --- a/examples/putget.ml +++ b/examples/putget.ml @@ -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 diff --git a/examples/q.ml b/examples/q.ml index d27e354..296669f 100644 --- a/examples/q.ml +++ b/examples/q.ml @@ -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;