From 8240c5b280cc8ce1220c240c0848375d593cbc86 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 22 Mar 2022 15:19:36 +0100 Subject: [PATCH 001/391] simpler list shrinker with better complexity --- src/core/QCheck.ml | 45 ++++++++++++++------------------------------- 1 file changed, 14 insertions(+), 31 deletions(-) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index 91650b93..602e2ddc 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -727,37 +727,20 @@ module Shrink = struct ) done - let list_spine l yield = - let n = List.length l in - let chunk_size = ref ((n+1)/2) in - - (* push the [n] first elements of [l] into [q], return the rest of the list *) - let rec fill_queue n l q = match n,l with - | 0, _ -> l - | _, x::xs -> - Queue.push x q; - fill_queue (n-1) xs q - | _, _ -> assert false - in - - (* remove elements from the list, by chunks of size [chunk_size] (bigger - chunks first) *) - while !chunk_size > 0 do - let q = Queue.create () in - let l' = fill_queue !chunk_size l q in - (* remove [chunk_size] elements in queue *) - let rec pos_loop rev_prefix suffix = - yield (List.rev_append rev_prefix suffix); - match suffix with - | [] -> () - | x::xs -> - Queue.push x q; - let y = Queue.pop q in - (pos_loop [@tailcall]) (y::rev_prefix) xs - in - pos_loop [] l'; - chunk_size := !chunk_size / 2; - done + let rec list_spine l yield = + let rec split l len acc = match len,l with + | _,[] + | 0,_ -> List.rev acc, l + | _,x::xs -> split xs (len-1) (x::acc) in + match l with + | [] -> () + | [_] -> yield [] + | [x;y] -> yield []; yield [x]; yield [y] + | _::_ -> + let len = List.length l in + let xs,ys = split l ((1 + len) / 2) [] in + yield xs; + list_spine xs (fun xs' -> yield (xs'@ys)) let list_elems shrink l yield = (* try to shrink each element of the list *) From ee11cb5f43caedfbf224cef01e2bb2d83d65806a Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 22 Mar 2022 15:26:21 +0100 Subject: [PATCH 002/391] use improved list shrinker for strings --- src/core/QCheck.ml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index 602e2ddc..ee1f74b2 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -694,14 +694,6 @@ module Shrink = struct | None -> Iter.empty | Some x -> Iter.(return None <+> map (fun y->Some y) (s x)) - let string s yield = - for i =0 to String.length s-1 do - let s' = Bytes.init (String.length s-1) - (fun j -> if j<i then s.[j] else s.[j+1]) - in - yield (Bytes.unsafe_to_string s') - done - let array ?shrink a yield = let n = Array.length a in let chunk_size = ref n in @@ -758,6 +750,11 @@ module Shrink = struct | None -> () | Some shrink -> list_elems shrink l yield + let string (*?(shrink=char)*) s yield = + list ~shrink:char + (List.of_seq (String.to_seq s)) + (fun cs -> yield (String.of_seq (List.to_seq cs))) + let pair a b (x,y) yield = a x (fun x' -> yield (x',y)); b y (fun y' -> yield (x,y')) From e9785f36a669d13f6bc97aa0ed0c1c728ffc8564 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 22 Mar 2022 15:37:26 +0100 Subject: [PATCH 003/391] improved function shrinker --- src/core/QCheck.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index ee1f74b2..0526c7a3 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -1328,7 +1328,7 @@ end = struct tbl; Buffer.contents b); p_shrink1=(fun yield -> - Shrink.list (tbl_to_list tbl) + Shrink.list_spine (tbl_to_list tbl) (fun l -> yield (make ~extend:false (tbl_of_list l))) ); @@ -1399,9 +1399,9 @@ module Fn = struct = function | Fun_tbl {fun_arb=a; fun_tbl=tbl; fun_default=def} -> let sh_v = match a.shrink with None -> Shrink.nil | Some s->s in - (Poly_tbl.shrink1 tbl >|= fun tbl' -> mk_repr tbl' a def) - <+> (sh_v def >|= fun def' -> mk_repr tbl a def') + <+> + (Poly_tbl.shrink1 tbl >|= fun tbl' -> mk_repr tbl' a def) <+> (Poly_tbl.shrink2 sh_v tbl >|= fun tbl' -> mk_repr tbl' a def) | Fun_map (g, r') -> From c503f43b4478b953f95f5b520487bdffca4978cc Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 22 Mar 2022 15:46:29 +0100 Subject: [PATCH 004/391] update expected output --- example/alcotest/output.txt.expected | 4 +- example/ounit/output.txt.expected | 2 +- example/output.txt.expected | 12 ++-- test/core/QCheck_expect_test.expected | 99 ++++++++++++++------------- 4 files changed, 60 insertions(+), 57 deletions(-) diff --git a/example/alcotest/output.txt.expected b/example/alcotest/output.txt.expected index 79e4f3cf..0e046030 100644 --- a/example/alcotest/output.txt.expected +++ b/example/alcotest/output.txt.expected @@ -9,8 +9,8 @@ Testing `my test'. ┌──────────────────────────────────────────────────────────────────────────────┐ │ [FAIL] suite 1 fail_sort_id. │ └──────────────────────────────────────────────────────────────────────────────┘ -test `fail_sort_id` failed on ≥ 1 cases: [1; 0] (after 20 shrink steps) -[exception] test `fail_sort_id` failed on ≥ 1 cases: [1; 0] (after 20 shrink steps) +test `fail_sort_id` failed on ≥ 1 cases: [1; 0] (after 11 shrink steps) +[exception] test `fail_sort_id` failed on ≥ 1 cases: [1; 0] (after 11 shrink steps) ────────────────────────────────────────────────────────────────────────────── ┌──────────────────────────────────────────────────────────────────────────────┐ │ [FAIL] suite 2 error_raise_exn. │ diff --git a/example/ounit/output.txt.expected b/example/ounit/output.txt.expected index cb6e4427..df0adfb1 100644 --- a/example/ounit/output.txt.expected +++ b/example/ounit/output.txt.expected @@ -35,7 +35,7 @@ Error: tests:1:fail_sort_id (in the log). Error: tests:1:fail_sort_id (in the code). -test `fail_sort_id` failed on ≥ 1 cases: [1; 0] (after 20 shrink steps) +test `fail_sort_id` failed on ≥ 1 cases: [1; 0] (after 11 shrink steps) ------------------------------------------------------------------------------ diff --git a/example/output.txt.expected b/example/output.txt.expected index 6692c769..cf10485f 100644 --- a/example/output.txt.expected +++ b/example/output.txt.expected @@ -2,7 +2,7 @@ random seed: 1234 --- Failure -------------------------------------------------------------------- -Test should_fail_sort_id failed (18 shrink steps): +Test should_fail_sort_id failed (13 shrink steps): [1; 0] @@ -59,9 +59,9 @@ stats num: --- Failure -------------------------------------------------------------------- -Test FAIL_pred_map_commute failed (107 shrink steps): +Test FAIL_pred_map_commute failed (77 shrink steps): -([0], {_ -> -21}, {-21 -> true; _ -> false}) +([1], {_ -> 0}, {1 -> true; _ -> false}) --- Failure -------------------------------------------------------------------- @@ -71,7 +71,7 @@ Test FAIL_fun2_pred_strings failed (1 shrink steps): --- Failure -------------------------------------------------------------------- -Test fold_left fold_right failed (24 shrink steps): +Test fold_left fold_right failed (34 shrink steps): (0, [1], {(1, 0) -> 1; _ -> 0}) @@ -84,9 +84,9 @@ l=[1], fold_left=1, fold_right=0 --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried failed (97 shrink steps): +Test fold_left fold_right uncurried failed (44 shrink steps): -({(1, 7) -> 0; _ -> 7}, 0, [1; 0]) +({(0, 7) -> 1; _ -> 0}, 0, [7]) --- Failure -------------------------------------------------------------------- diff --git a/test/core/QCheck_expect_test.expected b/test/core/QCheck_expect_test.expected index 0a00ceb1..4e01aa9c 100644 --- a/test/core/QCheck_expect_test.expected +++ b/test/core/QCheck_expect_test.expected @@ -72,12 +72,14 @@ random seed: 1234 1 0 [7; 1; 42; 1; 8; 5; 3; 9; 5; 38; 3; 3; 0; 1; 98; 1; 4; 13; 9; 2; 6; 9; 47; 6; 5; 8; 8; 6; 0; 9; 7; 2; 8; 6; 62; 6; 4; 31; 19; 1; 41; 60; 6; 5; 8; 1; 1; 4; 7; 7; 0; 5; 5; 71; 14; 26; 47; 5; 1; 6; 34; 9; 4; 2; 37; 3; 8; 4; 31; 6; 2; 1; 0; 7; 5; 1; 0; 15; 6; 1; 8; 13; 0; 6; 2; 4; 2; 6; 6; 1; 4; 1; 9; 79; 0; 87; 6; 8; 8; 62; 1; 4; 62; 6; 31; 1; 5; 6; 5; 9; 3; 3; 1; 79; 4; 3; 2; 67; 5; 7; 12; 70; 8; 8; 6; 1; 3; 14; 15; 1; 61; 4; 1; 4; 1; 7; 4; 4; 4; 2; 8; 8; 7; 5; 4; 27; 0; 9; 80; 25; 1; 8; 1; 3; 7; 4; 3; 5; 5; 6; 5; 5; 31; 7; 0; 3; 3; 6; 71; 76; 28; 60; 6; 2; 6; 3; 0; 4; 1; 0; 5; 7; 0; 28; 86; 4; 7; 51; 36; 0; 5; 0; 1; 4; 3; 6; 0; 1; 1; 8; 18; 4; 2; 8; 8; 1; 4; 7; 1; 0; 93; 5; 3; 0; 80; 1; 7; 7; 8; 8; 5; 7; 8; 9; 24; 4; 25; 8; 8; 5; 4; 90; 4; 6; 8; 4; 4; 0; 60; 8; 9; 7; 44; 5; 1; 2; 9; 74; 7; 7] -[1; 3; 14; 15; 1; 61; 4; 1; 4; 1; 7; 4; 4; 4; 2; 8; 8; 7; 5; 4; 27; 0; 9; 80; 25; 1; 8; 1; 3; 7; 4; 3; 5; 5; 6; 5; 5; 31; 7; 0; 3; 3; 6; 71; 76; 28; 60; 6; 2; 6; 3; 0; 4; 1; 0; 5; 7; 0; 28; 86; 4; 7; 51; 36; 0; 5; 0; 1; 4; 3; 6; 0; 1; 1; 8; 18; 4; 2; 8; 8; 1; 4; 7; 1; 0; 93; 5; 3; 0; 80; 1; 7; 7; 8; 8; 5; 7; 8; 9; 24; 4; 25; 8; 8; 5; 4; 90; 4; 6; 8; 4; 4; 0; 60; 8; 9; 7; 44; 5; 1; 2; 9; 74; 7; 7] -[36; 0; 5; 0; 1; 4; 3; 6; 0; 1; 1; 8; 18; 4; 2; 8; 8; 1; 4; 7; 1; 0; 93; 5; 3; 0; 80; 1; 7; 7; 8; 8; 5; 7; 8; 9; 24; 4; 25; 8; 8; 5; 4; 90; 4; 6; 8; 4; 4; 0; 60; 8; 9; 7; 44; 5; 1; 2; 9; 74; 7; 7] -[8; 5; 7; 8; 9; 24; 4; 25; 8; 8; 5; 4; 90; 4; 6; 8; 4; 4; 0; 60; 8; 9; 7; 44; 5; 1; 2; 9; 74; 7; 7] -[4; 4; 0; 60; 8; 9; 7; 44; 5; 1; 2; 9; 74; 7; 7] -[5; 1; 2; 9; 74; 7; 7] -[74; 7; 7] +[7; 1; 42; 1; 8; 5; 3; 9; 5; 38; 3; 3; 0; 1; 98; 1; 4; 13; 9; 2; 6; 9; 47; 6; 5; 8; 8; 6; 0; 9; 7; 2; 8; 6; 62; 6; 4; 31; 19; 1; 41; 60; 6; 5; 8; 1; 1; 4; 7; 7; 0; 5; 5; 71; 14; 26; 47; 5; 1; 6; 34; 9; 4; 2; 37; 3; 8; 4; 31; 6; 2; 1; 0; 7; 5; 1; 0; 15; 6; 1; 8; 13; 0; 6; 2; 4; 2; 6; 6; 1; 4; 1; 9; 79; 0; 87; 6; 8; 8; 62; 1; 4; 62; 6; 31; 1; 5; 6; 5; 9; 3; 3; 1; 79; 4; 3; 2; 67; 5; 7; 12; 70; 8; 8; 6] +[7; 1; 42; 1; 8; 5; 3; 9; 5; 38; 3; 3; 0; 1; 98; 1; 4; 13; 9; 2; 6; 9; 47; 6; 5; 8; 8; 6; 0; 9; 7; 2; 8; 6; 62; 6; 4; 31; 19; 1; 41; 60; 6; 5; 8; 1; 1; 4; 7; 7; 0; 5; 5; 71; 14; 26; 47; 5; 1; 6; 34; 9; 4] +[7; 1; 42; 1; 8; 5; 3; 9; 5; 38; 3; 3; 0; 1; 98; 1; 4; 13; 9; 2; 6; 9; 47; 6; 5; 8; 8; 6; 0; 9; 7; 2] +[7; 1; 42; 1; 8; 5; 3; 9; 5; 38; 3; 3; 0; 1; 98; 1] +[7; 1; 42; 1; 8; 5; 3; 9] +[7; 1; 42; 1] +[7; 1] +[] [7] [] [4] @@ -89,27 +91,28 @@ random seed: 1234 [0] [] [7; 1; 42; 1; 8; 5; 3; 9; 5; 38; 3; 3; 0; 1; 98; 1; 4; 13; 9; 2; 6; 9; 47; 6; 5; 8; 8; 6; 0; 9; 7; 2; 8; 6; 62; 6; 4; 31; 19; 1; 41; 60; 6; 5; 8; 1; 1; 4; 7; 7; 0; 5; 5; 71; 14; 26; 47; 5; 1; 6; 34; 9; 4; 2; 37; 3; 8; 4; 31; 6; 2; 1; 0; 7; 5; 1; 0; 15; 6; 1; 8; 13; 0; 6; 2; 4; 2; 6; 6; 1; 4; 1; 9; 79; 0; 87; 6; 8; 8; 62; 1; 4; 62; 6; 31; 1; 5; 6; 5; 9; 3; 3; 1; 79; 4; 3; 2; 67; 5; 7; 12; 70; 8; 8; 6; 1; 3; 14; 15; 1; 61; 4; 1; 4; 1; 7; 4; 4; 4; 2; 8; 8; 7; 5; 4; 27; 0; 9; 80; 25; 1; 8; 1; 3; 7; 4; 3; 5; 5; 6; 5; 5; 31; 7; 0; 3; 3; 6; 71; 76; 28; 60; 6; 2; 6; 3; 0; 4; 1; 0; 5; 7; 0; 28; 86; 4; 7; 51; 36; 0; 5; 0; 1; 4; 3; 6; 0; 1; 1; 8; 18; 4; 2; 8; 8; 1; 4; 7; 1; 0; 93; 5; 3; 0; 80; 1; 7; 7; 8; 8; 5; 7; 8; 9; 24; 4; 25; 8; 8; 5; 4; 90; 4; 6; 8; 4; 4; 0; 60; 8; 9; 7; 44; 5; 1; 2; 9; 74; 7; 7] -[1; 3; 14; 15; 1; 61; 4; 1; 4; 1; 7; 4; 4; 4; 2; 8; 8; 7; 5; 4; 27; 0; 9; 80; 25; 1; 8; 1; 3; 7; 4; 3; 5; 5; 6; 5; 5; 31; 7; 0; 3; 3; 6; 71; 76; 28; 60; 6; 2; 6; 3; 0; 4; 1; 0; 5; 7; 0; 28; 86; 4; 7; 51; 36; 0; 5; 0; 1; 4; 3; 6; 0; 1; 1; 8; 18; 4; 2; 8; 8; 1; 4; 7; 1; 0; 93; 5; 3; 0; 80; 1; 7; 7; 8; 8; 5; 7; 8; 9; 24; 4; 25; 8; 8; 5; 4; 90; 4; 6; 8; 4; 4; 0; 60; 8; 9; 7; 44; 5; 1; 2; 9; 74; 7; 7] -[36; 0; 5; 0; 1; 4; 3; 6; 0; 1; 1; 8; 18; 4; 2; 8; 8; 1; 4; 7; 1; 0; 93; 5; 3; 0; 80; 1; 7; 7; 8; 8; 5; 7; 8; 9; 24; 4; 25; 8; 8; 5; 4; 90; 4; 6; 8; 4; 4; 0; 60; 8; 9; 7; 44; 5; 1; 2; 9; 74; 7; 7] -[8; 5; 7; 8; 9; 24; 4; 25; 8; 8; 5; 4; 90; 4; 6; 8; 4; 4; 0; 60; 8; 9; 7; 44; 5; 1; 2; 9; 74; 7; 7] -[4; 4; 0; 60; 8; 9; 7; 44; 5; 1; 2; 9; 74; 7; 7] -[5; 1; 2; 9; 74; 7; 7] -[74; 7; 7] -[7] -[74] -[7; 7] -[7] -[7] -[4; 7] -[6; 7] -[6; 7] -[7; 4] -[7; 6] -[7; 6] +[7; 1; 42; 1; 8; 5; 3; 9; 5; 38; 3; 3; 0; 1; 98; 1; 4; 13; 9; 2; 6; 9; 47; 6; 5; 8; 8; 6; 0; 9; 7; 2; 8; 6; 62; 6; 4; 31; 19; 1; 41; 60; 6; 5; 8; 1; 1; 4; 7; 7; 0; 5; 5; 71; 14; 26; 47; 5; 1; 6; 34; 9; 4; 2; 37; 3; 8; 4; 31; 6; 2; 1; 0; 7; 5; 1; 0; 15; 6; 1; 8; 13; 0; 6; 2; 4; 2; 6; 6; 1; 4; 1; 9; 79; 0; 87; 6; 8; 8; 62; 1; 4; 62; 6; 31; 1; 5; 6; 5; 9; 3; 3; 1; 79; 4; 3; 2; 67; 5; 7; 12; 70; 8; 8; 6] +[7; 1; 42; 1; 8; 5; 3; 9; 5; 38; 3; 3; 0; 1; 98; 1; 4; 13; 9; 2; 6; 9; 47; 6; 5; 8; 8; 6; 0; 9; 7; 2; 8; 6; 62; 6; 4; 31; 19; 1; 41; 60; 6; 5; 8; 1; 1; 4; 7; 7; 0; 5; 5; 71; 14; 26; 47; 5; 1; 6; 34; 9; 4] +[7; 1; 42; 1; 8; 5; 3; 9; 5; 38; 3; 3; 0; 1; 98; 1; 4; 13; 9; 2; 6; 9; 47; 6; 5; 8; 8; 6; 0; 9; 7; 2] +[7; 1; 42; 1; 8; 5; 3; 9; 5; 38; 3; 3; 0; 1; 98; 1] +[7; 1; 42; 1; 8; 5; 3; 9] +[7; 1; 42; 1] +[7; 1] +[42; 1] +[7; 42; 1] +[1; 42; 1] +[1; 42] +[1] +[1; 1] +[] +[1] +[1] +[0; 1] +[1; 0] --- Failure -------------------------------------------------------------------- -Test should_fail_sort_id failed (18 shrink steps): +Test should_fail_sort_id failed (13 shrink steps): [1; 0] @@ -245,27 +248,27 @@ Test char never produces 'abcdef' failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test strings are empty failed (249 shrink steps): +Test strings are empty failed (145 shrink steps): -"\177" +"\000" --- Failure -------------------------------------------------------------------- -Test string never has a \000 char failed (25 shrink steps): +Test string never has a \000 char failed (8 shrink steps): "\000" --- Failure -------------------------------------------------------------------- -Test string never has a \255 char failed (249 shrink steps): +Test string never has a \255 char failed (14 shrink steps): "\255" --- Failure -------------------------------------------------------------------- -Test strings have unique chars failed (248 shrink steps): +Test strings have unique chars failed (13 shrink steps): -"\206\206" +"\129\129" --- Failure -------------------------------------------------------------------- @@ -311,13 +314,13 @@ Test pairs sum to less than 128 failed (116 shrink steps): --- Failure -------------------------------------------------------------------- -Test pairs lists rev concat failed (140 shrink steps): +Test pairs lists rev concat failed (147 shrink steps): ([0], [1]) --- Failure -------------------------------------------------------------------- -Test pairs lists no overlap failed (22 shrink steps): +Test pairs lists no overlap failed (26 shrink steps): ([0], [0]) @@ -425,25 +428,25 @@ Test bind ordered pairs failed (125 shrink steps): --- Failure -------------------------------------------------------------------- -Test bind list_size constant failed (50 shrink steps): +Test bind list_size constant failed (49 shrink steps): (4, [0; 0; 0; 0]) --- Failure -------------------------------------------------------------------- -Test lists are empty failed (11 shrink steps): +Test lists are empty failed (12 shrink steps): [0] --- Failure -------------------------------------------------------------------- -Test lists shorter than 10 failed (50 shrink steps): +Test lists shorter than 10 failed (39 shrink steps): [0; 0; 0; 0; 0; 0; 0; 0; 0; 0] --- Failure -------------------------------------------------------------------- -Test lists shorter than 432 failed (1696 shrink steps): +Test lists shorter than 432 failed (1632 shrink steps): [...] list length: 432 @@ -455,15 +458,15 @@ Test lists shorter than 4332 failed (13 shrink steps): --- Failure -------------------------------------------------------------------- -Test lists equal to duplication failed (20 shrink steps): +Test lists equal to duplication failed (26 shrink steps): [0] --- Failure -------------------------------------------------------------------- -Test lists have unique elems failed (7 shrink steps): +Test lists have unique elems failed (8 shrink steps): -[7; 7] +[1; 1] --- Failure -------------------------------------------------------------------- @@ -473,9 +476,9 @@ Leaf 0 --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute failed (107 shrink steps): +Test fail_pred_map_commute failed (77 shrink steps): -([0], {_ -> -21}, {-21 -> true; _ -> false}) +([1], {_ -> 0}, {1 -> true; _ -> false}) --- Failure -------------------------------------------------------------------- @@ -485,7 +488,7 @@ Test fail_pred_strings failed (1 shrink steps): --- Failure -------------------------------------------------------------------- -Test fold_left fold_right failed (24 shrink steps): +Test fold_left fold_right failed (34 shrink steps): (0, [1], {(1, 0) -> 1; _ -> 0}) @@ -498,21 +501,21 @@ l=[1], fold_left=1, fold_right=0 --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried failed (97 shrink steps): +Test fold_left fold_right uncurried failed (44 shrink steps): -({(1, 7) -> 0; _ -> 7}, 0, [1; 0]) +({(0, 7) -> 1; _ -> 0}, 0, [7]) --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried fun last failed (21 shrink steps): +Test fold_left fold_right uncurried fun last failed (34 shrink steps): -(0, [1], {(0, 1) -> 0; _ -> 1}) +(0, [1], {(1, 0) -> 1; _ -> 0}) --- Failure -------------------------------------------------------------------- -Test fold_left test, fun first failed (40 shrink steps): +Test fold_left test, fun first failed (275 shrink steps): -({_ -> ""}, "z", [], [0]) +({_ -> ""}, "\000", [], [0]) --- Failure -------------------------------------------------------------------- From db875cfe457237f69ce81b8cd0ac60f5ac3ef6d0 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 19 Apr 2022 14:19:27 +0200 Subject: [PATCH 005/391] update expected unit test output --- test/core/QCheck_unit_tests.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/core/QCheck_unit_tests.ml b/test/core/QCheck_unit_tests.ml index bb26e85b..95d3f150 100644 --- a/test/core/QCheck_unit_tests.ml +++ b/test/core/QCheck_unit_tests.ml @@ -76,7 +76,7 @@ module Check_exn = struct let test_fail_random () = let name = "list is own reverse" in - let counterex_str = "[0; -1] (after 126 shrink steps)" in + let counterex_str = "[0; 1] (after 123 shrink steps)" in let run_test () = check_exn QCheck.(Test.make ~name (list int) (fun l -> List.rev l = l)) in From 3ba1ce8529cf93b2e3d8040afe83046513f0ae03 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 5 May 2022 23:31:38 +0200 Subject: [PATCH 006/391] add CHANGELOG entry --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 63aa823d..05e524d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,11 @@ - add a shrinker performance benchmark [#177](https://github.com/c-cube/qcheck/pull/177) +- shrinker changes + - recursive list shrinker with better complexity + - string shrinker reuses improved list shrinker and adds char shrinking + - function shrinker now shrinks default entry first and benefits from list shrinker improvements + - documentation updates: - clarify upper bound inclusion in `Gen.int_bound` and `Gen.int_range` - clarify `printable_char` and `Gen.printable` distributions From b1e69f8ebd12a777ae7210396836180bd203bd50 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 6 May 2022 17:02:08 +0200 Subject: [PATCH 007/391] Fix indentation Co-authored-by: Valentin Chaboche <valentinchb@gmail.Com> --- src/core/QCheck.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index 0526c7a3..9b81b8c3 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -731,8 +731,8 @@ module Shrink = struct | _::_ -> let len = List.length l in let xs,ys = split l ((1 + len) / 2) [] in - yield xs; - list_spine xs (fun xs' -> yield (xs'@ys)) + yield xs; + list_spine xs (fun xs' -> yield (xs'@ys)) let list_elems shrink l yield = (* try to shrink each element of the list *) From 4aad609afae413878eb19c202fedf6771a7053e0 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 6 May 2022 17:04:40 +0200 Subject: [PATCH 008/391] remote commented parameter --- src/core/QCheck.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index 9b81b8c3..6f2222b7 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -750,7 +750,7 @@ module Shrink = struct | None -> () | Some shrink -> list_elems shrink l yield - let string (*?(shrink=char)*) s yield = + let string s yield = list ~shrink:char (List.of_seq (String.to_seq s)) (fun cs -> yield (String.of_seq (List.to_seq cs))) From a4c1e2eb6670f3108a1302a12ab8287ec0d42937 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 6 May 2022 18:58:58 +0200 Subject: [PATCH 009/391] improve linear char shrinker --- src/core/QCheck.ml | 8 ++++++-- src/core/QCheck.mli | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index 6f2222b7..f53e73cd 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -687,8 +687,12 @@ module Shrink = struct let filter f shrink x = Iter.filter f (shrink x) - let char c yield = - if Char.code c > 0 then yield (Char.chr (Char.code c-1)) + let char c = match c with + | 'a' -> Iter.empty + | _ -> + let c_code = Char.code c in + let a_code = Char.code 'a' in + Iter.map (fun diff -> Char.chr (a_code + diff)) (int (c_code - a_code)) let option s x = match x with | None -> Iter.empty diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index dc98fd3e..f6176f68 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -687,7 +687,9 @@ module Shrink : sig val unit : unit t (** @since 0.6 *) - val char : char t (** @since 0.6 *) + val char : char t + (** Shrinks towards ['a']. + @since 0.6 *) val int : int t From c89ab442a9d2763d6e858a848310c856eedf84ea Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 6 May 2022 19:00:47 +0200 Subject: [PATCH 010/391] update expected output after char improvement --- test/core/QCheck_expect_test.expected | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/core/QCheck_expect_test.expected b/test/core/QCheck_expect_test.expected index 4e01aa9c..5bb3d29d 100644 --- a/test/core/QCheck_expect_test.expected +++ b/test/core/QCheck_expect_test.expected @@ -248,9 +248,9 @@ Test char never produces 'abcdef' failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test strings are empty failed (145 shrink steps): +Test strings are empty failed (15 shrink steps): -"\000" +"a" --- Failure -------------------------------------------------------------------- @@ -513,9 +513,9 @@ Test fold_left fold_right uncurried fun last failed (34 shrink steps): --- Failure -------------------------------------------------------------------- -Test fold_left test, fun first failed (275 shrink steps): +Test fold_left test, fun first failed (36 shrink steps): -({_ -> ""}, "\000", [], [0]) +({_ -> ""}, "a", [], [0]) --- Failure -------------------------------------------------------------------- From 48d827dd8772213af175bb792cb40b06277c6da7 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Sat, 7 May 2022 00:27:39 +0200 Subject: [PATCH 011/391] avoid intermediate Seq in string shrinker conversions --- src/core/QCheck.ml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index f53e73cd..9550c9a7 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -755,9 +755,14 @@ module Shrink = struct | Some shrink -> list_elems shrink l yield let string s yield = + let buf = Buffer.create 42 in list ~shrink:char - (List.of_seq (String.to_seq s)) - (fun cs -> yield (String.of_seq (List.to_seq cs))) + (String.fold_right (fun c acc -> c::acc) s []) + (fun cs -> + List.iter (fun c -> Buffer.add_char buf c) cs; + let s = Buffer.contents buf in + Buffer.clear buf; + yield s) let pair a b (x,y) yield = a x (fun x' -> yield (x',y)); From 254e0c285b281b9345a28b76d3bbb3f062bd25c9 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Sat, 7 May 2022 23:49:09 +0200 Subject: [PATCH 012/391] add own String.fold_right, for backwards compatibility --- src/core/QCheck.ml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index 9550c9a7..0268bc33 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -86,6 +86,15 @@ let _opt_sum a b = match a, b with let sum_int = List.fold_left (+) 0 +(* Included for backwards compatibility, pre 4.13 *) +let string_fold_right f s acc = + let len = String.length s in + let rec loop i acc = + if i<0 + then acc + else loop (i-1) (f s.[i] acc) in + loop (len-1) acc + exception No_example_found of string (* raised if an example failed to be found *) @@ -757,7 +766,7 @@ module Shrink = struct let string s yield = let buf = Buffer.create 42 in list ~shrink:char - (String.fold_right (fun c acc -> c::acc) s []) + (string_fold_right (fun c acc -> c::acc) s []) (fun cs -> List.iter (fun c -> Buffer.add_char buf c) cs; let s = Buffer.contents buf in From 04ecdf042046b5c103922a0d9bc25e5fe25a22dc Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 9 May 2022 16:44:24 +0200 Subject: [PATCH 013/391] update CHANGELOG w/char shrinker improvement --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05e524d3..80148a8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ - recursive list shrinker with better complexity - string shrinker reuses improved list shrinker and adds char shrinking - function shrinker now shrinks default entry first and benefits from list shrinker improvements + - replacing the linear-time char shrinker with a faster one reusing the bisecting int shrinker algorithm - documentation updates: - clarify upper bound inclusion in `Gen.int_bound` and `Gen.int_range` From 419013db1d031f28a0ebf5ba264488f8b583f06d Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 30 May 2022 12:04:49 +0200 Subject: [PATCH 014/391] initial negative test support --- src/core/QCheck.ml | 8 ++++++-- src/core/QCheck.mli | 15 ++++++++++++++- src/core/QCheck2.ml | 17 ++++++++++++++--- src/core/QCheck2.mli | 24 ++++++++++++++++++++---- src/runner/QCheck_base_runner.ml | 20 +++++++++++--------- 5 files changed, 65 insertions(+), 19 deletions(-) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index 0268bc33..bb2df321 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -1697,15 +1697,19 @@ module Test = struct let get_long_factor = QCheck2.Test.get_long_factor let make_cell ?if_assumptions_fail - ?count ?long_factor ?max_gen + ?count ?long_factor ?negative ?max_gen ?max_fail ?small:_removed_in_qcheck_2 ?retries ?name arb law = let {gen; shrink; print; collect; stats; _} = arb in - QCheck2.Test.make_cell_from_QCheck1 ?if_assumptions_fail ?count ?long_factor ?max_gen ?max_fail ?retries ?name ~gen ?shrink ?print ?collect ~stats law + QCheck2.Test.make_cell_from_QCheck1 ?if_assumptions_fail ?count ?long_factor ?negative ?max_gen ?max_fail ?retries ?name ~gen ?shrink ?print ?collect ~stats law let make ?if_assumptions_fail ?count ?long_factor ?max_gen ?max_fail ?small ?retries ?name arb law = QCheck2.Test.Test (make_cell ?if_assumptions_fail ?count ?long_factor ?max_gen ?max_fail ?small ?retries ?name arb law) + let make_neg ?if_assumptions_fail ?count ?long_factor ?max_gen ?max_fail ?small ?retries ?name arb law = + let negative = Some true in + QCheck2.Test.Test (make_cell ?if_assumptions_fail ?count ?long_factor ?negative ?max_gen ?max_fail ?small ?retries ?name arb law) + let fail_report = QCheck2.Test.fail_report let fail_reportf = QCheck2.Test.fail_reportf diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index f6176f68..31d846e8 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -997,7 +997,7 @@ module Test : sig val make_cell : ?if_assumptions_fail:([`Fatal | `Warning] * float) -> - ?count:int -> ?long_factor:int -> ?max_gen:int -> ?max_fail:int -> + ?count:int -> ?long_factor:int -> ?negative:bool -> ?max_gen:int -> ?max_fail:int -> ?small:('a -> int) -> ?retries:int -> ?name:string -> 'a arbitrary -> ('a -> bool) -> 'a cell (** [make_cell arb prop] builds a test that checks property [prop] on instances @@ -1008,6 +1008,7 @@ module Test : sig @param retries number of times to retry the tested property while shrinking. @param long_factor the factor by which to multiply count, max_gen and max_fail when running a long test (default: 1). + @param negative whether the test is expected to fail. @param max_gen maximum number of times the generation function is called in total to replace inputs that do not satisfy preconditions (should be >= count). @@ -1053,6 +1054,18 @@ module Test : sig See {!make_cell} for a description of the parameters. *) + val make_neg : + ?if_assumptions_fail:([`Fatal | `Warning] * float) -> + ?count:int -> ?long_factor:int -> ?max_gen:int -> ?max_fail:int -> + ?small:('a -> int) -> ?retries:int -> ?name:string -> 'a arbitrary -> + ('a -> bool) -> t + (** [make_neg arb prop] builds a test that checks property [prop] on instances + of the generator [arb]. + The test is considered negative, meaning that it is expected to fail. + This information is recorded in an underlying test [cell] entry and interpreted suitably by test runners. + See {!make_cell} for a description of the parameters. + *) + include module type of QCheck2.Test_exceptions val print_instance : 'a cell -> 'a -> string diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index 2e3c5da2..4e649827 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -1380,6 +1380,7 @@ module Test = struct type 'a cell = { count : int; (* number of tests to do *) long_factor : int; (* multiplicative factor for long test count *) + positive : bool; (* indicates whether test is considered positive or negative *) max_gen : int; (* max number of instances to generate (>= count) *) max_fail : int; (* max number of failures *) retries : int; (* max number of retries during shrinking *) @@ -1413,6 +1414,8 @@ module Test = struct let get_long_factor {long_factor; _} = long_factor + let get_positive {positive; _} = positive + let default_count = 100 let default_long_factor = 1 @@ -1436,11 +1439,12 @@ module Test = struct let default_if_assumptions_fail = `Warning, 0.05 let make_cell ?(if_assumptions_fail=default_if_assumptions_fail) - ?(count) ?long_factor ?max_gen + ?(count) ?long_factor ?(negative=false) ?max_gen ?(max_fail=1) ?(retries=1) ?(name=fresh_name()) ?print ?collect ?(stats=[]) gen law = let count = global_count count in let long_factor = global_long_factor long_factor in + let positive = not negative in let max_gen = match max_gen with None -> count + 200 | Some x->x in { law; @@ -1454,16 +1458,18 @@ module Test = struct name; count; long_factor; + positive; if_assumptions_fail; qcheck1_shrink = None; } let make_cell_from_QCheck1 ?(if_assumptions_fail=default_if_assumptions_fail) - ?(count) ?long_factor ?max_gen + ?(count) ?long_factor ?(negative=false) ?max_gen ?(max_fail=1) ?(retries=1) ?(name=fresh_name()) ~gen ?shrink ?print ?collect ~stats law = let count = global_count count in let long_factor = global_long_factor long_factor in + let positive = not negative in (* Make a "fake" QCheck2 arbitrary with no shrinking *) let fake_gen = Gen.make_primitive ~gen ~shrink:(fun _ -> Seq.empty) in let max_gen = match max_gen with None -> count + 200 | Some x->x in @@ -1479,6 +1485,7 @@ module Test = struct name; count; long_factor; + positive; if_assumptions_fail; qcheck1_shrink = shrink; } @@ -1486,8 +1493,12 @@ module Test = struct let make ?if_assumptions_fail ?count ?long_factor ?max_gen ?max_fail ?retries ?name ?print ?collect ?stats gen law = Test (make_cell ?if_assumptions_fail ?count ?long_factor ?max_gen ?max_fail ?retries ?name ?print ?collect ?stats gen law) + let make_neg ?if_assumptions_fail ?count ?long_factor ?max_gen ?max_fail ?retries ?name ?print ?collect ?stats gen law = + let negative = Some true in + Test (make_cell ?if_assumptions_fail ?count ?long_factor ?negative ?max_gen ?max_fail ?retries ?name ?print ?collect ?stats gen law) + let test_get_count (Test cell) = get_count cell - + let test_get_long_factor (Test cell) = get_long_factor cell (** {6 Running the test} *) diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index ec54ca16..59669d4d 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -1587,10 +1587,10 @@ module Test : sig type 'a cell (** A single property test on a value of type ['a]. A {!Test.t} wraps a [cell] and hides its type parameter. *) - + val make_cell : ?if_assumptions_fail:([`Fatal | `Warning] * float) -> - ?count:int -> ?long_factor:int -> ?max_gen:int -> ?max_fail:int -> ?retries:int -> + ?count:int -> ?long_factor:int -> ?negative:bool -> ?max_gen:int -> ?max_fail:int -> ?retries:int -> ?name:string -> ?print:'a Print.t -> ?collect:('a -> string) -> ?stats:('a stat list) -> 'a Gen.t -> ('a -> bool) -> 'a cell @@ -1601,6 +1601,7 @@ module Test : sig the test cases which satisfy preconditions. @param long_factor the factor by which to multiply count, max_gen and max_fail when running a long test (default: 1). + @param negative whether the test is expected to fail. @param max_gen maximum number of times the generation function is called in total to replace inputs that do not satisfy preconditions (should be >= count). @@ -1621,11 +1622,11 @@ module Test : sig val make_cell_from_QCheck1 : ?if_assumptions_fail:([`Fatal | `Warning] * float) -> - ?count:int -> ?long_factor:int -> ?max_gen:int -> ?max_fail:int -> + ?count:int -> ?long_factor:int -> ?negative:bool -> ?max_gen:int -> ?max_fail:int -> ?retries:int -> ?name:string -> gen:(Random.State.t -> 'a) -> ?shrink:('a -> ('a -> unit) -> unit) -> ?print:('a -> string) -> ?collect:('a -> string) -> stats:'a stat list -> ('a -> bool) -> 'a cell - (** ⚠️ Do not use, this is exposed for internal reasons only. ⚠️ + (** ⚠️ Do not use, this is exposed for internal reasons only. ⚠️ @deprecated Migrate to QCheck2 and use {!make_cell} instead. *) @@ -1646,6 +1647,9 @@ module Test : sig (** Get the long factor of a cell. @since 0.5.3 *) + val get_positive : _ cell -> bool + (** Get the expected mode of a cell: positive indicates expected to succeed, negative indicates expected to fail. *) + type t = Test : 'a cell -> t (** Same as ['a cell], but masking the type parameter. This allows to put tests on different types in the same list of tests. *) @@ -1660,6 +1664,18 @@ module Test : sig See {!make_cell} for a description of the parameters. *) + val make_neg : + ?if_assumptions_fail:([`Fatal | `Warning] * float) -> + ?count:int -> ?long_factor:int -> ?max_gen:int -> ?max_fail:int -> ?retries:int -> + ?name:string -> ?print:('a Print.t) -> ?collect:('a -> string) -> ?stats:('a stat list) -> + 'a Gen.t -> ('a -> bool) -> t + (** [make_neg gen prop] builds a test that checks property [prop] on instances + of the generator [gen]. + The test is considered negative, meaning that it is expected to fail. + This information is recorded in an underlying test [cell] entry and interpreted suitably by test runners. + See {!make_cell} for a description of the parameters. + *) + val test_get_count : t -> int val test_get_long_factor : t -> int diff --git a/src/runner/QCheck_base_runner.ml b/src/runner/QCheck_base_runner.ml index a5edbce2..cb32c149 100644 --- a/src/runner/QCheck_base_runner.ml +++ b/src/runner/QCheck_base_runner.ml @@ -270,15 +270,17 @@ let default_handler in { handler; } -let step ~colors ~size ~out ~verbose c name _ _ r = - let aux = function - | QCheck2.Test.Success -> c.passed <- c.passed + 1 - | QCheck2.Test.Failure -> c.failed <- c.failed + 1 - | QCheck2.Test.FalseAssumption -> () - | QCheck2.Test.Error _ -> c.errored <- c.errored + 1 +let step ~colors ~size ~out ~verbose c name cell _ r = + let aux r pos = match r,pos with + | QCheck2.Test.Success, true -> c.passed <- c.passed + 1 + | QCheck2.Test.Failure, true -> c.failed <- c.failed + 1 + | QCheck2.Test.Success, false -> c.failed <- c.failed + 1 + | QCheck2.Test.Failure, false -> c.passed <- c.passed + 1 + | QCheck2.Test.FalseAssumption, _ -> () + | QCheck2.Test.Error _, _ -> c.errored <- c.errored + 1 in c.gen <- c.gen + 1; - aux r; + aux r (QCheck2.Test.get_positive cell); let now=Unix.gettimeofday() in if verbose && now -. !last_msg > get_time_between_msg () then ( last_msg := now; @@ -286,8 +288,8 @@ let step ~colors ~size ~out ~verbose c name _ _ r = (if colors then Color.reset_line else "\n") (pp_counter ~size) c name ) -let callback ~size ~out ~verbose ~colors c name _ r = - let pass = QCheck2.TestResult.is_success r in +let callback ~size ~out ~verbose ~colors c name cell r = + let pass = (QCheck2.Test.get_positive cell = QCheck2.TestResult.is_success r) in let color = if pass then `Green else `Red in if verbose then ( Printf.fprintf out "%s[%a] %a %s\n%!" From de62a2544fa1d159d0fcb35b9ca5c14153e4dbe6 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 30 May 2022 12:33:06 +0200 Subject: [PATCH 015/391] update runner printer --- src/runner/QCheck_base_runner.ml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/runner/QCheck_base_runner.ml b/src/runner/QCheck_base_runner.ml index cb32c149..50c8c90c 100644 --- a/src/runner/QCheck_base_runner.ml +++ b/src/runner/QCheck_base_runner.ml @@ -408,17 +408,29 @@ let run_tests let res = List.map aux_map l in let aux_fold (total, fail, error, warns) (Res (cell, r)) = let warns = warns + List.length (R.get_warnings r) in - let acc = match R.get_state r with - | R.Success -> + let acc = match R.get_state r, QCheck2.Test.get_positive cell with + | R.Success, true -> print_success ~colors out cell r; (total + 1, fail, error, warns) - | R.Failed {instances=l} -> + | R.Success, false -> + print_fail_other ~colors out cell "Negative test succeeded but was expected to fail"; + (total + 1, fail, error + 1, warns) + | R.Failed {instances=l}, true -> List.iter (print_fail ~colors out cell) l; (total + 1, fail + 1, error, warns) - | R.Failed_other {msg} -> + | R.Failed {instances=l}, false -> + (*List.iter (print_fail ~colors out cell) l;*) (* FIXME *) + let msgs = List.map (fun c_ex -> print_inst cell c_ex.QCheck2.TestResult.instance) l in + print_messages ~colors out cell msgs; + (total + 1, fail, error, warns) + | R.Failed_other {msg}, true -> print_fail_other ~colors out cell msg; (total + 1, fail + 1, error, warns) - | R.Error {instance=c_ex; exn; backtrace=bt} -> + | R.Failed_other {msg}, false -> + (*print_fail_other ~colors out cell msg;*) (* FIXME *) + print_messages ~colors out cell [msg]; + (total + 1, fail, error, warns) + | R.Error {instance=c_ex; exn; backtrace=bt}, _ -> (* Error is always considered a failure *) print_error ~colors out cell c_ex exn bt; (total + 1, fail, error + 1, warns) in From de353e2b23dda1f1ca3d46148e774b312b0b29ca Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 30 May 2022 12:39:36 +0200 Subject: [PATCH 016/391] print better message for negative failures and negative successes in verbose mode --- src/runner/QCheck_base_runner.ml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/runner/QCheck_base_runner.ml b/src/runner/QCheck_base_runner.ml index 50c8c90c..ec24d98b 100644 --- a/src/runner/QCheck_base_runner.ml +++ b/src/runner/QCheck_base_runner.ml @@ -358,6 +358,13 @@ let print_fail_other ~colors out cell msg = Printf.fprintf out "\n--- %a %s\n\n" (Color.pp_str_c ~colors `Red) "Failure" (String.make 68 '-'); Printf.fprintf out "Test %s failed:\n\n%s\n%!" (QCheck2.Test.get_name cell) msg +let print_expected_failure ~colors out cell c_ex = + Printf.fprintf out "\n--- %a %s\n\n" (Color.pp_str_c ~colors `Blue) "Info" (String.make 71 '-'); + Printf.fprintf out "Negative test %s failed as expected (%d shrink steps):\n\n%s\n%!" + (QCheck2.Test.get_name cell) c_ex.QCheck2.TestResult.shrink_steps + (print_inst cell c_ex.QCheck2.TestResult.instance); + print_messages ~colors out cell c_ex.QCheck2.TestResult.msg_l + let print_error ~colors out cell c_ex exn bt = Printf.fprintf out "\n=== %a %s\n\n" (Color.pp_str_c ~colors `Red) "Error" (String.make 70 '='); Printf.fprintf out "Test %s errored on (%d shrink steps):\n\n%s\n\nexception %s\n%s\n%!" @@ -413,15 +420,14 @@ let run_tests print_success ~colors out cell r; (total + 1, fail, error, warns) | R.Success, false -> - print_fail_other ~colors out cell "Negative test succeeded but was expected to fail"; - (total + 1, fail, error + 1, warns) + let msg = Printf.sprintf "Negative test %s succeeded but was expected to fail" (QCheck2.Test.get_name cell) in + print_fail_other ~colors out cell msg; + (total + 1, fail + 1, error, warns) | R.Failed {instances=l}, true -> List.iter (print_fail ~colors out cell) l; (total + 1, fail + 1, error, warns) | R.Failed {instances=l}, false -> - (*List.iter (print_fail ~colors out cell) l;*) (* FIXME *) - let msgs = List.map (fun c_ex -> print_inst cell c_ex.QCheck2.TestResult.instance) l in - print_messages ~colors out cell msgs; + if verbose then List.iter (print_expected_failure ~colors out cell) l; (total + 1, fail, error, warns) | R.Failed_other {msg}, true -> print_fail_other ~colors out cell msg; From 83a7380622a4cab9abd2c6adf77214338d13f8a3 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 30 May 2022 14:21:38 +0200 Subject: [PATCH 017/391] clean up failure condition --- src/core/QCheck2.ml | 4 ++++ src/core/QCheck2.mli | 5 ++++- src/runner/QCheck_base_runner.ml | 11 +++++------ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index 4e649827..8a3629c8 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -1367,6 +1367,10 @@ module TestResult = struct let is_success r = match r.state with | Success -> true | Failed _ | Error _ | Failed_other _ -> false + + let is_failed r = match r.state with + | Failed _ -> true + | Success | Error _ | Failed_other _ -> false end module Test_exceptions = struct diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index 59669d4d..ffb7676f 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -1537,9 +1537,12 @@ module TestResult : sig @since 0.18 *) val is_success : _ t -> bool - (** Returns true iff the state if [Success] + (** Returns true iff the state is [Success] @since 0.9 *) + val is_failed : _ t -> bool + (** Returns true iff the state is [Failed _] *) + val stats : 'a t -> ('a stat * (int,int) Hashtbl.t) list (** Obtain statistics @since 0.6 diff --git a/src/runner/QCheck_base_runner.ml b/src/runner/QCheck_base_runner.ml index ec24d98b..dee007e1 100644 --- a/src/runner/QCheck_base_runner.ml +++ b/src/runner/QCheck_base_runner.ml @@ -289,7 +289,10 @@ let step ~colors ~size ~out ~verbose c name cell _ r = ) let callback ~size ~out ~verbose ~colors c name cell r = - let pass = (QCheck2.Test.get_positive cell = QCheck2.TestResult.is_success r) in + let pass = + if QCheck2.Test.get_positive cell + then QCheck2.TestResult.is_success r + else QCheck2.TestResult.is_failed r in let color = if pass then `Green else `Red in if verbose then ( Printf.fprintf out "%s[%a] %a %s\n%!" @@ -429,13 +432,9 @@ let run_tests | R.Failed {instances=l}, false -> if verbose then List.iter (print_expected_failure ~colors out cell) l; (total + 1, fail, error, warns) - | R.Failed_other {msg}, true -> + | R.Failed_other {msg}, _ -> (* Failed_other is also considered a failure *) print_fail_other ~colors out cell msg; (total + 1, fail + 1, error, warns) - | R.Failed_other {msg}, false -> - (*print_fail_other ~colors out cell msg;*) (* FIXME *) - print_messages ~colors out cell [msg]; - (total + 1, fail, error, warns) | R.Error {instance=c_ex; exn; backtrace=bt}, _ -> (* Error is always considered a failure *) print_error ~colors out cell c_ex exn bt; (total + 1, fail, error + 1, warns) From 8339e6fcde1dab00eda03cb43b0035919061b5b8 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 14 Jun 2022 10:53:41 +0200 Subject: [PATCH 018/391] roll back step changes to keep interpretation --- src/runner/QCheck_base_runner.ml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/runner/QCheck_base_runner.ml b/src/runner/QCheck_base_runner.ml index dee007e1..543cdb2b 100644 --- a/src/runner/QCheck_base_runner.ml +++ b/src/runner/QCheck_base_runner.ml @@ -270,17 +270,15 @@ let default_handler in { handler; } -let step ~colors ~size ~out ~verbose c name cell _ r = - let aux r pos = match r,pos with - | QCheck2.Test.Success, true -> c.passed <- c.passed + 1 - | QCheck2.Test.Failure, true -> c.failed <- c.failed + 1 - | QCheck2.Test.Success, false -> c.failed <- c.failed + 1 - | QCheck2.Test.Failure, false -> c.passed <- c.passed + 1 - | QCheck2.Test.FalseAssumption, _ -> () - | QCheck2.Test.Error _, _ -> c.errored <- c.errored + 1 +let step ~colors ~size ~out ~verbose c name _ _ r = + let aux = function + | QCheck2.Test.Success -> c.passed <- c.passed + 1 + | QCheck2.Test.Failure -> c.failed <- c.failed + 1 + | QCheck2.Test.FalseAssumption -> () + | QCheck2.Test.Error _ -> c.errored <- c.errored + 1 in c.gen <- c.gen + 1; - aux r (QCheck2.Test.get_positive cell); + aux r; let now=Unix.gettimeofday() in if verbose && now -. !last_msg > get_time_between_msg () then ( last_msg := now; From 6a3e230bdc380fd75e41889bff79c3dd411ef22e Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 14 Jun 2022 10:55:05 +0200 Subject: [PATCH 019/391] add neg_tests --- test/core/QCheck2_tests.ml | 21 +++++++++++++++++++++ test/core/QCheck_tests.ml | 21 +++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/test/core/QCheck2_tests.ml b/test/core/QCheck2_tests.ml index d3c960e2..f9c07e50 100644 --- a/test/core/QCheck2_tests.ml +++ b/test/core/QCheck2_tests.ml @@ -101,6 +101,22 @@ module Overall = struct ~gen:(fun rs -> Random.State.int rs)) (fun _i -> false) + let neg_test_fail_as_expected = + Test.make_neg ~name:"all ints are even" ~print:Print.int Gen.small_int (fun i -> i mod 2 = 0) + + let neg_test_unexpected_success = + Test.make_neg ~name:"int double" ~print:Print.int Gen.small_int (fun i -> i + i = i * 2) + + let neg_test_fail_with_shrinking = + Test.make_neg ~name:"list rev concat" ~print:Print.(pair (list int) (list int)) + Gen.(pair (list small_int) (list small_int)) (fun (is,js) -> (List.rev is)@(List.rev js) = List.rev (is@js)) + + let pos_test_fails_with_error = + Test.make ~name:"pos fail with error" ~print:Print.int Gen.small_int (fun _i -> raise Error) + + let neg_test_fail_with_error = + Test.make_neg ~name:"neg fail with error" ~print:Print.int Gen.small_int (fun _i -> raise Error) + (* [apply_n f x n] computes f(f(...f(x))) with n applications of f *) let rec apply_n f x n = if n=0 @@ -134,6 +150,11 @@ module Overall = struct bad_assume_fail; bad_gen_fail; (*bad_shrinker_fail;*) + neg_test_fail_as_expected; + neg_test_unexpected_success; + neg_test_fail_with_shrinking; + pos_test_fails_with_error; + neg_test_fail_with_error; (* we repeat the following multiple times to check the expected output for duplicate lines *) bad_fun_repro; bad_fun_repro; diff --git a/test/core/QCheck_tests.ml b/test/core/QCheck_tests.ml index 558d8845..e00dd074 100644 --- a/test/core/QCheck_tests.ml +++ b/test/core/QCheck_tests.ml @@ -111,6 +111,22 @@ module Overall = struct Gen.int) (fun _i -> false) + let neg_test_fail_as_expected = + Test.make_neg ~name:"all ints are even" small_int (fun i -> i mod 2 = 0) + + let neg_test_unexpected_success = + Test.make_neg ~name:"int double" small_int (fun i -> i + i = i * 2) + + let neg_test_fail_with_shrinking = + Test.make_neg ~name:"list rev concat" + (pair (list small_int) (list small_int)) (fun (is,js) -> (List.rev is)@(List.rev js) = List.rev (is@js)) + + let pos_test_fails_with_error = + Test.make ~name:"pos fail with error" small_int (fun _i -> raise Error) + + let neg_test_fail_with_error = + Test.make_neg ~name:"neg fail with error" small_int (fun _i -> raise Error) + (* [apply_n f x n] computes f(f(...f(x))) with n applications of f *) let rec apply_n f x n = if n=0 @@ -144,6 +160,11 @@ module Overall = struct bad_assume_fail; bad_gen_fail; (*bad_shrinker_fail;*) + neg_test_fail_as_expected; + neg_test_unexpected_success; + neg_test_fail_with_shrinking; + pos_test_fails_with_error; + neg_test_fail_with_error; (* we repeat the following multiple times to check the expected output for duplicate lines *) bad_fun_repro; bad_fun_repro; From cc87937274b549fd2ef27c02a2183f7164a7beab Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 14 Jun 2022 10:55:36 +0200 Subject: [PATCH 020/391] update expected output --- test/core/QCheck2_expect_test.expected | 26 +++++++++++++++++++++++++- test/core/QCheck_expect_test.expected | 26 +++++++++++++++++++++++++- 2 files changed, 50 insertions(+), 2 deletions(-) diff --git a/test/core/QCheck2_expect_test.expected b/test/core/QCheck2_expect_test.expected index bf66c643..c3171822 100644 --- a/test/core/QCheck2_expect_test.expected +++ b/test/core/QCheck2_expect_test.expected @@ -260,6 +260,30 @@ ERROR: uncaught exception in generator for test FAIL_bad_gen after 100 steps: Exception: Invalid_argument("Gen.int_bound") Backtrace: +--- Failure -------------------------------------------------------------------- + +Test int double failed: + +Negative test int double succeeded but was expected to fail + +=== Error ====================================================================== + +Test pos fail with error errored on (1 shrink steps): + +0 + +exception QCheck2_tests.Overall.Error + + +=== Error ====================================================================== + +Test neg fail with error errored on (1 shrink steps): + +0 + +exception QCheck2_tests.Overall.Error + + --- Failure -------------------------------------------------------------------- Test char never produces '\255' failed (0 shrink steps): @@ -1250,7 +1274,7 @@ stats dist: 4150517416584649600.. 4611686018427387903: ################# 189 ================================================================================ 1 warning(s) -failure (57 tests failed, 1 tests errored, ran 122 tests) +failure (58 tests failed, 3 tests errored, ran 127 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_expect_test.expected b/test/core/QCheck_expect_test.expected index 5bb3d29d..2d3d7f0f 100644 --- a/test/core/QCheck_expect_test.expected +++ b/test/core/QCheck_expect_test.expected @@ -198,6 +198,30 @@ ERROR: uncaught exception in generator for test FAIL_bad_gen after 100 steps: Exception: Invalid_argument("Gen.int_bound") Backtrace: +--- Failure -------------------------------------------------------------------- + +Test int double failed: + +Negative test int double succeeded but was expected to fail + +=== Error ====================================================================== + +Test pos fail with error errored on (7 shrink steps): + +0 + +exception QCheck_tests.Overall.Error + + +=== Error ====================================================================== + +Test neg fail with error errored on (7 shrink steps): + +0 + +exception QCheck_tests.Overall.Error + + --- Failure -------------------------------------------------------------------- Test char never produces '\255' failed (0 shrink steps): @@ -1214,7 +1238,7 @@ stats dist: 4150517416584649600.. 4611686018427387903: ################# 189 ================================================================================ 1 warning(s) -failure (57 tests failed, 1 tests errored, ran 129 tests) +failure (58 tests failed, 3 tests errored, ran 134 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ From 8b1f246606f66930e09762860dd1204eb6737cd3 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 14 Jun 2022 15:53:28 +0200 Subject: [PATCH 021/391] add QCheck2.Test.print_expected_failure --- src/core/QCheck2.ml | 4 ++++ src/core/QCheck2.mli | 1 + 2 files changed, 5 insertions(+) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index 8a3629c8..69b8b2ca 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -1964,6 +1964,10 @@ module Test = struct let print_fail_other name ~msg = print_test_fail name [msg] + let print_expected_failure cell c_exs = match c_exs with + | [] -> Format.sprintf "negative test `%s` failed as expected\n" (get_name cell) + | c_ex::_ -> Format.sprintf "negative test `%s` failed as expected on: `%s`\n" (get_name cell) (print_c_ex cell c_ex) + let print_error ?(st="") arb name (i,e) = print_test_error name (print_c_ex arb i) e st diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index ffb7676f..a64879db 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -1707,6 +1707,7 @@ module Test : sig val print_c_ex : 'a cell -> 'a TestResult.counter_ex -> string val print_fail : 'a cell -> string -> 'a TestResult.counter_ex list -> string val print_fail_other : string -> msg:string -> string + val print_expected_failure : 'a cell -> 'a TestResult.counter_ex list -> string val print_error : ?st:string -> 'a cell -> string -> 'a TestResult.counter_ex * exn -> string val print_test_fail : string -> string list -> string val print_test_error : string -> string -> exn -> string -> string From 6d40080d894e397e102f292525a6265d4d68b648 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 14 Jun 2022 15:58:28 +0200 Subject: [PATCH 022/391] initial support for Test.make_neg in qcheck_ounit --- src/ounit/QCheck_ounit.ml | 32 +++++++++++++++++++++++--------- src/runner/QCheck_base_runner.ml | 9 +++++++-- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/src/ounit/QCheck_ounit.ml b/src/ounit/QCheck_ounit.ml index e4a814bc..b6b2e665 100644 --- a/src/ounit/QCheck_ounit.ml +++ b/src/ounit/QCheck_ounit.ml @@ -2,7 +2,7 @@ open OUnit open QCheck_base_runner -let ps = print_string +let ps = Printf.printf "%s" let va = Printf.sprintf let pf = Printf.printf @@ -72,8 +72,16 @@ let to_ounit2_test ?(rand =default_rand()) (QCheck2.Test.Test cell) = fail = (fun fmt -> Printf.ksprintf assert_failure fmt); err = (fun fmt -> logf ctxt `Error fmt); } in - T.check_cell_exn cell - ~long ~rand ~call:(Raw.callback ~colors:false ~verbose ~print_res:true ~print)) + if QCheck2.Test.get_positive cell + then + T.check_cell_exn cell + ~long ~rand ~call:(Raw.callback ~colors:false ~verbose ~print_res:true ~print) + else + try + T.check_cell_exn cell + ~long ~rand ~call:(Raw.callback ~colors:false ~verbose ~print_res:true ~print); + () + with T.Test_fail (_,_) -> ()) let to_ounit2_test_list ?rand lst = List.rev (List.rev_map (to_ounit2_test ?rand) lst) @@ -85,12 +93,18 @@ let to_ounit_test_cell ?(verbose=verbose()) ?(long=long_tests()) let module T = QCheck2.Test in let name = T.get_name cell in let run () = - try - T.check_cell_exn cell ~long ~rand - ~call:(Raw.callback ~colors:false ~verbose ~print_res:verbose ~print:Raw.print_std); - true - with T.Test_fail _ -> - false + + let res = + try + T.check_cell_exn cell ~long ~rand + ~call:(Raw.callback ~colors:false ~verbose ~print_res:verbose ~print:Raw.print_std); + true + with T.Test_fail _ -> + false + in + if QCheck2.Test.get_positive cell + then res + else not res in name >:: (fun () -> assert_bool name (run ())) diff --git a/src/runner/QCheck_base_runner.ml b/src/runner/QCheck_base_runner.ml index 543cdb2b..f9463a58 100644 --- a/src/runner/QCheck_base_runner.ml +++ b/src/runner/QCheck_base_runner.ml @@ -135,9 +135,14 @@ module Raw = struct if print_res then ( (* even if [not verbose], print errors *) match R.get_state result with - | R.Success -> () + | R.Success -> + if not (T.get_positive cell) + then + print.fail "%snegative test '%s' succeeded unexpectedly\n" reset_line name; | R.Failed {instances=l} -> - print.fail "%s%s\n" reset_line (T.print_fail cell name l); + if T.get_positive cell + then print.fail "%s%s\n" reset_line (T.print_fail cell name l) + else print.info "%s%s\n" reset_line (T.print_expected_failure cell l) | R.Failed_other {msg} -> print.fail "%s%s\n" reset_line (T.print_fail_other name ~msg); | R.Error {instance; exn; backtrace} -> From ba451f035360d47ef117d8895a51b833f3ed1f37 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 14 Jun 2022 15:59:56 +0200 Subject: [PATCH 023/391] add Test.make_neg tests for ounit --- example/QCheck_runner_test.ml | 13 +++++++++++++ example/ounit/QCheck_ounit_test.ml | 15 ++++++++++++++- example/ounit/QCheck_test.ml | 14 ++++++++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/example/QCheck_runner_test.ml b/example/QCheck_runner_test.ml index b600e666..64a8dd8b 100644 --- a/example/QCheck_runner_test.ml +++ b/example/QCheck_runner_test.ml @@ -36,6 +36,16 @@ let stats = ) (fun _ -> true) + +let neg_test_failing_as_expected = + QCheck.Test.make_neg ~name:"neg test pass (failing as expected)" QCheck.small_int (fun i -> i mod 2 = 0) + +let neg_test_unexpected_success = + QCheck.Test.make_neg ~name:"neg test unexpected success" QCheck.small_int (fun i -> i + i = i * 2) + +let neg_test_error = + QCheck.Test.make_neg ~name:"neg fail with error" QCheck.small_int (fun _i -> raise Error) + let fun1 = QCheck.Test.make ~count:100 ~long_factor:100 ~name:"FAIL_pred_map_commute" @@ -182,6 +192,9 @@ let () = error; collect; stats; + neg_test_failing_as_expected; + neg_test_unexpected_success; + neg_test_error; fun1; fun2; prop_foldleft_foldright; diff --git a/example/ounit/QCheck_ounit_test.ml b/example/ounit/QCheck_ounit_test.ml index b8e52bbd..66bb66bd 100644 --- a/example/ounit/QCheck_ounit_test.ml +++ b/example/ounit/QCheck_ounit_test.ml @@ -1,3 +1,5 @@ +(* Tests to check integration with the 'OUnit2.test' interface *) + let passing = QCheck.Test.make ~count:1000 ~name:"list_rev_is_involutive" @@ -24,6 +26,15 @@ let simple_qcheck = QCheck.small_int (fun _ -> QCheck.Test.fail_reportf "@[<v>this@ will@ always@ fail@]") +let neg_test_failing_as_expected = + QCheck.Test.make_neg ~name:"neg test pass (failing as expected)" QCheck.small_int (fun i -> i mod 2 = 0) + +let neg_test_unexpected_success = + QCheck.Test.make_neg ~name:"neg test unexpected success" QCheck.small_int (fun i -> i + i = i * 2) + +let neg_test_error = + QCheck.Test.make_neg ~name:"neg fail with error" QCheck.small_int (fun _i -> raise Error) + type tree = Leaf of int | Node of tree * tree @@ -55,4 +66,6 @@ let () = run_test_tt_main ("tests" >::: List.map QCheck_ounit.to_ounit2_test - [passing; failing; error; simple_qcheck; passing_tree_rev]) + [passing; failing; error; + neg_test_failing_as_expected; neg_test_unexpected_success; neg_test_error; + simple_qcheck; passing_tree_rev]) diff --git a/example/ounit/QCheck_test.ml b/example/ounit/QCheck_test.ml index 1734ca29..76a1cbfa 100644 --- a/example/ounit/QCheck_test.ml +++ b/example/ounit/QCheck_test.ml @@ -1,3 +1,5 @@ +(* Tests to check integration with the 'OUnit.test' interface *) + let (|>) x f = f x module Q = QCheck @@ -22,6 +24,15 @@ let error = Q.int (fun _ -> raise Error) +let neg_test_failing_as_expected = + Q.Test.make_neg ~name:"neg test pass (failing as expected)" QCheck.small_int (fun i -> i mod 2 = 0) + +let neg_test_unexpected_success = + Q.Test.make_neg ~name:"neg test unexpected success" QCheck.small_int (fun i -> i + i = i * 2) + +let neg_test_error = + Q.Test.make_neg ~name:"neg fail with error" QCheck.small_int (fun _i -> raise Error) + open OUnit let regression_23 = @@ -37,6 +48,9 @@ let others = [ passing; failing; error; + neg_test_failing_as_expected; + neg_test_unexpected_success; + neg_test_error; ] |> List.map (fun t -> QCheck_ounit.to_ounit_test t) let suite = From ca704838c1f26fe2a57ac87b3123956e66b63aaf Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 14 Jun 2022 16:00:26 +0200 Subject: [PATCH 024/391] update expected output --- example/ounit/output.txt.expected | 34 +++++++++++++++++++++++++------ example/output.txt.expected | 17 +++++++++++++++- 2 files changed, 44 insertions(+), 7 deletions(-) diff --git a/example/ounit/output.txt.expected b/example/ounit/output.txt.expected index df0adfb1..874cd527 100644 --- a/example/ounit/output.txt.expected +++ b/example/ounit/output.txt.expected @@ -1,4 +1,15 @@ -.FEF. +.FE.FEF. +============================================================================== +Error: tests:5:neg fail with error. + +Error: tests:5:neg fail with error (in the log). + + +test `neg fail with error` +raised exception `Dune__exe__QCheck_ounit_test.Error` +on `0 (after 7 shrink steps)` + +------------------------------------------------------------------------------ ============================================================================== Error: tests:2:error_raise_exn. @@ -10,11 +21,11 @@ on `0 (after 63 shrink steps)` ------------------------------------------------------------------------------ ============================================================================== -Error: tests:3:fail_check_err_message. +Error: tests:6:fail_check_err_message. -Error: tests:3:fail_check_err_message (in the log). +Error: tests:6:fail_check_err_message (in the log). -Error: tests:3:fail_check_err_message (in the code). +Error: tests:6:fail_check_err_message (in the code). test `fail_check_err_message` failed on ≥ 1 cases: @@ -26,6 +37,17 @@ fail +------------------------------------------------------------------------------ +============================================================================== +Error: tests:4:neg test unexpected success. + +Error: tests:4:neg test unexpected success (in the log). + +Error: tests:4:neg test unexpected success (in the code). + + +negative test 'neg test unexpected success' succeeded unexpectedly + ------------------------------------------------------------------------------ ============================================================================== Error: tests:1:fail_sort_id. @@ -39,5 +61,5 @@ test `fail_sort_id` failed on ≥ 1 cases: [1; 0] (after 11 shrink steps) ------------------------------------------------------------------------------ -Ran: 5 tests in: <nondet> seconds. -FAILED: Cases: 5 Tried: 5 Errors: 1 Failures: 2 Skip: 0 Todo: 0 Timeouts: 0. +Ran: 8 tests in: <nondet> seconds. +FAILED: Cases: 8 Tried: 8 Errors: 2 Failures: 3 Skip: 0 Todo: 0 Timeouts: 0. diff --git a/example/output.txt.expected b/example/output.txt.expected index cf10485f..f54f8f4f 100644 --- a/example/output.txt.expected +++ b/example/output.txt.expected @@ -57,6 +57,21 @@ stats num: 110..115: ####################################################### 9 116..121: ################## 3 +--- Failure -------------------------------------------------------------------- + +Test neg test unexpected success failed: + +Negative test neg test unexpected success succeeded but was expected to fail + +=== Error ====================================================================== + +Test neg fail with error errored on (7 shrink steps): + +0 + +exception Dune__exe__QCheck_runner_test.Error + + --- Failure -------------------------------------------------------------------- Test FAIL_pred_map_commute failed (77 shrink steps): @@ -315,4 +330,4 @@ stats dist: 4150387758342729156.. 4611540922436308291: ###################################################### 5039 ================================================================================ 1 warning(s) -failure (9 tests failed, 1 tests errored, ran 25 tests) +failure (10 tests failed, 2 tests errored, ran 28 tests) From 995a0e13029390cfc012c4f2d1eaf476a0df12c1 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 14 Jun 2022 16:59:27 +0200 Subject: [PATCH 025/391] initial support for Test.make_neg in QCheck_alcotest --- src/alcotest/QCheck_alcotest.ml | 16 +++++++++++----- src/core/QCheck2.ml | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/alcotest/QCheck_alcotest.ml b/src/alcotest/QCheck_alcotest.ml index ea2b71ad..0baffa40 100644 --- a/src/alcotest/QCheck_alcotest.ml +++ b/src/alcotest/QCheck_alcotest.ml @@ -51,11 +51,17 @@ let to_alcotest () in let print = Raw.print_std in - let run() = + let name = T.get_name cell in + let run () = let call = Raw.callback ~colors ~verbose ~print_res:true ~print in - T.check_cell_exn - ~long ~call ~handler ~rand - cell + if T.get_positive cell + then + T.check_cell_exn ~long ~call ~handler ~rand cell + else + try + T.check_cell_exn ~long ~call ~handler ~rand cell; + Alcotest.failf "negative test '%s' succeeded unexpectedly" name + with + T.Test_fail (_name,_l) -> () in - let name = T.get_name cell in ((name, `Slow, run) : unit Alcotest.test_case) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index 69b8b2ca..904f7f76 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -1966,7 +1966,7 @@ module Test = struct let print_expected_failure cell c_exs = match c_exs with | [] -> Format.sprintf "negative test `%s` failed as expected\n" (get_name cell) - | c_ex::_ -> Format.sprintf "negative test `%s` failed as expected on: `%s`\n" (get_name cell) (print_c_ex cell c_ex) + | c_ex::_ -> Format.sprintf "negative test `%s` failed as expected on: %s\n" (get_name cell) (print_c_ex cell c_ex) let print_error ?(st="") arb name (i,e) = print_test_error name (print_c_ex arb i) e st From 75964ebec1e1efd0e20416b9dc27669540c30826 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 14 Jun 2022 17:01:01 +0200 Subject: [PATCH 026/391] add alcotest Test.make_neg tests --- example/alcotest/QCheck_alcotest_test.ml | 13 ++++++++++- example/alcotest/output.txt.expected | 28 ++++++++++++++++++++---- 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/example/alcotest/QCheck_alcotest_test.ml b/example/alcotest/QCheck_alcotest_test.ml index 3b72c161..adadf42c 100644 --- a/example/alcotest/QCheck_alcotest_test.ml +++ b/example/alcotest/QCheck_alcotest_test.ml @@ -18,6 +18,15 @@ let error = QCheck.int (fun _ -> raise Error) +let neg_test_failing_as_expected = + QCheck.Test.make_neg ~name:"neg test pass (failing as expected)" QCheck.small_int (fun i -> i mod 2 = 0) + +let neg_test_unexpected_success = + QCheck.Test.make_neg ~name:"neg test unexpected success" QCheck.small_int (fun i -> i + i = i * 2) + +let neg_test_error = + QCheck.Test.make_neg ~name:"neg fail with error" QCheck.small_int (fun _i -> raise Error) + let simple_qcheck = QCheck.Test.make ~name:"fail_check_err_message" ~count: 100 @@ -60,7 +69,9 @@ let () = let module A = Alcotest in let suite = List.map QCheck_alcotest.to_alcotest - [ passing; failing; error; simple_qcheck; passing_tree_rev ] + [ passing; failing; error; + neg_test_failing_as_expected; neg_test_unexpected_success; neg_test_error; + simple_qcheck; passing_tree_rev ] in A.run ~show_errors:true "my test" [ "suite", suite; diff --git a/example/alcotest/output.txt.expected b/example/alcotest/output.txt.expected index 0e046030..ea706c72 100644 --- a/example/alcotest/output.txt.expected +++ b/example/alcotest/output.txt.expected @@ -3,8 +3,11 @@ Testing `my test'. [OK] suite 0 list_rev_is_involutive. [FAIL] suite 1 fail_sort_id. [FAIL] suite 2 error_raise_exn. - [FAIL] suite 3 fail_check_err_message. - [OK] suite 4 tree_rev_is_involutive. + [OK] suite 3 neg test pass (failing as expected). + [FAIL] suite 4 neg test unexpected success. + [FAIL] suite 5 neg fail with error. + [FAIL] suite 6 fail_check_err_message. + [OK] suite 7 tree_rev_is_involutive. [FAIL] shrinking 0 debug_shrink. ┌──────────────────────────────────────────────────────────────────────────────┐ │ [FAIL] suite 1 fail_sort_id. │ @@ -23,7 +26,24 @@ raised exception `Error` on `0 (after 63 shrink steps)` ────────────────────────────────────────────────────────────────────────────── ┌──────────────────────────────────────────────────────────────────────────────┐ -│ [FAIL] suite 3 fail_check_err_message. │ +│ [FAIL] suite 4 neg test unexpected success. │ +└──────────────────────────────────────────────────────────────────────────────┘ +negative test 'neg test unexpected success' succeeded unexpectedly +ASSERT negative test 'neg test unexpected success' succeeded unexpectedly +FAIL negative test 'neg test unexpected success' succeeded unexpectedly + ────────────────────────────────────────────────────────────────────────────── +┌──────────────────────────────────────────────────────────────────────────────┐ +│ [FAIL] suite 5 neg fail with error. │ +└──────────────────────────────────────────────────────────────────────────────┘ +test `neg fail with error` +raised exception `Error` +on `0 (after 7 shrink steps)` +[exception] test `neg fail with error` +raised exception `Error` +on `0 (after 7 shrink steps)` + ────────────────────────────────────────────────────────────────────────────── +┌──────────────────────────────────────────────────────────────────────────────┐ +│ [FAIL] suite 6 fail_check_err_message. │ └──────────────────────────────────────────────────────────────────────────────┘ test `fail_check_err_message` failed on ≥ 1 cases: 0 (after 7 shrink steps) @@ -57,4 +77,4 @@ law debug_shrink: 2 relevant cases (2 total) test `debug_shrink` failed on ≥ 1 cases: (1, 0) (after 3 shrink steps) [exception] test `debug_shrink` failed on ≥ 1 cases: (1, 0) (after 3 shrink steps) ────────────────────────────────────────────────────────────────────────────── -4 failures! 6 tests run. +6 failures! 9 tests run. From 9007055a0eb514fbc4ad99dadf060d9a5e4acfa9 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 21 Jun 2022 22:44:20 +0200 Subject: [PATCH 027/391] more informative error msg --- test/core/shrink_benchmark.ml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/core/shrink_benchmark.ml b/test/core/shrink_benchmark.ml index 322ce5d7..50b536c4 100644 --- a/test/core/shrink_benchmark.ml +++ b/test/core/shrink_benchmark.ml @@ -104,7 +104,9 @@ let rec merge_and_validate xs ys = match xs,ys with | t1::xs,t2::ys -> if get_name t1 = get_name t2 then (t1,t2) :: merge_and_validate xs ys - else failwith "QCheck_tests.Shrink and QCheck2_tests.Shrink are not in the same order" + else + let msg = Printf.sprintf "Found \"%s\" and \"%s\". Are QCheck_tests.Shrink and QCheck2_tests.Shrink not in the same order?" (get_name t1) (get_name t2) in + failwith msg let seeds = [1234;(*4321;*)8743;(*9876;*)6789; (*2143*) (* ouch: seed 2143 causes test "lists equal to duplication" to segfault *) From 2c6e3e8d2401cbb6971810d106c404fbbfc78305 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 14 Jun 2022 18:59:40 +0200 Subject: [PATCH 028/391] add CHANGELOG entry --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80148a8f..b625d5aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,9 @@ - add `tup2` to `tup9` for generators +- add `Test.make_neg` for negative property-based tests, that are + expected not to satisfy the tested property. + - rename `Gen.opt` to `Gen.option` but keep the old binding for compatibility. - add additional expect and unit tests and refactor expect test suite From 58cff202957c0a2fd6b5fd1805cad20d5095950f Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 21 Jun 2022 09:21:22 +0200 Subject: [PATCH 029/391] describe Test.make_neg in documentation --- src/core/QCheck.mli | 19 +++++++++++++------ src/core/QCheck2.mli | 16 +++++++++------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 31d846e8..ab6dcf4f 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -900,10 +900,17 @@ val get_print : 'a arbitrary -> 'a Print.t option with an object of type [foo arbitrary] used to generate, print, etc. values of type [foo]. - See {!Test.make} to build a test, and {!Test.check_exn} to - run one test simply. - For more serious testing, it is better to create a testsuite - and use {!QCheck_runner}. + The main features of this module are: + - {!Test.make} to build a test, + - {!Test.make_neg} to build a negative test that is expected not to satisfy the tested property, + - {!Test.check_exn} to run a single test with a simple runner. + + A test fails if the property does not hold for a given input. The {{!Test.fail_report} simple} form or the {{!Test.fail_reportf} rich} form) offer more elaborate forms to fail a test. + + For more serious testing, it is recommended to create a testsuite and use a full-fledged runner: + - {!QCheck_base_runner} is a QCheck-only runner (useful if you don't have or don't need another test framework) + - {!QCheck_alcotest} interfaces to the Alcotest framework + - {!QCheck_ounit} interfaces to the to OUnit framework *) (** Result of running a test *) @@ -1008,7 +1015,7 @@ module Test : sig @param retries number of times to retry the tested property while shrinking. @param long_factor the factor by which to multiply count, max_gen and max_fail when running a long test (default: 1). - @param negative whether the test is expected to fail. + @param negative whether the test is expected not to satisfy the tested property. @param max_gen maximum number of times the generation function is called in total to replace inputs that do not satisfy preconditions (should be >= count). @@ -1061,7 +1068,7 @@ module Test : sig ('a -> bool) -> t (** [make_neg arb prop] builds a test that checks property [prop] on instances of the generator [arb]. - The test is considered negative, meaning that it is expected to fail. + The test is considered negative, meaning that it is expected not to satisfy the tested property. This information is recorded in an underlying test [cell] entry and interpreted suitably by test runners. See {!make_cell} for a description of the parameters. *) diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index a64879db..c32627dd 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -1573,12 +1573,14 @@ module Test_exceptions : sig stacktrace (if enabled) or an empty string. *) end -(** A test is a pair of an generator and a property thar all generated values must satisfy. *) +(** A test is a pair of a generator and a property that all generated values must satisfy. *) module Test : sig (** The main features of this module are: - - {!make} a test - - fail the test if a property does not hold (using either the {{!fail_report} simple} form or the {{!fail_reportf} rich} form) - - {!check_exn} a single test + - {!make} to create a test + - {!make_neg} to create a negative test that is expected not to satisfy the tested property + - {!check_exn} to run a single test with a simple runner. + + A test fails if the property does not hold for a given input. The {{!fail_report} simple} form or the {{!fail_reportf} rich} form) offer more elaborate forms to fail a test. Note that while {!check_exn} is provided for convenience to discover QCheck or to run a single test in {{: https://opam.ocaml.org/blog/about-utop/} utop}, to run QCheck tests in your project you probably want to opt for a more advanced runner, or convert QCheck tests to your favorite test framework: @@ -1604,7 +1606,7 @@ module Test : sig the test cases which satisfy preconditions. @param long_factor the factor by which to multiply count, max_gen and max_fail when running a long test (default: 1). - @param negative whether the test is expected to fail. + @param negative whether the test is expected not to satisfy the tested property. @param max_gen maximum number of times the generation function is called in total to replace inputs that do not satisfy preconditions (should be >= count). @@ -1651,7 +1653,7 @@ module Test : sig @since 0.5.3 *) val get_positive : _ cell -> bool - (** Get the expected mode of a cell: positive indicates expected to succeed, negative indicates expected to fail. *) + (** Get the expected mode of a cell: positive indicates expected to satisfy the tested property, negative indicates expected not to satisfy the tested property. *) type t = Test : 'a cell -> t (** Same as ['a cell], but masking the type parameter. This allows to @@ -1674,7 +1676,7 @@ module Test : sig 'a Gen.t -> ('a -> bool) -> t (** [make_neg gen prop] builds a test that checks property [prop] on instances of the generator [gen]. - The test is considered negative, meaning that it is expected to fail. + The test is considered negative, meaning that it is expected not to satisfy the tested property. This information is recorded in an underlying test [cell] entry and interpreted suitably by test runners. See {!make_cell} for a description of the parameters. *) From 5f5f431eb0553de89d344620ea35a9ef6adf5291 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 22 Jun 2022 11:00:41 +0200 Subject: [PATCH 030/391] avoid parameter list duplication across make and make_neg --- src/core/QCheck.ml | 9 ++++----- src/core/QCheck2.ml | 9 ++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index bb2df321..b0aa99e3 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -1703,12 +1703,11 @@ module Test = struct let {gen; shrink; print; collect; stats; _} = arb in QCheck2.Test.make_cell_from_QCheck1 ?if_assumptions_fail ?count ?long_factor ?negative ?max_gen ?max_fail ?retries ?name ~gen ?shrink ?print ?collect ~stats law - let make ?if_assumptions_fail ?count ?long_factor ?max_gen ?max_fail ?small ?retries ?name arb law = - QCheck2.Test.Test (make_cell ?if_assumptions_fail ?count ?long_factor ?max_gen ?max_fail ?small ?retries ?name arb law) + let make' ?if_assumptions_fail ?count ?long_factor ?max_gen ?max_fail ?small ?retries ?name ~negative arb law = + QCheck2.Test.Test (make_cell ?if_assumptions_fail ?count ?long_factor ?max_gen ?max_fail ?small ?retries ?name ~negative arb law) - let make_neg ?if_assumptions_fail ?count ?long_factor ?max_gen ?max_fail ?small ?retries ?name arb law = - let negative = Some true in - QCheck2.Test.Test (make_cell ?if_assumptions_fail ?count ?long_factor ?negative ?max_gen ?max_fail ?small ?retries ?name arb law) + let make = make' ~negative:false + let make_neg = make' ~negative:true let fail_report = QCheck2.Test.fail_report diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index 904f7f76..f95104f9 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -1494,12 +1494,11 @@ module Test = struct qcheck1_shrink = shrink; } - let make ?if_assumptions_fail ?count ?long_factor ?max_gen ?max_fail ?retries ?name ?print ?collect ?stats gen law = - Test (make_cell ?if_assumptions_fail ?count ?long_factor ?max_gen ?max_fail ?retries ?name ?print ?collect ?stats gen law) + let make' ?if_assumptions_fail ?count ?long_factor ?max_gen ?max_fail ?retries ?name ?print ?collect ?stats ~negative arb law = + Test (make_cell ?if_assumptions_fail ?count ?long_factor ?max_gen ?max_fail ?retries ?name ?print ?collect ?stats ~negative arb law) - let make_neg ?if_assumptions_fail ?count ?long_factor ?max_gen ?max_fail ?retries ?name ?print ?collect ?stats gen law = - let negative = Some true in - Test (make_cell ?if_assumptions_fail ?count ?long_factor ?negative ?max_gen ?max_fail ?retries ?name ?print ?collect ?stats gen law) + let make = make' ~negative:false + let make_neg = make' ~negative:true let test_get_count (Test cell) = get_count cell From c0d033b508eea7bde5572371ff74ab68f9fdc490 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 10 Jun 2022 19:03:33 +0200 Subject: [PATCH 031/391] add shrinking to char arbitraries --- src/core/QCheck.ml | 24 ++++++++++++++++-------- src/core/QCheck.mli | 4 ++++ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index b0aa99e3..bfd46ae2 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -696,12 +696,15 @@ module Shrink = struct let filter f shrink x = Iter.filter f (shrink x) - let char c = match c with - | 'a' -> Iter.empty - | _ -> + let char_generic target c = + if c = target + then Iter.empty + else let c_code = Char.code c in - let a_code = Char.code 'a' in - Iter.map (fun diff -> Char.chr (a_code + diff)) (int (c_code - a_code)) + let target_code = Char.code target in + Iter.map (fun diff -> Char.chr (target_code + diff)) (int (c_code - target_code)) + let char = char_generic 'a' + let char_numeral = char_generic '0' let option s x = match x with | None -> Iter.empty @@ -1093,9 +1096,14 @@ let int64 = make ~print:(fun i -> Int64.to_string i ^ "L") ~small:small1 ~shrink:Shrink.int64 Gen.ui64 -let char = make_scalar ~print:(sprintf "%C") Gen.char -let printable_char = make_scalar ~print:(sprintf "%C") Gen.printable -let numeral_char = make_scalar ~print:(sprintf "%C") Gen.numeral +let small_char target c = abs ((Char.code c) - (Char.code target)) + +let char = + make ~print:(sprintf "%C") ~small:(small_char 'a') ~shrink:Shrink.char Gen.char +let printable_char = + make ~print:(sprintf "%C") ~small:(small_char 'a') ~shrink:Shrink.char Gen.printable +let numeral_char = + make ~print:(sprintf "%C") ~small:(small_char '0') ~shrink:Shrink.char_numeral Gen.numeral let string_gen_of_size size gen = make ~shrink:Shrink.string ~small:String.length diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index ab6dcf4f..73824ba0 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -691,6 +691,10 @@ module Shrink : sig (** Shrinks towards ['a']. @since 0.6 *) + val char_numeral : char t + (** Shrinks towards ['0']. + @since NEXT_RELEASE *) + val int : int t val int32 : int32 t From 18e536f6942e8e864777dd8952ba4f2d95003299 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 10 Jun 2022 19:04:15 +0200 Subject: [PATCH 032/391] update expected output --- test/core/QCheck_expect_test.expected | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/core/QCheck_expect_test.expected b/test/core/QCheck_expect_test.expected index 2d3d7f0f..f657f11d 100644 --- a/test/core/QCheck_expect_test.expected +++ b/test/core/QCheck_expect_test.expected @@ -266,9 +266,9 @@ Test nat < 5001 failed (6 shrink steps): --- Failure -------------------------------------------------------------------- -Test char never produces 'abcdef' failed (0 shrink steps): +Test char never produces 'abcdef' failed (3 shrink steps): -'d' +'a' --- Failure -------------------------------------------------------------------- From 9a34e5d0ff46c19e54cf4d6d98388a0e6977491d Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 10 Jun 2022 20:07:08 +0200 Subject: [PATCH 033/391] add Generator, Shrinker, and Statistics tests --- test/core/QCheck2_tests.ml | 32 +++++++++++++++++++++++++++----- test/core/QCheck_tests.ml | 38 +++++++++++++++++++++++++++++++------- 2 files changed, 58 insertions(+), 12 deletions(-) diff --git a/test/core/QCheck2_tests.ml b/test/core/QCheck2_tests.ml index f9c07e50..ee9c311f 100644 --- a/test/core/QCheck2_tests.ml +++ b/test/core/QCheck2_tests.ml @@ -181,6 +181,14 @@ module Generator = struct Test.make ~name:"char has right range'" ~count:1000 ~print:Print.char Gen.char (fun c -> '\000' <= c && c <= '\255') + let printable_test = + Test.make ~name:"printable has right range" ~count:1000 ~print:Print.char + Gen.printable (fun c -> c = '\n' || 32 <= Char.code c && Char.code c <= 126) + + let numeral_test = + Test.make ~name:"numeral has right range" ~count:1000 ~print:Print.char + Gen.numeral (fun c -> '0' <= c && c <= '9') + let nat_test = Test.make ~name:"nat has right range" ~count:1000 ~print:Print.int Gen.nat (fun n -> 0 <= n && n < 10000) @@ -370,6 +378,14 @@ module Shrink = struct Test.make ~name:"char never produces 'abcdef'" ~count:1000 ~print:Print.char Gen.char (fun c -> not (List.mem c ['a';'b';'c';'d';'e';'f'])) + let printable_is_never_sign = + Test.make ~name:"printable never produces '!@#$%'" ~count:1000 ~print:Print.char + Gen.printable (fun c -> not (List.mem c ['!';'@';'#';'$';'%'])) + + let numeral_is_never_5 = + Test.make ~name:"printable never produces '5" ~count:1000 ~print:Print.char + Gen.numeral (fun c -> c <> '5') + let strings_are_empty = Test.make ~name:"strings are empty" ~count:1000 ~print:Print.string Gen.string (fun s -> s = "") @@ -581,6 +597,8 @@ module Shrink = struct ints_smaller_209609; nats_smaller_5001; char_is_never_abcdef; + printable_is_never_sign; + numeral_is_never_5; strings_are_empty; string_never_has_000_char; string_never_has_255_char; @@ -745,8 +763,12 @@ module Stats = struct let bool_dist = Test.make ~name:"bool dist" ~count:500_000 ~collect:Bool.to_string Gen.bool (fun _ -> true) - let char_dist = - Test.make ~name:"char code dist" ~count:500_000 ~stats:[("char code", Char.code)] Gen.char (fun _ -> true) + let char_dist_tests = + [ + Test.make ~name:"char code dist" ~count:500_000 ~stats:[("char code", Char.code)] Gen.char (fun _ -> true); + Test.make ~name:"printable char code dist" ~count:500_000 ~stats:[("char code", Char.code)] Gen.printable (fun _ -> true); + Test.make ~name:"numeral char code dist" ~count:500_000 ~stats:[("char code", Char.code)] Gen.numeral (fun _ -> true); + ] let string_len_tests = let len = ("len",String.length) in @@ -819,9 +841,9 @@ module Stats = struct Gen.(oneof [small_int_corners ();int]) (fun _ -> true) let tests = - [ bool_dist; - char_dist; - tree_depth_test;] + [ bool_dist; ] + @ char_dist_tests + @ [ tree_depth_test;] @ string_len_tests @ [pair_dist; triple_dist; diff --git a/test/core/QCheck_tests.ml b/test/core/QCheck_tests.ml index e00dd074..c795c631 100644 --- a/test/core/QCheck_tests.ml +++ b/test/core/QCheck_tests.ml @@ -186,9 +186,17 @@ module Generator = struct Test.make ~name:"char never produces '\\255'" ~count:1_000_000 char (fun c -> c <> '\255') let char_test = - Test.make ~name:"char has right range'" ~count:1000 + Test.make ~name:"char has right range" ~count:1000 char (fun c -> '\000' <= c && c <= '\255') + let printable_test = + Test.make ~name:"printable has right range" ~count:1000 + printable_char (fun c -> c = '\n' || 32 <= Char.code c && Char.code c <= 126) + + let numeral_test = + Test.make ~name:"numeral has right range" ~count:1000 + numeral_char (fun c -> '0' <= c && c <= '9') + let nat_test = Test.make ~name:"nat has right range" ~count:1000 (make ~print:Print.int Gen.nat) (fun n -> 0 <= n && n < 10000) @@ -378,6 +386,8 @@ module Generator = struct let tests = [ char_dist_issue_23; char_test; + printable_test; + numeral_test; nat_test; string_test; pair_test; @@ -454,6 +464,14 @@ module Shrink = struct Test.make ~name:"char never produces 'abcdef'" ~count:1000 char (fun c -> not (List.mem c ['a';'b';'c';'d';'e';'f'])) + let printable_is_never_sign = + Test.make ~name:"printable never produces '!@#$%'" ~count:1000 + printable_char (fun c -> not (List.mem c ['!';'@';'#';'$';'%'])) + + let numeral_is_never_5 = + Test.make ~name:"printable never produces '5" ~count:1000 + numeral_char (fun c -> c <> '5') + let strings_are_empty = Test.make ~name:"strings are empty" ~count:1000 string (fun s -> s = "") @@ -656,6 +674,8 @@ module Shrink = struct ints_smaller_209609; nats_smaller_5001; char_is_never_abcdef; + printable_is_never_sign; + numeral_is_never_5; strings_are_empty; string_never_has_000_char; string_never_has_255_char; @@ -815,8 +835,12 @@ module Stats = struct let bool_dist = Test.make ~name:"bool dist" ~count:500_000 (set_collect Bool.to_string bool) (fun _ -> true) - let char_dist = - Test.make ~name:"char code dist" ~count:500_000 (add_stat ("char code", Char.code) char) (fun _ -> true) + let char_dist_tests = + [ + Test.make ~name:"char code dist" ~count:500_000 (add_stat ("char code", Char.code) char) (fun _ -> true); + Test.make ~name:"printable char code dist" ~count:500_000 (add_stat ("char code", Char.code) printable_char) (fun _ -> true); + Test.make ~name:"numeral char code dist" ~count:500_000 (add_stat ("char code", Char.code) numeral_char) (fun _ -> true); + ] let string_len_tests = let len = ("len",String.length) in @@ -896,10 +920,10 @@ module Stats = struct (add_stat ("dist",fun x -> x) (oneof [small_int_corners ();int])) (fun _ -> true) let tests = - [ bool_dist; - char_dist; - tree_depth_test; - range_subset_test;] + [ bool_dist; ] + @ char_dist_tests + @ [tree_depth_test; + range_subset_test;] @ string_len_tests @ [pair_dist; triple_dist; From 6767a64d4ce1380e2827536b51fdb9f7a0adb93c Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 10 Jun 2022 20:08:03 +0200 Subject: [PATCH 034/391] update erroneous spec --- src/core/QCheck.mli | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 73824ba0..3316ddcc 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -388,7 +388,7 @@ module Gen : sig val char : char t (** Generates characters upto character code 255. *) - val printable : char t (** Generates printable ascii characters in the range 32 to 127 *) + val printable : char t (** Generates printable ascii characters - either '\n' or in the range 32 to 126, inclusive *) val numeral : char t (** Generates numeral characters. *) @@ -1231,7 +1231,7 @@ val char : char arbitrary val printable_char : char arbitrary (** Uniformly distributed over a subset of printable ascii chars. - Ascii character codes 32 to 127. + Ascii character codes 32 to 126, inclusive - or ['\n'] with code 10. *) val numeral_char : char arbitrary From 43ad8babfcb136e976f410f8a03d57323831ff56 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 10 Jun 2022 20:09:03 +0200 Subject: [PATCH 035/391] fix QCheck2.Gen.printable generator --- src/core/QCheck2.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index f95104f9..647f8eff 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -649,7 +649,7 @@ module Gen = struct (** The first characters are the usual lower case alphabetical letters to help shrinking. *) let printable_chars : char list = (* Left and right inclusive *) - let range min max = List.init (max - min) (fun i -> char_of_int (i + min)) in + let range min max = List.init (max - min + 1) (fun i -> char_of_int (i + min)) in let a = 97 in let z = 122 in let lower_alphabet = range a z in From 6c634ae6567abde0591138ff5f36bf3bc9913c53 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 10 Jun 2022 20:09:29 +0200 Subject: [PATCH 036/391] update expected output --- test/core/QCheck2_expect_test.expected | 54 +++++++++++++++++++++++++- test/core/QCheck_expect_test.expected | 54 +++++++++++++++++++++++++- 2 files changed, 106 insertions(+), 2 deletions(-) diff --git a/test/core/QCheck2_expect_test.expected b/test/core/QCheck2_expect_test.expected index c3171822..8e85fd4f 100644 --- a/test/core/QCheck2_expect_test.expected +++ b/test/core/QCheck2_expect_test.expected @@ -334,6 +334,18 @@ Test char never produces 'abcdef' failed (1 shrink steps): --- Failure -------------------------------------------------------------------- +Test printable never produces '!@#$%' failed (1 shrink steps): + +'!' + +--- Failure -------------------------------------------------------------------- + +Test printable never produces '5 failed (0 shrink steps): + +'5' + +--- Failure -------------------------------------------------------------------- + Test strings are empty failed (8 shrink steps): "a" @@ -643,6 +655,46 @@ stats char code: 234..246: ###################################################### 25567 247..259: ##################################### 17709 ++++ Stats for printable char code dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats char code: + num: 500000, avg: 78.26, stddev: 28.15, median 78, min 10, max 126 + 10.. 15: ######### 5149 + 16.. 21: 0 + 22.. 27: 0 + 28.. 33: ################## 10379 + 34.. 39: ###################################################### 31153 + 40.. 45: ###################################################### 31341 + 46.. 51: ###################################################### 31408 + 52.. 57: ####################################################### 31456 + 58.. 63: ###################################################### 31310 + 64.. 69: ###################################################### 31152 + 70.. 75: ###################################################### 31308 + 76.. 81: ###################################################### 31156 + 82.. 87: ###################################################### 31170 + 88.. 93: ###################################################### 31286 + 94.. 99: ###################################################### 31364 + 100..105: ###################################################### 31368 + 106..111: ###################################################### 31024 + 112..117: ###################################################### 31261 + 118..123: ###################################################### 31064 + 124..129: ########################### 15651 + ++++ Stats for numeral char code dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats char code: + num: 500000, avg: 52.50, stddev: 2.87, median 52, min 48, max 57 + 48: ###################################################### 50260 + 49: ###################################################### 49590 + 50: ###################################################### 50170 + 51: ####################################################### 50270 + 52: ###################################################### 49805 + 53: ###################################################### 50161 + 54: ###################################################### 49919 + 55: ###################################################### 49971 + 56: ###################################################### 49980 + 57: ###################################################### 49874 + +++ Stats for tree's depth ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats depth: @@ -1274,7 +1326,7 @@ stats dist: 4150517416584649600.. 4611686018427387903: ################# 189 ================================================================================ 1 warning(s) -failure (58 tests failed, 3 tests errored, ran 127 tests) +failure (60 tests failed, 3 tests errored, ran 131 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_expect_test.expected b/test/core/QCheck_expect_test.expected index f657f11d..7040982f 100644 --- a/test/core/QCheck_expect_test.expected +++ b/test/core/QCheck_expect_test.expected @@ -272,6 +272,18 @@ Test char never produces 'abcdef' failed (3 shrink steps): --- Failure -------------------------------------------------------------------- +Test printable never produces '!@#$%' failed (1 shrink steps): + +'%' + +--- Failure -------------------------------------------------------------------- + +Test printable never produces '5 failed (0 shrink steps): + +'5' + +--- Failure -------------------------------------------------------------------- + Test strings are empty failed (15 shrink steps): "a" @@ -581,6 +593,46 @@ stats char code: 234..246: ###################################################### 25567 247..259: ##################################### 17709 ++++ Stats for printable char code dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats char code: + num: 500000, avg: 77.76, stddev: 27.92, median 78, min 10, max 125 + 10.. 15: ######### 5392 + 16.. 21: 0 + 22.. 27: 0 + 28.. 33: ################## 10661 + 34.. 39: ###################################################### 31788 + 40.. 45: ###################################################### 31217 + 46.. 51: ####################################################### 31790 + 52.. 57: ###################################################### 31625 + 58.. 63: ###################################################### 31421 + 64.. 69: ###################################################### 31732 + 70.. 75: ###################################################### 31446 + 76.. 81: ###################################################### 31382 + 82.. 87: ###################################################### 31623 + 88.. 93: ###################################################### 31730 + 94.. 99: ##################################################### 31193 + 100..105: ###################################################### 31424 + 106..111: ###################################################### 31675 + 112..117: ###################################################### 31651 + 118..123: ###################################################### 31682 + 124..129: ################## 10568 + ++++ Stats for numeral char code dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats char code: + num: 500000, avg: 52.50, stddev: 2.87, median 52, min 48, max 57 + 48: ###################################################### 50260 + 49: ###################################################### 49590 + 50: ###################################################### 50170 + 51: ####################################################### 50270 + 52: ###################################################### 49805 + 53: ###################################################### 50161 + 54: ###################################################### 49919 + 55: ###################################################### 49971 + 56: ###################################################### 49980 + 57: ###################################################### 49874 + +++ Stats for tree's depth ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats depth: @@ -1238,7 +1290,7 @@ stats dist: 4150517416584649600.. 4611686018427387903: ################# 189 ================================================================================ 1 warning(s) -failure (58 tests failed, 3 tests errored, ran 134 tests) +failure (60 tests failed, 3 tests errored, ran 140 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ From 614a374b9580ee86929d87420022c71e8b80144e Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 14 Jun 2022 09:18:21 +0200 Subject: [PATCH 037/391] refine Shrinker tests --- test/core/QCheck2_expect_test.expected | 6 +++--- test/core/QCheck2_tests.ml | 12 ++++++------ test/core/QCheck_expect_test.expected | 8 ++++---- test/core/QCheck_tests.ml | 14 +++++++------- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/test/core/QCheck2_expect_test.expected b/test/core/QCheck2_expect_test.expected index 8e85fd4f..64b857ef 100644 --- a/test/core/QCheck2_expect_test.expected +++ b/test/core/QCheck2_expect_test.expected @@ -334,15 +334,15 @@ Test char never produces 'abcdef' failed (1 shrink steps): --- Failure -------------------------------------------------------------------- -Test printable never produces '!@#$%' failed (1 shrink steps): +Test printable never produces '!"#$%&'' failed (1 shrink steps): '!' --- Failure -------------------------------------------------------------------- -Test printable never produces '5 failed (0 shrink steps): +Test printable never produces less than '5 failed (1 shrink steps): -'5' +'0' --- Failure -------------------------------------------------------------------- diff --git a/test/core/QCheck2_tests.ml b/test/core/QCheck2_tests.ml index ee9c311f..24954dbc 100644 --- a/test/core/QCheck2_tests.ml +++ b/test/core/QCheck2_tests.ml @@ -378,13 +378,13 @@ module Shrink = struct Test.make ~name:"char never produces 'abcdef'" ~count:1000 ~print:Print.char Gen.char (fun c -> not (List.mem c ['a';'b';'c';'d';'e';'f'])) - let printable_is_never_sign = - Test.make ~name:"printable never produces '!@#$%'" ~count:1000 ~print:Print.char + let printable_is_never_sign = (* should shrink towards '!' with lowest ascii code 33 *) + Test.make ~name:"printable never produces '!\"#$%&''" ~count:1000 ~print:Print.char Gen.printable (fun c -> not (List.mem c ['!';'@';'#';'$';'%'])) - let numeral_is_never_5 = - Test.make ~name:"printable never produces '5" ~count:1000 ~print:Print.char - Gen.numeral (fun c -> c <> '5') + let numeral_is_never_less_5 = + Test.make ~name:"printable never produces less than '5" ~count:1000 ~print:Print.char + Gen.numeral (fun c -> c >= '5') let strings_are_empty = Test.make ~name:"strings are empty" ~count:1000 ~print:Print.string @@ -598,7 +598,7 @@ module Shrink = struct nats_smaller_5001; char_is_never_abcdef; printable_is_never_sign; - numeral_is_never_5; + numeral_is_never_less_5; strings_are_empty; string_never_has_000_char; string_never_has_255_char; diff --git a/test/core/QCheck_expect_test.expected b/test/core/QCheck_expect_test.expected index 7040982f..3d828e7b 100644 --- a/test/core/QCheck_expect_test.expected +++ b/test/core/QCheck_expect_test.expected @@ -272,15 +272,15 @@ Test char never produces 'abcdef' failed (3 shrink steps): --- Failure -------------------------------------------------------------------- -Test printable never produces '!@#$%' failed (1 shrink steps): +Test printable never produces '!"#$%&' failed (2 shrink steps): -'%' +'&' --- Failure -------------------------------------------------------------------- -Test printable never produces '5 failed (0 shrink steps): +Test printable never produces less than '5 failed (3 shrink steps): -'5' +'0' --- Failure -------------------------------------------------------------------- diff --git a/test/core/QCheck_tests.ml b/test/core/QCheck_tests.ml index c795c631..805b28cd 100644 --- a/test/core/QCheck_tests.ml +++ b/test/core/QCheck_tests.ml @@ -464,13 +464,13 @@ module Shrink = struct Test.make ~name:"char never produces 'abcdef'" ~count:1000 char (fun c -> not (List.mem c ['a';'b';'c';'d';'e';'f'])) - let printable_is_never_sign = - Test.make ~name:"printable never produces '!@#$%'" ~count:1000 - printable_char (fun c -> not (List.mem c ['!';'@';'#';'$';'%'])) + let printable_is_never_sign = (* should shrink towards 'a', hence produce '&' with highest ascii code 38 *) + Test.make ~name:"printable never produces '!\"#$%&'" ~count:1000 + printable_char (fun c -> not (List.mem c ['!';'"';'#';'$';'%';'&'])) - let numeral_is_never_5 = - Test.make ~name:"printable never produces '5" ~count:1000 - numeral_char (fun c -> c <> '5') + let numeral_is_never_less_5 = + Test.make ~name:"printable never produces less than '5" ~count:1000 + numeral_char (fun c -> c >= '5') let strings_are_empty = Test.make ~name:"strings are empty" ~count:1000 @@ -675,7 +675,7 @@ module Shrink = struct nats_smaller_5001; char_is_never_abcdef; printable_is_never_sign; - numeral_is_never_5; + numeral_is_never_less_5; strings_are_empty; string_never_has_000_char; string_never_has_255_char; From 84aae0a0f31178c08cf413301908afac2f14a02b Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 14 Jun 2022 09:19:05 +0200 Subject: [PATCH 038/391] Fix QCheck2.printable shrinker behaviour doc --- src/core/QCheck2.mli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index c32627dd..fee3fd9e 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -280,7 +280,7 @@ module Gen : sig - [32] to [126], inclusive - ['\n'] - Shrinks towards ['a']. + Shrinks towards ['a'] or lower character codes. *) val numeral : char t From 58eca26b84a1a6776d216eb53396261de64a9e2c Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 14 Jun 2022 09:19:21 +0200 Subject: [PATCH 039/391] update CHANGELOG --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b625d5aa..64cfbc75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,11 +28,15 @@ - add a shrinker performance benchmark [#177](https://github.com/c-cube/qcheck/pull/177) +- fix distribution of `QCheck2.printable` which would omit certain characters + - shrinker changes - recursive list shrinker with better complexity - string shrinker reuses improved list shrinker and adds char shrinking - function shrinker now shrinks default entry first and benefits from list shrinker improvements - replacing the linear-time char shrinker with a faster one reusing the bisecting int shrinker algorithm + - add `Shrink.char_numeral` + - add shrinking for `char arbitrary`s `char`, `printable_char`, and `numeral_char` - documentation updates: - clarify upper bound inclusion in `Gen.int_bound` and `Gen.int_range` @@ -42,6 +46,8 @@ - fix documented size distribution for `arbitrary` generators `string_gen`, `string`, `printable_string`, `numeral_string`, `list`, and `array` - fix exception documentation for `check_result`, `check_cell_exn`, and `check_exn` + - fix documentation for the distribution of `Gen.printable` and `printable_char` + - fix documentation for the shrinking behaviour of `QCheck2.printable` - add environment variable `QCHECK_LONG_FACTOR` similar to `QCHECK_COUNT` [#220](https://github.com/c-cube/qcheck/pull/220) From 4d73f158fd385103bd59caa1faae490254c52973 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 16 Jun 2022 09:41:43 +0200 Subject: [PATCH 040/391] add Shrink.char_printable --- src/core/QCheck.ml | 6 +++++- src/core/QCheck.mli | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index bfd46ae2..331fec81 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -706,6 +706,10 @@ module Shrink = struct let char = char_generic 'a' let char_numeral = char_generic '0' + let char_printable = function + | '\n' -> char '~' (* treat '\n' (10) as '~' (126) to ensure a non-trivial, printable output *) + | c -> char c + let option s x = match x with | None -> Iter.empty | Some x -> Iter.(return None <+> map (fun y->Some y) (s x)) @@ -1101,7 +1105,7 @@ let small_char target c = abs ((Char.code c) - (Char.code target)) let char = make ~print:(sprintf "%C") ~small:(small_char 'a') ~shrink:Shrink.char Gen.char let printable_char = - make ~print:(sprintf "%C") ~small:(small_char 'a') ~shrink:Shrink.char Gen.printable + make ~print:(sprintf "%C") ~small:(small_char 'a') ~shrink:Shrink.char_printable Gen.printable let numeral_char = make ~print:(sprintf "%C") ~small:(small_char '0') ~shrink:Shrink.char_numeral Gen.numeral diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 3316ddcc..6924df30 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -695,6 +695,10 @@ module Shrink : sig (** Shrinks towards ['0']. @since NEXT_RELEASE *) + val char_printable : char t + (** Shrinks towards ['a'] like [!char]. The output is also a printable character. + @since NEXT_RELEASE *) + val int : int t val int32 : int32 t From 5514da0c4014204c03d929300723501975adc866 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 16 Jun 2022 09:42:48 +0200 Subject: [PATCH 041/391] add char shrinker unit tests --- test/core/QCheck2_unit_tests.ml | 72 ++++++++++++++++++++++++++++++++- test/core/QCheck_unit_tests.ml | 39 +++++++++++++++++- 2 files changed, 109 insertions(+), 2 deletions(-) diff --git a/test/core/QCheck2_unit_tests.ml b/test/core/QCheck2_unit_tests.ml index 8711971a..6624fdd6 100644 --- a/test/core/QCheck2_unit_tests.ml +++ b/test/core/QCheck2_unit_tests.ml @@ -1,5 +1,18 @@ open QCheck2 +let rand_init i = Random.State.make [|i|] + +let rec repeated_success t = + Tree.root t :: match Tree.children t () with + | Seq.Nil -> [] + | Seq.Cons (t,_) -> repeated_success t + +let repeated_failure t = + Tree.root t :: match Tree.children t () with + | Seq.Nil -> [] + | Seq.Cons (t,ts) -> Tree.root t :: (Seq.map Tree.root ts |> List.of_seq) + + module Shrink = struct let test_int_towards () = Alcotest.(check' (list int)) @@ -57,11 +70,68 @@ module Shrink = struct ~actual:(Shrink.float_towards (-50.) (-26.) |> List.of_seq) ~expected:[-50.; -38.; -32.; -29.; -27.5; -26.75; -26.375; -26.1875; -26.0938; -26.0469; -26.0234; -26.0117; -26.0059; -26.0029; -26.0015] + let test_char () = + Alcotest.(check' (list char)) + ~msg:"'k' on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 1234) char) |> repeated_failure) + ~expected:['k'; 'a'; 'f'; 'h'; 'i'; 'j']; + Alcotest.(check' (list char)) + ~msg:"'1' on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3345) char) |> repeated_failure) + ~expected:['1'; 'a'; 'I'; '='; '7'; '4'; '2']; + Alcotest.(check' (list char)) + ~msg:"'k' on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 1234) char) |> repeated_success) + ~expected:['k'; 'a';]; + Alcotest.(check' (list char)) + ~msg:"'1' on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3345) char) |> repeated_success) + ~expected:['1'; 'a';] + + let test_char_numeral () = + Alcotest.(check' (list char)) + ~msg:"'3' on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 1234) numeral) |> repeated_failure) + ~expected:['3'; '0'; '1'; '2']; + Alcotest.(check' (list char)) + ~msg:"'0' on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) numeral) |> repeated_failure) + ~expected:['0']; + Alcotest.(check' (list char)) + ~msg:"'3' on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 1234) numeral) |> repeated_success) + ~expected:['3'; '0';]; + Alcotest.(check' (list char)) + ~msg:"'0' on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) numeral) |> repeated_success) + ~expected:['0';] + + let test_char_printable () = + Alcotest.(check' (list char)) + ~msg:"'l' on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 1234) printable) |> repeated_failure) + ~expected:['l'; 'a'; 'f'; 'i'; 'j'; 'k']; + Alcotest.(check' (list char)) + ~msg:"'8' on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) printable) |> repeated_failure) + ~expected:['8'; 'a'; 'z'; ','; '2'; '5'; '7']; + Alcotest.(check' (list char)) + ~msg:"'l' on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 1234) printable) |> repeated_success) + ~expected:['l'; 'a';]; + Alcotest.(check' (list char)) + ~msg:"'8' on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) printable) |> repeated_success) + ~expected:['8'; 'a';] + let tests = ("Shrink", Alcotest.[ test_case "int_towards" `Quick test_int_towards; test_case "int32_towards" `Quick test_int32_towards; test_case "int64_towards" `Quick test_int64_towards; - test_case "float_towards" `Quick test_float_towards + test_case "float_towards" `Quick test_float_towards; + test_case "Gen.char tree" `Quick test_char; + test_case "Gen.numeral tree" `Quick test_char_numeral; + test_case "Gen.printable tree" `Quick test_char_printable; ]) end diff --git a/test/core/QCheck_unit_tests.ml b/test/core/QCheck_unit_tests.ml index 95d3f150..1e648ff4 100644 --- a/test/core/QCheck_unit_tests.ml +++ b/test/core/QCheck_unit_tests.ml @@ -15,7 +15,7 @@ module Shrink = struct loop x let alco_check typ func msg_suffix (msg,input,expected) = - Alcotest.(check (list typ)) (msg ^ " - " ^ msg_suffix) (func input) expected + Alcotest.(check (list typ)) (msg ^ " - " ^ msg_suffix) expected (func input) let test_int () = List.iter (alco_check Alcotest.int (trace_false Shrink.int) "on repeated failure") @@ -47,10 +47,47 @@ module Shrink = struct ("int 1000", 1000L, [500L; 250L; 125L; 63L; 32L; 16L; 8L; 4L; 2L; 1L; 0L]); ("int (-26)", -26L, [-13L; -7L; -4L; -2L; -1L; 0L]) ] + let test_char () = + List.iter (alco_check Alcotest.char (trace_false Shrink.char) "on repeated failure") + [ ("char 'a'", 'a', []); + ("char 'z'", 'z', ['n'; 't'; 'w'; 'y'; 'y']); (*WTF?*) + ("char 'A'", 'A', ['Q'; 'I'; 'E'; 'C'; 'B']); + ("char '~'", '~', ['p'; 'w'; '{'; '}'; '}']) ]; (*WTF?*) + List.iter (alco_check Alcotest.char (trace_true Shrink.char) "on repeated success") + [ ("char 'a'", 'a', []); + ("char 'z'", 'z', ['n'; 'h'; 'e'; 'c'; 'b'; 'a']); + ("char 'A'", 'A', ['Q'; 'Y'; ']'; '_'; '`'; 'a']); + ("char '~'", '~', ['p'; 'i'; 'e'; 'c'; 'b'; 'a']); ] + + let test_char_numeral () = + List.iter (alco_check Alcotest.char (trace_false Shrink.char_numeral) "on repeated failure") + [ ("char '0'", '0', []); + ("char '9'", '9', ['5'; '7'; '8']) ]; + List.iter (alco_check Alcotest.char (trace_true Shrink.char_numeral) "on repeated success") + [ ("char '0'", '0', []); + ("char '9'", '9', ['5'; '3'; '2'; '1'; '0']); ] + + let test_char_printable () = + List.iter (alco_check Alcotest.char (trace_false Shrink.char_printable) "on repeated failure") + [ ("char 'A'", 'A', ['Q'; 'I'; 'E'; 'C'; 'B']); + ("char 'a'", 'a', []); + ("char ' '", ' ', ['@'; '0'; '('; '$'; '"'; '!']); + ("char '~'", '~', ['p'; 'w'; '{'; '}'; '}']); (*WTF?*) + ("char '\\n'", '\n', ['p'; 'w'; '{'; '}'; '}']); ]; (*WTF?*) + List.iter (alco_check Alcotest.char (trace_true Shrink.char_printable) "on repeated success") + [ ("char 'A'", 'A', ['Q'; 'Y'; ']'; '_'; '`'; 'a']); + ("char 'a'", 'a', []); + ("char ' '", ' ', ['@'; 'P'; 'X'; '\\'; '^'; '_'; '`'; 'a']); + ("char '~'", '~', ['p'; 'i'; 'e'; 'c'; 'b'; 'a']); + ("char '\\n'", '\n', ['p'; 'i'; 'e'; 'c'; 'b'; 'a']); ] + let tests = ("Shrink", Alcotest.[ test_case "int" `Quick test_int; test_case "int32" `Quick test_int32; test_case "int64" `Quick test_int64; + test_case "char" `Quick test_char; + test_case "char_numeral" `Quick test_char_numeral; + test_case "char_printable" `Quick test_char_printable; ]) end From 3c5bd5bc671cc8254511953fb0622adcef3b7550 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 16 Jun 2022 09:43:17 +0200 Subject: [PATCH 042/391] update CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64cfbc75..8d942550 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,7 +35,7 @@ - string shrinker reuses improved list shrinker and adds char shrinking - function shrinker now shrinks default entry first and benefits from list shrinker improvements - replacing the linear-time char shrinker with a faster one reusing the bisecting int shrinker algorithm - - add `Shrink.char_numeral` + - add `Shrink.char_numeral` and `Shrink.char_printable` - add shrinking for `char arbitrary`s `char`, `printable_char`, and `numeral_char` - documentation updates: From 46a8f29eff7a777badfbb16785e9136e79333ae3 Mon Sep 17 00:00:00 2001 From: n-osborne <nicolas.osborne@tarides.com> Date: Wed, 29 Jun 2022 09:52:45 +0200 Subject: [PATCH 043/391] use Float.equal --- CHANGELOG.md | 2 ++ src/core/QCheck.ml | 2 +- src/core/QCheck2.ml | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d942550..ee28ed08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## 0.19 +- use `Float.equal` for comparing `float`s in the `Observable` module underlying function generators. + - add optional `debug_shrink` parameters in alcotest interface and expose default `debug_shrinking_choices` in test runners diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index 331fec81..0b22950c 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -955,7 +955,7 @@ module Observable = struct let int : int t = (=) let string : string t = (=) let bool : bool t = (=) - let float : float t = (=) + let float = Float.equal let unit () () = true let char : char t = (=) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index 647f8eff..3f0e90e8 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -976,7 +976,7 @@ module Observable = struct let bool : bool t = (=) - let float : float t = (=) + let float = Float.equal let unit () () = true From 759abe3ff46f8ad6ac1176237f52c39c70592744 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 30 Jun 2022 15:57:26 +0200 Subject: [PATCH 044/391] prepare for 0.19 --- qcheck-alcotest.opam | 2 +- qcheck-core.opam | 2 +- qcheck-ounit.opam | 2 +- qcheck.opam | 2 +- src/alcotest/QCheck_alcotest.mli | 2 +- src/core/QCheck.mli | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/qcheck-alcotest.opam b/qcheck-alcotest.opam index 2c39f316..64d62823 100644 --- a/qcheck-alcotest.opam +++ b/qcheck-alcotest.opam @@ -5,7 +5,7 @@ homepage: "https://github.com/c-cube/qcheck/" license: "BSD-2-Clause" synopsis: "Alcotest backend for qcheck" doc: ["http://c-cube.github.io/qcheck/"] -version: "0.18" +version: "0.19" tags: [ "test" "quickcheck" diff --git a/qcheck-core.opam b/qcheck-core.opam index 6ad35a30..a565434c 100644 --- a/qcheck-core.opam +++ b/qcheck-core.opam @@ -5,7 +5,7 @@ homepage: "https://github.com/c-cube/qcheck/" license: "BSD-2-Clause" synopsis: "Core qcheck library" doc: ["http://c-cube.github.io/qcheck/"] -version: "0.18" +version: "0.19" tags: [ "test" "property" diff --git a/qcheck-ounit.opam b/qcheck-ounit.opam index 5075225c..4c597d9f 100644 --- a/qcheck-ounit.opam +++ b/qcheck-ounit.opam @@ -5,7 +5,7 @@ license: "BSD-2-Clause" homepage: "https://github.com/c-cube/qcheck/" doc: ["http://c-cube.github.io/qcheck/"] synopsis: "OUnit backend for qcheck" -version: "0.18" +version: "0.19" tags: [ "qcheck" "quickcheck" diff --git a/qcheck.opam b/qcheck.opam index 88995fac..6fe33c00 100644 --- a/qcheck.opam +++ b/qcheck.opam @@ -5,7 +5,7 @@ synopsis: "Compatibility package for qcheck" homepage: "https://github.com/c-cube/qcheck/" license: "BSD-2-Clause" doc: ["http://c-cube.github.io/qcheck/"] -version: "0.18" +version: "0.19" tags: [ "test" "property" diff --git a/src/alcotest/QCheck_alcotest.mli b/src/alcotest/QCheck_alcotest.mli index 9177566b..bb7c2394 100644 --- a/src/alcotest/QCheck_alcotest.mli +++ b/src/alcotest/QCheck_alcotest.mli @@ -25,5 +25,5 @@ val to_alcotest : @since 0.9 @since 0.9 parameters [verbose], [long], [rand] - @since NEXT_VERSION parameters [colors], [debug_shrink], [debug_shrink_list] + @since 0.19 parameters [colors], [debug_shrink], [debug_shrink_list] *) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 6924df30..a45017f2 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -693,11 +693,11 @@ module Shrink : sig val char_numeral : char t (** Shrinks towards ['0']. - @since NEXT_RELEASE *) + @since 0.19 *) val char_printable : char t (** Shrinks towards ['a'] like [!char]. The output is also a printable character. - @since NEXT_RELEASE *) + @since 0.19 *) val int : int t From 6951e22371394e1d957ee2c40600e0cab59cf627 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 30 Jun 2022 17:11:08 +0200 Subject: [PATCH 045/391] specify package for ppx_deriving_qcheck tests --- test/ppx_deriving_qcheck/deriver/dune | 1 + 1 file changed, 1 insertion(+) diff --git a/test/ppx_deriving_qcheck/deriver/dune b/test/ppx_deriving_qcheck/deriver/dune index a154c752..ce1de538 100644 --- a/test/ppx_deriving_qcheck/deriver/dune +++ b/test/ppx_deriving_qcheck/deriver/dune @@ -1,4 +1,5 @@ (tests + (package ppx_deriving_qcheck) (names test_textual test_primitives From 6bb21eb144929476a2c2671e5b9f44da7ab8888c Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 30 Jun 2022 17:38:03 +0200 Subject: [PATCH 046/391] add qcheck-alcotest as a test dependency for ppx_deriving_qcheck --- ppx_deriving_qcheck.opam | 1 + 1 file changed, 1 insertion(+) diff --git a/ppx_deriving_qcheck.opam b/ppx_deriving_qcheck.opam index b4ca4220..7732445c 100644 --- a/ppx_deriving_qcheck.opam +++ b/ppx_deriving_qcheck.opam @@ -15,6 +15,7 @@ depends: [ "ppx_deriving" {>= "5.2.1"} "odoc" {with-doc} "alcotest" {with-test & >= "1.4.0" } + "qcheck-alcotest" {with-test & >= "0.17"} ] build: [ From 36bfddb414ce3770366ca24d376371383003252e Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 30 Jun 2022 17:57:29 +0200 Subject: [PATCH 047/391] add alcotest lower bound for qcheck-alcotest --- qcheck-alcotest.opam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qcheck-alcotest.opam b/qcheck-alcotest.opam index 64d62823..d13e995a 100644 --- a/qcheck-alcotest.opam +++ b/qcheck-alcotest.opam @@ -22,7 +22,7 @@ depends: [ "base-bytes" "base-unix" "qcheck-core" { = version } - "alcotest" + "alcotest" {>= "0.8.1"} "odoc" {with-doc} "ocaml" {>= "4.08.0"} ] From 3e2cc31c618c15c4ae4a1d3a377a883f74623e53 Mon Sep 17 00:00:00 2001 From: Valentin Chaboche <valentin.chaboche@nomadic-labs.com> Date: Mon, 13 Dec 2021 18:02:11 +0100 Subject: [PATCH 048/391] Handle qcheck and qcheck2 generators --- src/ppx_deriving_qcheck/QCheck_generators.ml | 232 ++++++++++++++---- .../ppx_deriving_qcheck.ml | 104 ++++---- .../ppx_deriving_qcheck.mli | 11 +- src/ppx_deriving_qcheck/tuple.ml | 14 +- 4 files changed, 259 insertions(+), 102 deletions(-) diff --git a/src/ppx_deriving_qcheck/QCheck_generators.ml b/src/ppx_deriving_qcheck/QCheck_generators.ml index df969e9e..b150e8fc 100644 --- a/src/ppx_deriving_qcheck/QCheck_generators.ml +++ b/src/ppx_deriving_qcheck/QCheck_generators.ml @@ -5,92 +5,222 @@ open Ppxlib (** {2. Type} *) -let ty = Ldot (Ldot (Lident "QCheck", "Gen"), "t") +let ty = function + | `QCheck -> Ldot (Ldot (Lident "QCheck", "Gen"), "t") + | `QCheck2 -> Ldot (Ldot (Lident "QCheck2", "Gen"), "t") (** {2. Primitive generators} *) -let unit loc = [%expr QCheck.Gen.unit] +let unit loc = function + | `QCheck -> [%expr QCheck.Gen.unit] + | `QCheck2 -> [%expr QCheck2.Gen.unit] -let int loc = [%expr QCheck.Gen.int] +let int loc = function + | `QCheck -> [%expr QCheck.Gen.int] + | `QCheck2 -> [%expr QCheck2.Gen.int] -let string loc = [%expr QCheck.Gen.string] +let string loc = function + | `QCheck -> [%expr QCheck.Gen.string] + | `QCheck2 -> [%expr QCheck2.Gen.string] -let char loc = [%expr QCheck.Gen.char] +let char loc = function + | `QCheck -> [%expr QCheck.Gen.char] + | `QCheck2 -> [%expr QCheck2.Gen.char] -let bool loc = [%expr QCheck.Gen.bool] +let bool loc = function + | `QCheck -> [%expr QCheck.Gen.bool] + | `QCheck2 -> [%expr QCheck2.Gen.bool] -let float loc = [%expr QCheck.Gen.float] +let float loc = function + | `QCheck -> [%expr QCheck.Gen.float] + | `QCheck2 -> [%expr QCheck2.Gen.float] -let int32 loc = [%expr QCheck.Gen.ui32] +let int32 loc = function + | `QCheck -> [%expr QCheck.Gen.ui32] + | `QCheck2 -> [%expr QCheck2.Gen.ui32] -let int64 loc = [%expr QCheck.Gen.ui64] +let int64 loc = function + | `QCheck -> [%expr QCheck.Gen.ui64] + | `QCheck2 -> [%expr QCheck2.Gen.ui64] -let option ~loc e = [%expr QCheck.Gen.option [%e e]] +let option ~loc ~version e = + match version with + | `QCheck -> [%expr QCheck.Gen.option [%e e]] + | `QCheck2 -> [%expr QCheck2.Gen.opt [%e e]] -let list ~loc e = [%expr QCheck.Gen.list [%e e]] +let list ~loc ~version e = + match version with + | `QCheck -> [%expr QCheck.Gen.list [%e e]] + | `QCheck2 -> [%expr QCheck2.Gen.list [%e e]] -let array ~loc e = [%expr QCheck.Gen.array [%e e]] +let array ~loc ~version e = + match version with + | `QCheck -> [%expr QCheck.Gen.array [%e e]] + | `QCheck2 -> [%expr QCheck2.Gen.array [%e e]] (** {2. Generator combinators} *) -let pure ~loc x = [%expr QCheck.Gen.pure [%e x]] +let pure ~loc ~version x = + match version with + | `QCheck -> [%expr QCheck.Gen.pure [%e x]] + | `QCheck2 -> [%expr QCheck2.Gen.pure [%e x]] -let frequency ~loc l = +let frequency ~loc ~version l = match l with | [%expr [([%e? _], [%e? x])]] -> x | _ -> - [%expr QCheck.Gen.frequency [%e l]] - -let map ~loc pat expr gen = - [%expr QCheck.Gen.map (fun [%p pat] -> [%e expr]) [%e gen]] - -let pair ~loc a b = - [%expr QCheck.Gen.pair [%e a] [%e b]] - -let triple ~loc a b c = - [%expr QCheck.Gen.triple [%e a] [%e b] [%e c]] - -let quad ~loc a b c d= - [%expr QCheck.Gen.quad [%e a] [%e b] [%e c] [%e d]] - -let sized ~loc e = - [%expr QCheck.Gen.sized @@ [%e e]] - -let fix ~loc e = - [%expr QCheck.Gen.fix [%e e]] + (match version with + | `QCheck -> [%expr QCheck.Gen.frequency [%e l]] + | `QCheck2 -> [%expr QCheck2.Gen.frequency [%e l]]) + +let map ~loc ~version pat expr gen = + match version with + | `QCheck -> [%expr QCheck.Gen.map (fun [%p pat] -> [%e expr]) [%e gen]] + | `QCheck2 -> [%expr QCheck2.Gen.map (fun [%p pat] -> [%e expr]) [%e gen]] + +let pair ~loc ~version a b = + match version with + | `QCheck -> [%expr QCheck.Gen.pair [%e a] [%e b]] + | `QCheck2 -> [%expr QCheck2.Gen.pair [%e a] [%e b]] + +let triple ~loc ~version a b c = + match version with + | `QCheck -> [%expr QCheck.Gen.triple [%e a] [%e b] [%e c]] + | `QCheck2 -> [%expr QCheck2.Gen.triple [%e a] [%e b] [%e c]] + +let quad ~loc ~version a b c d = + match version with + | `QCheck -> [%expr QCheck.Gen.quad [%e a] [%e b] [%e c] [%e d]] + | `QCheck2 -> [%expr QCheck2.Gen.quad [%e a] [%e b] [%e c] [%e d]] + +let sized ~loc ~version e = + match version with + | `QCheck -> [%expr QCheck.Gen.sized @@ [%e e]] + | `QCheck2 -> [%expr QCheck2.Gen.sized @@ [%e e]] + +let fix ~loc ~version e = + match version with + | `QCheck -> [%expr QCheck.Gen.fix [%e e]] + | `QCheck2 -> [%expr QCheck2.Gen.fix [%e e]] (** Observable generators *) module Observable = struct (** {2. Primitive generators} *) - let unit loc = [%expr QCheck.Observable.unit] + let unit loc = function + | `QCheck -> [%expr QCheck.Observable.unit] + | `QCheck2 -> [%expr QCheck2.Observable.unit] - let int loc = [%expr QCheck.Observable.int] + let int loc = function + | `QCheck -> [%expr QCheck.Observable.int] + | `QCheck2 -> [%expr QCheck2.Observable.int] - let string loc = [%expr QCheck.Observable.string] + let string loc = function + | `QCheck -> [%expr QCheck.Observable.string] + | `QCheck2 -> [%expr QCheck2.Observable.string] - let char loc = [%expr QCheck.Observable.char] + let char loc = function + | `QCheck -> [%expr QCheck.Observable.char] + | `QCheck2 -> [%expr QCheck2.Observable.char] - let bool loc = [%expr QCheck.Observable.bool] + let bool loc = function + | `QCheck -> [%expr QCheck.Observable.bool] + | `QCheck2 -> [%expr QCheck2.Observable.bool] - let float loc = [%expr QCheck.Observable.float] + let float loc = function + | `QCheck -> [%expr QCheck.Observable.float] + | `QCheck2 -> [%expr QCheck2.Observable.float] - let int32 loc = [%expr QCheck.Observable.int32] + let int32 loc = function + | `QCheck -> [%expr QCheck.Observable.int32] + | `QCheck2 -> [%expr QCheck2.Observable.int32] - let int64 loc = [%expr QCheck.Observable.int64] + let int64 loc = function + | `QCheck -> [%expr QCheck.Observable.int64] + | `QCheck2 -> [%expr QCheck2.Observable.int64] - let option ~loc e = [%expr QCheck.Observable.option [%e e]] + let option ~loc ~version e = + match version with + | `QCheck -> [%expr QCheck.Observable.option [%e e]] + | `QCheck2 -> [%expr QCheck2.Observable.option [%e e]] - let list ~loc e = [%expr QCheck.Observable.list [%e e]] + let list ~loc ~version e = + match version with + | `QCheck -> [%expr QCheck.Observable.list [%e e]] + | `QCheck2 -> [%expr QCheck2.Observable.list [%e e]] - let array ~loc e = [%expr QCheck.Observable.array [%e e]] + let array ~loc ~version e = + match version with + | `QCheck -> [%expr QCheck.Observable.array [%e e]] + | `QCheck2 -> [%expr QCheck2.Observable.array [%e e]] (** {2. Observable combinators} *) - let pair ~loc a b = - [%expr QCheck.Observable.pair [%e a] [%e b]] - - let triple ~loc a b c = - [%expr QCheck.Observable.triple [%e a] [%e b] [%e c]] + let pair ~loc ~version a b = + match version with + | `QCheck -> [%expr QCheck.Observable.pair [%e a] [%e b]] + | `QCheck2 -> [%expr QCheck2.Observable.pair [%e a] [%e b]] + + let triple ~loc ~version a b c = + match version with + | `QCheck -> [%expr QCheck.Observable.triple [%e a] [%e b] [%e c]] + | `QCheck2 -> [%expr QCheck2.Observable.triple [%e a] [%e b] [%e c]] + + let quad ~loc ~version a b c d = + match version with + | `QCheck -> [%expr QCheck.Observable.quad [%e a] [%e b] [%e c] [%e d]] + | `QCheck2 -> [%expr QCheck2.Observable.quad [%e a] [%e b] [%e c] [%e d]] + + let fun_nary ~loc ~version left right gen = + match version with + | `QCheck -> + let arb = [%expr QCheck.make [%e gen]] in + [%expr QCheck.fun_nary QCheck.Tuple.([%e left] @-> [%e right]) [%e arb] |> QCheck.gen] + | `QCheck2 -> + [%expr QCheck2.fun_nary QCheck2.Tuple.([%e left] @-> [%e right]) [%e gen]] +end - let quad ~loc a b c d= - [%expr QCheck.Observable.quad [%e a] [%e b] [%e c] [%e d]] +module Make (Version : sig val version : [`QCheck | `QCheck2] end) = struct + let version = Version.version + let ty = ty version + let unit loc = unit loc version + let int loc = int loc version + let string loc = string loc version + let char loc = char loc version + let bool loc = bool loc version + let float loc = float loc version + let int32 loc = int32 loc version + let int64 loc = int64 loc version + let option ~loc = option ~loc ~version + let list ~loc = list ~loc ~version + let array ~loc = array ~loc ~version + let pure ~loc x = pure ~loc ~version x + let frequency ~loc l = frequency ~loc ~version l + let map ~loc pat expr gen = map ~loc ~version pat expr gen + let pair ~loc a b = pair ~loc ~version a b + let triple ~loc a b c = triple ~loc ~version a b c + let quad ~loc a b c d = quad ~loc ~version a b c d + let sized ~loc e = sized ~loc ~version e + let fix ~loc e = fix ~loc ~version e + module Observable = struct + let unit loc = Observable.unit loc version + let int loc = Observable.int loc version + let string loc = Observable.string loc version + let char loc = Observable.char loc version + let bool loc = Observable.bool loc version + let float loc = Observable.float loc version + let int32 loc = Observable.int32 loc version + let int64 loc = Observable.int64 loc version + let option ~loc e = Observable.option ~loc ~version e + let list ~loc e = Observable.list ~loc ~version e + let array ~loc e = Observable.array ~loc ~version e + let pair ~loc a b = Observable.pair ~loc ~version a b + let triple ~loc a b c = Observable.triple ~loc ~version a b c + let quad ~loc a b c d = Observable.quad ~loc ~version a b c d + let fun_nary ~loc left right gen = Observable.fun_nary ~loc ~version left right gen + end end + +module QCheck = Make (struct let version = `QCheck end) +module QCheck2 = Make (struct let version = `QCheck2 end) +module type S = module type of QCheck + +let make version = (module Make (struct let version = version end) : S) diff --git a/src/ppx_deriving_qcheck/ppx_deriving_qcheck.ml b/src/ppx_deriving_qcheck/ppx_deriving_qcheck.ml index 0de8f511..bab03249 100644 --- a/src/ppx_deriving_qcheck/ppx_deriving_qcheck.ml +++ b/src/ppx_deriving_qcheck/ppx_deriving_qcheck.ml @@ -61,14 +61,19 @@ module Env = struct (** [env] contains: - the list of recursive types during the derivation - the list of types to derive (i.e. mutual types) - - the current type to derive *) + - the current type to derive + + It also contains the current version of QCheck we derive *) type env = { + version : [`QCheck | `QCheck2]; rec_types : string list; curr_types : string list; curr_type : string; } let is_rec env x = List.mem x env.rec_types + + let get_version env = env.version end let rec longident_to_str = function @@ -203,8 +208,9 @@ let gen_longident ~loc ~env lg args = Therefore, [is_rec] and [to_gen] are different for variants and polymorphic variants. *) -let gen_sized ~loc (is_rec : 'a -> bool) (to_gen : 'a -> expression) (xs : 'a list) = +let gen_sized ~loc ~env (is_rec : 'a -> bool) (to_gen : 'a -> expression) (xs : 'a list) = let (module A) = Ast_builder.make loc in + let (module G) = G.make (Env.get_version env) in let leaves = List.filter (fun x -> not (is_rec x)) xs |> List.map to_gen in @@ -217,7 +223,7 @@ let gen_sized ~loc (is_rec : 'a -> bool) (to_gen : 'a -> expression) (xs : 'a li G.frequency ~loc (A.elist nodes) else let nodes = List.map to_gen nodes in - let leaves = A.elist leaves |> G.frequency ~loc + let leaves = A.elist leaves |> G.frequency ~loc and nodes = A.elist (leaves @ nodes) |> G.frequency ~loc in [%expr match n with @@ -242,12 +248,12 @@ let gen_sized ~loc (is_rec : 'a -> bool) (to_gen : 'a -> expression) (xs : 'a li let gen = QCheck.Gen.(map (fun (x, y) -> Foo (x, y)) (pair int int)) ]} *) -let gen_tuple ~loc ?(f = fun x -> x) tys = +let gen_tuple ~loc ~env ?(f = fun x -> x) tys = let tuple = Tuple.from_list tys in - let gen = Tuple.to_gen ~loc tuple in + let gen = Tuple.to_gen ~loc ~version:(Env.get_version env) tuple in let expr = Tuple.to_expr ~loc tuple |> f in let pat = Tuple.to_pat ~loc tuple in - G.map ~loc pat expr gen + G.map ~loc ~version:(Env.get_version env) pat expr gen (** [gen_record loc gens ?f label_decls] transforms [gens] and [label_decls] to a record generator. @@ -268,10 +274,10 @@ let gen_tuple ~loc ?(f = fun x -> x) tys = ]} *) -let gen_record ~loc ~gens ?(f = fun x -> x) xs = +let gen_record ~loc ~env ~gens ?(f = fun x -> x) xs = let (module A) = Ast_builder.make loc in let tuple = Tuple.from_list gens in - let gen = Tuple.to_gen ~loc tuple in + let gen = Tuple.to_gen ~loc ~version:(Env.get_version env) tuple in let pat = Tuple.to_pat ~loc tuple in (* TODO: this should be handled in {!Tuple} *) let gens = @@ -289,12 +295,13 @@ let gen_record ~loc ~gens ?(f = fun x -> x) xs = in let expr = A.pexp_record fields None |> f in - G.map ~loc pat expr gen + G.map ~loc ~version:(Env.get_version env) pat expr gen (** {2. Core derivation} *) (** [gen_from_type typ] performs the AST traversal and derivation to qcheck generators *) let rec gen_from_type ~loc ~env typ = + let (module G) = G.make (Env.get_version env) in Option.value (Attributes.gen typ) ~default: (match typ with @@ -311,7 +318,7 @@ let rec gen_from_type ~loc ~env typ = | [%type: [%t? typ] array] -> G.array ~loc (gen_from_type ~loc ~env typ) | { ptyp_desc = Ptyp_tuple typs; _ } -> let tys = List.map (gen_from_type ~loc ~env) typs in - gen_tuple ~loc tys + gen_tuple ~loc ~env tys | { ptyp_desc = Ptyp_constr ({ txt = ty; _ }, args); _ } -> let args = List.map (gen_from_type ~loc ~env) args in gen_longident ~loc ~env ty args @@ -335,19 +342,20 @@ and gen_from_constr ~loc ~env { pcd_name; pcd_args; pcd_attributes; _ } = let gen = match pcd_args with | Pcstr_tuple [] | Pcstr_record [] -> - G.pure ~loc @@ A.econstruct constr_decl None + G.pure ~loc ~version:(Env.get_version env) @@ A.econstruct constr_decl None | Pcstr_tuple xs -> let tys = List.map (gen_from_type ~loc ~env) xs in - gen_tuple ~loc ~f:mk_constr tys + gen_tuple ~loc ~env ~f:mk_constr tys | Pcstr_record xs -> let tys = List.map (fun x -> gen_from_type ~loc ~env x.pld_type) xs in - gen_record ~loc ~f:mk_constr ~gens:tys xs + gen_record ~loc ~env ~f:mk_constr ~gens:tys xs in A.pexp_tuple [ Option.value ~default:[%expr 1] weight; gen ] and gen_from_variant ~loc ~env rws = let (module A) = Ast_builder.make loc in + let (module G) = G.make (Env.get_version env) in let is_rec = is_rec_row_field env in let to_gen (row : row_field) : expression = let w = @@ -356,33 +364,36 @@ and gen_from_variant ~loc ~env rws = let gen = match row.prf_desc with | Rinherit typ -> gen_from_type ~loc ~env typ - | Rtag (label, _, []) -> G.pure ~loc @@ A.pexp_variant label.txt None + | Rtag (label, _, []) -> + G.pure ~loc @@ A.pexp_variant label.txt None | Rtag (label, _, typs) -> let f expr = A.pexp_variant label.txt (Some expr) in - gen_tuple ~loc ~f (List.map (gen_from_type ~loc ~env) typs) + gen_tuple ~loc ~env ~f (List.map (gen_from_type ~loc ~env) typs) in [%expr [%e w], [%e gen]] in - let gen = gen_sized ~loc is_rec to_gen rws in + let gen = gen_sized ~loc ~env is_rec to_gen rws in let typ_t = A.ptyp_constr (A.Located.mk @@ Lident env.curr_type) [] in let typ_gen = A.Located.mk G.ty in let typ = A.ptyp_constr typ_gen [ typ_t ] in [%expr ([%e gen] : [%t typ])] and gen_from_arrow ~loc ~env left right = + let (module Gen) = G.make (Env.get_version env) in + let open Gen.Observable in let rec observable = function - | [%type: unit] -> O.unit loc - | [%type: bool] -> O.bool loc - | [%type: int] -> O.int loc - | [%type: float] -> O.float loc - | [%type: string] -> O.string loc - | [%type: char] -> O.char loc - | [%type: [%t? typ] option] -> O.option ~loc (observable typ) - | [%type: [%t? typ] array] -> O.array ~loc (observable typ) - | [%type: [%t? typ] list] -> O.list ~loc (observable typ) + | [%type: unit] -> unit loc + | [%type: bool] -> bool loc + | [%type: int] -> int loc + | [%type: float] -> float loc + | [%type: string] -> string loc + | [%type: char] -> char loc + | [%type: [%t? typ] option] -> option ~loc (observable typ) + | [%type: [%t? typ] array] -> array ~loc (observable typ) + | [%type: [%t? typ] list] -> list ~loc (observable typ) | { ptyp_desc = Ptyp_tuple xs; _ } -> let obs = List.map observable xs in - Tuple.from_list obs |> Tuple.to_obs ~loc + Tuple.from_list obs |> Tuple.to_obs ~version:(Env.get_version env) ~loc | { ptyp_loc = loc; _ } -> Ppxlib.Location.raise_errorf ~loc "This type is not supported in ppx_deriving_qcheck" @@ -394,12 +405,9 @@ and gen_from_arrow ~loc ~env left right = (res, [%expr [%e obs] @-> [%e xs]]) | x -> (gen_from_type ~loc ~env x, [%expr o_nil]) in - let x, obs = aux right in - (* TODO: export this in qcheck_generators for https://github.com/c-cube/qcheck/issues/190 *) - let arb = [%expr QCheck.make [%e x]] in - [%expr - QCheck.fun_nary QCheck.Tuple.([%e observable left] @-> [%e obs]) [%e arb] - |> QCheck.gen] + let gen, right = aux right in + let left = observable left in + fun_nary ~loc left right gen (** [gen_from_type_declaration loc td] creates a generator from the type declaration. @@ -432,10 +440,10 @@ let gen_from_type_declaration ~loc ~env td = match td.ptype_kind with | Ptype_variant xs -> let is_rec cd = is_rec_constr_decl env cd in - gen_sized ~loc is_rec (gen_from_constr ~loc ~env) xs + gen_sized ~loc ~env is_rec (gen_from_constr ~loc ~env) xs | Ptype_record xs -> let gens = List.map (fun x -> gen_from_type ~loc ~env x.pld_type) xs in - gen_record ~loc ~gens xs + gen_record ~loc ~env ~gens xs | _ -> let typ = Option.get td.ptype_manifest in gen_from_type ~loc ~env typ @@ -455,7 +463,7 @@ let gen_from_type_declaration ~loc ~env td = let gen_sized = name ~sized:true ty |> A.evar in let gen_normal = Args.curry_args ~loc args_pat - (G.sized ~loc (Args.apply_args ~loc args_expr gen_sized)) + (G.sized ~loc ~version:(Env.get_version env) (Args.apply_args ~loc args_expr gen_sized)) in `Recursive ( [%stri let rec [%p pat_gen_sized] = [%e gen]], @@ -484,25 +492,27 @@ let mutually_recursive_gens ~loc gens = let mutual_gens = A.pstr_value Recursive gens in mutual_gens :: normal_gens -(** [derive_gen ~loc xs] creates generators for type declaration in [xs]. *) -let derive_gen ~loc (xs : rec_flag * type_declaration list) : structure = - let open Env in +(** [derive_gen ~version ~loc xs] creates generators for type declaration in [xs]. + + The generator can either be a [QCheck.Gen.t] or a [QCheck2.Gen.t] based on + [version]. *) +let derive_gen ~version ~loc (xs : rec_flag * type_declaration list) : structure = let add_if_rec env typ x = if is_rec_type_decl env typ then - { env with rec_types = x :: env.rec_types} + Env.{ env with rec_types = x :: env.rec_types} else env in match xs with | (_, [ x ]) -> let typ_name = x.ptype_name.txt in - let env = { curr_type = typ_name; rec_types = []; curr_types = [typ_name] } in + let env = Env.{ curr_type = typ_name; rec_types = []; curr_types = [typ_name]; version } in let env = add_if_rec env x typ_name in (match gen_from_type_declaration ~loc ~env x with | `Recursive (gen_sized, gen) -> [gen_sized; gen] | `Normal gen -> [gen]) | _, xs -> let typ_names = List.map (fun x -> x.ptype_name.txt) xs in - let env = { curr_type = ""; rec_types = []; curr_types = typ_names } in + let env = Env.{ curr_type = ""; rec_types = []; curr_types = typ_names; version } in let env = List.fold_left (fun env x -> add_if_rec env x x.ptype_name.txt) @@ -517,10 +527,14 @@ let derive_gen ~loc (xs : rec_flag * type_declaration list) : structure = (** {2. Ppxlib machinery} *) -let create_gen ~ctxt (decls : rec_flag * type_declaration list) : structure = +let create_gen version ~ctxt (decls : rec_flag * type_declaration list) : structure = let loc = Expansion_context.Deriver.derived_item_loc ctxt in - derive_gen ~loc decls + derive_gen ~version ~loc decls + +let gen_expander_qcheck = Deriving.Generator.V2.make_noarg (create_gen `QCheck) + +let gen_expander_qcheck2 = Deriving.Generator.V2.make_noarg (create_gen `QCheck2) -let gen_expander = Deriving.Generator.V2.make_noarg create_gen +let _ = Deriving.add "qcheck" ~str_type_decl:gen_expander_qcheck -let _ = Deriving.add "qcheck" ~str_type_decl:gen_expander +let _ = Deriving.add "qcheck2" ~str_type_decl:gen_expander_qcheck2 diff --git a/src/ppx_deriving_qcheck/ppx_deriving_qcheck.mli b/src/ppx_deriving_qcheck/ppx_deriving_qcheck.mli index 1d2fe7cf..47d566e5 100644 --- a/src/ppx_deriving_qcheck/ppx_deriving_qcheck.mli +++ b/src/ppx_deriving_qcheck/ppx_deriving_qcheck.mli @@ -1,4 +1,11 @@ open Ppxlib -val derive_gen : loc:location -> rec_flag * type_declaration list -> structure -(** [derive_gen loc xs] derives a generator for each type_declaration in [xs] *) +val derive_gen : + version:[`QCheck | `QCheck2] -> + loc:location -> + rec_flag * type_declaration list -> + structure +(** [derive_gen ~version ~loc xs] creates generators for type declaration in [xs]. + + The generator can either be a [QCheck.Gen.t] or a [QCheck2.Gen.t] based on + [version]. *) diff --git a/src/ppx_deriving_qcheck/tuple.ml b/src/ppx_deriving_qcheck/tuple.ml index 89194154..0b5a6e42 100644 --- a/src/ppx_deriving_qcheck/tuple.ml +++ b/src/ppx_deriving_qcheck/tuple.ml @@ -98,12 +98,18 @@ let rec nest ~pair ~triple ~quad = function | Elem a -> a (** [to_gen t] creates a Gen.t with generators' combinators *) -let to_gen ~loc t = - nest ~pair:(G.pair ~loc) ~triple:(G.triple ~loc) ~quad:(G.quad ~loc) t +let to_gen ~loc ~version t = + nest + ~pair:(G.pair ~loc ~version) + ~triple:(G.triple ~loc ~version) + ~quad:(G.quad ~loc ~version) t (** [to_obs t] creates a Obs.t with obsersvables' combinators *) -let to_obs ~loc t = - nest ~pair:(O.pair ~loc) ~triple:(O.triple ~loc) ~quad:(O.quad ~loc) t +let to_obs ~loc ~version t = + nest + ~pair:(O.pair ~loc ~version) + ~triple:(O.triple ~loc ~version) + ~quad:(O.quad ~loc ~version) t let to_pat ~loc t = let fresh_id = From 930f05f2ddb23a81067765abad00fb67c28667aa Mon Sep 17 00:00:00 2001 From: Valentin Chaboche <valentin.chaboche@nomadic-labs.com> Date: Mon, 13 Dec 2021 18:02:28 +0100 Subject: [PATCH 049/391] Duplicate qcheck tests for qcheck2 --- .../deriver/{ => qcheck}/dune | 0 .../deriver/{ => qcheck}/helpers.ml | 0 .../deriver/{ => qcheck}/test_primitives.ml | 0 .../{ => qcheck}/test_qualified_names.ml | 0 .../deriver/{ => qcheck}/test_record.ml | 0 .../deriver/{ => qcheck}/test_recursive.ml | 0 .../deriver/{ => qcheck}/test_textual.ml | 14 +- .../deriver/{ => qcheck}/test_tuple.ml | 0 .../deriver/{ => qcheck}/test_variants.ml | 0 test/ppx_deriving_qcheck/deriver/qcheck2/dune | 11 + .../deriver/qcheck2/helpers.ml | 15 + .../deriver/qcheck2/test_primitives.ml | 89 ++ .../deriver/qcheck2/test_qualified_names.ml | 37 + .../deriver/qcheck2/test_record.ml | 12 + .../deriver/qcheck2/test_recursive.ml | 78 ++ .../deriver/qcheck2/test_textual.ml | 767 ++++++++++++++++++ .../deriver/qcheck2/test_tuple.ml | 23 + .../deriver/qcheck2/test_variants.ml | 81 ++ 18 files changed, 1123 insertions(+), 4 deletions(-) rename test/ppx_deriving_qcheck/deriver/{ => qcheck}/dune (100%) rename test/ppx_deriving_qcheck/deriver/{ => qcheck}/helpers.ml (100%) rename test/ppx_deriving_qcheck/deriver/{ => qcheck}/test_primitives.ml (100%) rename test/ppx_deriving_qcheck/deriver/{ => qcheck}/test_qualified_names.ml (100%) rename test/ppx_deriving_qcheck/deriver/{ => qcheck}/test_record.ml (100%) rename test/ppx_deriving_qcheck/deriver/{ => qcheck}/test_recursive.ml (100%) rename test/ppx_deriving_qcheck/deriver/{ => qcheck}/test_textual.ml (97%) rename test/ppx_deriving_qcheck/deriver/{ => qcheck}/test_tuple.ml (100%) rename test/ppx_deriving_qcheck/deriver/{ => qcheck}/test_variants.ml (100%) create mode 100644 test/ppx_deriving_qcheck/deriver/qcheck2/dune create mode 100644 test/ppx_deriving_qcheck/deriver/qcheck2/helpers.ml create mode 100644 test/ppx_deriving_qcheck/deriver/qcheck2/test_primitives.ml create mode 100644 test/ppx_deriving_qcheck/deriver/qcheck2/test_qualified_names.ml create mode 100644 test/ppx_deriving_qcheck/deriver/qcheck2/test_record.ml create mode 100644 test/ppx_deriving_qcheck/deriver/qcheck2/test_recursive.ml create mode 100644 test/ppx_deriving_qcheck/deriver/qcheck2/test_textual.ml create mode 100644 test/ppx_deriving_qcheck/deriver/qcheck2/test_tuple.ml create mode 100644 test/ppx_deriving_qcheck/deriver/qcheck2/test_variants.ml diff --git a/test/ppx_deriving_qcheck/deriver/dune b/test/ppx_deriving_qcheck/deriver/qcheck/dune similarity index 100% rename from test/ppx_deriving_qcheck/deriver/dune rename to test/ppx_deriving_qcheck/deriver/qcheck/dune diff --git a/test/ppx_deriving_qcheck/deriver/helpers.ml b/test/ppx_deriving_qcheck/deriver/qcheck/helpers.ml similarity index 100% rename from test/ppx_deriving_qcheck/deriver/helpers.ml rename to test/ppx_deriving_qcheck/deriver/qcheck/helpers.ml diff --git a/test/ppx_deriving_qcheck/deriver/test_primitives.ml b/test/ppx_deriving_qcheck/deriver/qcheck/test_primitives.ml similarity index 100% rename from test/ppx_deriving_qcheck/deriver/test_primitives.ml rename to test/ppx_deriving_qcheck/deriver/qcheck/test_primitives.ml diff --git a/test/ppx_deriving_qcheck/deriver/test_qualified_names.ml b/test/ppx_deriving_qcheck/deriver/qcheck/test_qualified_names.ml similarity index 100% rename from test/ppx_deriving_qcheck/deriver/test_qualified_names.ml rename to test/ppx_deriving_qcheck/deriver/qcheck/test_qualified_names.ml diff --git a/test/ppx_deriving_qcheck/deriver/test_record.ml b/test/ppx_deriving_qcheck/deriver/qcheck/test_record.ml similarity index 100% rename from test/ppx_deriving_qcheck/deriver/test_record.ml rename to test/ppx_deriving_qcheck/deriver/qcheck/test_record.ml diff --git a/test/ppx_deriving_qcheck/deriver/test_recursive.ml b/test/ppx_deriving_qcheck/deriver/qcheck/test_recursive.ml similarity index 100% rename from test/ppx_deriving_qcheck/deriver/test_recursive.ml rename to test/ppx_deriving_qcheck/deriver/qcheck/test_recursive.ml diff --git a/test/ppx_deriving_qcheck/deriver/test_textual.ml b/test/ppx_deriving_qcheck/deriver/qcheck/test_textual.ml similarity index 97% rename from test/ppx_deriving_qcheck/deriver/test_textual.ml rename to test/ppx_deriving_qcheck/deriver/qcheck/test_textual.ml index 9d2e6920..308eeb30 100644 --- a/test/ppx_deriving_qcheck/deriver/test_textual.ml +++ b/test/ppx_deriving_qcheck/deriver/qcheck/test_textual.ml @@ -4,7 +4,7 @@ open Ppxlib (** Primitive types tests *) let loc = Location.none -let f = Ppx_deriving_qcheck.derive_gen ~loc +let f = Ppx_deriving_qcheck.derive_gen ~version:`QCheck ~loc let f' xs = List.map f xs |> List.concat @@ -735,10 +735,13 @@ let test_unused_variable () = [(1, (QCheck.Gen.pure A)); (1, (QCheck.Gen.map (fun gen0 -> B gen0) gen_myint))] and gen_myint = QCheck.Gen.nat - ]; + ]; [%stri - let gen_c = QCheck.Gen.sized @@ gen_c_sized + let gen_c = QCheck.Gen.sized gen_c_sized ]; + [%stri let arb_c_sized n = QCheck.make @@ (gen_c_sized n)]; + [%stri let arb_myint = QCheck.make @@ gen_myint]; + [%stri let arb_c = QCheck.make @@ gen_c]; [%stri let rec gen_c_sized _n = QCheck.Gen.frequency @@ -747,8 +750,11 @@ let test_unused_variable () = and gen_myint = QCheck.Gen.nat ]; [%stri - let gen_c = QCheck.Gen.sized @@ gen_c_sized + let gen_c = QCheck.Gen.sized gen_c_sized ]; + [%stri let arb_c_sized _n = QCheck.make @@ (gen_c_sized _n)]; + [%stri let arb_myint = QCheck.make @@ gen_myint]; + [%stri let arb_c = QCheck.make @@ gen_c]; ] in let actual = diff --git a/test/ppx_deriving_qcheck/deriver/test_tuple.ml b/test/ppx_deriving_qcheck/deriver/qcheck/test_tuple.ml similarity index 100% rename from test/ppx_deriving_qcheck/deriver/test_tuple.ml rename to test/ppx_deriving_qcheck/deriver/qcheck/test_tuple.ml diff --git a/test/ppx_deriving_qcheck/deriver/test_variants.ml b/test/ppx_deriving_qcheck/deriver/qcheck/test_variants.ml similarity index 100% rename from test/ppx_deriving_qcheck/deriver/test_variants.ml rename to test/ppx_deriving_qcheck/deriver/qcheck/test_variants.ml diff --git a/test/ppx_deriving_qcheck/deriver/qcheck2/dune b/test/ppx_deriving_qcheck/deriver/qcheck2/dune new file mode 100644 index 00000000..a154c752 --- /dev/null +++ b/test/ppx_deriving_qcheck/deriver/qcheck2/dune @@ -0,0 +1,11 @@ +(tests + (names + test_textual + test_primitives + test_qualified_names + test_recursive + test_tuple + test_variants + test_record) + (libraries qcheck-alcotest ppxlib ppx_deriving_qcheck qcheck) + (preprocess (pps ppxlib.metaquot ppx_deriving_qcheck))) diff --git a/test/ppx_deriving_qcheck/deriver/qcheck2/helpers.ml b/test/ppx_deriving_qcheck/deriver/qcheck2/helpers.ml new file mode 100644 index 00000000..b2f5eabb --- /dev/null +++ b/test/ppx_deriving_qcheck/deriver/qcheck2/helpers.ml @@ -0,0 +1,15 @@ +open QCheck2 + +(** {1. Helpers} *) + +let seed = [| 42 |] + +let generate gen = Gen.generate ~n:20 ~rand:(Random.State.make seed) gen + +(** [test_compare msg eq gen_ref gen_cand] will generate with the same seed + [gen_ref] and [gen_cand], and test with Alcotest that both generators + generates the same values. *) +let test_compare ~msg ~eq gen_ref gen_candidate = + let expected = generate gen_ref in + let actual = generate gen_candidate in + Alcotest.(check (list eq)) msg expected actual diff --git a/test/ppx_deriving_qcheck/deriver/qcheck2/test_primitives.ml b/test/ppx_deriving_qcheck/deriver/qcheck2/test_primitives.ml new file mode 100644 index 00000000..2b6f40c6 --- /dev/null +++ b/test/ppx_deriving_qcheck/deriver/qcheck2/test_primitives.ml @@ -0,0 +1,89 @@ +open QCheck2 +open Helpers + +(** {1. Test primitives derivation} *) + +(** {2. Tests} *) + +type int' = int [@@deriving qcheck2] + +let test_int () = + test_compare ~msg:"Gen.int <=> deriving int" ~eq:Alcotest.int Gen.int gen_int' + +type unit' = unit [@@deriving qcheck2] + +(* Pretty useless though, but, meh *) +let test_unit () = + test_compare ~msg:"Gen.unit <=> deriving unit" ~eq:Alcotest.unit Gen.unit gen_unit' + +type string' = string [@@deriving qcheck2] + +let test_string () = + test_compare ~msg:"Gen.string <=> deriving string" ~eq:Alcotest.string Gen.string gen_string' + +type char' = char [@@deriving qcheck2] + +let test_char () = + test_compare ~msg:"Gen.char <=> deriving char" ~eq:Alcotest.char Gen.char gen_char' + +type bool' = bool [@@deriving qcheck2] + +let test_bool () = + test_compare ~msg:"Gen.bool <=> deriving bool" ~eq:Alcotest.bool Gen.bool gen_bool' + +type float' = float [@@deriving qcheck2] + +let test_float () = + test_compare ~msg:"Gen.float <=> deriving float" ~eq:(Alcotest.float 0.) Gen.float gen_float' + +type int32' = int32 [@@deriving qcheck2] + +let test_int32 () = + test_compare ~msg:"Gen.int32 <=> deriving int32" ~eq:Alcotest.int32 Gen.ui32 gen_int32' + +type int64' = int64 [@@deriving qcheck2] + +let test_int64 () = + test_compare ~msg:"Gen.int64 <=> deriving int64" ~eq:Alcotest.int64 Gen.ui64 gen_int64' + +type 'a option' = 'a option [@@deriving qcheck2] + +let test_option () = + let zero = Gen.pure 0 in + test_compare ~msg:"Gen.opt <=> deriving opt" + ~eq:Alcotest.(option int) + (Gen.opt zero) (gen_option' zero) + +type 'a array' = 'a array [@@deriving qcheck2] + +let test_array () = + let zero = Gen.pure 0 in + test_compare ~msg:"Gen.array <=> deriving array" + ~eq:Alcotest.(array int) + (Gen.array zero) (gen_array' zero) + +type 'a list' = 'a list [@@deriving qcheck2] + +let test_list () = + let zero = Gen.pure 0 in + test_compare ~msg:"Gen.list <=> deriving list" + ~eq:Alcotest.(list int) + (Gen.list zero) (gen_list' zero) + +(** {2. Execute tests} *) + +let () = Alcotest.run "Test_Primitives" + [("Primitives", + Alcotest.[ + test_case "test_int" `Quick test_int; + test_case "test_unit" `Quick test_unit; + test_case "test_string" `Quick test_string; + test_case "test_char" `Quick test_char; + test_case "test_bool" `Quick test_bool; + test_case "test_float" `Quick test_float; + test_case "test_int32" `Quick test_int32; + test_case "test_int64" `Quick test_int64; + test_case "test_option" `Quick test_option; + test_case "test_array" `Quick test_array; + test_case "test_list" `Quick test_list; + ])] diff --git a/test/ppx_deriving_qcheck/deriver/qcheck2/test_qualified_names.ml b/test/ppx_deriving_qcheck/deriver/qcheck2/test_qualified_names.ml new file mode 100644 index 00000000..e9ef4829 --- /dev/null +++ b/test/ppx_deriving_qcheck/deriver/qcheck2/test_qualified_names.ml @@ -0,0 +1,37 @@ +open QCheck2 +open Helpers + +module type S = sig + type t = int + + val gen : int QCheck2.Gen.t +end + +module Q : S = struct + type t = int [@@deriving qcheck2] +end + +module F (X : S) = struct + type t = X.t [@@deriving qcheck2] +end + +module G = F (Q) + +type t = Q.t [@@deriving qcheck2] + +type u = G.t [@@deriving qcheck2] + +let test_module () = + test_compare ~msg:"Gen.int <=> deriving Q.t" ~eq:Alcotest.int Gen.int gen + +let test_functor () = + test_compare ~msg:"Gen.int <=> deriving F.t" ~eq:Alcotest.int Gen.int gen_u + +(** {2. Execute tests} *) + +let () = Alcotest.run "Test_Qualified_names" + [("Qualified names", + Alcotest.[ + test_case "test_module" `Quick test_module; + test_case "test_functor" `Quick test_functor + ])] diff --git a/test/ppx_deriving_qcheck/deriver/qcheck2/test_record.ml b/test/ppx_deriving_qcheck/deriver/qcheck2/test_record.ml new file mode 100644 index 00000000..b11428cc --- /dev/null +++ b/test/ppx_deriving_qcheck/deriver/qcheck2/test_record.ml @@ -0,0 +1,12 @@ +type t = { + rec_types : string list; + curr_types : string list; + curr_type : string + } +[@@deriving qcheck2] + +type color = Color of { red : float; green : float; blue : float } +[@@deriving qcheck2] + +(* TODO: use these types to test generated values inside records. + For now, having these ensure the compilation *) diff --git a/test/ppx_deriving_qcheck/deriver/qcheck2/test_recursive.ml b/test/ppx_deriving_qcheck/deriver/qcheck2/test_recursive.ml new file mode 100644 index 00000000..68fb0ff0 --- /dev/null +++ b/test/ppx_deriving_qcheck/deriver/qcheck2/test_recursive.ml @@ -0,0 +1,78 @@ +open QCheck2 +open Helpers + +type 'a tree = Leaf | Node of 'a * 'a tree * 'a tree +[@@deriving qcheck2] + +let rec pp_tree pp fmt x = + let open Format in + match x with + | Leaf -> + fprintf fmt "Leaf" + | Node (x, l, r) -> + fprintf fmt "Node (%a, %a, %a)" + pp x + (pp_tree pp) l + (pp_tree pp) r + +let eq_tree pp = Alcotest.of_pp (pp_tree pp) + +let gen_tree_ref gen = + let open Gen in + sized @@ fix (fun self -> + function + | 0 -> pure Leaf + | n -> + oneof [ + pure Leaf; + map3 (fun x l r -> Node (x,l,r)) gen (self (n/2)) (self (n/2)); + ]) + +let test_tree_ref () = + let gen = Gen.int in + test_compare ~msg:"gen tree <=> derivation tree" + ~eq:(eq_tree Format.pp_print_int) + (gen_tree_ref gen) (gen_tree gen) + +let test_leaf = + Test.make + ~name:"gen_tree_sized 0 = Node (_, Leaf, Leaf)" + (gen_tree_sized Gen.int 0) + (function + | Leaf -> true + | Node (_, Leaf, Leaf) -> true + | _ -> false) + |> + QCheck_alcotest.to_alcotest + +(* A slight error has been found here: + If the type is named `list` then `'a list` will be derived with the + QCheck generator `list` instead of the `gen_list_sized`. + + This could lead to a design choice: + - do we allow overriding primitive types? + - do we prioritize `Env.curr_types` over primitive types? +*) +type 'a my_list = Cons of 'a * 'a my_list | Nil +[@@deriving qcheck2] + +let rec length = function + | Nil -> 0 + | Cons (_, xs) -> 1 + length xs + +let test_length = + Test.make + ~name:"gen_list_sized n >>= fun l -> length l <= n" + Gen.small_int + (fun n -> + let l = Gen.(generate1 (gen_my_list_sized Gen.int n)) in + length l <= n) + |> + QCheck_alcotest.to_alcotest + +let () = Alcotest.run "Test_Recursive" + [("Recursive", + Alcotest.[ + test_case "test_tree_ref" `Quick test_tree_ref; + test_leaf + ])] diff --git a/test/ppx_deriving_qcheck/deriver/qcheck2/test_textual.ml b/test/ppx_deriving_qcheck/deriver/qcheck2/test_textual.ml new file mode 100644 index 00000000..a4dda303 --- /dev/null +++ b/test/ppx_deriving_qcheck/deriver/qcheck2/test_textual.ml @@ -0,0 +1,767 @@ +(** Module test for ppx_deriving_qcheck *) +open Ppxlib + +(** Primitive types tests *) +let loc = Location.none + +let f = Ppx_deriving_qcheck.derive_gen ~version:`QCheck2 ~loc + +let f' xs = List.map f xs |> List.concat + +let extract stri = + match stri.pstr_desc with Pstr_type (x, y) -> (x, y) | _ -> assert false + +let extract' xs = List.map extract xs + +let check_eq ~expected ~actual name = + let f = Ppxlib.Pprintast.string_of_structure in + Alcotest.(check string) name (f expected) (f actual) + +let test_int () = + let expected = [ [%stri let gen = QCheck2.Gen.int] ] in + + let actual = f @@ extract [%stri type t = int] in + + check_eq ~expected ~actual "deriving int" + +let test_float () = + let expected = [ [%stri let gen = QCheck2.Gen.float] ] in + let actual = f @@ extract [%stri type t = float] in + + check_eq ~expected ~actual "deriving float" + +let test_char () = + let expected = [ [%stri let gen = QCheck2.Gen.char] ] in + let actual = f @@ extract [%stri type t = char] in + + check_eq ~expected ~actual "deriving char" + +let test_string () = + let expected = [ [%stri let gen = QCheck2.Gen.string] ] in + let actual = f @@ extract [%stri type t = string] in + + check_eq ~expected ~actual "deriving string" + +let test_unit () = + let expected = [ [%stri let gen = QCheck2.Gen.unit] ] in + let actual = f @@ extract [%stri type t = unit] in + + check_eq ~expected ~actual "deriving unit" + +let test_bool () = + let expected = [ [%stri let gen = QCheck2.Gen.bool] ] in + let actual = f @@ extract [%stri type t = bool] in + + check_eq ~expected ~actual "deriving bool" + +let test_int32 () = + let expected = [ [%stri let gen = QCheck2.Gen.ui32] ] in + let actual = f @@ extract [%stri type t = int32] in + + check_eq ~expected ~actual "deriving int32" + +let test_int32' () = + let expected = [ [%stri let gen = QCheck2.Gen.ui32] ] in + let actual = f @@ extract [%stri type t = Int32.t] in + + check_eq ~expected ~actual "deriving int32'" + +let test_int64 () = + let expected = [ [%stri let gen = QCheck2.Gen.ui64] ] in + let actual = f @@ extract [%stri type t = int64] in + + check_eq ~expected ~actual "deriving int64" + +let test_int64' () = + let expected = [ [%stri let gen = QCheck2.Gen.ui64] ] in + let actual = f @@ extract [%stri type t = Int64.t] in + + check_eq ~expected ~actual "deriving int64'" + +(* let test_bytes () = + * let expected = + * [ + * [%stri + * let gen = + * QCheck2.map + * (fun n -> Bytes.create n) + * QCheck2.(0 -- Sys.max_string_length)]; + * ] + * in + * let actual = f @@ extract [%stri type t = Bytes.t ] in + * + * check_eq ~expected ~actual "deriving int64" *) + +let test_tuple () = + let actual = + f' + @@ extract' + [ + [%stri type t = int * int]; + [%stri type t = int * int * int]; + [%stri type t = int * int * int * int]; + [%stri type t = int * int * int * int * int]; + [%stri type t = int * int * int * int * int * int]; + ] + in + let expected = + [ + [%stri + let gen = + QCheck2.Gen.map + (fun (gen0, gen1) -> (gen0, gen1)) + (QCheck2.Gen.pair QCheck2.Gen.int QCheck2.Gen.int)]; + [%stri + let gen = + QCheck2.Gen.map + (fun (gen0, gen1, gen2) -> (gen0, gen1, gen2)) + (QCheck2.Gen.triple QCheck2.Gen.int QCheck2.Gen.int QCheck2.Gen.int)]; + [%stri + let gen = + QCheck2.Gen.map + (fun (gen0, gen1, gen2, gen3) -> (gen0, gen1, gen2, gen3)) + (QCheck2.Gen.quad + QCheck2.Gen.int + QCheck2.Gen.int + QCheck2.Gen.int + QCheck2.Gen.int)]; + [%stri + let gen = + QCheck2.Gen.map + (fun ((gen0, gen1), (gen2, gen3, gen4)) -> + (gen0, gen1, gen2, gen3, gen4)) + (QCheck2.Gen.pair + (QCheck2.Gen.pair QCheck2.Gen.int QCheck2.Gen.int) + (QCheck2.Gen.triple QCheck2.Gen.int QCheck2.Gen.int QCheck2.Gen.int))]; + [%stri + let gen = + QCheck2.Gen.map + (fun ((gen0, gen1, gen2), (gen3, gen4, gen5)) -> + (gen0, gen1, gen2, gen3, gen4, gen5)) + (QCheck2.Gen.pair + (QCheck2.Gen.triple QCheck2.Gen.int QCheck2.Gen.int QCheck2.Gen.int) + (QCheck2.Gen.triple QCheck2.Gen.int QCheck2.Gen.int QCheck2.Gen.int))]; + ] + in + + check_eq ~expected ~actual "deriving tuples" + +let test_option () = + let expected = [ [%stri let gen = QCheck2.Gen.opt QCheck2.Gen.int] ] in + let actual = f' @@ extract' [ [%stri type t = int option] ] in + check_eq ~expected ~actual "deriving option" + +let test_array () = + let expected = [ [%stri let gen = QCheck2.Gen.array QCheck2.Gen.int] ] in + let actual = f' @@ extract' [ [%stri type t = int array] ] in + check_eq ~expected ~actual "deriving option" + +let test_list () = + let expected = [ [%stri let gen = QCheck2.Gen.list QCheck2.Gen.string] ] in + + let actual = f' @@ extract' [ [%stri type t = string list] ] in + check_eq ~expected ~actual "deriving list" + +let test_alpha () = + let expected = + [ + [%stri let gen gen_a = gen_a]; + [%stri let gen gen_a = QCheck2.Gen.list gen_a]; + [%stri let gen gen_a = QCheck2.Gen.map (fun gen0 -> A gen0) gen_a]; + [%stri + let gen gen_a gen_b = + QCheck2.Gen.map + (fun (gen0, gen1) -> A (gen0, gen1)) + (QCheck2.Gen.pair gen_a gen_b)]; + [%stri + let gen gen_left gen_right = + QCheck2.Gen.map + (fun (gen0, gen1) -> (gen0, gen1)) + (QCheck2.Gen.pair gen_left gen_right)]; + [%stri + let gen_int_tree = gen_tree QCheck2.Gen.int + ] + ] + in + let actual = + f' + @@ extract' + [ + [%stri type 'a t = 'a]; + [%stri type 'a t = 'a list]; + [%stri type 'a t = A of 'a]; + [%stri type ('a, 'b) t = A of 'a * 'b]; + [%stri type ('left, 'right) t = 'left * 'right]; + [%stri type int_tree = int tree] + ] + in + check_eq ~expected ~actual "deriving alpha" + +let test_equal () = + let expected = + [ + [%stri + let gen = + QCheck2.Gen.frequency + [ + (1, QCheck2.Gen.pure A); + (1, QCheck2.Gen.pure B); + (1, QCheck2.Gen.pure C); + ]]; + [%stri + let gen_t' = + QCheck2.Gen.frequency + [ + (1, QCheck2.Gen.pure A); + (1, QCheck2.Gen.pure B); + (1, QCheck2.Gen.pure C); + ]]; + ] + in + let actual = + f' + @@ extract' + [ [%stri type t = A | B | C]; [%stri type t' = t = A | B | C] ] + in + check_eq ~expected ~actual "deriving equal" + +let test_dependencies () = + let expected = + [ + [%stri + let gen = + QCheck2.Gen.frequency + [ + (1, QCheck2.Gen.map (fun gen0 -> Int gen0) SomeModule.gen); + ( 1, + QCheck2.Gen.map + (fun gen0 -> Float gen0) + SomeModule.SomeOtherModule.gen ); + ]]; + [%stri let gen = gen_something]; + ] + in + let actual = + f' + @@ extract' + [ + [%stri + type t = + | Int of SomeModule.t + | Float of SomeModule.SomeOtherModule.t]; + [%stri type t = (Something.t[@gen gen_something])]; + ] + in + + check_eq ~expected ~actual "deriving dependencies" + +let test_konstr () = + let expected = + [ + [%stri let gen = QCheck2.Gen.map (fun gen0 -> A gen0) QCheck2.Gen.int]; + [%stri + let gen = + QCheck2.Gen.frequency + [ + (1, QCheck2.Gen.map (fun gen0 -> B gen0) QCheck2.Gen.int); + (1, QCheck2.Gen.map (fun gen0 -> C gen0) QCheck2.Gen.int); + ]]; + [%stri + let gen = + QCheck2.Gen.frequency + [ + (1, QCheck2.Gen.map (fun gen0 -> X gen0) gen_t1); + (1, QCheck2.Gen.map (fun gen0 -> Y gen0) gen_t2); + (1, QCheck2.Gen.map (fun gen0 -> Z gen0) QCheck2.Gen.string); + ]]; + [%stri + let gen = + QCheck2.Gen.frequency + [ (1, QCheck2.Gen.pure Left); (1, QCheck2.Gen.pure Right) ]]; + [%stri + let gen = + QCheck2.Gen.frequency + [ + (1, QCheck2.Gen.map (fun gen0 -> Simple gen0) QCheck2.Gen.int); + ( 1, + QCheck2.Gen.map + (fun (gen0, gen1) -> Double (gen0, gen1)) + (QCheck2.Gen.pair QCheck2.Gen.int QCheck2.Gen.int) ); + ( 1, + QCheck2.Gen.map + (fun (gen0, gen1, gen2) -> Triple (gen0, gen1, gen2)) + (QCheck2.Gen.triple + QCheck2.Gen.int + QCheck2.Gen.int + QCheck2.Gen.int) ); + ]]; + ] + in + let actual = + f' + @@ extract' + [ + [%stri type t = A of int]; + [%stri type t = B of int | C of int]; + [%stri type t = X of t1 | Y of t2 | Z of string]; + [%stri type t = Left | Right]; + [%stri + type t = + | Simple of int + | Double of int * int + | Triple of int * int * int]; + ] + in + check_eq ~expected ~actual "deriving constructors" + +let test_record () = + let expected = + [ + [%stri + let gen = + QCheck2.Gen.map + (fun (gen0, gen1) -> { a = gen0; b = gen1 }) + (QCheck2.Gen.pair QCheck2.Gen.int QCheck2.Gen.string)]; + [%stri + let gen = + QCheck2.Gen.map + (fun (gen0, gen1) -> { a = gen0; b = gen1 }) + (QCheck2.Gen.pair QCheck2.Gen.int QCheck2.Gen.string)]; + [%stri + let gen = + QCheck2.Gen.frequency + [ + (1, QCheck2.Gen.map (fun gen0 -> A gen0) gen_t'); + ( 1, + QCheck2.Gen.map + (fun (gen0, gen1) -> B { left = gen0; right = gen1 }) + (QCheck2.Gen.pair QCheck2.Gen.int QCheck2.Gen.int) ); + ]]; + ] + in + let actual = + f' + @@ extract' + [ + [%stri type t = { a : int; b : string }]; + [%stri type t = { mutable a : int; mutable b : string }]; + [%stri type t = A of t' | B of { left : int; right : int }]; + ] + in + check_eq ~expected ~actual "deriving record" + +let test_variant () = + let expected = + [ + [%stri + let gen = + (QCheck2.Gen.frequency + [ + (1, QCheck2.Gen.pure `A); + (1, QCheck2.Gen.map (fun gen0 -> `B gen0) QCheck2.Gen.int); + (1, QCheck2.Gen.map (fun gen0 -> `C gen0) QCheck2.Gen.string); + ] + : t QCheck2.Gen.t)]; + [%stri + let gen_t' = + (QCheck2.Gen.frequency [ (1, QCheck2.Gen.pure `B); (1, gen) ] + : t' QCheck2.Gen.t)]; + ] + in + let actual = + f' + @@ extract' + [ + [%stri type t = [ `A | `B of int | `C of string ]]; + [%stri type t' = [ `B | t ]]; + ] + in + check_eq ~expected ~actual "deriving variant" + +let test_tree () = + let expected = + [ + [%stri + let rec gen_tree_sized gen_a n = + match n with + | 0 -> QCheck2.Gen.pure Leaf + | _ -> + QCheck2.Gen.frequency + [ + (1, QCheck2.Gen.pure Leaf); + ( 1, + QCheck2.Gen.map + (fun (gen0, gen1, gen2) -> Node (gen0, gen1, gen2)) + (QCheck2.Gen.triple + gen_a + ((gen_tree_sized gen_a) (n / 2)) + ((gen_tree_sized gen_a) (n / 2))) ); + ] + ]; + [%stri + let gen_tree gen_a = QCheck2.Gen.sized @@ (gen_tree_sized gen_a) + ]; + ] + in + let actual = + f + @@ extract [%stri type 'a tree = Leaf | Node of 'a * 'a tree * 'a tree]; + in + check_eq ~expected ~actual "deriving tree" + +let test_expr () = + let expected = + [ + [%stri + let rec gen_expr_sized n = + match n with + | 0 -> QCheck2.Gen.map (fun gen0 -> Value gen0) QCheck2.Gen.int + | _ -> + QCheck2.Gen.frequency + [ + ( 1, + QCheck2.Gen.map (fun gen0 -> Value gen0) QCheck2.Gen.int + ); + ( 1, + QCheck2.Gen.map + (fun (gen0, gen1, gen2) -> If (gen0, gen1, gen2)) + (QCheck2.Gen.triple + (gen_expr_sized (n / 2)) + (gen_expr_sized (n / 2)) + (gen_expr_sized (n / 2))) ); + ( 1, + QCheck2.Gen.map + (fun (gen0, gen1) -> Eq (gen0, gen1)) + (QCheck2.Gen.pair (gen_expr_sized (n / 2)) (gen_expr_sized (n / 2))) ); + ( 1, + QCheck2.Gen.map + (fun (gen0, gen1) -> Lt (gen0, gen1)) + (QCheck2.Gen.pair (gen_expr_sized (n / 2)) (gen_expr_sized (n / 2))) ); + ] + ]; + [%stri + let gen_expr = QCheck2.Gen.sized @@ gen_expr_sized + ] + ] + in + let actual = + f @@ extract + [%stri + type expr = + | Value of int + | If of expr * expr * expr + | Eq of expr * expr + | Lt of expr * expr] + in + check_eq ~expected ~actual "deriving expr" + +let test_forest () = + let expected = + [ + [%stri + let rec gen_tree_sized gen_a n = + QCheck2.Gen.map + (fun gen0 -> Node gen0) + (QCheck2.Gen.map + (fun (gen0, gen1) -> (gen0, gen1)) + (QCheck2.Gen.pair gen_a ((gen_forest_sized gen_a) (n / 2)))) + + and gen_forest_sized gen_a n = + match n with + | 0 -> QCheck2.Gen.pure Nil + | _ -> + QCheck2.Gen.frequency + [ + (1, QCheck2.Gen.pure Nil); + ( 1, + QCheck2.Gen.map + (fun gen0 -> Cons gen0) + (QCheck2.Gen.map + (fun (gen0, gen1) -> (gen0, gen1)) + (QCheck2.Gen.pair + ((gen_tree_sized gen_a) (n / 2)) + ((gen_forest_sized gen_a) (n / 2)))) ); + ] + ]; + [%stri let gen_tree gen_a = QCheck2.Gen.sized @@ (gen_tree_sized gen_a)]; + [%stri let gen_forest gen_a = QCheck2.Gen.sized @@ (gen_forest_sized gen_a)]; + ] + in + let actual = + f + @@ extract + [%stri + type 'a tree = Node of ('a * 'a forest) + + and 'a forest = Nil | Cons of ('a tree * 'a forest)] + in + check_eq ~expected ~actual "deriving forest" + +let test_fun_primitives () = + let expected = + [ + [%stri + let gen = + QCheck2.fun_nary + QCheck2.Tuple.( + QCheck2.Observable.int @-> QCheck2.Observable.int @-> o_nil) + QCheck2.Gen.string]; + [%stri + let gen = + QCheck2.fun_nary + QCheck2.Tuple.( + QCheck2.Observable.float @-> QCheck2.Observable.float @-> o_nil) + QCheck2.Gen.string + ]; + [%stri + let gen = + QCheck2.fun_nary + QCheck2.Tuple.( + QCheck2.Observable.string @-> QCheck2.Observable.string @-> o_nil) + QCheck2.Gen.string + ]; + [%stri + let gen = + QCheck2.fun_nary + QCheck2.Tuple.( + QCheck2.Observable.bool @-> QCheck2.Observable.bool @-> o_nil) + QCheck2.Gen.string + ]; + [%stri + let gen = + QCheck2.fun_nary + QCheck2.Tuple.( + QCheck2.Observable.char @-> QCheck2.Observable.char @-> o_nil) + QCheck2.Gen.string + ]; + [%stri + let gen = + QCheck2.fun_nary + QCheck2.Tuple.(QCheck2.Observable.unit @-> o_nil) + QCheck2.Gen.string + ]; + ] + in + + let actual = + f' + @@ extract' + [ + [%stri type t = int -> int -> string]; + [%stri type t = float -> float -> string]; + [%stri type t = string -> string -> string]; + [%stri type t = bool -> bool -> string]; + [%stri type t = char -> char -> string]; + [%stri type t = unit -> string]; + ] + in + check_eq ~expected ~actual "deriving fun primitives" + +let test_fun_n () = + let expected = + [ + [%stri + let gen = + QCheck2.fun_nary + QCheck2.Tuple.( + QCheck2.Observable.bool @-> QCheck2.Observable.int + @-> QCheck2.Observable.float @-> QCheck2.Observable.string + @-> QCheck2.Observable.char @-> o_nil) + QCheck2.Gen.unit + ]; + ] + in + let actual = + f @@ extract [%stri type t = bool -> int -> float -> string -> char -> unit] + in + check_eq ~expected ~actual "deriving fun n" + +let test_fun_option () = + let expected = + [ + [%stri + let gen = + QCheck2.fun_nary + QCheck2.Tuple.( + QCheck2.Observable.option QCheck2.Observable.int @-> o_nil) + QCheck2.Gen.unit + ]; + ] + in + let actual = f @@ extract [%stri type t = int option -> unit] in + check_eq ~expected ~actual "deriving fun option" + +let test_fun_list () = + let expected = + [ + [%stri + let gen = + QCheck2.fun_nary + QCheck2.Tuple.( + QCheck2.Observable.list QCheck2.Observable.int @-> o_nil) + QCheck2.Gen.unit + ]; + ] + in + let actual = f @@ extract [%stri type t = int list -> unit] in + check_eq ~expected ~actual "deriving fun list" + +let test_fun_array () = + let expected = + [ + [%stri + let gen = + QCheck2.fun_nary + QCheck2.Tuple.( + QCheck2.Observable.array QCheck2.Observable.int @-> o_nil) + QCheck2.Gen.unit + ]; + ] + in + let actual = f @@ extract [%stri type t = int array -> unit] in + check_eq ~expected ~actual "deriving fun array" + +let test_fun_tuple () = + let expected = + [ + [%stri + let gen = + QCheck2.fun_nary + QCheck2.Tuple.( + QCheck2.Observable.pair QCheck2.Observable.int QCheck2.Observable.int + @-> o_nil) + QCheck2.Gen.unit + ]; + [%stri + let gen = + QCheck2.fun_nary + QCheck2.Tuple.( + QCheck2.Observable.triple + QCheck2.Observable.int + QCheck2.Observable.int + QCheck2.Observable.int + @-> o_nil) + QCheck2.Gen.unit + ]; + [%stri + let gen = + QCheck2.fun_nary + QCheck2.Tuple.( + QCheck2.Observable.quad + QCheck2.Observable.int + QCheck2.Observable.int + QCheck2.Observable.int + QCheck2.Observable.int + @-> o_nil) + QCheck2.Gen.unit + ]; + ] + in + let actual = + f' + @@ extract' + [ + [%stri type t = int * int -> unit]; + [%stri type t = int * int * int -> unit]; + [%stri type t = int * int * int * int -> unit]; + ] + in + check_eq ~expected ~actual "deriving fun tuple" + +let test_weight_konstrs () = + let expected = + [ + [%stri + let gen = + QCheck2.Gen.frequency + [ + (5, QCheck2.Gen.pure A); + (6, QCheck2.Gen.pure B); + (1, QCheck2.Gen.pure C); + ]]; + ] + in + let actual = + f @@ extract [%stri type t = A [@weight 5] | B [@weight 6] | C] + in + check_eq ~expected ~actual "deriving weight konstrs" + +(* Regression test: https://github.com/c-cube/qcheck/issues/187 *) +let test_recursive_poly_variant () = + let expected = + [ + [%stri + let rec gen_tree_sized gen_a n = + (match n with + | 0 -> QCheck2.Gen.map (fun gen0 -> `Leaf gen0) gen_a + | _ -> + QCheck2.Gen.frequency + [ + ( 1, + QCheck2.Gen.map (fun gen0 -> `Leaf gen0) gen_a + ); + ( 1, + QCheck2.Gen.map + (fun gen0 -> `Node gen0) + (QCheck2.Gen.map + (fun (gen0, gen1) -> (gen0, gen1)) + (QCheck2.Gen.pair + ((gen_tree_sized gen_a) (n / 2)) + ((gen_tree_sized gen_a) (n / 2)))) + ); + ] + : tree QCheck2.Gen.t)]; + [%stri + let gen_tree gen_a = QCheck2.Gen.sized @@ (gen_tree_sized gen_a) + ] + ] + in + let actual = + f @@ extract [%stri type 'a tree = [ `Leaf of 'a | `Node of 'a tree * 'a tree ]] + in + check_eq ~expected ~actual "deriving recursive polymorphic variants" + +let () = + Alcotest.( + run + "ppx_deriving_qcheck tests" + [ + ( "deriving generator good", + [ + test_case "deriving int" `Quick test_int; + test_case "deriving float" `Quick test_float; + test_case "deriving char" `Quick test_char; + test_case "deriving string" `Quick test_string; + test_case "deriving unit" `Quick test_unit; + test_case "deriving bool" `Quick test_bool; + test_case "deriving int32" `Quick test_int32; + test_case "deriving int32'" `Quick test_int32'; + test_case "deriving int64" `Quick test_int64; + test_case "deriving int64'" `Quick test_int64'; + (* test_case "deriving bytes" `Quick test_bytes; *) + test_case "deriving tuple" `Quick test_tuple; + test_case "deriving option" `Quick test_option; + test_case "deriving array" `Quick test_array; + test_case "deriving list" `Quick test_list; + test_case "deriving constructors" `Quick test_konstr; + test_case "deriving dependencies" `Quick test_dependencies; + test_case "deriving record" `Quick test_record; + test_case "deriving equal" `Quick test_equal; + test_case "deriving tree like" `Quick test_tree; + test_case "deriving expr like" `Quick test_expr; + test_case "deriving alpha" `Quick test_alpha; + test_case "deriving variant" `Quick test_variant; + test_case "deriving weight constructors" `Quick test_weight_konstrs; + test_case "deriving forest" `Quick test_forest; + test_case "deriving fun primitives" `Quick test_fun_primitives; + test_case "deriving fun option" `Quick test_fun_option; + test_case "deriving fun array" `Quick test_fun_array; + test_case "deriving fun list" `Quick test_fun_list; + test_case "deriving fun n" `Quick test_fun_n; + test_case "deriving fun tuple" `Quick test_fun_tuple; + test_case + "deriving rec poly variants" + `Quick + test_recursive_poly_variant; + ] ); + ]) diff --git a/test/ppx_deriving_qcheck/deriver/qcheck2/test_tuple.ml b/test/ppx_deriving_qcheck/deriver/qcheck2/test_tuple.ml new file mode 100644 index 00000000..f361ace1 --- /dev/null +++ b/test/ppx_deriving_qcheck/deriver/qcheck2/test_tuple.ml @@ -0,0 +1,23 @@ +type tup2 = int * int +[@@deriving qcheck2] + +type tup3 = int * int * int +[@@deriving qcheck2] + +type tup4 = int * int * int * int +[@@deriving qcheck2] + +type tup5 = int * int * int * int * int +[@@deriving qcheck2] + +type tup6 = int * int * int * int * int * int +[@@deriving qcheck2] + +type tup7 = int * int * int * int * int * int * int +[@@deriving qcheck2] + +type tup8 = int * int * int * int * int * int * int * int +[@@deriving qcheck2] + +(* TODO: use these types to test generated values inside tuples. + For now, having these ensure the compilation *) diff --git a/test/ppx_deriving_qcheck/deriver/qcheck2/test_variants.ml b/test/ppx_deriving_qcheck/deriver/qcheck2/test_variants.ml new file mode 100644 index 00000000..6ae376ca --- /dev/null +++ b/test/ppx_deriving_qcheck/deriver/qcheck2/test_variants.ml @@ -0,0 +1,81 @@ +open QCheck2 +open Helpers + +(** {1. Test variants and polymorphic variants derivation} *) + +(** {2. Variants} *) + +type colors = Red | Green | Blue [@@deriving qcheck2] + +let pp_colors fmt x = + let open Format in + match x with + | Red -> fprintf fmt "Red" + | Green -> fprintf fmt "Green" + | Blue -> fprintf fmt "Blue" + +let eq_colors = Alcotest.of_pp pp_colors + +let gen = Gen.oneofl [Red; Green; Blue] + +let test_variants () = + test_compare ~msg:"Gen.oneofl <=> deriving variants" ~eq:eq_colors gen gen_colors + +type poly_colors = [`Red | `Green | `Blue] [@@deriving qcheck2] + +let pp_poly_colors fmt x = + let open Format in + match x with + | `Red -> fprintf fmt "`Red" + | `Green -> fprintf fmt "`Green" + | `Blue -> fprintf fmt "`Blue" + +let eq_poly_colors = Alcotest.of_pp pp_poly_colors + +let gen_poly : poly_colors Gen.t = Gen.oneofl [`Red; `Green; `Blue] + +let test_poly_variants () = + test_compare ~msg:"Gen.oneofl <=> deriving variants" + ~eq:eq_poly_colors gen_poly gen_poly_colors + +(** {2. Tests weight} *) + +type letters = + | A [@weight 0] + | B +[@@deriving qcheck2] + +let test_weight = + Test.make ~name:"gen_letters always produces B" + gen_letters + (function + | A -> false + | B -> true) + |> + QCheck_alcotest.to_alcotest + +type poly_letters = [ + | `A [@weight 0] + | `B + ] +[@@deriving qcheck2] + +let test_weight_poly = + Test.make ~name:"gen_poly_letters always produces B" + gen_poly_letters + (function + | `A -> false + | `B -> true) + |> + QCheck_alcotest.to_alcotest + +(** {2. Execute tests} *) + +let () = Alcotest.run "Test_Variant" + [("Variants", + Alcotest.[ + test_case "test_variants" `Quick test_variants; + test_case "test_poly_variants" `Quick test_poly_variants; + test_weight; + test_weight_poly + ])] From 3a3e107514ccdcc226d6934762ff7800b78925e9 Mon Sep 17 00:00:00 2001 From: Valentin Chaboche <valentin.chaboche@nomadic-labs.com> Date: Wed, 15 Dec 2021 15:41:38 +0100 Subject: [PATCH 050/391] Create a QCheck arbitrary with derived generator --- .../ppx_deriving_qcheck.ml | 114 +++++++++++++- .../ppx_deriving_qcheck.mli | 13 +- .../deriver/qcheck/helpers.ml | 18 ++- .../deriver/qcheck/test_primitives.ml | 28 ++-- .../deriver/qcheck/test_qualified_names.ml | 5 +- .../deriver/qcheck/test_record.ml | 20 ++- .../deriver/qcheck/test_recursive.ml | 16 +- .../deriver/qcheck/test_textual.ml | 145 ++++++++++++++---- .../deriver/qcheck/test_variants.ml | 16 +- .../deriver/qcheck2/test_textual.ml | 2 +- 10 files changed, 285 insertions(+), 92 deletions(-) diff --git a/src/ppx_deriving_qcheck/ppx_deriving_qcheck.ml b/src/ppx_deriving_qcheck/ppx_deriving_qcheck.ml index bab03249..8c26eef3 100644 --- a/src/ppx_deriving_qcheck/ppx_deriving_qcheck.ml +++ b/src/ppx_deriving_qcheck/ppx_deriving_qcheck.ml @@ -11,8 +11,10 @@ module O = G.Observable {[ module Tree : sig type t - + val gen_sized : int -> t QCheck.Gen.t val gen : t QCheck.Gen.t + val arb_sized : int -> t QCheck.arbitrary + val arb : t QCheck.arbitrary end = struct type t = Leaf | Node of int * t * t [@@deriving qcheck] @@ -34,6 +36,32 @@ let pat ~loc ?sized s = let s = name ?sized s in A.pvar s +(** [name_gen_to_arb name] creates the arb name based on the generator [name] *) +let name_gen_to_arb = function + | "gen" -> "arb" + | name -> + let n = String.length name in + let suffix = String.sub name 3 (n - 3) in + "arb" ^ suffix + +(** [pattern_name pat] tries to find the [pattern] name. *) +let pattern_name pat : string = + let loc = pat.ppat_loc in + match pat.ppat_desc with + | Ppat_var var -> var.txt + | _ -> + Ppxlib.Location.raise_errorf ~loc + "Could not extract name from this pattern" + +(** [args_and_body expr] extracts the args used in [expr] with + the actual body using these args. *) +let rec args_and_body expr : (string list * expression) = + match expr.pexp_desc with + | Pexp_fun (Nolabel, _, pat, expr) -> + let (args, body) = args_and_body expr in + (pattern_name pat :: args, body) + | _ -> ([], expr) + (** {2. Recursive generators} *) (** Recursive generators must be treated separatly: @@ -492,11 +520,11 @@ let mutually_recursive_gens ~loc gens = let mutual_gens = A.pstr_value Recursive gens in mutual_gens :: normal_gens -(** [derive_gen ~version ~loc xs] creates generators for type declaration in [xs]. +(** [derive_gens ~version ~loc xs] creates generators for type declaration in [xs]. - The generator can either be a [QCheck.Gen.t] or a [QCheck2.Gen.t] based on + The generators can either be [QCheck.Gen.t] or [QCheck2.Gen.t] based on [version]. *) -let derive_gen ~version ~loc (xs : rec_flag * type_declaration list) : structure = +let derive_gens ~version ~loc (xs : rec_flag * type_declaration list) : structure = let add_if_rec env typ x = if is_rec_type_decl env typ then Env.{ env with rec_types = x :: env.rec_types} @@ -525,15 +553,85 @@ let derive_gen ~version ~loc (xs : rec_flag * type_declaration list) : structure in mutually_recursive_gens ~loc gens +(** [derive_arb gen] creates an arbitrary declaration based on [gen]. We call + QCheck.make on the derived generator.. + + It fetches the generator name and its parameters. + + e.g. + {[ + type 'a list = Cons of 'a * 'a list | Nil + [@@deriving qcheck] + + (* produces => *) + + let rec gen_list_sized gen_a = + match n with + | ... + + let gen_list_gen_a = QCheck.Gen.sized @@ (gen_list_sized gen_a) + + let arb_list_sized gen_a = QCheck.make @@ (gen_list_sized gen_a) + + let arb_list gen_a = QCheck.make @@ (gen_list gen_a) + ]} +*) +let derive_arb gen = + let loc = gen.pstr_loc in + let (module A) = Ast_builder.make loc in + let (args, body, gen_name) = + match gen with + | [%stri let [%p? pat] = [%e? body]] + | [%stri let rec [%p? pat] = [%e? body]] -> + let (args, body) = args_and_body body in + let gen_name = pattern_name pat in + (args, body, gen_name) + | _ -> assert false + in + let args_pat = List.map A.pvar args in + let args_expr = List.map A.evar args in + + let arb_pat = A.pvar (name_gen_to_arb gen_name) in + let body = + match body with + | [%expr QCheck.sized @@ [%e? _]] -> + A.evar gen_name |> + Args.apply_args ~loc args_expr |> + fun e -> [%expr QCheck.make @@ [%e e]] + | _ -> + A.evar gen_name |> + Args.apply_args ~loc args_expr + in + let body = Args.curry_args ~loc args_pat [%expr QCheck.make @@ [%e body]] in + [%stri let [%p arb_pat] = [%e body]] + +let derive_arbs ~loc xs = + let gens = derive_gens ~loc ~version:`QCheck xs in + (* When generators are mutual, they are nested in a {[ let rec gen = ... and gen .. ]}, + we want an arbitrary for each generator, so, we flatten them in a list. *) + let flatten_gens = + List.fold_right (fun gen acc -> + match gen.pstr_desc with + | Pstr_value (_, vbs) -> + List.map (fun vb -> [%stri let [%p vb.pvb_pat] = [%e vb.pvb_expr]]) vbs @ acc + | _ -> gen :: acc + ) gens [] + in + gens @ List.map derive_arb flatten_gens + (** {2. Ppxlib machinery} *) -let create_gen version ~ctxt (decls : rec_flag * type_declaration list) : structure = +let create_gens version ~ctxt (decls : rec_flag * type_declaration list) : structure = + let loc = Expansion_context.Deriver.derived_item_loc ctxt in + derive_gens ~version ~loc decls + +let create_arbs ~ctxt (decls : rec_flag * type_declaration list) : structure = let loc = Expansion_context.Deriver.derived_item_loc ctxt in - derive_gen ~version ~loc decls + derive_arbs ~loc decls -let gen_expander_qcheck = Deriving.Generator.V2.make_noarg (create_gen `QCheck) +let gen_expander_qcheck = Deriving.Generator.V2.make_noarg create_arbs -let gen_expander_qcheck2 = Deriving.Generator.V2.make_noarg (create_gen `QCheck2) +let gen_expander_qcheck2 = Deriving.Generator.V2.make_noarg (create_gens `QCheck2) let _ = Deriving.add "qcheck" ~str_type_decl:gen_expander_qcheck diff --git a/src/ppx_deriving_qcheck/ppx_deriving_qcheck.mli b/src/ppx_deriving_qcheck/ppx_deriving_qcheck.mli index 47d566e5..09d289f6 100644 --- a/src/ppx_deriving_qcheck/ppx_deriving_qcheck.mli +++ b/src/ppx_deriving_qcheck/ppx_deriving_qcheck.mli @@ -1,11 +1,18 @@ open Ppxlib -val derive_gen : +val derive_gens : version:[`QCheck | `QCheck2] -> loc:location -> rec_flag * type_declaration list -> structure -(** [derive_gen ~version ~loc xs] creates generators for type declaration in [xs]. +(** [derive_gens ~version ~loc xs] creates generators for type declaration in [xs]. - The generator can either be a [QCheck.Gen.t] or a [QCheck2.Gen.t] based on + The generators can either be [QCheck.Gen.t] or [QCheck2.Gen.t] based on [version]. *) + +val derive_arbs : + loc:location -> + rec_flag * type_declaration list -> + structure +(** [derive_arbs ~loc xs] creates generators for type declaration in [xs] and + use these lasts to build [QCheck.arbitrary]. *) diff --git a/test/ppx_deriving_qcheck/deriver/qcheck/helpers.ml b/test/ppx_deriving_qcheck/deriver/qcheck/helpers.ml index 2f93c021..8caf198d 100644 --- a/test/ppx_deriving_qcheck/deriver/qcheck/helpers.ml +++ b/test/ppx_deriving_qcheck/deriver/qcheck/helpers.ml @@ -4,12 +4,14 @@ open QCheck let seed = [| 42 |] -let generate gen = Gen.generate ~n:20 ~rand:(Random.State.make seed) gen - -(** [test_compare msg eq gen_ref gen_cand] will generate with the same seed - [gen_ref] and [gen_cand], and test with Alcotest that both generators - generates the same values. *) -let test_compare ~msg ~eq gen_ref gen_candidate = - let expected = generate gen_ref in - let actual = generate gen_candidate in +let generate arb = + let gen = QCheck.gen arb in + Gen.generate ~n:20 ~rand:(Random.State.make seed) gen + +(** [test_compare msg eq arb_ref arb_cand] will arberate with the same seed + [arb_ref] and [arb_cand], and test with Alcotest that both arberators + arberates the same values. *) +let test_compare ~msg ~eq arb_ref arb_candidate = + let expected = generate arb_ref in + let actual = generate arb_candidate in Alcotest.(check (list eq)) msg expected actual diff --git a/test/ppx_deriving_qcheck/deriver/qcheck/test_primitives.ml b/test/ppx_deriving_qcheck/deriver/qcheck/test_primitives.ml index ffd06bef..79182a0d 100644 --- a/test/ppx_deriving_qcheck/deriver/qcheck/test_primitives.ml +++ b/test/ppx_deriving_qcheck/deriver/qcheck/test_primitives.ml @@ -8,67 +8,67 @@ open Helpers type int' = int [@@deriving qcheck] let test_int () = - test_compare ~msg:"Gen.int <=> deriving int" ~eq:Alcotest.int Gen.int gen_int' + test_compare ~msg:"int <=> deriving int" ~eq:Alcotest.int int arb_int' type unit' = unit [@@deriving qcheck] (* Pretty useless though, but, meh *) let test_unit () = - test_compare ~msg:"Gen.unit <=> deriving unit" ~eq:Alcotest.unit Gen.unit gen_unit' + test_compare ~msg:"unit <=> deriving unit" ~eq:Alcotest.unit unit arb_unit' type string' = string [@@deriving qcheck] let test_string () = - test_compare ~msg:"Gen.string <=> deriving string" ~eq:Alcotest.string Gen.string gen_string' + test_compare ~msg:"string <=> deriving string" ~eq:Alcotest.string string arb_string' type char' = char [@@deriving qcheck] let test_char () = - test_compare ~msg:"Gen.char <=> deriving char" ~eq:Alcotest.char Gen.char gen_char' + test_compare ~msg:"char <=> deriving char" ~eq:Alcotest.char char arb_char' type bool' = bool [@@deriving qcheck] let test_bool () = - test_compare ~msg:"Gen.bool <=> deriving bool" ~eq:Alcotest.bool Gen.bool gen_bool' + test_compare ~msg:"bool <=> deriving bool" ~eq:Alcotest.bool bool arb_bool' type float' = float [@@deriving qcheck] let test_float () = - test_compare ~msg:"Gen.float <=> deriving float" ~eq:(Alcotest.float 0.) Gen.float gen_float' + test_compare ~msg:"float <=> deriving float" ~eq:(Alcotest.float 0.) float arb_float' type int32' = int32 [@@deriving qcheck] let test_int32 () = - test_compare ~msg:"Gen.int32 <=> deriving int32" ~eq:Alcotest.int32 Gen.ui32 gen_int32' + test_compare ~msg:"int32 <=> deriving int32" ~eq:Alcotest.int32 int32 arb_int32' type int64' = int64 [@@deriving qcheck] let test_int64 () = - test_compare ~msg:"Gen.int64 <=> deriving int64" ~eq:Alcotest.int64 Gen.ui64 gen_int64' + test_compare ~msg:"int64 <=> deriving int64" ~eq:Alcotest.int64 int64 arb_int64' type 'a option' = 'a option [@@deriving qcheck] let test_option () = let zero = Gen.pure 0 in - test_compare ~msg:"Gen.option <=> deriving option" + test_compare ~msg:"option <=> deriving opt" ~eq:Alcotest.(option int) - (Gen.option zero) (gen_option' zero) + (option (make zero)) (arb_option' zero) type 'a array' = 'a array [@@deriving qcheck] let test_array () = let zero = Gen.pure 0 in - test_compare ~msg:"Gen.array <=> deriving array" + test_compare ~msg:"array <=> deriving array" ~eq:Alcotest.(array int) - (Gen.array zero) (gen_array' zero) + (array (make zero)) (arb_array' zero) type 'a list' = 'a list [@@deriving qcheck] let test_list () = let zero = Gen.pure 0 in - test_compare ~msg:"Gen.list <=> deriving list" + test_compare ~msg:"list <=> deriving list" ~eq:Alcotest.(list int) - (Gen.list zero) (gen_list' zero) + (list (make zero)) (arb_list' zero) (** {2. Execute tests} *) diff --git a/test/ppx_deriving_qcheck/deriver/qcheck/test_qualified_names.ml b/test/ppx_deriving_qcheck/deriver/qcheck/test_qualified_names.ml index 623bc088..c775a9c9 100644 --- a/test/ppx_deriving_qcheck/deriver/qcheck/test_qualified_names.ml +++ b/test/ppx_deriving_qcheck/deriver/qcheck/test_qualified_names.ml @@ -5,6 +5,7 @@ module type S = sig type t = int val gen : int QCheck.Gen.t + val arb : int QCheck.arbitrary end module Q : S = struct @@ -22,10 +23,10 @@ type t = Q.t [@@deriving qcheck] type u = G.t [@@deriving qcheck] let test_module () = - test_compare ~msg:"Gen.int <=> deriving Q.t" ~eq:Alcotest.int Gen.int gen + test_compare ~msg:"Gen.int <=> deriving Q.t" ~eq:Alcotest.int int arb let test_functor () = - test_compare ~msg:"Gen.int <=> deriving F.t" ~eq:Alcotest.int Gen.int gen_u + test_compare ~msg:"Gen.int <=> deriving F.t" ~eq:Alcotest.int int arb_u (** {2. Execute tests} *) diff --git a/test/ppx_deriving_qcheck/deriver/qcheck/test_record.ml b/test/ppx_deriving_qcheck/deriver/qcheck/test_record.ml index 77b3acd5..1192fee1 100644 --- a/test/ppx_deriving_qcheck/deriver/qcheck/test_record.ml +++ b/test/ppx_deriving_qcheck/deriver/qcheck/test_record.ml @@ -21,15 +21,14 @@ let pp_env fmt {rec_types; curr_types; curr_type} = let eq_env = Alcotest.of_pp pp_env -let gen_env_ref = - let open Gen in - map3 (fun rec_types curr_types curr_type -> +let arb_env_ref = + map (fun (rec_types, curr_types, curr_type) -> { rec_types; curr_types; curr_type }) - (list string) (list string) string + (triple (list string) (list string) string) let test_env () = - test_compare ~msg:"gen_env ref <=> deriving env" - ~eq:eq_env gen_env_ref gen_env + test_compare ~msg:"arb_env ref <=> deriving env" + ~eq:eq_env arb_env_ref arb_env type color = Color of { red : float; green : float; blue : float } [@@deriving qcheck] @@ -47,13 +46,12 @@ let pp_color fmt (Color {red; green; blue}) = let eq_color = Alcotest.of_pp pp_color -let gen_color_ref = - let open Gen in - map3 (fun red green blue -> Color {red; green; blue}) float float float +let arb_color_ref = + map (fun (red, green, blue) -> Color {red; green; blue}) (triple float float float) let test_color () = - test_compare ~msg:"gen_color ref <=> deriving color" - ~eq:eq_color gen_color_ref gen_color + test_compare ~msg:"arb_color ref <=> deriving color" + ~eq:eq_color arb_color_ref arb_color (** {2. Execute tests} *) diff --git a/test/ppx_deriving_qcheck/deriver/qcheck/test_recursive.ml b/test/ppx_deriving_qcheck/deriver/qcheck/test_recursive.ml index af3c759a..68811ca1 100644 --- a/test/ppx_deriving_qcheck/deriver/qcheck/test_recursive.ml +++ b/test/ppx_deriving_qcheck/deriver/qcheck/test_recursive.ml @@ -17,9 +17,9 @@ let rec pp_tree pp fmt x = let eq_tree pp = Alcotest.of_pp (pp_tree pp) -let gen_tree_ref gen = +let arb_tree_ref gen = let open Gen in - sized @@ fix (fun self -> + make @@ sized @@ fix (fun self -> function | 0 -> pure Leaf | n -> @@ -28,18 +28,18 @@ let gen_tree_ref gen = map3 (fun x l r -> Node (x,l,r)) gen (self (n/2)) (self (n/2)); ]) -let gen_tree_candidate = gen_tree +let arb_tree_candidate = arb_tree let test_tree_ref () = let gen = Gen.int in test_compare ~msg:"gen tree <=> derivation tree" ~eq:(eq_tree Format.pp_print_int) - (gen_tree_ref gen) (gen_tree gen) + (arb_tree_ref gen) (arb_tree gen) let test_leaf = Test.make - ~name:"gen_tree_sized 0 = Node (_, Leaf, Leaf)" - (make (gen_tree_sized Gen.int 0)) + ~name:"arb_tree_sized 0 = Node (_, Leaf, Leaf)" + (arb_tree_sized Gen.int 0) (function | Leaf -> true | Node (_, Leaf, Leaf) -> true @@ -49,7 +49,7 @@ let test_leaf = (* A slight error has been found here: If the type is named `list` then `'a list` will be derived with the - QCheck generator `list` instead of the `gen_list_sized`. + QCheck generator `list` instead of the `arb_list_sized`. This could lead to a design choice: - do we allow overriding primitive types? @@ -64,7 +64,7 @@ let rec length = function let test_length = Test.make - ~name:"gen_list_sized n >>= fun l -> length l <= n" + ~name:"arb_list_sized n >>= fun l -> length l <= n" small_int (fun n -> let l = Gen.(generate1 (gen_my_list_sized Gen.int n)) in diff --git a/test/ppx_deriving_qcheck/deriver/qcheck/test_textual.ml b/test/ppx_deriving_qcheck/deriver/qcheck/test_textual.ml index 308eeb30..4103725a 100644 --- a/test/ppx_deriving_qcheck/deriver/qcheck/test_textual.ml +++ b/test/ppx_deriving_qcheck/deriver/qcheck/test_textual.ml @@ -4,7 +4,7 @@ open Ppxlib (** Primitive types tests *) let loc = Location.none -let f = Ppx_deriving_qcheck.derive_gen ~version:`QCheck ~loc +let f = Ppx_deriving_qcheck.derive_arbs ~loc let f' xs = List.map f xs |> List.concat @@ -18,62 +18,91 @@ let check_eq ~expected ~actual name = Alcotest.(check string) name (f expected) (f actual) let test_int () = - let expected = [ [%stri let gen = QCheck.Gen.int] ] in - + let expected = [ + [%stri let gen = QCheck.Gen.int]; + [%stri let arb = QCheck.make @@ gen]; + ] in let actual = f @@ extract [%stri type t = int] in check_eq ~expected ~actual "deriving int" let test_float () = - let expected = [ [%stri let gen = QCheck.Gen.float] ] in + let expected = [ + [%stri let gen = QCheck.Gen.float]; + [%stri let arb = QCheck.make @@ gen]; + ] in let actual = f @@ extract [%stri type t = float] in check_eq ~expected ~actual "deriving float" let test_char () = - let expected = [ [%stri let gen = QCheck.Gen.char] ] in + let expected = [ + [%stri let gen = QCheck.Gen.char]; + [%stri let arb = QCheck.make @@ gen]; + ] in let actual = f @@ extract [%stri type t = char] in check_eq ~expected ~actual "deriving char" let test_string () = - let expected = [ [%stri let gen = QCheck.Gen.string] ] in + let expected = [ + [%stri let gen = QCheck.Gen.string]; + [%stri let arb = QCheck.make @@ gen]; + ] in let actual = f @@ extract [%stri type t = string] in check_eq ~expected ~actual "deriving string" let test_unit () = - let expected = [ [%stri let gen = QCheck.Gen.unit] ] in + let expected = [ + [%stri let gen = QCheck.Gen.unit]; + [%stri let arb = QCheck.make @@ gen]; + ] in let actual = f @@ extract [%stri type t = unit] in check_eq ~expected ~actual "deriving unit" let test_bool () = - let expected = [ [%stri let gen = QCheck.Gen.bool] ] in + let expected = [ + [%stri let gen = QCheck.Gen.bool]; + [%stri let arb = QCheck.make @@ gen]; + ] in let actual = f @@ extract [%stri type t = bool] in check_eq ~expected ~actual "deriving bool" let test_int32 () = - let expected = [ [%stri let gen = QCheck.Gen.ui32] ] in + let expected = [ + [%stri let gen = QCheck.Gen.ui32]; + [%stri let arb = QCheck.make @@ gen]; + ] in let actual = f @@ extract [%stri type t = int32] in check_eq ~expected ~actual "deriving int32" let test_int32' () = - let expected = [ [%stri let gen = QCheck.Gen.ui32] ] in + let expected = [ + [%stri let gen = QCheck.Gen.ui32]; + [%stri let arb = QCheck.make @@ gen]; + ] in let actual = f @@ extract [%stri type t = Int32.t] in check_eq ~expected ~actual "deriving int32'" let test_int64 () = - let expected = [ [%stri let gen = QCheck.Gen.ui64] ] in + let expected = [ + [%stri let gen = QCheck.Gen.ui64]; + [%stri let arb = QCheck.make @@ gen]; + ] in let actual = f @@ extract [%stri type t = int64] in check_eq ~expected ~actual "deriving int64" let test_int64' () = - let expected = [ [%stri let gen = QCheck.Gen.ui64] ] in + let expected = [ + [%stri let gen = QCheck.Gen.ui64]; + [%stri let arb = QCheck.make @@ gen]; + ] in let actual = f @@ extract [%stri type t = Int64.t] in check_eq ~expected ~actual "deriving int64'" @@ -111,11 +140,13 @@ let test_tuple () = QCheck.Gen.map (fun (gen0, gen1) -> (gen0, gen1)) (QCheck.Gen.pair QCheck.Gen.int QCheck.Gen.int)]; + [%stri let arb = QCheck.make @@ gen]; [%stri let gen = QCheck.Gen.map (fun (gen0, gen1, gen2) -> (gen0, gen1, gen2)) (QCheck.Gen.triple QCheck.Gen.int QCheck.Gen.int QCheck.Gen.int)]; + [%stri let arb = QCheck.make @@ gen]; [%stri let gen = QCheck.Gen.map @@ -125,6 +156,7 @@ let test_tuple () = QCheck.Gen.int QCheck.Gen.int QCheck.Gen.int)]; + [%stri let arb = QCheck.make @@ gen]; [%stri let gen = QCheck.Gen.map @@ -133,6 +165,7 @@ let test_tuple () = (QCheck.Gen.pair (QCheck.Gen.pair QCheck.Gen.int QCheck.Gen.int) (QCheck.Gen.triple QCheck.Gen.int QCheck.Gen.int QCheck.Gen.int))]; + [%stri let arb = QCheck.make @@ gen]; [%stri let gen = QCheck.Gen.map @@ -141,24 +174,33 @@ let test_tuple () = (QCheck.Gen.pair (QCheck.Gen.triple QCheck.Gen.int QCheck.Gen.int QCheck.Gen.int) (QCheck.Gen.triple QCheck.Gen.int QCheck.Gen.int QCheck.Gen.int))]; + [%stri let arb = QCheck.make @@ gen]; ] in check_eq ~expected ~actual "deriving tuples" let test_option () = - let expected = [ [%stri let gen = QCheck.Gen.option QCheck.Gen.int] ] in + let expected = [ + [%stri let gen = QCheck.Gen.option QCheck.Gen.int]; + [%stri let arb = QCheck.make @@ gen]; + ] in let actual = f' @@ extract' [ [%stri type t = int option] ] in check_eq ~expected ~actual "deriving option" let test_array () = - let expected = [ [%stri let gen = QCheck.Gen.array QCheck.Gen.int] ] in + let expected = [ + [%stri let gen = QCheck.Gen.array QCheck.Gen.int]; + [%stri let arb = QCheck.make @@ gen]; + ] in let actual = f' @@ extract' [ [%stri type t = int array] ] in check_eq ~expected ~actual "deriving option" let test_list () = - let expected = [ [%stri let gen = QCheck.Gen.list QCheck.Gen.string] ] in - + let expected = [ + [%stri let gen = QCheck.Gen.list QCheck.Gen.string]; + [%stri let arb = QCheck.make @@ gen]; + ] in let actual = f' @@ extract' [ [%stri type t = string list] ] in check_eq ~expected ~actual "deriving list" @@ -166,21 +208,27 @@ let test_alpha () = let expected = [ [%stri let gen gen_a = gen_a]; + [%stri let arb gen_a = QCheck.make @@ (gen gen_a)]; [%stri let gen gen_a = QCheck.Gen.list gen_a]; + [%stri let arb gen_a = QCheck.make @@ (gen gen_a)]; [%stri let gen gen_a = QCheck.Gen.map (fun gen0 -> A gen0) gen_a]; + [%stri let arb gen_a = QCheck.make @@ (gen gen_a)]; [%stri let gen gen_a gen_b = QCheck.Gen.map (fun (gen0, gen1) -> A (gen0, gen1)) (QCheck.Gen.pair gen_a gen_b)]; + [%stri let arb gen_a gen_b = QCheck.make @@ ((gen gen_a) gen_b)]; [%stri let gen gen_left gen_right = QCheck.Gen.map (fun (gen0, gen1) -> (gen0, gen1)) (QCheck.Gen.pair gen_left gen_right)]; + [%stri let arb gen_left gen_right = QCheck.make @@ ((gen gen_left) gen_right)]; [%stri let gen_int_tree = gen_tree QCheck.Gen.int - ] + ]; + [%stri let arb_int_tree = QCheck.make @@ gen_int_tree]; ] in let actual = @@ -207,7 +255,8 @@ let test_equal () = (1, QCheck.Gen.pure A); (1, QCheck.Gen.pure B); (1, QCheck.Gen.pure C); - ]]; + ]]; + [%stri let arb = QCheck.make @@ gen]; [%stri let gen_t' = QCheck.Gen.frequency @@ -215,7 +264,8 @@ let test_equal () = (1, QCheck.Gen.pure A); (1, QCheck.Gen.pure B); (1, QCheck.Gen.pure C); - ]]; + ]]; + [%stri let arb_t' = QCheck.make @@ gen_t']; ] in let actual = @@ -237,8 +287,10 @@ let test_dependencies () = QCheck.Gen.map (fun gen0 -> Float gen0) SomeModule.SomeOtherModule.gen ); - ]]; + ]]; + [%stri let arb = QCheck.make @@ gen]; [%stri let gen = gen_something]; + [%stri let arb = QCheck.make @@ gen]; ] in let actual = @@ -259,13 +311,15 @@ let test_konstr () = let expected = [ [%stri let gen = QCheck.Gen.map (fun gen0 -> A gen0) QCheck.Gen.int]; + [%stri let arb = QCheck.make @@ gen]; [%stri let gen = QCheck.Gen.frequency [ (1, QCheck.Gen.map (fun gen0 -> B gen0) QCheck.Gen.int); (1, QCheck.Gen.map (fun gen0 -> C gen0) QCheck.Gen.int); - ]]; + ]]; + [%stri let arb = QCheck.make @@ gen]; [%stri let gen = QCheck.Gen.frequency @@ -273,11 +327,13 @@ let test_konstr () = (1, QCheck.Gen.map (fun gen0 -> X gen0) gen_t1); (1, QCheck.Gen.map (fun gen0 -> Y gen0) gen_t2); (1, QCheck.Gen.map (fun gen0 -> Z gen0) QCheck.Gen.string); - ]]; + ]]; + [%stri let arb = QCheck.make @@ gen]; [%stri let gen = QCheck.Gen.frequency [ (1, QCheck.Gen.pure Left); (1, QCheck.Gen.pure Right) ]]; + [%stri let arb = QCheck.make @@ gen]; [%stri let gen = QCheck.Gen.frequency @@ -294,7 +350,8 @@ let test_konstr () = QCheck.Gen.int QCheck.Gen.int QCheck.Gen.int) ); - ]]; + ]]; + [%stri let arb = QCheck.make @@ gen]; ] in let actual = @@ -322,11 +379,13 @@ let test_record () = QCheck.Gen.map (fun (gen0, gen1) -> { a = gen0; b = gen1 }) (QCheck.Gen.pair QCheck.Gen.int QCheck.Gen.string)]; + [%stri let arb = QCheck.make @@ gen]; [%stri let gen = QCheck.Gen.map (fun (gen0, gen1) -> { a = gen0; b = gen1 }) (QCheck.Gen.pair QCheck.Gen.int QCheck.Gen.string)]; + [%stri let arb = QCheck.make @@ gen]; [%stri let gen = QCheck.Gen.frequency @@ -336,7 +395,8 @@ let test_record () = QCheck.Gen.map (fun (gen0, gen1) -> B { left = gen0; right = gen1 }) (QCheck.Gen.pair QCheck.Gen.int QCheck.Gen.int) ); - ]]; + ]]; + [%stri let arb = QCheck.make @@ gen]; ] in let actual = @@ -361,11 +421,14 @@ let test_variant () = (1, QCheck.Gen.map (fun gen0 -> `B gen0) QCheck.Gen.int); (1, QCheck.Gen.map (fun gen0 -> `C gen0) QCheck.Gen.string); ] - : t QCheck.Gen.t)]; + : t QCheck.Gen.t)]; + [%stri let arb = QCheck.make @@ gen]; [%stri let gen_t' = (QCheck.Gen.frequency [ (1, QCheck.Gen.pure `B); (1, gen) ] - : t' QCheck.Gen.t)]; + : t' QCheck.Gen.t)]; + [%stri let arb_t' = QCheck.make @@ gen_t']; + ] in let actual = @@ -401,6 +464,8 @@ let test_tree () = [%stri let gen_tree gen_a = QCheck.Gen.sized @@ (gen_tree_sized gen_a) ]; + [%stri let arb_tree_sized gen_a n = QCheck.make @@ ((gen_tree_sized gen_a) n)]; + [%stri let arb_tree gen_a = QCheck.make @@ (gen_tree gen_a)]; ] in let actual = @@ -441,7 +506,9 @@ let test_expr () = ]; [%stri let gen_expr = QCheck.Gen.sized @@ gen_expr_sized - ] + ]; + [%stri let arb_expr_sized n = QCheck.make @@ (gen_expr_sized n)]; + [%stri let arb_expr = QCheck.make @@ gen_expr]; ] in let actual = @@ -485,6 +552,10 @@ let test_forest () = ]; [%stri let gen_tree gen_a = QCheck.Gen.sized @@ (gen_tree_sized gen_a)]; [%stri let gen_forest gen_a = QCheck.Gen.sized @@ (gen_forest_sized gen_a)]; + [%stri let arb_tree_sized gen_a n = QCheck.make @@ ((gen_tree_sized gen_a) n)]; + [%stri let arb_forest_sized gen_a n = QCheck.make @@ ((gen_forest_sized gen_a) n)]; + [%stri let arb_tree gen_a = QCheck.make @@ (gen_tree gen_a)]; + [%stri let arb_forest gen_a = QCheck.make @@ (gen_forest gen_a)]; ] in let actual = @@ -507,6 +578,7 @@ let test_fun_primitives () = QCheck.Observable.int @-> QCheck.Observable.int @-> o_nil) (QCheck.make QCheck.Gen.string) |> QCheck.gen]; + [%stri let arb = QCheck.make @@ gen]; [%stri let gen = QCheck.fun_nary @@ -514,6 +586,7 @@ let test_fun_primitives () = QCheck.Observable.float @-> QCheck.Observable.float @-> o_nil) (QCheck.make QCheck.Gen.string) |> QCheck.gen]; + [%stri let arb = QCheck.make @@ gen]; [%stri let gen = QCheck.fun_nary @@ -521,6 +594,7 @@ let test_fun_primitives () = QCheck.Observable.string @-> QCheck.Observable.string @-> o_nil) (QCheck.make QCheck.Gen.string) |> QCheck.gen]; + [%stri let arb = QCheck.make @@ gen]; [%stri let gen = QCheck.fun_nary @@ -528,6 +602,7 @@ let test_fun_primitives () = QCheck.Observable.bool @-> QCheck.Observable.bool @-> o_nil) (QCheck.make QCheck.Gen.string) |> QCheck.gen]; + [%stri let arb = QCheck.make @@ gen]; [%stri let gen = QCheck.fun_nary @@ -535,12 +610,14 @@ let test_fun_primitives () = QCheck.Observable.char @-> QCheck.Observable.char @-> o_nil) (QCheck.make QCheck.Gen.string) |> QCheck.gen]; + [%stri let arb = QCheck.make @@ gen]; [%stri let gen = QCheck.fun_nary QCheck.Tuple.(QCheck.Observable.unit @-> o_nil) (QCheck.make QCheck.Gen.string) |> QCheck.gen]; + [%stri let arb = QCheck.make @@ gen]; ] in @@ -570,6 +647,7 @@ let test_fun_n () = @-> QCheck.Observable.char @-> o_nil) (QCheck.make QCheck.Gen.unit) |> QCheck.gen]; + [%stri let arb = QCheck.make @@ gen]; ] in let actual = @@ -587,6 +665,7 @@ let test_fun_option () = QCheck.Observable.option QCheck.Observable.int @-> o_nil) (QCheck.make QCheck.Gen.unit) |> QCheck.gen]; + [%stri let arb = QCheck.make @@ gen]; ] in let actual = f @@ extract [%stri type t = int option -> unit] in @@ -602,6 +681,7 @@ let test_fun_list () = QCheck.Observable.list QCheck.Observable.int @-> o_nil) (QCheck.make QCheck.Gen.unit) |> QCheck.gen]; + [%stri let arb = QCheck.make @@ gen]; ] in let actual = f @@ extract [%stri type t = int list -> unit] in @@ -617,6 +697,7 @@ let test_fun_array () = QCheck.Observable.array QCheck.Observable.int @-> o_nil) (QCheck.make QCheck.Gen.unit) |> QCheck.gen]; + [%stri let arb = QCheck.make @@ gen]; ] in let actual = f @@ extract [%stri type t = int array -> unit] in @@ -633,6 +714,7 @@ let test_fun_tuple () = @-> o_nil) (QCheck.make QCheck.Gen.unit) |> QCheck.gen]; + [%stri let arb = QCheck.make @@ gen]; [%stri let gen = QCheck.fun_nary @@ -644,6 +726,7 @@ let test_fun_tuple () = @-> o_nil) (QCheck.make QCheck.Gen.unit) |> QCheck.gen]; + [%stri let arb = QCheck.make @@ gen]; [%stri let gen = QCheck.fun_nary @@ -656,6 +739,7 @@ let test_fun_tuple () = @-> o_nil) (QCheck.make QCheck.Gen.unit) |> QCheck.gen]; + [%stri let arb = QCheck.make @@ gen]; ] in let actual = @@ -679,7 +763,8 @@ let test_weight_konstrs () = (5, QCheck.Gen.pure A); (6, QCheck.Gen.pure B); (1, QCheck.Gen.pure C); - ]]; + ]]; + [%stri let arb = QCheck.make @@ gen]; ] in let actual = @@ -714,7 +799,9 @@ let test_recursive_poly_variant () = : tree QCheck.Gen.t)]; [%stri let gen_tree gen_a = QCheck.Gen.sized @@ (gen_tree_sized gen_a) - ] + ]; + [%stri let arb_tree_sized gen_a n = QCheck.make @@ ((gen_tree_sized gen_a) n)]; + [%stri let arb_tree gen_a = QCheck.make @@ gen_tree gen_a]; ] in let actual = diff --git a/test/ppx_deriving_qcheck/deriver/qcheck/test_variants.ml b/test/ppx_deriving_qcheck/deriver/qcheck/test_variants.ml index 58110fab..978ddaf6 100644 --- a/test/ppx_deriving_qcheck/deriver/qcheck/test_variants.ml +++ b/test/ppx_deriving_qcheck/deriver/qcheck/test_variants.ml @@ -16,10 +16,10 @@ let pp_colors fmt x = let eq_colors = Alcotest.of_pp pp_colors -let gen = Gen.oneofl [Red; Green; Blue] +let arb = oneofl [Red; Green; Blue] let test_variants () = - test_compare ~msg:"Gen.oneofl <=> deriving variants" ~eq:eq_colors gen gen_colors + test_compare ~msg:"Gen.oneofl <=> deriving variants" ~eq:eq_colors arb arb_colors type poly_colors = [`Red | `Green | `Blue] [@@deriving qcheck] @@ -32,11 +32,11 @@ let pp_poly_colors fmt x = let eq_poly_colors = Alcotest.of_pp pp_poly_colors -let gen_poly : poly_colors Gen.t = Gen.oneofl [`Red; `Green; `Blue] +let arb_poly = oneofl [`Red; `Green; `Blue] let test_poly_variants () = test_compare ~msg:"Gen.oneofl <=> deriving variants" - ~eq:eq_poly_colors gen_poly gen_poly_colors + ~eq:eq_poly_colors arb_poly arb_poly_colors (** {2. Tests weight} *) @@ -46,8 +46,8 @@ type letters = [@@deriving qcheck] let test_weight = - Test.make ~name:"gen_letters always produces B" - (make gen_letters) + Test.make ~name:"arb_letters always produces B" + arb_letters (function | A -> false | B -> true) @@ -61,8 +61,8 @@ type poly_letters = [ [@@deriving qcheck] let test_weight_poly = - Test.make ~name:"gen_poly_letters always produces B" - (make gen_poly_letters) + Test.make ~name:"arb_poly_letters always produces B" + arb_poly_letters (function | `A -> false | `B -> true) diff --git a/test/ppx_deriving_qcheck/deriver/qcheck2/test_textual.ml b/test/ppx_deriving_qcheck/deriver/qcheck2/test_textual.ml index a4dda303..1fa76971 100644 --- a/test/ppx_deriving_qcheck/deriver/qcheck2/test_textual.ml +++ b/test/ppx_deriving_qcheck/deriver/qcheck2/test_textual.ml @@ -4,7 +4,7 @@ open Ppxlib (** Primitive types tests *) let loc = Location.none -let f = Ppx_deriving_qcheck.derive_gen ~version:`QCheck2 ~loc +let f = Ppx_deriving_qcheck.derive_gens ~version:`QCheck2 ~loc let f' xs = List.map f xs |> List.concat From b1c8290bc9da4cbcaf87f3239cd6a722478613f2 Mon Sep 17 00:00:00 2001 From: Valentin Chaboche <valentin.chaboche@nomadic-labs.com> Date: Mon, 24 Jan 2022 17:51:30 +0100 Subject: [PATCH 051/391] Factorize generators versions --- src/ppx_deriving_qcheck/QCheck_generators.ml | 182 ++++++++---------- .../deriver/qcheck/test_textual.ml | 10 +- .../deriver/qcheck2/test_textual.ml | 10 +- 3 files changed, 88 insertions(+), 114 deletions(-) diff --git a/src/ppx_deriving_qcheck/QCheck_generators.ml b/src/ppx_deriving_qcheck/QCheck_generators.ml index b150e8fc..48e44cfe 100644 --- a/src/ppx_deriving_qcheck/QCheck_generators.ml +++ b/src/ppx_deriving_qcheck/QCheck_generators.ml @@ -3,171 +3,145 @@ open Ppxlib (** This module contains all generators from QCheck used to derive a type declaration *) +(** {2. Version} *) + +type version = [`QCheck | `QCheck2] + +let to_module : version -> string = function + | `QCheck -> "QCheck" + | `QCheck2 -> "QCheck2" + +let with_prefix loc version prefix x = + let (module A) = Ast_builder.make loc in + A.Located.mk @@ Ldot (Ldot (Lident (to_module version), prefix), x) + |> A.pexp_ident + +let with_prefix_gen loc version x = with_prefix loc version "Gen" x + +let with_prefix_obs loc version x = with_prefix loc version "Observable" x + +let apply1 loc f a = [%expr [%e f] [%e a]] + +let apply2 loc f a b = [%expr [%e f] [%e a] [%e b]] + +let apply3 loc f a b c = [%expr [%e f] [%e a] [%e b] [%e c]] + +let apply4 loc f a b c d = [%expr [%e f] [%e a] [%e b] [%e c] [%e d]] + (** {2. Type} *) -let ty = function - | `QCheck -> Ldot (Ldot (Lident "QCheck", "Gen"), "t") - | `QCheck2 -> Ldot (Ldot (Lident "QCheck2", "Gen"), "t") +let ty version = Ldot (Ldot (Lident (to_module version), "Gen"), "t") (** {2. Primitive generators} *) -let unit loc = function - | `QCheck -> [%expr QCheck.Gen.unit] - | `QCheck2 -> [%expr QCheck2.Gen.unit] +let unit loc version = with_prefix_gen loc version "unit" -let int loc = function - | `QCheck -> [%expr QCheck.Gen.int] - | `QCheck2 -> [%expr QCheck2.Gen.int] +let int loc version = with_prefix_gen loc version "int" -let string loc = function - | `QCheck -> [%expr QCheck.Gen.string] - | `QCheck2 -> [%expr QCheck2.Gen.string] +let string loc version = with_prefix_gen loc version "string" -let char loc = function - | `QCheck -> [%expr QCheck.Gen.char] - | `QCheck2 -> [%expr QCheck2.Gen.char] +let char loc version = with_prefix_gen loc version "char" -let bool loc = function - | `QCheck -> [%expr QCheck.Gen.bool] - | `QCheck2 -> [%expr QCheck2.Gen.bool] +let bool loc version = with_prefix_gen loc version "bool" -let float loc = function - | `QCheck -> [%expr QCheck.Gen.float] - | `QCheck2 -> [%expr QCheck2.Gen.float] +let float loc version = with_prefix_gen loc version "float" -let int32 loc = function - | `QCheck -> [%expr QCheck.Gen.ui32] - | `QCheck2 -> [%expr QCheck2.Gen.ui32] +let int32 loc version = with_prefix_gen loc version "ui32" -let int64 loc = function - | `QCheck -> [%expr QCheck.Gen.ui64] - | `QCheck2 -> [%expr QCheck2.Gen.ui64] +let int64 loc version = with_prefix_gen loc version "ui64" let option ~loc ~version e = - match version with - | `QCheck -> [%expr QCheck.Gen.option [%e e]] - | `QCheck2 -> [%expr QCheck2.Gen.opt [%e e]] + let gen = with_prefix_gen loc version "option" in + apply1 loc gen e let list ~loc ~version e = - match version with - | `QCheck -> [%expr QCheck.Gen.list [%e e]] - | `QCheck2 -> [%expr QCheck2.Gen.list [%e e]] + let gen = with_prefix_gen loc version "list" in + apply1 loc gen e let array ~loc ~version e = - match version with - | `QCheck -> [%expr QCheck.Gen.array [%e e]] - | `QCheck2 -> [%expr QCheck2.Gen.array [%e e]] + let gen = with_prefix_gen loc version "array" in + apply1 loc gen e (** {2. Generator combinators} *) -let pure ~loc ~version x = - match version with - | `QCheck -> [%expr QCheck.Gen.pure [%e x]] - | `QCheck2 -> [%expr QCheck2.Gen.pure [%e x]] +let pure ~loc ~version e = + let gen = with_prefix_gen loc version "pure" in + apply1 loc gen e let frequency ~loc ~version l = match l with | [%expr [([%e? _], [%e? x])]] -> x | _ -> - (match version with - | `QCheck -> [%expr QCheck.Gen.frequency [%e l]] - | `QCheck2 -> [%expr QCheck2.Gen.frequency [%e l]]) + let gen = with_prefix_gen loc version "frequency" in + apply1 loc gen l let map ~loc ~version pat expr gen = - match version with - | `QCheck -> [%expr QCheck.Gen.map (fun [%p pat] -> [%e expr]) [%e gen]] - | `QCheck2 -> [%expr QCheck2.Gen.map (fun [%p pat] -> [%e expr]) [%e gen]] + let f = with_prefix_gen loc version "map" in + apply2 loc f [%expr fun [%p pat] -> [%e expr]] gen let pair ~loc ~version a b = - match version with - | `QCheck -> [%expr QCheck.Gen.pair [%e a] [%e b]] - | `QCheck2 -> [%expr QCheck2.Gen.pair [%e a] [%e b]] + let gen = with_prefix_gen loc version "pair" in + apply2 loc gen a b let triple ~loc ~version a b c = - match version with - | `QCheck -> [%expr QCheck.Gen.triple [%e a] [%e b] [%e c]] - | `QCheck2 -> [%expr QCheck2.Gen.triple [%e a] [%e b] [%e c]] + let gen = with_prefix_gen loc version "triple" in + apply3 loc gen a b c let quad ~loc ~version a b c d = - match version with - | `QCheck -> [%expr QCheck.Gen.quad [%e a] [%e b] [%e c] [%e d]] - | `QCheck2 -> [%expr QCheck2.Gen.quad [%e a] [%e b] [%e c] [%e d]] + let gen = with_prefix_gen loc version "quad" in + apply4 loc gen a b c d let sized ~loc ~version e = - match version with - | `QCheck -> [%expr QCheck.Gen.sized @@ [%e e]] - | `QCheck2 -> [%expr QCheck2.Gen.sized @@ [%e e]] + let gen = with_prefix_gen loc version "sized" in + apply1 loc gen e let fix ~loc ~version e = - match version with - | `QCheck -> [%expr QCheck.Gen.fix [%e e]] - | `QCheck2 -> [%expr QCheck2.Gen.fix [%e e]] + let gen = with_prefix_gen loc version "fix" in + apply1 loc gen e (** Observable generators *) module Observable = struct (** {2. Primitive generators} *) - let unit loc = function - | `QCheck -> [%expr QCheck.Observable.unit] - | `QCheck2 -> [%expr QCheck2.Observable.unit] + let unit loc version = with_prefix_obs loc version "unit" - let int loc = function - | `QCheck -> [%expr QCheck.Observable.int] - | `QCheck2 -> [%expr QCheck2.Observable.int] + let int loc version = with_prefix_obs loc version "int" - let string loc = function - | `QCheck -> [%expr QCheck.Observable.string] - | `QCheck2 -> [%expr QCheck2.Observable.string] + let string loc version = with_prefix_obs loc version "string" - let char loc = function - | `QCheck -> [%expr QCheck.Observable.char] - | `QCheck2 -> [%expr QCheck2.Observable.char] + let char loc version = with_prefix_obs loc version "char" - let bool loc = function - | `QCheck -> [%expr QCheck.Observable.bool] - | `QCheck2 -> [%expr QCheck2.Observable.bool] + let bool loc version = with_prefix_obs loc version "bool" - let float loc = function - | `QCheck -> [%expr QCheck.Observable.float] - | `QCheck2 -> [%expr QCheck2.Observable.float] + let float loc version = with_prefix_obs loc version "float" - let int32 loc = function - | `QCheck -> [%expr QCheck.Observable.int32] - | `QCheck2 -> [%expr QCheck2.Observable.int32] + let int32 loc version = with_prefix_obs loc version "int32" - let int64 loc = function - | `QCheck -> [%expr QCheck.Observable.int64] - | `QCheck2 -> [%expr QCheck2.Observable.int64] + let int64 loc version = with_prefix_obs loc version "int64" let option ~loc ~version e = - match version with - | `QCheck -> [%expr QCheck.Observable.option [%e e]] - | `QCheck2 -> [%expr QCheck2.Observable.option [%e e]] + let obs = with_prefix_obs loc version "option" in + apply1 loc obs e let list ~loc ~version e = - match version with - | `QCheck -> [%expr QCheck.Observable.list [%e e]] - | `QCheck2 -> [%expr QCheck2.Observable.list [%e e]] + let obs = with_prefix_obs loc version "list" in + apply1 loc obs e let array ~loc ~version e = - match version with - | `QCheck -> [%expr QCheck.Observable.array [%e e]] - | `QCheck2 -> [%expr QCheck2.Observable.array [%e e]] + let obs = with_prefix_obs loc version "array" in + apply1 loc obs e (** {2. Observable combinators} *) let pair ~loc ~version a b = - match version with - | `QCheck -> [%expr QCheck.Observable.pair [%e a] [%e b]] - | `QCheck2 -> [%expr QCheck2.Observable.pair [%e a] [%e b]] + let obs = with_prefix_obs loc version "pair" in + apply2 loc obs a b let triple ~loc ~version a b c = - match version with - | `QCheck -> [%expr QCheck.Observable.triple [%e a] [%e b] [%e c]] - | `QCheck2 -> [%expr QCheck2.Observable.triple [%e a] [%e b] [%e c]] + let obs = with_prefix_obs loc version "triple" in + apply3 loc obs a b c let quad ~loc ~version a b c d = - match version with - | `QCheck -> [%expr QCheck.Observable.quad [%e a] [%e b] [%e c] [%e d]] - | `QCheck2 -> [%expr QCheck2.Observable.quad [%e a] [%e b] [%e c] [%e d]] + let obs = with_prefix_obs loc version "quad" in + apply4 loc obs a b c d let fun_nary ~loc ~version left right gen = match version with @@ -178,7 +152,7 @@ module Observable = struct [%expr QCheck2.fun_nary QCheck2.Tuple.([%e left] @-> [%e right]) [%e gen]] end -module Make (Version : sig val version : [`QCheck | `QCheck2] end) = struct +module Make (Version : sig val version : version end) = struct let version = Version.version let ty = ty version let unit loc = unit loc version diff --git a/test/ppx_deriving_qcheck/deriver/qcheck/test_textual.ml b/test/ppx_deriving_qcheck/deriver/qcheck/test_textual.ml index 4103725a..f30bedce 100644 --- a/test/ppx_deriving_qcheck/deriver/qcheck/test_textual.ml +++ b/test/ppx_deriving_qcheck/deriver/qcheck/test_textual.ml @@ -462,7 +462,7 @@ let test_tree () = ] ]; [%stri - let gen_tree gen_a = QCheck.Gen.sized @@ (gen_tree_sized gen_a) + let gen_tree gen_a = QCheck.Gen.sized (gen_tree_sized gen_a) ]; [%stri let arb_tree_sized gen_a n = QCheck.make @@ ((gen_tree_sized gen_a) n)]; [%stri let arb_tree gen_a = QCheck.make @@ (gen_tree gen_a)]; @@ -505,7 +505,7 @@ let test_expr () = ] ]; [%stri - let gen_expr = QCheck.Gen.sized @@ gen_expr_sized + let gen_expr = QCheck.Gen.sized gen_expr_sized ]; [%stri let arb_expr_sized n = QCheck.make @@ (gen_expr_sized n)]; [%stri let arb_expr = QCheck.make @@ gen_expr]; @@ -550,8 +550,8 @@ let test_forest () = ((gen_forest_sized gen_a) (n / 2)))) ); ] ]; - [%stri let gen_tree gen_a = QCheck.Gen.sized @@ (gen_tree_sized gen_a)]; - [%stri let gen_forest gen_a = QCheck.Gen.sized @@ (gen_forest_sized gen_a)]; + [%stri let gen_tree gen_a = QCheck.Gen.sized (gen_tree_sized gen_a)]; + [%stri let gen_forest gen_a = QCheck.Gen.sized (gen_forest_sized gen_a)]; [%stri let arb_tree_sized gen_a n = QCheck.make @@ ((gen_tree_sized gen_a) n)]; [%stri let arb_forest_sized gen_a n = QCheck.make @@ ((gen_forest_sized gen_a) n)]; [%stri let arb_tree gen_a = QCheck.make @@ (gen_tree gen_a)]; @@ -798,7 +798,7 @@ let test_recursive_poly_variant () = ] : tree QCheck.Gen.t)]; [%stri - let gen_tree gen_a = QCheck.Gen.sized @@ (gen_tree_sized gen_a) + let gen_tree gen_a = QCheck.Gen.sized (gen_tree_sized gen_a) ]; [%stri let arb_tree_sized gen_a n = QCheck.make @@ ((gen_tree_sized gen_a) n)]; [%stri let arb_tree gen_a = QCheck.make @@ gen_tree gen_a]; diff --git a/test/ppx_deriving_qcheck/deriver/qcheck2/test_textual.ml b/test/ppx_deriving_qcheck/deriver/qcheck2/test_textual.ml index 1fa76971..092519ab 100644 --- a/test/ppx_deriving_qcheck/deriver/qcheck2/test_textual.ml +++ b/test/ppx_deriving_qcheck/deriver/qcheck2/test_textual.ml @@ -399,7 +399,7 @@ let test_tree () = ] ]; [%stri - let gen_tree gen_a = QCheck2.Gen.sized @@ (gen_tree_sized gen_a) + let gen_tree gen_a = QCheck2.Gen.sized (gen_tree_sized gen_a) ]; ] in @@ -440,7 +440,7 @@ let test_expr () = ] ]; [%stri - let gen_expr = QCheck2.Gen.sized @@ gen_expr_sized + let gen_expr = QCheck2.Gen.sized gen_expr_sized ] ] in @@ -483,8 +483,8 @@ let test_forest () = ((gen_forest_sized gen_a) (n / 2)))) ); ] ]; - [%stri let gen_tree gen_a = QCheck2.Gen.sized @@ (gen_tree_sized gen_a)]; - [%stri let gen_forest gen_a = QCheck2.Gen.sized @@ (gen_forest_sized gen_a)]; + [%stri let gen_tree gen_a = QCheck2.Gen.sized (gen_tree_sized gen_a)]; + [%stri let gen_forest gen_a = QCheck2.Gen.sized (gen_forest_sized gen_a)]; ] in let actual = @@ -712,7 +712,7 @@ let test_recursive_poly_variant () = ] : tree QCheck2.Gen.t)]; [%stri - let gen_tree gen_a = QCheck2.Gen.sized @@ (gen_tree_sized gen_a) + let gen_tree gen_a = QCheck2.Gen.sized (gen_tree_sized gen_a) ] ] in From c2867abb56eb18ad9a1392aa14573f0f31bf4daa Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 6 Jul 2022 18:29:40 +0100 Subject: [PATCH 052/391] rewrite unit tests to disregard shrink count --- test/core/QCheck2_unit_tests.ml | 41 +++++++++++++++++++++---------- test/core/QCheck_unit_tests.ml | 43 ++++++++++++++++++++++----------- 2 files changed, 57 insertions(+), 27 deletions(-) diff --git a/test/core/QCheck2_unit_tests.ml b/test/core/QCheck2_unit_tests.ml index 6624fdd6..8328926b 100644 --- a/test/core/QCheck2_unit_tests.ml +++ b/test/core/QCheck2_unit_tests.ml @@ -237,29 +237,44 @@ module Check_exn = struct let test_fail_always () = let name = "will-always-fail" in - let counterex_str = "0 (after 2 shrink steps)" in - let run_test () = - check_exn QCheck2.(Test.make ~name ~print:Print.int Gen.int (fun _ -> false)) in - Alcotest.check_raises "Fail" (Test.Test_fail (name,[counterex_str])) run_test + try + check_exn QCheck2.(Test.make ~name ~print:Print.int Gen.int (fun _ -> false)); + Alcotest.failf "%s: Unexpected success" name + with + (Test.Test_fail (n,[c_ex_str])) -> + Alcotest.(check string) (Printf.sprintf "%s: name" name) n name; + if not (Stdlib.String.starts_with ~prefix:"0" c_ex_str) + then + Alcotest.failf "%s: counter-example prefix. Received: \"%s\"" name c_ex_str let test_fail_random () = let name = "list is own reverse" in - let counterex_str = "[0; 1] (after 64 shrink steps)" in - let run_test () = + try check_exn QCheck2.(Test.make ~name ~print:Print.(list int) - Gen.(list int) (fun l -> List.rev l = l)) in - Alcotest.check_raises "Fail" (Test.Test_fail (name,[counterex_str])) run_test + Gen.(list int) (fun l -> List.rev l = l)); + Alcotest.failf "%s: Unexpected success" name + with + (Test.Test_fail (n,[c_ex_str])) -> + Alcotest.(check string) (Printf.sprintf "%s: name" name) n name; + if not (Stdlib.String.starts_with ~prefix:"[0; 1]" c_ex_str) + then + Alcotest.failf "%s: counter-example prefix. Received \"%s\"" name c_ex_str exception MyError let test_error () = let name = "will-always-error" in - let counterex_str = "0 (after 2 shrink steps)" in - let run_test () = - let () = Printexc.record_backtrace false in (* for easier pattern-matching below *) - check_exn QCheck2.(Test.make ~name ~print:Print.int Gen.int (fun _ -> raise MyError)) in - Alcotest.check_raises "MyError" (Test.Test_error (name,counterex_str,MyError,"")) run_test + try + Printexc.record_backtrace false; (* for easier pattern-matching below *) + check_exn QCheck2.(Test.make ~name ~print:Print.int Gen.int (fun _ -> raise MyError)); + Alcotest.failf "%s: Unexpected success" name + with + (Test.Test_error (n,c_ex_str,MyError,"")) -> + Alcotest.(check string) (Printf.sprintf "%s: name" name) n name; + if not (Stdlib.String.starts_with ~prefix:"0" c_ex_str) + then + Alcotest.failf "%s: counter-example prefix. Received \"%s\"" name c_ex_str let tests = ("Test.check_exn", Alcotest.[ diff --git a/test/core/QCheck_unit_tests.ml b/test/core/QCheck_unit_tests.ml index 1e648ff4..9c150f35 100644 --- a/test/core/QCheck_unit_tests.ml +++ b/test/core/QCheck_unit_tests.ml @@ -106,28 +106,43 @@ module Check_exn = struct let test_fail_always () = let name = "will-always-fail" in - let counterex_str = "0 (after 63 shrink steps)" in - let run_test () = - check_exn QCheck.(Test.make ~name int (fun _ -> false)) in - Alcotest.check_raises "Fail" (Test.Test_fail (name,[counterex_str])) run_test + try + check_exn QCheck.(Test.make ~name int (fun _ -> false)); + Alcotest.failf "%s: Unexpected success" name + with + (Test.Test_fail (n,[c_ex_str])) -> + Alcotest.(check string) (Printf.sprintf "%s: name" name) n name; + if not (Stdlib.String.starts_with ~prefix:"0" c_ex_str) + then + Alcotest.failf "%s: counter-example prefix. Received \"%s\"" name c_ex_str let test_fail_random () = let name = "list is own reverse" in - let counterex_str = "[0; 1] (after 123 shrink steps)" in - let run_test () = - check_exn - QCheck.(Test.make ~name (list int) (fun l -> List.rev l = l)) in - Alcotest.check_raises "Fail" (Test.Test_fail (name,[counterex_str])) run_test + try + check_exn QCheck.(Test.make ~name (list int) (fun l -> List.rev l = l)); + Alcotest.failf "%s: Unexpected success" name + with + (Test.Test_fail (n,[c_ex_str])) -> + Alcotest.(check string) (Printf.sprintf "%s: name" name) n name; + if not (Stdlib.String.starts_with ~prefix:"[0; 1]" c_ex_str + || Stdlib.String.starts_with ~prefix:"[0; -1]" c_ex_str) + then + Alcotest.failf "%s: counter-example prefix. Received \"%s\"" name c_ex_str exception MyError let test_error () = let name = "will-always-error" in - let counterex_str = "0 (after 63 shrink steps)" in - let run_test () = - let () = Printexc.record_backtrace false in (* for easier pattern-matching below *) - check_exn QCheck.(Test.make ~name int (fun _ -> raise MyError)) in - Alcotest.check_raises "MyError" (Test.Test_error (name,counterex_str,MyError,"")) run_test + try + Printexc.record_backtrace false; (* for easier pattern-matching below *) + check_exn QCheck.(Test.make ~name int (fun _ -> raise MyError)); + Alcotest.failf "%s: Unexpected success" name + with + (Test.Test_error (n,c_ex_str,MyError,"")) -> + Alcotest.(check string) (Printf.sprintf "%s: name" name) n name; + if not (Stdlib.String.starts_with ~prefix:"0" c_ex_str) + then + Alcotest.failf "%s: counter-example prefix. Received \"%s\"" name c_ex_str let tests = ("Test.check_exn", Alcotest.[ From 566d3e1ffb5d02325fb5788a9e15534fd3a3b9dd Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 6 Jul 2022 18:43:23 +0100 Subject: [PATCH 053/391] use backport of String.starts_with --- test/core/QCheck2_unit_tests.ml | 14 +++++++++++--- test/core/QCheck_unit_tests.ml | 15 +++++++++++---- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/test/core/QCheck2_unit_tests.ml b/test/core/QCheck2_unit_tests.ml index 8328926b..36b8d8f9 100644 --- a/test/core/QCheck2_unit_tests.ml +++ b/test/core/QCheck2_unit_tests.ml @@ -224,6 +224,14 @@ end module Check_exn = struct + (* String.starts_with was introduced in 4.13. + Include the below to support pre-4.13 OCaml. *) + let string_starts_with ~prefix s = + let open Stdlib in + let prefix_len = String.length prefix in + prefix_len <= String.length s + && prefix = String.sub s 0 prefix_len + let check_exn = Test.check_exn let test_pass_trivial () = @@ -243,7 +251,7 @@ module Check_exn = struct with (Test.Test_fail (n,[c_ex_str])) -> Alcotest.(check string) (Printf.sprintf "%s: name" name) n name; - if not (Stdlib.String.starts_with ~prefix:"0" c_ex_str) + if not (string_starts_with ~prefix:"0" c_ex_str) then Alcotest.failf "%s: counter-example prefix. Received: \"%s\"" name c_ex_str @@ -257,7 +265,7 @@ module Check_exn = struct with (Test.Test_fail (n,[c_ex_str])) -> Alcotest.(check string) (Printf.sprintf "%s: name" name) n name; - if not (Stdlib.String.starts_with ~prefix:"[0; 1]" c_ex_str) + if not (string_starts_with ~prefix:"[0; 1]" c_ex_str) then Alcotest.failf "%s: counter-example prefix. Received \"%s\"" name c_ex_str @@ -272,7 +280,7 @@ module Check_exn = struct with (Test.Test_error (n,c_ex_str,MyError,"")) -> Alcotest.(check string) (Printf.sprintf "%s: name" name) n name; - if not (Stdlib.String.starts_with ~prefix:"0" c_ex_str) + if not (string_starts_with ~prefix:"0" c_ex_str) then Alcotest.failf "%s: counter-example prefix. Received \"%s\"" name c_ex_str diff --git a/test/core/QCheck_unit_tests.ml b/test/core/QCheck_unit_tests.ml index 9c150f35..c0d64011 100644 --- a/test/core/QCheck_unit_tests.ml +++ b/test/core/QCheck_unit_tests.ml @@ -93,6 +93,13 @@ end module Check_exn = struct + (* String.starts_with was introduced in 4.13. + Include the below to support pre-4.13 OCaml. *) + let string_starts_with ~prefix s = + let prefix_len = String.length prefix in + prefix_len <= String.length s + && prefix = String.sub s 0 prefix_len + let check_exn = Test.check_exn let test_pass_trivial () = @@ -112,7 +119,7 @@ module Check_exn = struct with (Test.Test_fail (n,[c_ex_str])) -> Alcotest.(check string) (Printf.sprintf "%s: name" name) n name; - if not (Stdlib.String.starts_with ~prefix:"0" c_ex_str) + if not (string_starts_with ~prefix:"0" c_ex_str) then Alcotest.failf "%s: counter-example prefix. Received \"%s\"" name c_ex_str @@ -124,8 +131,8 @@ module Check_exn = struct with (Test.Test_fail (n,[c_ex_str])) -> Alcotest.(check string) (Printf.sprintf "%s: name" name) n name; - if not (Stdlib.String.starts_with ~prefix:"[0; 1]" c_ex_str - || Stdlib.String.starts_with ~prefix:"[0; -1]" c_ex_str) + if not (string_starts_with ~prefix:"[0; 1]" c_ex_str + || string_starts_with ~prefix:"[0; -1]" c_ex_str) then Alcotest.failf "%s: counter-example prefix. Received \"%s\"" name c_ex_str @@ -140,7 +147,7 @@ module Check_exn = struct with (Test.Test_error (n,c_ex_str,MyError,"")) -> Alcotest.(check string) (Printf.sprintf "%s: name" name) n name; - if not (Stdlib.String.starts_with ~prefix:"0" c_ex_str) + if not (string_starts_with ~prefix:"0" c_ex_str) then Alcotest.failf "%s: counter-example prefix. Received \"%s\"" name c_ex_str From 40882df416c885181791472f2a38367909439128 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 6 Jul 2022 18:46:27 +0100 Subject: [PATCH 054/391] update alcotest expect test --- example/alcotest/dune | 15 +++- example/alcotest/output.txt.expected.32 | 80 +++++++++++++++++++ ...ut.txt.expected => output.txt.expected.64} | 0 3 files changed, 91 insertions(+), 4 deletions(-) create mode 100644 example/alcotest/output.txt.expected.32 rename example/alcotest/{output.txt.expected => output.txt.expected.64} (100%) diff --git a/example/alcotest/dune b/example/alcotest/dune index aebb720f..352a7285 100644 --- a/example/alcotest/dune +++ b/example/alcotest/dune @@ -1,3 +1,6 @@ +(* -*- tuareg -*- *) + +let dune = Printf.sprintf {| (executable (name QCheck_alcotest_test) @@ -6,18 +9,22 @@ (rule (targets output.txt) (deps ./QCheck_alcotest_test.exe) - (enabled_if (= %{os_type} "Unix")) + (enabled_if (= %%{os_type} "Unix")) (action (with-accepted-exit-codes 1 (setenv QCHECK_SEED 1234 (with-stdout-to - %{targets} + %%{targets} (run ./run_alcotest.sh --color=never)))))) (rule (alias runtest) (package qcheck-alcotest) - (enabled_if (= %{os_type} "Unix")) - (action (diff output.txt.expected output.txt))) + (enabled_if (= %%{os_type} "Unix")) + (action (diff output.txt.expected.%i output.txt))) + +|} Sys.word_size + +let () = Jbuild_plugin.V1.send dune diff --git a/example/alcotest/output.txt.expected.32 b/example/alcotest/output.txt.expected.32 new file mode 100644 index 00000000..634312ae --- /dev/null +++ b/example/alcotest/output.txt.expected.32 @@ -0,0 +1,80 @@ +qcheck random seed: 1234 +Testing `my test'. + [OK] suite 0 list_rev_is_involutive. + [FAIL] suite 1 fail_sort_id. + [FAIL] suite 2 error_raise_exn. + [OK] suite 3 neg test pass (failing as expected). + [FAIL] suite 4 neg test unexpected success. + [FAIL] suite 5 neg fail with error. + [FAIL] suite 6 fail_check_err_message. + [OK] suite 7 tree_rev_is_involutive. + [FAIL] shrinking 0 debug_shrink. +┌──────────────────────────────────────────────────────────────────────────────┐ +│ [FAIL] suite 1 fail_sort_id. │ +└──────────────────────────────────────────────────────────────────────────────┘ +test `fail_sort_id` failed on ≥ 1 cases: [1; 0] (after 11 shrink steps) +[exception] test `fail_sort_id` failed on ≥ 1 cases: [1; 0] (after 11 shrink steps) + ────────────────────────────────────────────────────────────────────────────── +┌──────────────────────────────────────────────────────────────────────────────┐ +│ [FAIL] suite 2 error_raise_exn. │ +└──────────────────────────────────────────────────────────────────────────────┘ +test `error_raise_exn` +raised exception `Error` +on `0 (after 31 shrink steps)` +[exception] test `error_raise_exn` +raised exception `Error` +on `0 (after 31 shrink steps)` + ────────────────────────────────────────────────────────────────────────────── +┌──────────────────────────────────────────────────────────────────────────────┐ +│ [FAIL] suite 4 neg test unexpected success. │ +└──────────────────────────────────────────────────────────────────────────────┘ +negative test 'neg test unexpected success' succeeded unexpectedly +ASSERT negative test 'neg test unexpected success' succeeded unexpectedly +FAIL negative test 'neg test unexpected success' succeeded unexpectedly + ────────────────────────────────────────────────────────────────────────────── +┌──────────────────────────────────────────────────────────────────────────────┐ +│ [FAIL] suite 5 neg fail with error. │ +└──────────────────────────────────────────────────────────────────────────────┘ +test `neg fail with error` +raised exception `Error` +on `0 (after 7 shrink steps)` +[exception] test `neg fail with error` +raised exception `Error` +on `0 (after 7 shrink steps)` + ────────────────────────────────────────────────────────────────────────────── +┌──────────────────────────────────────────────────────────────────────────────┐ +│ [FAIL] suite 6 fail_check_err_message. │ +└──────────────────────────────────────────────────────────────────────────────┘ +test `fail_check_err_message` failed on ≥ 1 cases: +0 (after 7 shrink steps) +this +will +always +fail +[exception] test `fail_check_err_message` failed on ≥ 1 cases: +0 (after 7 shrink steps) +this +will +always +fail + ────────────────────────────────────────────────────────────────────────────── +┌──────────────────────────────────────────────────────────────────────────────┐ +│ [FAIL] shrinking 0 debug_shrink. │ +└──────────────────────────────────────────────────────────────────────────────┘ +~~~ Shrink ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Test debug_shrink successfully shrunk counter example (step 0) to: +(3, 1) +~~~ Shrink ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Test debug_shrink successfully shrunk counter example (step 1) to: +(2, 1) +~~~ Shrink ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Test debug_shrink successfully shrunk counter example (step 2) to: +(2, 0) +~~~ Shrink ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Test debug_shrink successfully shrunk counter example (step 3) to: +(1, 0) +law debug_shrink: 2 relevant cases (2 total) +test `debug_shrink` failed on ≥ 1 cases: (1, 0) (after 3 shrink steps) +[exception] test `debug_shrink` failed on ≥ 1 cases: (1, 0) (after 3 shrink steps) + ────────────────────────────────────────────────────────────────────────────── +6 failures! 9 tests run. diff --git a/example/alcotest/output.txt.expected b/example/alcotest/output.txt.expected.64 similarity index 100% rename from example/alcotest/output.txt.expected rename to example/alcotest/output.txt.expected.64 From a63f9c329ace39190def3be134e7b66c851ad0f6 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 6 Jul 2022 18:47:22 +0100 Subject: [PATCH 055/391] update ounit expect test --- example/ounit/dune | 15 +++-- example/ounit/output.txt.expected.32 | 65 +++++++++++++++++++ ...ut.txt.expected => output.txt.expected.64} | 0 3 files changed, 76 insertions(+), 4 deletions(-) create mode 100644 example/ounit/output.txt.expected.32 rename example/ounit/{output.txt.expected => output.txt.expected.64} (100%) diff --git a/example/ounit/dune b/example/ounit/dune index 86554a74..bed0bfc6 100644 --- a/example/ounit/dune +++ b/example/ounit/dune @@ -1,3 +1,6 @@ +(* -*- tuareg -*- *) + +let dune = Printf.sprintf {| (executables (names QCheck_ounit_test QCheck_test) @@ -6,16 +9,20 @@ (rule (targets output.txt) (deps ./QCheck_ounit_test.exe) - (enabled_if (= %{os_type} "Unix")) + (enabled_if (= %%{os_type} "Unix")) (action (with-accepted-exit-codes 1 (with-stdout-to - %{targets} + %%{targets} (run ./run_ounit.sh -runner=sequential -seed 1234))))) (rule (alias runtest) (package qcheck-ounit) - (enabled_if (= %{os_type} "Unix")) - (action (diff output.txt.expected output.txt))) + (enabled_if (= %%{os_type} "Unix")) + (action (diff output.txt.expected.%i output.txt))) + +|} Sys.word_size + +let () = Jbuild_plugin.V1.send dune diff --git a/example/ounit/output.txt.expected.32 b/example/ounit/output.txt.expected.32 new file mode 100644 index 00000000..0ead3a2a --- /dev/null +++ b/example/ounit/output.txt.expected.32 @@ -0,0 +1,65 @@ +.FE.FEF. +============================================================================== +Error: tests:5:neg fail with error. + +Error: tests:5:neg fail with error (in the log). + + +test `neg fail with error` +raised exception `Dune__exe__QCheck_ounit_test.Error` +on `0 (after 7 shrink steps)` + +------------------------------------------------------------------------------ +============================================================================== +Error: tests:2:error_raise_exn. + +Error: tests:2:error_raise_exn (in the log). + + +test `error_raise_exn` raised exception `Dune__exe__QCheck_ounit_test.Error` +on `0 (after 31 shrink steps)` + +------------------------------------------------------------------------------ +============================================================================== +Error: tests:6:fail_check_err_message. + +Error: tests:6:fail_check_err_message (in the log). + +Error: tests:6:fail_check_err_message (in the code). + + +test `fail_check_err_message` failed on ≥ 1 cases: +0 (after 7 shrink steps) +this +will +always +fail + + + +------------------------------------------------------------------------------ +============================================================================== +Error: tests:4:neg test unexpected success. + +Error: tests:4:neg test unexpected success (in the log). + +Error: tests:4:neg test unexpected success (in the code). + + +negative test 'neg test unexpected success' succeeded unexpectedly + +------------------------------------------------------------------------------ +============================================================================== +Error: tests:1:fail_sort_id. + +Error: tests:1:fail_sort_id (in the log). + +Error: tests:1:fail_sort_id (in the code). + + +test `fail_sort_id` failed on ≥ 1 cases: [1; 0] (after 11 shrink steps) + + +------------------------------------------------------------------------------ +Ran: 8 tests in: <nondet> seconds. +FAILED: Cases: 8 Tried: 8 Errors: 2 Failures: 3 Skip: 0 Todo: 0 Timeouts: 0. diff --git a/example/ounit/output.txt.expected b/example/ounit/output.txt.expected.64 similarity index 100% rename from example/ounit/output.txt.expected rename to example/ounit/output.txt.expected.64 From 0cf26644e9c6b821ed14ccdba6de59e449995c62 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 6 Jul 2022 18:48:33 +0100 Subject: [PATCH 056/391] update qcheck-core example expect test --- example/dune | 15 +- example/output.txt.expected.32 | 333 ++++++++++++++++++ ...ut.txt.expected => output.txt.expected.64} | 0 3 files changed, 344 insertions(+), 4 deletions(-) create mode 100644 example/output.txt.expected.32 rename example/{output.txt.expected => output.txt.expected.64} (100%) diff --git a/example/dune b/example/dune index fe4b2715..66c5c28d 100644 --- a/example/dune +++ b/example/dune @@ -1,3 +1,6 @@ +(* -*- tuareg -*- *) + +let dune = Printf.sprintf {| (executables (names QCheck_runner_test) @@ -6,16 +9,20 @@ (rule (targets output.txt) (deps ./QCheck_runner_test.exe) - (enabled_if (= %{os_type} "Unix")) + (enabled_if (= %%{os_type} "Unix")) (action (with-accepted-exit-codes 1 (with-stdout-to - %{targets} + %%{targets} (run ./QCheck_runner_test.exe --no-colors -s 1234))))) (rule (alias runtest) - (enabled_if (= %{os_type} "Unix")) + (enabled_if (= %%{os_type} "Unix")) (package qcheck) - (action (diff output.txt.expected output.txt))) + (action (diff output.txt.expected.%i output.txt))) + +|} Sys.word_size + +let () = Jbuild_plugin.V1.send dune diff --git a/example/output.txt.expected.32 b/example/output.txt.expected.32 new file mode 100644 index 00000000..5eb9e10c --- /dev/null +++ b/example/output.txt.expected.32 @@ -0,0 +1,333 @@ +random seed: 1234 + +--- Failure -------------------------------------------------------------------- + +Test should_fail_sort_id failed (13 shrink steps): + +[1; 0] + +=== Error ====================================================================== + +Test should_error_raise_exn errored on (31 shrink steps): + +0 + +exception Dune__exe__QCheck_runner_test.Error + + ++++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Collect results for test collect_results: + +4: 20 cases +3: 25 cases +2: 17 cases +1: 18 cases +0: 20 cases + ++++ Stats for with_stats ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats mod4: + num: 100, avg: 1.68, stddev: 1.09, median 2, min 0, max 3 + 0: ############################## 17 + 1: ################################################### 29 + 2: ######################################## 23 + 3: ####################################################### 31 + +stats num: + num: 100, avg: 66.84, stddev: 31.94, median 65, min 2, max 120 + 2.. 7: ################## 3 + 8.. 13: ################## 3 + 14.. 19: 0 + 20.. 25: ########################################## 7 + 26.. 31: ######################## 4 + 32.. 37: ######################## 4 + 38.. 43: ################## 3 + 44.. 49: ################################################ 8 + 50.. 55: #################################### 6 + 56.. 61: #################################### 6 + 62.. 67: ####################################################### 9 + 68.. 73: ########################################## 7 + 74.. 79: ######################## 4 + 80.. 85: ################## 3 + 86.. 91: ############ 2 + 92.. 97: ########################################## 7 + 98..103: #################################### 6 + 104..109: #################################### 6 + 110..115: ####################################################### 9 + 116..121: ################## 3 + +--- Failure -------------------------------------------------------------------- + +Test neg test unexpected success failed: + +Negative test neg test unexpected success succeeded but was expected to fail + +=== Error ====================================================================== + +Test neg fail with error errored on (7 shrink steps): + +0 + +exception Dune__exe__QCheck_runner_test.Error + + +--- Failure -------------------------------------------------------------------- + +Test FAIL_pred_map_commute failed (47 shrink steps): + +([1], {_ -> 0}, {0 -> false; _ -> true}) + +--- Failure -------------------------------------------------------------------- + +Test FAIL_fun2_pred_strings failed (1 shrink steps): + +{some other string -> false; _ -> true} + +--- Failure -------------------------------------------------------------------- + +Test fold_left fold_right failed (34 shrink steps): + +(0, [1], {(1, 0) -> 1; _ -> 0}) + ++++ Messages ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Messages for test fold_left fold_right: + +l=[1], fold_left=1, fold_right=0 + + +--- Failure -------------------------------------------------------------------- + +Test fold_left fold_right uncurried failed (44 shrink steps): + +({(0, 7) -> 1; _ -> 0}, 0, [7]) + +--- Failure -------------------------------------------------------------------- + +Test long_shrink failed (87 shrink steps): + +([0], [-1]) + +--- Failure -------------------------------------------------------------------- + +Test mod3_should_fail failed (34 shrink steps): + +-21 + ++++ Stats for stats_neg ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 5000, avg: 0.17, stddev: 29.68, median 0, min -99, max 99 + -99..-90: # 65 + -89..-80: # 63 + -79..-70: # 64 + -69..-60: # 58 + -59..-50: # 67 + -49..-40: # 72 + -39..-30: # 61 + -29..-20: # 61 + -19..-10: # 67 + -9.. 0: ####################################################### 2076 + 1.. 10: ############################################## 1764 + 11.. 20: # 66 + 21.. 30: # 64 + 31.. 40: # 64 + 41.. 50: # 67 + 51.. 60: # 60 + 61.. 70: # 75 + 71.. 80: # 60 + 81.. 90: # 60 + 91..100: # 66 + +!!! Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +Warning for test WARN_unlikely_precond: + +WARNING: only 0.6% tests (of 2000) passed precondition for "WARN_unlikely_precond" + +NOTE: it is likely that the precondition is too strong, or that the generator is buggy. + +--- Failure -------------------------------------------------------------------- + +Test FAIL_unlikely_precond failed: + +ERROR: only 0.6% tests (of 2000) passed precondition for "FAIL_unlikely_precond" + +NOTE: it is likely that the precondition is too strong, or that the generator is buggy. + + +--- Failure -------------------------------------------------------------------- + +Test FAIL_#99_1 failed: + +ERROR: uncaught exception in generator for test FAIL_#99_1 after 100 steps: +Exception: QCheck.No_example_found("<example>") +Backtrace: + ++++ Stats for stat_display_test_1 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 0.90, stddev: 28.23, median 0, min -99, max 99 + -99..-90: # 12 + -89..-80: # 11 + -79..-70: # 9 + -69..-60: 6 + -59..-50: # 11 + -49..-40: # 13 + -39..-30: # 9 + -29..-20: # 13 + -19..-10: 8 + -9.. 0: ####################################################### 453 + 1.. 10: ######################################### 340 + 11.. 20: # 15 + 21.. 30: # 11 + 31.. 40: # 12 + 41.. 50: # 13 + 51.. 60: # 13 + 61.. 70: # 16 + 71.. 80: # 9 + 81.. 90: # 16 + 91..100: # 10 + ++++ Stats for stat_display_test_2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 15.11, stddev: 23.27, median 6, min 0, max 99 + 0.. 4: #################################################### 377 + 5.. 9: ####################################################### 392 + 10.. 14: ## 20 + 15.. 19: ## 15 + 20.. 24: # 11 + 25.. 29: ## 17 + 30.. 34: ## 19 + 35.. 39: ## 17 + 40.. 44: # 10 + 45.. 49: # 9 + 50.. 54: # 8 + 55.. 59: # 9 + 60.. 64: ## 15 + 65.. 69: # 10 + 70.. 74: # 13 + 75.. 79: ## 19 + 80.. 84: # 11 + 85.. 89: # 13 + 90.. 94: 5 + 95.. 99: # 10 + ++++ Stats for stat_display_test_3 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 195335.64, stddev: 136803.99, median 195583, min -43624, max 435210 + -43624..-19683: ############################################ 52 + -19682.. 4259: ######################################## 47 + 4260.. 28201: ############################## 36 + 28202.. 52143: ############################################ 52 + 52144.. 76085: ########################################## 50 + 76086..100027: ####################################################### 64 + 100028..123969: ############################################### 55 + 123970..147911: ######################################## 47 + 147912..171853: ############################################## 54 + 171854..195795: #################################### 43 + 195796..219737: ############################################## 54 + 219738..243679: ########################################### 51 + 243680..267621: ################################################ 57 + 267622..291563: ########################################## 49 + 291564..315505: #################################### 42 + 315506..339447: ###################################### 45 + 339448..363389: ################################################ 57 + 363390..387331: ###################################### 45 + 387332..411273: ########################################## 49 + 411274..435215: ########################################### 51 + ++++ Stats for stat_display_test_4 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: -173.78, stddev: 23042.92, median 180, min -39859, max 39942 + -39859..-35869: ############################################# 56 + -35868..-31878: ################################### 43 + -31877..-27887: ################################################# 60 + -27886..-23896: ##################################### 46 + -23895..-19905: ######################################## 49 + -19904..-15914: #################################### 45 + -15913..-11923: ############################################ 54 + -11922.. -7932: ############################################### 58 + -7931.. -3941: ######################################### 51 + -3940.. 50: ############################ 35 + 51.. 4041: ####################################### 48 + 4042.. 8032: ########################################## 52 + 8033.. 12023: ######################################### 51 + 12024.. 16014: ########################################### 53 + 16015.. 20005: ############################################ 54 + 20006.. 23996: ################################## 42 + 23997.. 27987: ####################################################### 67 + 27988.. 31978: ################################ 40 + 31979.. 35969: ######################################### 51 + 35970.. 39960: #################################### 45 + ++++ Stats for stat_display_test_5 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 0.02, stddev: 2.55, median 0, min -4, max 4 + -4: ############################################ 99 + -3: ##################################################### 118 + -2: ################################################## 111 + -1: ################################################## 113 + 0: ################################################## 113 + 1: ##################################################### 118 + 2: ############################################# 102 + 3: ####################################################### 122 + 4: ############################################## 104 + ++++ Stats for stat_display_test_6 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 6.67, stddev: 6.39, median 7, min -4, max 17 + -4..-3: ############################################# 90 + -2..-1: ############################################# 91 + 0.. 1: ########################################## 84 + 2.. 3: ############################################## 92 + 4.. 5: ########################################### 87 + 6.. 7: ########################################### 86 + 8.. 9: ############################################ 89 + 10..11: ########################################### 87 + 12..13: ####################################################### 110 + 14..15: ############################################# 91 + 16..17: ############################################## 93 + 18..19: 0 + 20..21: 0 + 22..23: 0 + 24..25: 0 + 26..27: 0 + 28..29: 0 + 30..31: 0 + 32..33: 0 + 34..35: 0 + ++++ Stats for stat_display_test_7 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 100000, avg: 336840.90, stddev: 619301756.02, median 895228, min -1073728193, max 1073739280 + -1073728193.. -966354820: ##################################################### 5009 + -966354819.. -858981446: #################################################### 5004 + -858981445.. -751608072: #################################################### 4917 + -751608071.. -644234698: ##################################################### 5028 + -644234697.. -536861324: #################################################### 4962 + -536861323.. -429487950: ##################################################### 5039 + -429487949.. -322114576: #################################################### 4927 + -322114575.. -214741202: ##################################################### 5054 + -214741201.. -107367828: ##################################################### 5065 + -107367827.. 5546: #################################################### 4954 + 5547.. 107378920: #################################################### 4943 + 107378921.. 214752294: ################################################### 4900 + 214752295.. 322125668: ###################################################### 5126 + 322125669.. 429499042: ####################################################### 5198 + 429499043.. 536872416: #################################################### 4988 + 536872417.. 644245790: #################################################### 4940 + 644245791.. 751619164: #################################################### 5002 + 751619165.. 858992538: #################################################### 4928 + 858992539.. 966365912: ##################################################### 5070 + 966365913.. 1073739286: #################################################### 4946 +================================================================================ +1 warning(s) +failure (10 tests failed, 2 tests errored, ran 28 tests) diff --git a/example/output.txt.expected b/example/output.txt.expected.64 similarity index 100% rename from example/output.txt.expected rename to example/output.txt.expected.64 From d5622bc85e9483c2b1104742ed52b97bd774d957 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 6 Jul 2022 18:50:15 +0100 Subject: [PATCH 057/391] update QCheck+QCheck2 expect tests --- test/core/QCheck2_expect_test.expected.32 | 1293 +++++++++++++++++ ...pected => QCheck2_expect_test.expected.64} | 0 test/core/QCheck_expect_test.expected.32 | 1289 ++++++++++++++++ ...xpected => QCheck_expect_test.expected.64} | 0 test/core/dune | 38 +- 5 files changed, 2616 insertions(+), 4 deletions(-) create mode 100644 test/core/QCheck2_expect_test.expected.32 rename test/core/{QCheck2_expect_test.expected => QCheck2_expect_test.expected.64} (100%) create mode 100644 test/core/QCheck_expect_test.expected.32 rename test/core/{QCheck_expect_test.expected => QCheck_expect_test.expected.64} (100%) diff --git a/test/core/QCheck2_expect_test.expected.32 b/test/core/QCheck2_expect_test.expected.32 new file mode 100644 index 00000000..157dcbf4 --- /dev/null +++ b/test/core/QCheck2_expect_test.expected.32 @@ -0,0 +1,1293 @@ +random seed: 1234 +50 7 0 0 0 0 0 0 0 0 0 0 3 3 3 3 3 3 3 3 3 3 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 (6,fun,50) (0,fun,2) (7,fun,66) (54,fun,9) (2,fun,5) (90,fun,4) (1,fun,4) (37,fun,7) (7,fun,1) (8,fun,5) +(6,fun,50) (0,fun,2) (7,fun,66) (54,fun,9) (2,fun,5) (90,fun,4) (1,fun,4) (37,fun,7) (7,fun,1) (8,fun,5) +(6,fun,50) (0,fun,2) (7,fun,66) (54,fun,9) (2,fun,5) (90,fun,4) (1,fun,4) (37,fun,7) (7,fun,1) (8,fun,5) +(6,fun,50) (0,fun,2) (7,fun,66) (54,fun,9) (2,fun,5) (90,fun,4) (1,fun,4) (37,fun,7) (7,fun,1) (8,fun,5) +(6,fun,50) (0,fun,2) (7,fun,66) (54,fun,9) (2,fun,5) (90,fun,4) (1,fun,4) (37,fun,7) (7,fun,1) (8,fun,5) +(6,fun,50) (0,fun,2) (7,fun,66) (54,fun,9) (2,fun,5) (90,fun,4) (1,fun,4) (37,fun,7) (7,fun,1) (8,fun,5) +(6,fun,50) (0,fun,2) (7,fun,66) (54,fun,9) (2,fun,5) (90,fun,4) (1,fun,4) (37,fun,7) (7,fun,1) (8,fun,5) +(6,fun,50) (0,fun,2) (7,fun,66) (54,fun,9) (2,fun,5) (90,fun,4) (1,fun,4) (37,fun,7) (7,fun,1) (8,fun,5) +911769578 +0 +455884789 +0 +227942394 +0 +113971197 +0 +56985598 +0 +28492799 +0 +14246399 +0 +7123199 +0 +3561599 +0 +1780799 +0 +890399 +0 +445199 +0 +222599 +0 +111299 +0 +55649 +0 +27824 +0 +13912 +0 +6956 +0 +3478 +0 +1739 +0 +869 +0 +434 +0 +217 +0 +108 +0 +54 +0 +27 +0 +13 +0 +6 +0 +3 +0 +1 +0 +[7; 1; 42; 1; 8; 5; 3; 9; 5; 38; 3; 3; 0; 1; 98; 1; 4; 13; 9; 2; 6; 9; 47; 6; 5; 8; 8; 6; 0; 9; 7; 2; 8; 6; 62; 6; 4; 31; 19; 1; 41; 60; 6; 5; 8; 1; 1; 4; 7; 7; 0; 5; 5; 71; 14; 26; 47; 5; 1; 6; 34; 9; 4; 2; 37; 3; 8; 4; 31; 6; 2; 1; 0; 7; 5; 1; 0; 15; 6; 1; 8; 13; 0; 6; 2; 4; 2; 6; 6; 1; 4; 1; 9; 79; 0; 87; 6; 8; 8; 62; 1; 4; 62; 6; 31; 1; 5; 6; 5; 9; 3; 3; 1; 79; 4; 3; 2; 67; 5; 7; 12; 70; 8; 8; 6; 1; 3; 14; 15; 1; 61; 4; 1; 4; 1; 7; 4; 4; 4; 2; 8; 8; 7; 5; 4; 27; 0; 9; 80; 25; 1; 8; 1; 3; 7; 4; 3; 5; 5; 6; 5; 5; 31; 7; 0; 3; 3; 6; 71; 76; 28; 60; 6; 2; 6; 3; 0; 4; 1; 0; 5; 7; 0; 28; 86; 4; 7; 51; 36; 0; 5; 0; 1; 4; 3; 6; 0; 1; 1; 8; 18; 4; 2; 8; 8; 1; 4; 7; 1; 0; 93; 5; 3; 0; 80; 1; 7; 7; 8; 8; 5; 7; 8; 9; 24; 4; 25; 8; 8; 5; 4; 90; 4; 6; 8; 4; 4; 0; 60; 8; 9; 7; 44; 5; 1; 2; 9; 74; 7; 7] +[] +[9; 61; 8; 4; 69; 2; 0; 72; 4; 41; 3; 8; 75; 83; 7; 7; 3; 9; 5; 8; 4; 1; 0; 2; 1; 4; 7; 6; 2; 1; 4; 86; 3; 79; 7; 86; 52; 39; 19; 0; 4; 7; 7; 7; 0; 4; 8; 8; 0; 5; 13; 1; 5; 0; 7; 12; 64; 34; 1; 1; 85; 8; 2; 9; 76; 0; 2; 5; 76; 69; 8; 8; 0; 1; 2; 2; 4; 60; 29; 5; 9; 4; 0; 8; 3; 3; 5; 1; 35; 8; 2; 7; 23; 61; 56; 8; 1; 1; 78; 7; 5; 0; 30; 9; 3; 7; 28; 57; 98; 3; 52; 3; 82; 7; 5; 5; 6; 8; 1; 6; 8; 9; 8; 16; 0] +[] +[1; 9; 8; 28; 47; 8; 5; 6; 8; 9; 2; 5; 8; 30; 6; 8; 84; 0; 6; 7; 76; 7; 9; 1; 0; 5; 76; 95; 2; 2; 1; 45; 7; 8; 8; 1; 6; 37; 5; 6; 73; 8; 0; 85; 8; 0; 4; 5; 2; 0; 26; 59; 0; 5; 13; 4; 7; 3; 6; 8; 1; 3] +[] +[5; 0; 0; 4; 10; 2; 4; 9; 5; 73; 6; 1; 5; 5; 3; 10; 5; 31; 1; 4; 3; 8; 9; 13; 41; 20; 96; 5; 1; 2; 8] +[] +[9; 8; 73; 5; 8; 2; 1; 8; 2; 6; 4; 18; 5; 76; 3] +[] +[0; 6; 2; 8; 8; 1; 4] +[] +[5; 2; 3] +[] +[3] +[] +[0] +[7; 1; 42; 1; 8; 5; 3; 9; 5; 38; 3; 3; 0; 1; 98; 1; 4; 13; 9; 2; 6; 9; 47; 6; 5; 8; 8; 6; 0; 9; 7; 2; 8; 6; 62; 6; 4; 31; 19; 1; 41; 60; 6; 5; 8; 1; 1; 4; 7; 7; 0; 5; 5; 71; 14; 26; 47; 5; 1; 6; 34; 9; 4; 2; 37; 3; 8; 4; 31; 6; 2; 1; 0; 7; 5; 1; 0; 15; 6; 1; 8; 13; 0; 6; 2; 4; 2; 6; 6; 1; 4; 1; 9; 79; 0; 87; 6; 8; 8; 62; 1; 4; 62; 6; 31; 1; 5; 6; 5; 9; 3; 3; 1; 79; 4; 3; 2; 67; 5; 7; 12; 70; 8; 8; 6; 1; 3; 14; 15; 1; 61; 4; 1; 4; 1; 7; 4; 4; 4; 2; 8; 8; 7; 5; 4; 27; 0; 9; 80; 25; 1; 8; 1; 3; 7; 4; 3; 5; 5; 6; 5; 5; 31; 7; 0; 3; 3; 6; 71; 76; 28; 60; 6; 2; 6; 3; 0; 4; 1; 0; 5; 7; 0; 28; 86; 4; 7; 51; 36; 0; 5; 0; 1; 4; 3; 6; 0; 1; 1; 8; 18; 4; 2; 8; 8; 1; 4; 7; 1; 0; 93; 5; 3; 0; 80; 1; 7; 7; 8; 8; 5; 7; 8; 9; 24; 4; 25; 8; 8; 5; 4; 90; 4; 6; 8; 4; 4; 0; 60; 8; 9; 7; 44; 5; 1; 2; 9; 74; 7; 7] +[] +[9; 61; 8; 4; 69; 2; 0; 72; 4; 41; 3; 8; 75; 83; 7; 7; 3; 9; 5; 8; 4; 1; 0; 2; 1; 4; 7; 6; 2; 1; 4; 86; 3; 79; 7; 86; 52; 39; 19; 0; 4; 7; 7; 7; 0; 4; 8; 8; 0; 5; 13; 1; 5; 0; 7; 12; 64; 34; 1; 1; 85; 8; 2; 9; 76; 0; 2; 5; 76; 69; 8; 8; 0; 1; 2; 2; 4; 60; 29; 5; 9; 4; 0; 8; 3; 3; 5; 1; 35; 8; 2; 7; 23; 61; 56; 8; 1; 1; 78; 7; 5; 0; 30; 9; 3; 7; 28; 57; 98; 3; 52; 3; 82; 7; 5; 5; 6; 8; 1; 6; 8; 9; 8; 16; 0] +[] +[1; 9; 8; 28; 47; 8; 5; 6; 8; 9; 2; 5; 8; 30; 6; 8; 84; 0; 6; 7; 76; 7; 9; 1; 0; 5; 76; 95; 2; 2; 1; 45; 7; 8; 8; 1; 6; 37; 5; 6; 73; 8; 0; 85; 8; 0; 4; 5; 2; 0; 26; 59; 0; 5; 13; 4; 7; 3; 6; 8; 1; 3] +[] +[5; 0; 0; 4; 10; 2; 4; 9; 5; 73; 6; 1; 5; 5; 3; 10; 5; 31; 1; 4; 3; 8; 9; 13; 41; 20; 96; 5; 1; 2; 8] +[] +[9; 8; 73; 5; 8; 2; 1; 8; 2; 6; 4; 18; 5; 76; 3] +[] +[0; 6; 2; 8; 8; 1; 4] +[] +[5; 2; 3] +[3; 2; 7; 3; 3] +[] +[5; 3] +[5; 3; 2] +[9; 87; 7; 0] +[0; 2; 7; 3; 3] +[0; 0; 7; 3; 3] +[0; 0; 0; 3; 3] +[0; 0; 0; 0; 3] +[0; 0; 0; 0; 0] + +--- Failure -------------------------------------------------------------------- + +Test should_fail_sort_id failed (9 shrink steps): + +[1; 0] + +=== Error ====================================================================== + +Test should_error_raise_exn errored on (1 shrink steps): + +0 + +exception QCheck2_tests.Overall.Error + + ++++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Collect results for test collect_results: + +4: 20 cases +3: 25 cases +2: 17 cases +1: 18 cases +0: 20 cases + ++++ Stats for with_stats ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats mod4: + num: 100, avg: 1.68, stddev: 1.09, median 2, min 0, max 3 + 0: ############################## 17 + 1: ################################################### 29 + 2: ######################################## 23 + 3: ####################################################### 31 + +stats num: + num: 100, avg: 66.84, stddev: 31.94, median 65, min 2, max 120 + 2.. 7: ################## 3 + 8.. 13: ################## 3 + 14.. 19: 0 + 20.. 25: ########################################## 7 + 26.. 31: ######################## 4 + 32.. 37: ######################## 4 + 38.. 43: ################## 3 + 44.. 49: ################################################ 8 + 50.. 55: #################################### 6 + 56.. 61: #################################### 6 + 62.. 67: ####################################################### 9 + 68.. 73: ########################################## 7 + 74.. 79: ######################## 4 + 80.. 85: ################## 3 + 86.. 91: ############ 2 + 92.. 97: ########################################## 7 + 98..103: #################################### 6 + 104..109: #################################### 6 + 110..115: ####################################################### 9 + 116..121: ################## 3 + +--- Failure -------------------------------------------------------------------- + +Test with shrinking retries failed (0 shrink steps): + +7 + +!!! Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +Warning for test WARN_unlikely_precond: + +WARNING: only 0.6% tests (of 2000) passed precondition for "WARN_unlikely_precond" + +NOTE: it is likely that the precondition is too strong, or that the generator is buggy. + +--- Failure -------------------------------------------------------------------- + +Test FAIL_unlikely_precond failed: + +ERROR: only 0.6% tests (of 2000) passed precondition for "FAIL_unlikely_precond" + +NOTE: it is likely that the precondition is too strong, or that the generator is buggy. + + +--- Failure -------------------------------------------------------------------- + +Test FAIL_bad_gen failed: + +ERROR: uncaught exception in generator for test FAIL_bad_gen after 100 steps: +Exception: Invalid_argument("Gen.int_bound") +Backtrace: + +--- Failure -------------------------------------------------------------------- + +Test int double failed: + +Negative test int double succeeded but was expected to fail + +=== Error ====================================================================== + +Test pos fail with error errored on (1 shrink steps): + +0 + +exception QCheck2_tests.Overall.Error + + +=== Error ====================================================================== + +Test neg fail with error errored on (1 shrink steps): + +0 + +exception QCheck2_tests.Overall.Error + + +--- Failure -------------------------------------------------------------------- + +Test char never produces '\255' failed (0 shrink steps): + +'\255' + +--- Failure -------------------------------------------------------------------- + +Test big bound issue59 failed (0 shrink steps): + +1073741823 + +--- Failure -------------------------------------------------------------------- + +Test long_shrink failed (3018 shrink steps): + +([0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0], [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 1]) + +--- Failure -------------------------------------------------------------------- + +Test ints arent 0 mod 3 failed (2 shrink steps): + +0 + +--- Failure -------------------------------------------------------------------- + +Test ints are 0 failed (29 shrink steps): + +1 + +--- Failure -------------------------------------------------------------------- + +Test ints < 209609 failed (0 shrink steps): + +1073741823 + +--- Failure -------------------------------------------------------------------- + +Test nat < 5001 failed (7 shrink steps): + +5001 + +--- Failure -------------------------------------------------------------------- + +Test char never produces 'abcdef' failed (1 shrink steps): + +'a' + +--- Failure -------------------------------------------------------------------- + +Test printable never produces '!"#$%&'' failed (1 shrink steps): + +'!' + +--- Failure -------------------------------------------------------------------- + +Test printable never produces less than '5 failed (1 shrink steps): + +'0' + +--- Failure -------------------------------------------------------------------- + +Test strings are empty failed (8 shrink steps): + +"a" + +--- Failure -------------------------------------------------------------------- + +Test string never has a \000 char failed (22 shrink steps): + +"aaaaaa\000aaaaaaaaaaaaaaaa" + +--- Failure -------------------------------------------------------------------- + +Test string never has a \255 char failed (59 shrink steps): + +"aaaaaaaaaaaaaaaaaaaaaaaaaa\255aaaaaaaaaaaaaaaaaaaaaaaa" + +--- Failure -------------------------------------------------------------------- + +Test strings have unique chars failed (18 shrink steps): + +"aaaaaaaaaaaaa" + +--- Failure -------------------------------------------------------------------- + +Test pairs have different components failed (0 shrink steps): + +(4, 4) + +--- Failure -------------------------------------------------------------------- + +Test pairs have same components failed (31 shrink steps): + +(0, 1) + +--- Failure -------------------------------------------------------------------- + +Test pairs have a zero component failed (58 shrink steps): + +(1, 1) + +--- Failure -------------------------------------------------------------------- + +Test pairs are (0,0) failed (31 shrink steps): + +(0, 1) + +--- Failure -------------------------------------------------------------------- + +Test pairs are ordered failed (43 shrink steps): + +(1, 0) + +--- Failure -------------------------------------------------------------------- + +Test pairs are ordered reversely failed (29 shrink steps): + +(0, 1) + +--- Failure -------------------------------------------------------------------- + +Test pairs sum to less than 128 failed (25 shrink steps): + +(0, 128) + +--- Failure -------------------------------------------------------------------- + +Test pairs lists rev concat failed (41 shrink steps): + +([0], [1]) + +--- Failure -------------------------------------------------------------------- + +Test pairs lists no overlap failed (27 shrink steps): + +([0], [0; 0; 0; 0]) + +--- Failure -------------------------------------------------------------------- + +Test triples have pair-wise different components failed (3 shrink steps): + +(0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test triples have same components failed (33 shrink steps): + +(0, 1, 0) + +--- Failure -------------------------------------------------------------------- + +Test triples are ordered failed (4 shrink steps): + +(0, -1, 0) + +--- Failure -------------------------------------------------------------------- + +Test triples are ordered reversely failed (33 shrink steps): + +(0, 0, 1) + +--- Failure -------------------------------------------------------------------- + +Test quadruples have pair-wise different components failed (4 shrink steps): + +(0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test quadruples have same components failed (61 shrink steps): + +(0, 1, 0, 1) + +--- Failure -------------------------------------------------------------------- + +Test quadruples are ordered failed (5 shrink steps): + +(0, 0, -1, 0) + +--- Failure -------------------------------------------------------------------- + +Test quadruples are ordered reversely failed (34 shrink steps): + +(0, 0, 0, 1) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b) in nat: a < b failed (6 shrink steps): + +(0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c) in nat: a < b < c failed (3 shrink steps): + +(0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c, d) in nat: a < b < c < d failed (4 shrink steps): + +(0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c, d, e) in nat: a < b < c < d < e failed (5 shrink steps): + +(0, 0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c, d, e, f) in nat: a < b < c < d < e < f failed (6 shrink steps): + +(0, 0, 0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c, d, e, f, g) in nat: a < b < c < d < e < f < g failed (7 shrink steps): + +(0, 0, 0, 0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c, d, e, f, g, h) in nat: a < b < c < d < e < f < g < h failed (8 shrink steps): + +(0, 0, 0, 0, 0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c, d, e, f, g, h, i) in nat: a < b < c < d < e < f < g < h < i failed (9 shrink steps): + +(0, 0, 0, 0, 0, 0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test bind ordered pairs failed (1 shrink steps): + +(0, 0) + +--- Failure -------------------------------------------------------------------- + +Test bind list_size constant failed (12 shrink steps): + +(4, [0; 0; 0; 0]) + +--- Failure -------------------------------------------------------------------- + +Test lists are empty failed (8 shrink steps): + +[0] + +--- Failure -------------------------------------------------------------------- + +Test lists shorter than 10 failed (16 shrink steps): + +[0; 0; 0; 0; 0; 0; 0; 0; 0; 0] + +--- Failure -------------------------------------------------------------------- + +Test lists shorter than 432 failed (412 shrink steps): + +[...] list length: 432 + +--- Failure -------------------------------------------------------------------- + +Test lists shorter than 4332 failed (4022 shrink steps): + +[...] list length: 4332 + +--- Failure -------------------------------------------------------------------- + +Test lists equal to duplication failed (4 shrink steps): + +[0] + +--- Failure -------------------------------------------------------------------- + +Test lists have unique elems failed (11 shrink steps): + +[0; 0; 0; 0; 0] + +--- Failure -------------------------------------------------------------------- + +Test tree contains only 42 failed (2 shrink steps): + +Leaf 0 + +--- Failure -------------------------------------------------------------------- + +Test fail_pred_map_commute failed (37 shrink steps): + +([1], {_ -> 0}, {0 -> false; 1 -> true; -489114431 -> false; -334037599 -> false; -1002044798 -> false; 3 -> false; 607479396 -> false; 4 -> false; 5 -> false; 442140485 -> false; 50542662 -> false; 38 -> false; 281414086 -> false; 757535206 -> false; 6 -> false; 7 -> false; 8 -> false; 629085609 -> false; 10 -> false; -765856245 -> false; 44 -> false; 12 -> false; -386873971 -> false; 15 -> false; 47 -> false; -842421617 -> false; 588710735 -> false; 49 -> false; 18 -> false; 51 -> false; 449695123 -> false; 20 -> false; 21 -> false; -386709771 -> false; -92591850 -> false; 136918038 -> false; 54 -> false; -484444937 -> false; -1042148456 -> false; 24 -> false; 1062551480 -> false; 747852089 -> false; 25 -> false; -737785766 -> false; 58 -> false; -530708612 -> false; -60654788 -> false; 28 -> false; 60 -> false; 29 -> false; 947455871 -> false; _ -> false}) + +--- Failure -------------------------------------------------------------------- + +Test fail_pred_strings failed (2 shrink steps): + +{"some random string" -> true; _ -> false} + +--- Failure -------------------------------------------------------------------- + +Test fold_left fold_right failed (56 shrink steps): + +(0, [1], {(1, 0) -> 1; (8, 0) -> 0; (6, 4) -> 0; (2, 6) -> 0; (3, 6) -> 0; (2, 16) -> 0; (0, 60) -> 0; (20, 3) -> 0; (12, 60) -> 0; (0, 2) -> 0; (2, 4) -> 0; (1, 6) -> 0; (6, 1) -> 0; (60, 83) -> 0; (3, 5) -> 0; (7, 12) -> 0; (6, 8) -> 0; (2, 2) -> 0; (56, 6) -> 0; (6, 5) -> 0; (12, 3) -> 0; (6, 6) -> 0; (0, 8) -> 0; (0, 58) -> 0; (5, 5) -> 0; (20, 2) -> 0; (54, 0) -> 0; (0, 6) -> 0; (4, 6) -> 0; (4, 56) -> 0; (5, 54) -> 0; (9, 8) -> 0; (8, 6) -> 0; (60, 47) -> 0; (9, 12) -> 0; (4, 20) -> 0; (0, 20) -> 0; (1, 2) -> 0; (28, 2) -> 0; (4, 1) -> 0; (0, 4) -> 0; (8, 3) -> 0; (4, 28) -> 0; (42, 8) -> 0; (6, 0) -> 0; (58, 65) -> 0; (12, 12) -> 0; (5, 6) -> 0; _ -> 0}) + ++++ Messages ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Messages for test fold_left fold_right: + +l=[1], fold_left=1, fold_right=0 + + +--- Failure -------------------------------------------------------------------- + +Test fold_left fold_right uncurried failed (376 shrink steps): + +({(0, 2) -> 0; (13, 0) -> 0; (22, 3) -> 0; (20, 5) -> 0; (2, 93) -> 0; (65, 34) -> 0; (2, 7) -> 0; (0, 7) -> 0; (49, 3) -> 0; (8, 62) -> 0; (8, 2) -> 0; (54, 6) -> 0; (38, 4) -> 0; (7, 0) -> 1; (6, 25) -> 0; (0, 0) -> 0; (3, 4) -> 0; (1, 7) -> 0; (4, 6) -> 0; (8, 1) -> 0; (48, 42) -> 0; (18, 1) -> 0; (90, 14) -> 0; (8, 70) -> 0; (9, 1) -> 0; (38, 2) -> 0; (3, 5) -> 0; (8, 8) -> 0; (9, 3) -> 0; (2, 36) -> 0; (45, 2) -> 0; (18, 6) -> 0; (7, 98) -> 0; (3, 9) -> 0; (2, 31) -> 0; (86, 2) -> 0; (4, 7) -> 0; (1, 1) -> 0; (0, 5) -> 0; (2, 9) -> 0; (1, 5) -> 0; (44, 0) -> 0; (77, 7) -> 0; (5, 8) -> 0; (1, 4) -> 0; (9, 79) -> 0; (48, 1) -> 0; (30, 7) -> 0; (6, 79) -> 0; (5, 1) -> 0; (65, 4) -> 0; (2, 1) -> 0; (4, 1) -> 0; (66, 12) -> 0; (6, 5) -> 0; (7, 3) -> 0; (3, 7) -> 0; (9, 7) -> 0; (9, 9) -> 0; (2, 6) -> 0; (3, 15) -> 0; (5, 3) -> 0; (67, 1) -> 0; (3, 28) -> 0; (1, 87) -> 0; (7, 31) -> 0; (9, 13) -> 0; (32, 1) -> 0; (0, 27) -> 0; (6, 15) -> 0; (20, 0) -> 0; (6, 8) -> 0; (1, 6) -> 0; (0, 6) -> 0; (3, 1) -> 0; (9, 71) -> 0; (95, 4) -> 0; (97, 1) -> 0; (7, 4) -> 0; (84, 3) -> 0; (92, 6) -> 0; (6, 2) -> 0; (8, 4) -> 0; (5, 0) -> 0; (7, 5) -> 0; (9, 8) -> 0; (90, 26) -> 0; (0, 19) -> 0; (1, 13) -> 0; (6, 1) -> 0; (9, 28) -> 0; (9, 6) -> 0; (8, 6) -> 0; (3, 8) -> 0; (7, 62) -> 0; (86, 0) -> 0; (65, 1) -> 0; (7, 1) -> 0; (6, 6) -> 0; (30, 4) -> 0; (7, 67) -> 0; (0, 9) -> 0; (78, 5) -> 0; (17, 3) -> 0; (9, 60) -> 0; (3, 71) -> 0; (88, 1) -> 0; (4, 61) -> 0; (9, 0) -> 0; (45, 0) -> 0; (2, 5) -> 0; (9, 47) -> 0; (18, 5) -> 0; (66, 0) -> 0; (0, 76) -> 0; (8, 3) -> 0; (74, 6) -> 0; (5, 60) -> 0; (5, 80) -> 0; (8, 9) -> 0; (7, 8) -> 0; (39, 4) -> 0; (72, 8) -> 0; (4, 38) -> 0; (70, 31) -> 0; (19, 5) -> 0; (4, 9) -> 0; (0, 1) -> 0; (1, 37) -> 0; (7, 6) -> 0; (6, 3) -> 0; (9, 5) -> 0; (58, 4) -> 0; (54, 5) -> 0; (7, 86) -> 0; (67, 6) -> 0; (0, 8) -> 0; (8, 7) -> 0; (44, 18) -> 0; (3, 0) -> 0; (4, 41) -> 0; (0, 31) -> 0; (1, 51) -> 0; (6, 0) -> 0; (1, 3) -> 0; (70, 1) -> 0; (9, 4) -> 0; (4, 5) -> 0; (1, 8) -> 0; (5, 9) -> 0; (0, 14) -> 0; (3, 3) -> 0; (4, 0) -> 0; (78, 9) -> 0; (0, 4) -> 0; (2, 3) -> 0; (9, 62) -> 0; (35, 1) -> 0; (55, 1) -> 0; _ -> 0}, 0, [7; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0]) + +--- Failure -------------------------------------------------------------------- + +Test fold_left fold_right uncurried fun last failed (56 shrink steps): + +(0, [1], {(0, 2) -> 0; (3, 6) -> 0; (0, 20) -> 0; (20, 4) -> 0; (6, 42) -> 0; (47, 6) -> 0; (6, 12) -> 0; (2, 6) -> 0; (0, 58) -> 0; (8, 2) -> 0; (6, 6) -> 0; (8, 60) -> 0; (12, 3) -> 0; (6, 4) -> 0; (16, 8) -> 0; (6, 0) -> 0; (3, 4) -> 0; (12, 0) -> 0; (60, 5) -> 0; (8, 1) -> 0; (6, 8) -> 0; (2, 5) -> 0; (2, 42) -> 0; (5, 4) -> 0; (4, 20) -> 0; (54, 0) -> 0; (12, 4) -> 0; (3, 2) -> 0; (8, 0) -> 0; (4, 7) -> 0; (28, 3) -> 0; (2, 9) -> 0; (65, 54) -> 0; (5, 28) -> 0; (20, 2) -> 0; (6, 2) -> 0; (83, 6) -> 0; (58, 5) -> 0; (5, 6) -> 0; (56, 12) -> 0; (1, 60) -> 0; (4, 9) -> 0; (0, 1) -> 1; (2, 8) -> 0; (2, 0) -> 0; (6, 1) -> 0; (1, 12) -> 0; (60, 0) -> 0; _ -> 0}) + +--- Failure -------------------------------------------------------------------- + +Test fold_left test, fun first failed (15 shrink steps): + +({_ -> ""}, "a", [], [0]) + +--- Failure -------------------------------------------------------------------- + +Test FAIL_#99_1 failed: + +ERROR: uncaught exception in generator for test FAIL_#99_1 after 100 steps: +Exception: QCheck2.No_example_found("<example>") +Backtrace: + ++++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Collect results for test bool dist: + +true: 250134 cases +false: 249866 cases + ++++ Stats for char code dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats char code: + num: 500000, avg: 127.42, stddev: 73.92, median 127, min 0, max 255 + 0.. 12: ###################################################### 25509 + 13.. 25: ###################################################### 25398 + 26.. 38: ###################################################### 25293 + 39.. 51: ###################################################### 25448 + 52.. 64: ###################################################### 25392 + 65.. 77: ####################################################### 25660 + 78.. 90: ###################################################### 25462 + 91..103: ###################################################### 25331 + 104..116: ##################################################### 25129 + 117..129: ###################################################### 25351 + 130..142: ###################################################### 25492 + 143..155: ###################################################### 25370 + 156..168: ###################################################### 25658 + 169..181: ###################################################### 25400 + 182..194: ##################################################### 25167 + 195..207: ###################################################### 25338 + 208..220: ##################################################### 25181 + 221..233: ##################################################### 25145 + 234..246: ###################################################### 25567 + 247..259: ##################################### 17709 + ++++ Stats for printable char code dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats char code: + num: 500000, avg: 78.26, stddev: 28.15, median 78, min 10, max 126 + 10.. 15: ######### 5149 + 16.. 21: 0 + 22.. 27: 0 + 28.. 33: ################## 10379 + 34.. 39: ###################################################### 31153 + 40.. 45: ###################################################### 31341 + 46.. 51: ###################################################### 31408 + 52.. 57: ####################################################### 31456 + 58.. 63: ###################################################### 31310 + 64.. 69: ###################################################### 31152 + 70.. 75: ###################################################### 31308 + 76.. 81: ###################################################### 31156 + 82.. 87: ###################################################### 31170 + 88.. 93: ###################################################### 31286 + 94.. 99: ###################################################### 31364 + 100..105: ###################################################### 31368 + 106..111: ###################################################### 31024 + 112..117: ###################################################### 31261 + 118..123: ###################################################### 31064 + 124..129: ########################### 15651 + ++++ Stats for numeral char code dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats char code: + num: 500000, avg: 52.50, stddev: 2.87, median 52, min 48, max 57 + 48: ###################################################### 50260 + 49: ###################################################### 49590 + 50: ###################################################### 50170 + 51: ####################################################### 50270 + 52: ###################################################### 49805 + 53: ###################################################### 50161 + 54: ###################################################### 49919 + 55: ###################################################### 49971 + 56: ###################################################### 49980 + 57: ###################################################### 49874 + ++++ Stats for tree's depth ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats depth: + num: 1000, avg: 3.74, stddev: 3.28, median 3, min 1, max 15 + 1: ####################################################### 377 + 2: ################ 113 + 3: ############ 87 + 4: ################# 123 + 5: ########### 81 + 6: #### 33 + 7: ##### 40 + 8: ##### 39 + 9: # 9 + 10: ### 25 + 11: ####### 49 + 12: 4 + 13: # 9 + 14: # 7 + 15: 4 + ++++ Stats for string_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 7.49, stddev: 1.70, median 7, min 5, max 10 + 5: ##################################################### 837 + 6: ##################################################### 826 + 7: ###################################################### 843 + 8: ####################################################### 855 + 9: #################################################### 813 + 10: ##################################################### 826 + ++++ Stats for string len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 384.53, stddev: 1330.61, median 9, min 0, max 9969 + 0.. 498: ####################################################### 4246 + 499.. 997: ###### 518 + 998..1496: 21 + 1497..1995: 10 + 1996..2494: 11 + 2495..2993: 10 + 2994..3492: 13 + 3493..3991: 13 + 3992..4490: 5 + 4491..4989: 10 + 4990..5488: 19 + 5489..5987: 9 + 5988..6486: 10 + 6487..6985: 12 + 6986..7484: 17 + 7485..7983: 16 + 7984..8482: 16 + 8483..8981: 16 + 8982..9480: 16 + 9481..9979: 12 + ++++ Stats for string_of len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 363.14, stddev: 1245.80, median 9, min 0, max 9986 + 0.. 499: ####################################################### 4270 + 500.. 999: ###### 493 + 1000.. 1499: 16 + 1500.. 1999: 11 + 2000.. 2499: 15 + 2500.. 2999: 17 + 3000.. 3499: 11 + 3500.. 3999: 19 + 4000.. 4499: 14 + 4500.. 4999: 10 + 5000.. 5499: 16 + 5500.. 5999: 11 + 6000.. 6499: 15 + 6500.. 6999: 13 + 7000.. 7499: 12 + 7500.. 7999: 16 + 8000.. 8499: 11 + 8500.. 8999: 4 + 9000.. 9499: 13 + 9500.. 9999: 13 + ++++ Stats for string_printable len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 384.53, stddev: 1330.61, median 9, min 0, max 9969 + 0.. 498: ####################################################### 4246 + 499.. 997: ###### 518 + 998..1496: 21 + 1497..1995: 10 + 1996..2494: 11 + 2495..2993: 10 + 2994..3492: 13 + 3493..3991: 13 + 3992..4490: 5 + 4491..4989: 10 + 4990..5488: 19 + 5489..5987: 9 + 5988..6486: 10 + 6487..6985: 12 + 6986..7484: 17 + 7485..7983: 16 + 7984..8482: 16 + 8483..8981: 16 + 8982..9480: 16 + 9481..9979: 12 + ++++ Stats for small_string len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 15.57, stddev: 24.36, median 6, min 0, max 99 + 0.. 4: #################################################### 1925 + 5.. 9: ####################################################### 2005 + 10.. 14: # 52 + 15.. 19: # 50 + 20.. 24: # 55 + 25.. 29: # 56 + 30.. 34: # 55 + 35.. 39: # 49 + 40.. 44: # 65 + 45.. 49: # 65 + 50.. 54: # 55 + 55.. 59: # 68 + 60.. 64: # 61 + 65.. 69: # 65 + 70.. 74: # 57 + 75.. 79: # 66 + 80.. 84: # 65 + 85.. 89: # 64 + 90.. 94: # 60 + 95.. 99: # 62 + ++++ Stats for pair dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats pair sum: + num: 500000, avg: 100.02, stddev: 41.22, median 100, min 0, max 200 + 0.. 9: ### 2685 + 10.. 19: ######## 7622 + 20.. 29: ############## 12474 + 30.. 39: #################### 17330 + 40.. 49: ########################## 22263 + 50.. 59: ############################### 26982 + 60.. 69: ##################################### 32182 + 70.. 79: ########################################### 37125 + 80.. 89: ################################################# 42287 + 90.. 99: ###################################################### 46691 + 100..109: ####################################################### 46977 + 110..119: ################################################# 42444 + 120..129: ############################################ 37719 + 130..139: ###################################### 32595 + 140..149: ################################ 27588 + 150..159: ########################## 22792 + 160..169: #################### 17805 + 170..179: ############### 13068 + 180..189: ######### 8218 + 190..199: ### 3115 + 200..209: 38 + ++++ Stats for triple dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats triple sum: + num: 500000, avg: 150.08, stddev: 50.51, median 150, min 0, max 299 + 0.. 14: 345 + 15.. 29: ## 2121 + 30.. 44: ##### 5372 + 45.. 59: ########## 10501 + 60.. 74: ################# 17031 + 75.. 89: ######################### 25417 + 90..104: ################################### 35148 + 105..119: ############################################# 45134 + 120..134: ################################################### 51751 + 135..149: ####################################################### 55090 + 150..164: ###################################################### 55074 + 165..179: #################################################### 52238 + 180..194: ############################################# 45651 + 195..209: ################################### 35994 + 210..224: ######################### 26039 + 225..239: ################# 17749 + 240..254: ########## 10870 + 255..269: ##### 5765 + 270..284: ## 2313 + 285..299: 397 + ++++ Stats for quad dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats quad sum: + num: 500000, avg: 200.13, stddev: 58.33, median 200, min 5, max 394 + 5.. 24: 102 + 25.. 44: 842 + 45.. 64: ## 3023 + 65.. 84: ###### 7154 + 85..104: ############ 14368 + 105..124: ##################### 25397 + 125..144: ############################### 37547 + 145..164: ########################################## 50174 + 165..184: ################################################## 60558 + 185..204: ####################################################### 65376 + 205..224: ##################################################### 63687 + 225..244: ############################################### 56248 + 245..264: ###################################### 45384 + 265..284: ########################## 31780 + 285..304: ################ 20158 + 305..324: ######### 10899 + 325..344: #### 5045 + 345..364: # 1848 + 365..384: 386 + 385..404: 24 + ++++ Stats for bind dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats ordered pair difference: + num: 1000000, avg: 25.02, stddev: 22.36, median 19, min 0, max 100 + 0.. 4: ####################################################### 193184 + 5.. 9: ##################################### 130024 + 10.. 14: ############################# 103828 + 15.. 19: ######################## 87496 + 20.. 24: ##################### 74431 + 25.. 29: ################## 64629 + 30.. 34: ################ 56663 + 35.. 39: ############# 48986 + 40.. 44: ############ 43424 + 45.. 49: ########## 37599 + 50.. 54: ######### 32787 + 55.. 59: ######## 28332 + 60.. 64: ###### 24023 + 65.. 69: ##### 20312 + 70.. 74: #### 16649 + 75.. 79: ### 13338 + 80.. 84: ## 10239 + 85.. 89: ## 7391 + 90.. 94: # 4548 + 95.. 99: 2015 + 100..104: 102 + +stats ordered pair sum: + num: 1000000, avg: 75.12, stddev: 46.93, median 72, min 0, max 200 + 0.. 9: ####################################################### 70423 + 10.. 19: ##################################################### 68068 + 20.. 29: ##################################################### 68449 + 30.. 39: ##################################################### 68577 + 40.. 49: ##################################################### 68763 + 50.. 59: ##################################################### 68351 + 60.. 69: ##################################################### 68744 + 70.. 79: ##################################################### 68451 + 80.. 89: ##################################################### 68309 + 90.. 99: ##################################################### 68835 + 100..109: ################################################## 64544 + 110..119: ########################################### 55512 + 120..129: ##################################### 47595 + 130..139: ############################### 39809 + 140..149: ######################### 32677 + 150..159: #################### 26312 + 160..169: ############### 20180 + 170..179: ########### 14265 + 180..189: ###### 8625 + 190..199: ## 3433 + 200..209: 78 + ++++ Stats for list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 361.42, stddev: 1230.75, median 9, min 0, max 9974 + 0.. 498: ####################################################### 4212 + 499.. 997: ####### 578 + 998..1496: 11 + 1497..1995: 15 + 1996..2494: 11 + 2495..2993: 10 + 2994..3492: 13 + 3493..3991: 12 + 3992..4490: 7 + 4491..4989: 8 + 4990..5488: 15 + 5489..5987: 14 + 5988..6486: 12 + 6487..6985: 8 + 6986..7484: 9 + 7485..7983: 19 + 7984..8482: 14 + 8483..8981: 11 + 8982..9480: 11 + 9481..9979: 10 + ++++ Stats for small_list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 15.79, stddev: 24.64, median 6, min 0, max 99 + 0.. 4: ###################################################### 1930 + 5.. 9: ####################################################### 1957 + 10.. 14: # 59 + 15.. 19: # 66 + 20.. 24: # 61 + 25.. 29: # 52 + 30.. 34: # 61 + 35.. 39: # 65 + 40.. 44: # 62 + 45.. 49: # 64 + 50.. 54: # 70 + 55.. 59: # 63 + 60.. 64: # 50 + 65.. 69: # 51 + 70.. 74: # 52 + 75.. 79: # 63 + 80.. 84: # 56 + 85.. 89: ## 75 + 90.. 94: ## 73 + 95.. 99: # 70 + ++++ Stats for list_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 7.51, stddev: 1.71, median 8, min 5, max 10 + 5: ###################################################### 834 + 6: ##################################################### 825 + 7: ##################################################### 820 + 8: ###################################################### 833 + 9: ####################################################### 844 + 10: ####################################################### 844 + ++++ Stats for list_repeat len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 42.00, stddev: 0.00, median 42, min 42, max 42 + 42: ####################################################### 5000 + ++++ Stats for array len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 361.42, stddev: 1230.75, median 9, min 0, max 9974 + 0.. 498: ####################################################### 4212 + 499.. 997: ####### 578 + 998..1496: 11 + 1497..1995: 15 + 1996..2494: 11 + 2495..2993: 10 + 2994..3492: 13 + 3493..3991: 12 + 3992..4490: 7 + 4491..4989: 8 + 4990..5488: 15 + 5489..5987: 14 + 5988..6486: 12 + 6487..6985: 8 + 6986..7484: 9 + 7485..7983: 19 + 7984..8482: 14 + 8483..8981: 11 + 8982..9480: 11 + 9481..9979: 10 + ++++ Stats for small_array len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 15.79, stddev: 24.64, median 6, min 0, max 99 + 0.. 4: ###################################################### 1930 + 5.. 9: ####################################################### 1957 + 10.. 14: # 59 + 15.. 19: # 66 + 20.. 24: # 61 + 25.. 29: # 52 + 30.. 34: # 61 + 35.. 39: # 65 + 40.. 44: # 62 + 45.. 49: # 64 + 50.. 54: # 70 + 55.. 59: # 63 + 60.. 64: # 50 + 65.. 69: # 51 + 70.. 74: # 52 + 75.. 79: # 63 + 80.. 84: # 56 + 85.. 89: ## 75 + 90.. 94: ## 73 + 95.. 99: # 70 + ++++ Stats for array_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 7.51, stddev: 1.71, median 8, min 5, max 10 + 5: ###################################################### 834 + 6: ##################################################### 825 + 7: ##################################################### 820 + 8: ###################################################### 833 + 9: ####################################################### 844 + 10: ####################################################### 844 + ++++ Stats for array_repeat len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 42.00, stddev: 0.00, median 42, min 42, max 42 + 42: ####################################################### 5000 + ++++ Stats for int_stats_neg ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 5000, avg: 0.17, stddev: 29.68, median 0, min -99, max 99 + -99..-90: # 65 + -89..-80: # 63 + -79..-70: # 64 + -69..-60: # 58 + -59..-50: # 67 + -49..-40: # 72 + -39..-30: # 61 + -29..-20: # 61 + -19..-10: # 67 + -9.. 0: ####################################################### 2076 + 1.. 10: ############################################## 1764 + 11.. 20: # 66 + 21.. 30: # 64 + 31.. 40: # 64 + 41.. 50: # 67 + 51.. 60: # 60 + 61.. 70: # 75 + 71.. 80: # 60 + 81.. 90: # 60 + 91..100: # 66 + ++++ Stats for small_signed_int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 0.90, stddev: 28.23, median 0, min -99, max 99 + -99..-90: # 12 + -89..-80: # 11 + -79..-70: # 9 + -69..-60: 6 + -59..-50: # 11 + -49..-40: # 13 + -39..-30: # 9 + -29..-20: # 13 + -19..-10: 8 + -9.. 0: ####################################################### 453 + 1.. 10: ######################################### 340 + 11.. 20: # 15 + 21.. 30: # 11 + 31.. 40: # 12 + 41.. 50: # 13 + 51.. 60: # 13 + 61.. 70: # 16 + 71.. 80: # 9 + 81.. 90: # 16 + 91..100: # 10 + ++++ Stats for small_nat dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 15.11, stddev: 23.27, median 6, min 0, max 99 + 0.. 4: #################################################### 377 + 5.. 9: ####################################################### 392 + 10.. 14: ## 20 + 15.. 19: ## 15 + 20.. 24: # 11 + 25.. 29: ## 17 + 30.. 34: ## 19 + 35.. 39: ## 17 + 40.. 44: # 10 + 45.. 49: # 9 + 50.. 54: # 8 + 55.. 59: # 9 + 60.. 64: ## 15 + 65.. 69: # 10 + 70.. 74: # 13 + 75.. 79: ## 19 + 80.. 84: # 11 + 85.. 89: # 13 + 90.. 94: 5 + 95.. 99: # 10 + ++++ Stats for nat dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 363.02, stddev: 1215.04, median 9, min 0, max 9476 + 0.. 473: ####################################################### 847 + 474.. 947: ###### 95 + 948..1421: 14 + 1422..1895: 3 + 1896..2369: 0 + 2370..2843: 3 + 2844..3317: 2 + 3318..3791: 3 + 3792..4265: 2 + 4266..4739: 4 + 4740..5213: 3 + 5214..5687: 4 + 5688..6161: 3 + 6162..6635: 4 + 6636..7109: 1 + 7110..7583: 4 + 7584..8057: 2 + 8058..8531: 1 + 8532..9005: 1 + 9006..9479: 4 + ++++ Stats for int_range (-43643) 435434 dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 195335.64, stddev: 136803.99, median 195583, min -43624, max 435210 + -43624..-19683: ############################################ 52 + -19682.. 4259: ######################################## 47 + 4260.. 28201: ############################## 36 + 28202.. 52143: ############################################ 52 + 52144.. 76085: ########################################## 50 + 76086..100027: ####################################################### 64 + 100028..123969: ############################################### 55 + 123970..147911: ######################################## 47 + 147912..171853: ############################################## 54 + 171854..195795: #################################### 43 + 195796..219737: ############################################## 54 + 219738..243679: ########################################### 51 + 243680..267621: ################################################ 57 + 267622..291563: ########################################## 49 + 291564..315505: #################################### 42 + 315506..339447: ###################################### 45 + 339448..363389: ################################################ 57 + 363390..387331: ###################################### 45 + 387332..411273: ########################################## 49 + 411274..435215: ########################################### 51 + ++++ Stats for int_range (-40000) 40000 dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: -173.78, stddev: 23042.92, median 180, min -39859, max 39942 + -39859..-35869: ############################################# 56 + -35868..-31878: ################################### 43 + -31877..-27887: ################################################# 60 + -27886..-23896: ##################################### 46 + -23895..-19905: ######################################## 49 + -19904..-15914: #################################### 45 + -15913..-11923: ############################################ 54 + -11922.. -7932: ############################################### 58 + -7931.. -3941: ######################################### 51 + -3940.. 50: ############################ 35 + 51.. 4041: ####################################### 48 + 4042.. 8032: ########################################## 52 + 8033.. 12023: ######################################### 51 + 12024.. 16014: ########################################### 53 + 16015.. 20005: ############################################ 54 + 20006.. 23996: ################################## 42 + 23997.. 27987: ####################################################### 67 + 27988.. 31978: ################################ 40 + 31979.. 35969: ######################################### 51 + 35970.. 39960: #################################### 45 + ++++ Stats for int_range (-4) 4 dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 0.02, stddev: 2.55, median 0, min -4, max 4 + -4: ############################################ 99 + -3: ##################################################### 118 + -2: ################################################## 111 + -1: ################################################## 113 + 0: ################################################## 113 + 1: ##################################################### 118 + 2: ############################################# 102 + 3: ####################################################### 122 + 4: ############################################## 104 + ++++ Stats for int_range (-4) 17 dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 6.67, stddev: 6.39, median 7, min -4, max 17 + -4..-3: ############################################# 90 + -2..-1: ############################################# 91 + 0.. 1: ########################################## 84 + 2.. 3: ############################################## 92 + 4.. 5: ########################################### 87 + 6.. 7: ########################################### 86 + 8.. 9: ############################################ 89 + 10..11: ########################################### 87 + 12..13: ####################################################### 110 + 14..15: ############################################# 91 + 16..17: ############################################## 93 + 18..19: 0 + 20..21: 0 + 22..23: 0 + 24..25: 0 + 26..27: 0 + 28..29: 0 + 30..31: 0 + 32..33: 0 + 34..35: 0 + ++++ Stats for int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 100000, avg: 336840.90, stddev: 619301756.02, median 895228, min -1073728193, max 1073739280 + -1073728193.. -966354820: ##################################################### 5009 + -966354819.. -858981446: #################################################### 5004 + -858981445.. -751608072: #################################################### 4917 + -751608071.. -644234698: ##################################################### 5028 + -644234697.. -536861324: #################################################### 4962 + -536861323.. -429487950: ##################################################### 5039 + -429487949.. -322114576: #################################################### 4927 + -322114575.. -214741202: ##################################################### 5054 + -214741201.. -107367828: ##################################################### 5065 + -107367827.. 5546: #################################################### 4954 + 5547.. 107378920: #################################################### 4943 + 107378921.. 214752294: ################################################### 4900 + 214752295.. 322125668: ###################################################### 5126 + 322125669.. 429499042: ####################################################### 5198 + 429499043.. 536872416: #################################################### 4988 + 536872417.. 644245790: #################################################### 4940 + 644245791.. 751619164: #################################################### 5002 + 751619165.. 858992538: #################################################### 4928 + 858992539.. 966365912: ##################################################### 5070 + 966365913.. 1073739286: #################################################### 4946 + ++++ Stats for oneof int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 1073741.63, stddev: 676575790.92, median 0, min -1073741824, max 1073741823 + -1073741824.. -966367642: ################## 208 + -966367641.. -858993459: 0 + -858993458.. -751619276: 0 + -751619275.. -644245093: 0 + -644245092.. -536870910: 0 + -536870909.. -429496727: 0 + -429496726.. -322122544: 0 + -322122543.. -214748361: 0 + -214748360.. -107374178: 0 + -107374177.. 5: ####################################################### 603 + 6.. 107374188: 0 + 107374189.. 214748371: 0 + 214748372.. 322122554: 0 + 322122555.. 429496737: 0 + 429496738.. 536870920: 0 + 536870921.. 644245103: 0 + 644245104.. 751619286: 0 + 751619287.. 858993469: 0 + 858993470.. 966367652: 0 + 966367653.. 1073741823: ################# 189 +================================================================================ +1 warning(s) +failure (60 tests failed, 3 tests errored, ran 131 tests) +random seed: 153870556 + ++++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 10351291.88, stddev: 432212939.52, median 9, min -1066972208, max 1073741823 + -1066972208.. -959936507: ## 27 + -959936506.. -852900805: ## 22 + -852900804.. -745865103: ## 22 + -745865102.. -638829401: # 18 + -638829400.. -531793699: # 17 + -531793698.. -424757997: ## 21 + -424757996.. -317722295: ### 33 + -317722294.. -210686593: ### 33 + -210686592.. -103650891: ### 32 + -103650890.. 3384811: ####################################################### 516 + 3384812.. 110420513: ### 34 + 110420514.. 217456215: ### 34 + 217456216.. 324491917: # 17 + 324491918.. 431527619: ## 24 + 431527620.. 538563321: ## 26 + 538563322.. 645599023: ## 20 + 645599024.. 752634725: ## 24 + 752634726.. 859670427: ## 27 + 859670428.. 966706129: ## 27 + 966706130.. 1073741823: ## 26 +================================================================================ +success (ran 1 tests) diff --git a/test/core/QCheck2_expect_test.expected b/test/core/QCheck2_expect_test.expected.64 similarity index 100% rename from test/core/QCheck2_expect_test.expected rename to test/core/QCheck2_expect_test.expected.64 diff --git a/test/core/QCheck_expect_test.expected.32 b/test/core/QCheck_expect_test.expected.32 new file mode 100644 index 00000000..6d139ddd --- /dev/null +++ b/test/core/QCheck_expect_test.expected.32 @@ -0,0 +1,1289 @@ +random seed: 1234 +50 7 4 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 (6,fun,50) (0,fun,2) (7,fun,66) (54,fun,9) (2,fun,5) (90,fun,4) (1,fun,4) (37,fun,7) (7,fun,1) (8,fun,5) +(6,fun,50) (0,fun,2) (7,fun,66) (54,fun,9) (2,fun,5) (90,fun,4) (1,fun,4) (37,fun,7) (7,fun,1) (8,fun,5) +(6,fun,50) (0,fun,2) (7,fun,66) (54,fun,9) (2,fun,5) (90,fun,4) (1,fun,4) (37,fun,7) (7,fun,1) (8,fun,5) +(6,fun,50) (0,fun,2) (7,fun,66) (54,fun,9) (2,fun,5) (90,fun,4) (1,fun,4) (37,fun,7) (7,fun,1) (8,fun,5) +(6,fun,50) (0,fun,2) (7,fun,66) (54,fun,9) (2,fun,5) (90,fun,4) (1,fun,4) (37,fun,7) (7,fun,1) (8,fun,5) +(6,fun,50) (0,fun,2) (7,fun,66) (54,fun,9) (2,fun,5) (90,fun,4) (1,fun,4) (37,fun,7) (7,fun,1) (8,fun,5) +(6,fun,50) (0,fun,2) (7,fun,66) (54,fun,9) (2,fun,5) (90,fun,4) (1,fun,4) (37,fun,7) (7,fun,1) (8,fun,5) +(6,fun,50) (0,fun,2) (7,fun,66) (54,fun,9) (2,fun,5) (90,fun,4) (1,fun,4) (37,fun,7) (7,fun,1) (8,fun,5) +911769578 +455884789 +227942395 +113971198 +56985599 +28492800 +14246400 +7123200 +3561600 +1780800 +890400 +445200 +222600 +111300 +55650 +27825 +13913 +6957 +3479 +1740 +870 +435 +218 +109 +55 +28 +14 +7 +4 +2 +1 +0 +[7; 1; 42; 1; 8; 5; 3; 9; 5; 38; 3; 3; 0; 1; 98; 1; 4; 13; 9; 2; 6; 9; 47; 6; 5; 8; 8; 6; 0; 9; 7; 2; 8; 6; 62; 6; 4; 31; 19; 1; 41; 60; 6; 5; 8; 1; 1; 4; 7; 7; 0; 5; 5; 71; 14; 26; 47; 5; 1; 6; 34; 9; 4; 2; 37; 3; 8; 4; 31; 6; 2; 1; 0; 7; 5; 1; 0; 15; 6; 1; 8; 13; 0; 6; 2; 4; 2; 6; 6; 1; 4; 1; 9; 79; 0; 87; 6; 8; 8; 62; 1; 4; 62; 6; 31; 1; 5; 6; 5; 9; 3; 3; 1; 79; 4; 3; 2; 67; 5; 7; 12; 70; 8; 8; 6; 1; 3; 14; 15; 1; 61; 4; 1; 4; 1; 7; 4; 4; 4; 2; 8; 8; 7; 5; 4; 27; 0; 9; 80; 25; 1; 8; 1; 3; 7; 4; 3; 5; 5; 6; 5; 5; 31; 7; 0; 3; 3; 6; 71; 76; 28; 60; 6; 2; 6; 3; 0; 4; 1; 0; 5; 7; 0; 28; 86; 4; 7; 51; 36; 0; 5; 0; 1; 4; 3; 6; 0; 1; 1; 8; 18; 4; 2; 8; 8; 1; 4; 7; 1; 0; 93; 5; 3; 0; 80; 1; 7; 7; 8; 8; 5; 7; 8; 9; 24; 4; 25; 8; 8; 5; 4; 90; 4; 6; 8; 4; 4; 0; 60; 8; 9; 7; 44; 5; 1; 2; 9; 74; 7; 7] +[7; 1; 42; 1; 8; 5; 3; 9; 5; 38; 3; 3; 0; 1; 98; 1; 4; 13; 9; 2; 6; 9; 47; 6; 5; 8; 8; 6; 0; 9; 7; 2; 8; 6; 62; 6; 4; 31; 19; 1; 41; 60; 6; 5; 8; 1; 1; 4; 7; 7; 0; 5; 5; 71; 14; 26; 47; 5; 1; 6; 34; 9; 4; 2; 37; 3; 8; 4; 31; 6; 2; 1; 0; 7; 5; 1; 0; 15; 6; 1; 8; 13; 0; 6; 2; 4; 2; 6; 6; 1; 4; 1; 9; 79; 0; 87; 6; 8; 8; 62; 1; 4; 62; 6; 31; 1; 5; 6; 5; 9; 3; 3; 1; 79; 4; 3; 2; 67; 5; 7; 12; 70; 8; 8; 6] +[7; 1; 42; 1; 8; 5; 3; 9; 5; 38; 3; 3; 0; 1; 98; 1; 4; 13; 9; 2; 6; 9; 47; 6; 5; 8; 8; 6; 0; 9; 7; 2; 8; 6; 62; 6; 4; 31; 19; 1; 41; 60; 6; 5; 8; 1; 1; 4; 7; 7; 0; 5; 5; 71; 14; 26; 47; 5; 1; 6; 34; 9; 4] +[7; 1; 42; 1; 8; 5; 3; 9; 5; 38; 3; 3; 0; 1; 98; 1; 4; 13; 9; 2; 6; 9; 47; 6; 5; 8; 8; 6; 0; 9; 7; 2] +[7; 1; 42; 1; 8; 5; 3; 9; 5; 38; 3; 3; 0; 1; 98; 1] +[7; 1; 42; 1; 8; 5; 3; 9] +[7; 1; 42; 1] +[7; 1] +[] +[7] +[] +[4] +[] +[2] +[] +[1] +[] +[0] +[] +[7; 1; 42; 1; 8; 5; 3; 9; 5; 38; 3; 3; 0; 1; 98; 1; 4; 13; 9; 2; 6; 9; 47; 6; 5; 8; 8; 6; 0; 9; 7; 2; 8; 6; 62; 6; 4; 31; 19; 1; 41; 60; 6; 5; 8; 1; 1; 4; 7; 7; 0; 5; 5; 71; 14; 26; 47; 5; 1; 6; 34; 9; 4; 2; 37; 3; 8; 4; 31; 6; 2; 1; 0; 7; 5; 1; 0; 15; 6; 1; 8; 13; 0; 6; 2; 4; 2; 6; 6; 1; 4; 1; 9; 79; 0; 87; 6; 8; 8; 62; 1; 4; 62; 6; 31; 1; 5; 6; 5; 9; 3; 3; 1; 79; 4; 3; 2; 67; 5; 7; 12; 70; 8; 8; 6; 1; 3; 14; 15; 1; 61; 4; 1; 4; 1; 7; 4; 4; 4; 2; 8; 8; 7; 5; 4; 27; 0; 9; 80; 25; 1; 8; 1; 3; 7; 4; 3; 5; 5; 6; 5; 5; 31; 7; 0; 3; 3; 6; 71; 76; 28; 60; 6; 2; 6; 3; 0; 4; 1; 0; 5; 7; 0; 28; 86; 4; 7; 51; 36; 0; 5; 0; 1; 4; 3; 6; 0; 1; 1; 8; 18; 4; 2; 8; 8; 1; 4; 7; 1; 0; 93; 5; 3; 0; 80; 1; 7; 7; 8; 8; 5; 7; 8; 9; 24; 4; 25; 8; 8; 5; 4; 90; 4; 6; 8; 4; 4; 0; 60; 8; 9; 7; 44; 5; 1; 2; 9; 74; 7; 7] +[7; 1; 42; 1; 8; 5; 3; 9; 5; 38; 3; 3; 0; 1; 98; 1; 4; 13; 9; 2; 6; 9; 47; 6; 5; 8; 8; 6; 0; 9; 7; 2; 8; 6; 62; 6; 4; 31; 19; 1; 41; 60; 6; 5; 8; 1; 1; 4; 7; 7; 0; 5; 5; 71; 14; 26; 47; 5; 1; 6; 34; 9; 4; 2; 37; 3; 8; 4; 31; 6; 2; 1; 0; 7; 5; 1; 0; 15; 6; 1; 8; 13; 0; 6; 2; 4; 2; 6; 6; 1; 4; 1; 9; 79; 0; 87; 6; 8; 8; 62; 1; 4; 62; 6; 31; 1; 5; 6; 5; 9; 3; 3; 1; 79; 4; 3; 2; 67; 5; 7; 12; 70; 8; 8; 6] +[7; 1; 42; 1; 8; 5; 3; 9; 5; 38; 3; 3; 0; 1; 98; 1; 4; 13; 9; 2; 6; 9; 47; 6; 5; 8; 8; 6; 0; 9; 7; 2; 8; 6; 62; 6; 4; 31; 19; 1; 41; 60; 6; 5; 8; 1; 1; 4; 7; 7; 0; 5; 5; 71; 14; 26; 47; 5; 1; 6; 34; 9; 4] +[7; 1; 42; 1; 8; 5; 3; 9; 5; 38; 3; 3; 0; 1; 98; 1; 4; 13; 9; 2; 6; 9; 47; 6; 5; 8; 8; 6; 0; 9; 7; 2] +[7; 1; 42; 1; 8; 5; 3; 9; 5; 38; 3; 3; 0; 1; 98; 1] +[7; 1; 42; 1; 8; 5; 3; 9] +[7; 1; 42; 1] +[7; 1] +[42; 1] +[7; 42; 1] +[1; 42; 1] +[1; 42] +[1] +[1; 1] +[] +[1] +[1] +[0; 1] +[1; 0] + +--- Failure -------------------------------------------------------------------- + +Test should_fail_sort_id failed (13 shrink steps): + +[1; 0] + +=== Error ====================================================================== + +Test should_error_raise_exn errored on (31 shrink steps): + +0 + +exception QCheck_tests.Overall.Error + + ++++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Collect results for test collect_results: + +4: 20 cases +3: 25 cases +2: 17 cases +1: 18 cases +0: 20 cases + ++++ Stats for with_stats ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats mod4: + num: 100, avg: 1.68, stddev: 1.09, median 2, min 0, max 3 + 0: ############################## 17 + 1: ################################################### 29 + 2: ######################################## 23 + 3: ####################################################### 31 + +stats num: + num: 100, avg: 66.84, stddev: 31.94, median 65, min 2, max 120 + 2.. 7: ################## 3 + 8.. 13: ################## 3 + 14.. 19: 0 + 20.. 25: ########################################## 7 + 26.. 31: ######################## 4 + 32.. 37: ######################## 4 + 38.. 43: ################## 3 + 44.. 49: ################################################ 8 + 50.. 55: #################################### 6 + 56.. 61: #################################### 6 + 62.. 67: ####################################################### 9 + 68.. 73: ########################################## 7 + 74.. 79: ######################## 4 + 80.. 85: ################## 3 + 86.. 91: ############ 2 + 92.. 97: ########################################## 7 + 98..103: #################################### 6 + 104..109: #################################### 6 + 110..115: ####################################################### 9 + 116..121: ################## 3 + +--- Failure -------------------------------------------------------------------- + +Test with shrinking retries failed (1 shrink steps): + +4 + +!!! Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +Warning for test WARN_unlikely_precond: + +WARNING: only 0.6% tests (of 2000) passed precondition for "WARN_unlikely_precond" + +NOTE: it is likely that the precondition is too strong, or that the generator is buggy. + +--- Failure -------------------------------------------------------------------- + +Test FAIL_unlikely_precond failed: + +ERROR: only 0.6% tests (of 2000) passed precondition for "FAIL_unlikely_precond" + +NOTE: it is likely that the precondition is too strong, or that the generator is buggy. + + +--- Failure -------------------------------------------------------------------- + +Test FAIL_bad_gen failed: + +ERROR: uncaught exception in generator for test FAIL_bad_gen after 100 steps: +Exception: Invalid_argument("Gen.int_bound") +Backtrace: + +--- Failure -------------------------------------------------------------------- + +Test int double failed: + +Negative test int double succeeded but was expected to fail + +=== Error ====================================================================== + +Test pos fail with error errored on (7 shrink steps): + +0 + +exception QCheck_tests.Overall.Error + + +=== Error ====================================================================== + +Test neg fail with error errored on (7 shrink steps): + +0 + +exception QCheck_tests.Overall.Error + + +--- Failure -------------------------------------------------------------------- + +Test char never produces '\255' failed (0 shrink steps): + +'\255' + +--- Failure -------------------------------------------------------------------- + +Test big bound issue59 failed (20 shrink steps): + +209609 + +--- Failure -------------------------------------------------------------------- + +Test long_shrink failed (87 shrink steps): + +([0], [-1]) + +--- Failure -------------------------------------------------------------------- + +Test ints arent 0 mod 3 failed (34 shrink steps): + +-21 + +--- Failure -------------------------------------------------------------------- + +Test ints are 0 failed (30 shrink steps): + +1 + +--- Failure -------------------------------------------------------------------- + +Test ints < 209609 failed (20 shrink steps): + +209609 + +--- Failure -------------------------------------------------------------------- + +Test nat < 5001 failed (6 shrink steps): + +5001 + +--- Failure -------------------------------------------------------------------- + +Test char never produces 'abcdef' failed (3 shrink steps): + +'a' + +--- Failure -------------------------------------------------------------------- + +Test printable never produces '!"#$%&' failed (2 shrink steps): + +'&' + +--- Failure -------------------------------------------------------------------- + +Test printable never produces less than '5 failed (3 shrink steps): + +'0' + +--- Failure -------------------------------------------------------------------- + +Test strings are empty failed (15 shrink steps): + +"a" + +--- Failure -------------------------------------------------------------------- + +Test string never has a \000 char failed (8 shrink steps): + +"\000" + +--- Failure -------------------------------------------------------------------- + +Test string never has a \255 char failed (14 shrink steps): + +"\255" + +--- Failure -------------------------------------------------------------------- + +Test strings have unique chars failed (13 shrink steps): + +"\129\129" + +--- Failure -------------------------------------------------------------------- + +Test pairs have different components failed (0 shrink steps): + +(4, 4) + +--- Failure -------------------------------------------------------------------- + +Test pairs have same components failed (60 shrink steps): + +(0, 1) + +--- Failure -------------------------------------------------------------------- + +Test pairs have a zero component failed (59 shrink steps): + +(-1, 1) + +--- Failure -------------------------------------------------------------------- + +Test pairs are (0,0) failed (60 shrink steps): + +(0, 1) + +--- Failure -------------------------------------------------------------------- + +Test pairs are ordered failed (214 shrink steps): + +(1, 0) + +--- Failure -------------------------------------------------------------------- + +Test pairs are ordered reversely failed (59 shrink steps): + +(0, 1) + +--- Failure -------------------------------------------------------------------- + +Test pairs sum to less than 128 failed (54 shrink steps): + +(0, 128) + +--- Failure -------------------------------------------------------------------- + +Test pairs lists rev concat failed (72 shrink steps): + +([0], [1]) + +--- Failure -------------------------------------------------------------------- + +Test pairs lists no overlap failed (26 shrink steps): + +([0], [0]) + +--- Failure -------------------------------------------------------------------- + +Test triples have pair-wise different components failed (7 shrink steps): + +(0, 7, 7) + +--- Failure -------------------------------------------------------------------- + +Test triples have same components failed (90 shrink steps): + +(0, -1, 0) + +--- Failure -------------------------------------------------------------------- + +Test triples are ordered failed (90 shrink steps): + +(0, -1, 0) + +--- Failure -------------------------------------------------------------------- + +Test triples are ordered reversely failed (90 shrink steps): + +(0, 0, 1) + +--- Failure -------------------------------------------------------------------- + +Test quadruples have pair-wise different components failed (23 shrink steps): + +(0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test quadruples have same components failed (119 shrink steps): + +(0, -1, -2, 0) + +--- Failure -------------------------------------------------------------------- + +Test quadruples are ordered failed (121 shrink steps): + +(0, 0, -1, 0) + +--- Failure -------------------------------------------------------------------- + +Test quadruples are ordered reversely failed (121 shrink steps): + +(0, 0, 0, 1) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b) in nat: a < b failed (13 shrink steps): + +(0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c) in nat: a < b < c failed (15 shrink steps): + +(0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c, d) in nat: a < b < c < d failed (23 shrink steps): + +(0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c, d, e) in nat: a < b < c < d < e failed (28 shrink steps): + +(0, 0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c, d, e, f) in nat: a < b < c < d < e < f failed (30 shrink steps): + +(0, 0, 0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c, d, e, f, g) in nat: a < b < c < d < e < f < g failed (31 shrink steps): + +(0, 0, 0, 0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c, d, e, f, g, h) in nat: a < b < c < d < e < f < g < h failed (35 shrink steps): + +(0, 0, 0, 0, 0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c, d, e, f, g, h, i) in nat: a < b < c < d < e < f < g < h < i failed (42 shrink steps): + +(0, 0, 0, 0, 0, 0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test bind ordered pairs failed (61 shrink steps): + +(0, 0) + +--- Failure -------------------------------------------------------------------- + +Test bind list_size constant failed (49 shrink steps): + +(4, [0; 0; 0; 0]) + +--- Failure -------------------------------------------------------------------- + +Test lists are empty failed (12 shrink steps): + +[0] + +--- Failure -------------------------------------------------------------------- + +Test lists shorter than 10 failed (39 shrink steps): + +[0; 0; 0; 0; 0; 0; 0; 0; 0; 0] + +--- Failure -------------------------------------------------------------------- + +Test lists shorter than 432 failed (1632 shrink steps): + +[...] list length: 432 + +--- Failure -------------------------------------------------------------------- + +Test lists shorter than 4332 failed (13 shrink steps): + +[...] list length: 4332 + +--- Failure -------------------------------------------------------------------- + +Test lists equal to duplication failed (26 shrink steps): + +[0] + +--- Failure -------------------------------------------------------------------- + +Test lists have unique elems failed (8 shrink steps): + +[1; 1] + +--- Failure -------------------------------------------------------------------- + +Test tree contains only 42 failed (10 shrink steps): + +Leaf 0 + +--- Failure -------------------------------------------------------------------- + +Test fail_pred_map_commute failed (47 shrink steps): + +([1], {_ -> 0}, {0 -> false; _ -> true}) + +--- Failure -------------------------------------------------------------------- + +Test fail_pred_strings failed (1 shrink steps): + +{some other string -> false; _ -> true} + +--- Failure -------------------------------------------------------------------- + +Test fold_left fold_right failed (34 shrink steps): + +(0, [1], {(1, 0) -> 1; _ -> 0}) + ++++ Messages ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Messages for test fold_left fold_right: + +l=[1], fold_left=1, fold_right=0 + + +--- Failure -------------------------------------------------------------------- + +Test fold_left fold_right uncurried failed (44 shrink steps): + +({(0, 7) -> 1; _ -> 0}, 0, [7]) + +--- Failure -------------------------------------------------------------------- + +Test fold_left fold_right uncurried fun last failed (34 shrink steps): + +(0, [1], {(1, 0) -> 1; _ -> 0}) + +--- Failure -------------------------------------------------------------------- + +Test fold_left test, fun first failed (36 shrink steps): + +({_ -> ""}, "a", [], [0]) + +--- Failure -------------------------------------------------------------------- + +Test FAIL_#99_1 failed: + +ERROR: uncaught exception in generator for test FAIL_#99_1 after 100 steps: +Exception: QCheck.No_example_found("<example>") +Backtrace: + ++++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Collect results for test bool dist: + +true: 250134 cases +false: 249866 cases + ++++ Stats for char code dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats char code: + num: 500000, avg: 127.42, stddev: 73.92, median 127, min 0, max 255 + 0.. 12: ###################################################### 25509 + 13.. 25: ###################################################### 25398 + 26.. 38: ###################################################### 25293 + 39.. 51: ###################################################### 25448 + 52.. 64: ###################################################### 25392 + 65.. 77: ####################################################### 25660 + 78.. 90: ###################################################### 25462 + 91..103: ###################################################### 25331 + 104..116: ##################################################### 25129 + 117..129: ###################################################### 25351 + 130..142: ###################################################### 25492 + 143..155: ###################################################### 25370 + 156..168: ###################################################### 25658 + 169..181: ###################################################### 25400 + 182..194: ##################################################### 25167 + 195..207: ###################################################### 25338 + 208..220: ##################################################### 25181 + 221..233: ##################################################### 25145 + 234..246: ###################################################### 25567 + 247..259: ##################################### 17709 + ++++ Stats for printable char code dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats char code: + num: 500000, avg: 77.76, stddev: 27.92, median 78, min 10, max 125 + 10.. 15: ######### 5392 + 16.. 21: 0 + 22.. 27: 0 + 28.. 33: ################## 10661 + 34.. 39: ###################################################### 31788 + 40.. 45: ###################################################### 31217 + 46.. 51: ####################################################### 31790 + 52.. 57: ###################################################### 31625 + 58.. 63: ###################################################### 31421 + 64.. 69: ###################################################### 31732 + 70.. 75: ###################################################### 31446 + 76.. 81: ###################################################### 31382 + 82.. 87: ###################################################### 31623 + 88.. 93: ###################################################### 31730 + 94.. 99: ##################################################### 31193 + 100..105: ###################################################### 31424 + 106..111: ###################################################### 31675 + 112..117: ###################################################### 31651 + 118..123: ###################################################### 31682 + 124..129: ################## 10568 + ++++ Stats for numeral char code dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats char code: + num: 500000, avg: 52.50, stddev: 2.87, median 52, min 48, max 57 + 48: ###################################################### 50260 + 49: ###################################################### 49590 + 50: ###################################################### 50170 + 51: ####################################################### 50270 + 52: ###################################################### 49805 + 53: ###################################################### 50161 + 54: ###################################################### 49919 + 55: ###################################################### 49971 + 56: ###################################################### 49980 + 57: ###################################################### 49874 + ++++ Stats for tree's depth ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats depth: + num: 1000, avg: 3.74, stddev: 3.28, median 3, min 1, max 15 + 1: ####################################################### 377 + 2: ################ 113 + 3: ############ 87 + 4: ################# 123 + 5: ########### 81 + 6: #### 33 + 7: ##### 40 + 8: ##### 39 + 9: # 9 + 10: ### 25 + 11: ####### 49 + 12: 4 + 13: # 9 + 14: # 7 + 15: 4 + ++++ Stats for range_subset_spec ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 5000, avg: 9.97, stddev: 6.08, median 10, min 0, max 20 + 0: ################################################# 246 + 1: ################################################ 244 + 2: ################################################ 240 + 3: ################################################ 243 + 4: ############################################## 232 + 5: ############################################## 230 + 6: ############################################### 239 + 7: ############################################### 235 + 8: ####################################################### 274 + 9: ############################################## 233 + 10: ########################################## 212 + 11: ############################################## 231 + 12: ############################################### 239 + 13: ############################################# 226 + 14: ############################################# 225 + 15: ################################################### 256 + 16: ################################################ 240 + 17: ############################################# 229 + 18: ################################################ 243 + 19: ################################################## 253 + 20: ############################################## 230 + ++++ Stats for string_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 7.49, stddev: 1.70, median 7, min 5, max 10 + 5: ##################################################### 837 + 6: ##################################################### 826 + 7: ###################################################### 843 + 8: ####################################################### 855 + 9: #################################################### 813 + 10: ##################################################### 826 + ++++ Stats for string len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 384.53, stddev: 1330.61, median 9, min 0, max 9969 + 0.. 498: ####################################################### 4246 + 499.. 997: ###### 518 + 998..1496: 21 + 1497..1995: 10 + 1996..2494: 11 + 2495..2993: 10 + 2994..3492: 13 + 3493..3991: 13 + 3992..4490: 5 + 4491..4989: 10 + 4990..5488: 19 + 5489..5987: 9 + 5988..6486: 10 + 6487..6985: 12 + 6986..7484: 17 + 7485..7983: 16 + 7984..8482: 16 + 8483..8981: 16 + 8982..9480: 16 + 9481..9979: 12 + ++++ Stats for string_of len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 363.14, stddev: 1245.80, median 9, min 0, max 9986 + 0.. 499: ####################################################### 4270 + 500.. 999: ###### 493 + 1000.. 1499: 16 + 1500.. 1999: 11 + 2000.. 2499: 15 + 2500.. 2999: 17 + 3000.. 3499: 11 + 3500.. 3999: 19 + 4000.. 4499: 14 + 4500.. 4999: 10 + 5000.. 5499: 16 + 5500.. 5999: 11 + 6000.. 6499: 15 + 6500.. 6999: 13 + 7000.. 7499: 12 + 7500.. 7999: 16 + 8000.. 8499: 11 + 8500.. 8999: 4 + 9000.. 9499: 13 + 9500.. 9999: 13 + ++++ Stats for printable_string len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 384.53, stddev: 1330.61, median 9, min 0, max 9969 + 0.. 498: ####################################################### 4246 + 499.. 997: ###### 518 + 998..1496: 21 + 1497..1995: 10 + 1996..2494: 11 + 2495..2993: 10 + 2994..3492: 13 + 3493..3991: 13 + 3992..4490: 5 + 4491..4989: 10 + 4990..5488: 19 + 5489..5987: 9 + 5988..6486: 10 + 6487..6985: 12 + 6986..7484: 17 + 7485..7983: 16 + 7984..8482: 16 + 8483..8981: 16 + 8982..9480: 16 + 9481..9979: 12 + ++++ Stats for small_string len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 15.57, stddev: 24.36, median 6, min 0, max 99 + 0.. 4: #################################################### 1925 + 5.. 9: ####################################################### 2005 + 10.. 14: # 52 + 15.. 19: # 50 + 20.. 24: # 55 + 25.. 29: # 56 + 30.. 34: # 55 + 35.. 39: # 49 + 40.. 44: # 65 + 45.. 49: # 65 + 50.. 54: # 55 + 55.. 59: # 68 + 60.. 64: # 61 + 65.. 69: # 65 + 70.. 74: # 57 + 75.. 79: # 66 + 80.. 84: # 65 + 85.. 89: # 64 + 90.. 94: # 60 + 95.. 99: # 62 + ++++ Stats for pair dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats pair sum: + num: 500000, avg: 100.02, stddev: 41.22, median 100, min 0, max 200 + 0.. 9: ### 2685 + 10.. 19: ######## 7622 + 20.. 29: ############## 12474 + 30.. 39: #################### 17330 + 40.. 49: ########################## 22263 + 50.. 59: ############################### 26982 + 60.. 69: ##################################### 32182 + 70.. 79: ########################################### 37125 + 80.. 89: ################################################# 42287 + 90.. 99: ###################################################### 46691 + 100..109: ####################################################### 46977 + 110..119: ################################################# 42444 + 120..129: ############################################ 37719 + 130..139: ###################################### 32595 + 140..149: ################################ 27588 + 150..159: ########################## 22792 + 160..169: #################### 17805 + 170..179: ############### 13068 + 180..189: ######### 8218 + 190..199: ### 3115 + 200..209: 38 + ++++ Stats for triple dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats triple sum: + num: 500000, avg: 150.08, stddev: 50.51, median 150, min 0, max 299 + 0.. 14: 345 + 15.. 29: ## 2121 + 30.. 44: ##### 5372 + 45.. 59: ########## 10501 + 60.. 74: ################# 17031 + 75.. 89: ######################### 25417 + 90..104: ################################### 35148 + 105..119: ############################################# 45134 + 120..134: ################################################### 51751 + 135..149: ####################################################### 55090 + 150..164: ###################################################### 55074 + 165..179: #################################################### 52238 + 180..194: ############################################# 45651 + 195..209: ################################### 35994 + 210..224: ######################### 26039 + 225..239: ################# 17749 + 240..254: ########## 10870 + 255..269: ##### 5765 + 270..284: ## 2313 + 285..299: 397 + ++++ Stats for quad dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats quad sum: + num: 500000, avg: 200.13, stddev: 58.33, median 200, min 5, max 394 + 5.. 24: 102 + 25.. 44: 842 + 45.. 64: ## 3023 + 65.. 84: ###### 7154 + 85..104: ############ 14368 + 105..124: ##################### 25397 + 125..144: ############################### 37547 + 145..164: ########################################## 50174 + 165..184: ################################################## 60558 + 185..204: ####################################################### 65376 + 205..224: ##################################################### 63687 + 225..244: ############################################### 56248 + 245..264: ###################################### 45384 + 265..284: ########################## 31780 + 285..304: ################ 20158 + 305..324: ######### 10899 + 325..344: #### 5045 + 345..364: # 1848 + 365..384: 386 + 385..404: 24 + ++++ Stats for bind dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats ordered pair difference: + num: 1000000, avg: 25.02, stddev: 22.36, median 19, min 0, max 100 + 0.. 4: ####################################################### 193184 + 5.. 9: ##################################### 130024 + 10.. 14: ############################# 103828 + 15.. 19: ######################## 87496 + 20.. 24: ##################### 74431 + 25.. 29: ################## 64629 + 30.. 34: ################ 56663 + 35.. 39: ############# 48986 + 40.. 44: ############ 43424 + 45.. 49: ########## 37599 + 50.. 54: ######### 32787 + 55.. 59: ######## 28332 + 60.. 64: ###### 24023 + 65.. 69: ##### 20312 + 70.. 74: #### 16649 + 75.. 79: ### 13338 + 80.. 84: ## 10239 + 85.. 89: ## 7391 + 90.. 94: # 4548 + 95.. 99: 2015 + 100..104: 102 + +stats ordered pair sum: + num: 1000000, avg: 75.12, stddev: 46.93, median 72, min 0, max 200 + 0.. 9: ####################################################### 70423 + 10.. 19: ##################################################### 68068 + 20.. 29: ##################################################### 68449 + 30.. 39: ##################################################### 68577 + 40.. 49: ##################################################### 68763 + 50.. 59: ##################################################### 68351 + 60.. 69: ##################################################### 68744 + 70.. 79: ##################################################### 68451 + 80.. 89: ##################################################### 68309 + 90.. 99: ##################################################### 68835 + 100..109: ################################################## 64544 + 110..119: ########################################### 55512 + 120..129: ##################################### 47595 + 130..139: ############################### 39809 + 140..149: ######################### 32677 + 150..159: #################### 26312 + 160..169: ############### 20180 + 170..179: ########### 14265 + 180..189: ###### 8625 + 190..199: ## 3433 + 200..209: 78 + ++++ Stats for list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 361.42, stddev: 1230.75, median 9, min 0, max 9974 + 0.. 498: ####################################################### 4212 + 499.. 997: ####### 578 + 998..1496: 11 + 1497..1995: 15 + 1996..2494: 11 + 2495..2993: 10 + 2994..3492: 13 + 3493..3991: 12 + 3992..4490: 7 + 4491..4989: 8 + 4990..5488: 15 + 5489..5987: 14 + 5988..6486: 12 + 6487..6985: 8 + 6986..7484: 9 + 7485..7983: 19 + 7984..8482: 14 + 8483..8981: 11 + 8982..9480: 11 + 9481..9979: 10 + ++++ Stats for small_list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 15.79, stddev: 24.64, median 6, min 0, max 99 + 0.. 4: ###################################################### 1930 + 5.. 9: ####################################################### 1957 + 10.. 14: # 59 + 15.. 19: # 66 + 20.. 24: # 61 + 25.. 29: # 52 + 30.. 34: # 61 + 35.. 39: # 65 + 40.. 44: # 62 + 45.. 49: # 64 + 50.. 54: # 70 + 55.. 59: # 63 + 60.. 64: # 50 + 65.. 69: # 51 + 70.. 74: # 52 + 75.. 79: # 63 + 80.. 84: # 56 + 85.. 89: ## 75 + 90.. 94: ## 73 + 95.. 99: # 70 + ++++ Stats for list_of_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 7.51, stddev: 1.71, median 8, min 5, max 10 + 5: ###################################################### 834 + 6: ##################################################### 825 + 7: ##################################################### 820 + 8: ###################################################### 833 + 9: ####################################################### 844 + 10: ####################################################### 844 + ++++ Stats for list_repeat len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 42.00, stddev: 0.00, median 42, min 42, max 42 + 42: ####################################################### 5000 + ++++ Stats for array len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 361.42, stddev: 1230.75, median 9, min 0, max 9974 + 0.. 498: ####################################################### 4212 + 499.. 997: ####### 578 + 998..1496: 11 + 1497..1995: 15 + 1996..2494: 11 + 2495..2993: 10 + 2994..3492: 13 + 3493..3991: 12 + 3992..4490: 7 + 4491..4989: 8 + 4990..5488: 15 + 5489..5987: 14 + 5988..6486: 12 + 6487..6985: 8 + 6986..7484: 9 + 7485..7983: 19 + 7984..8482: 14 + 8483..8981: 11 + 8982..9480: 11 + 9481..9979: 10 + ++++ Stats for small_array len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 15.79, stddev: 24.64, median 6, min 0, max 99 + 0.. 4: ###################################################### 1930 + 5.. 9: ####################################################### 1957 + 10.. 14: # 59 + 15.. 19: # 66 + 20.. 24: # 61 + 25.. 29: # 52 + 30.. 34: # 61 + 35.. 39: # 65 + 40.. 44: # 62 + 45.. 49: # 64 + 50.. 54: # 70 + 55.. 59: # 63 + 60.. 64: # 50 + 65.. 69: # 51 + 70.. 74: # 52 + 75.. 79: # 63 + 80.. 84: # 56 + 85.. 89: ## 75 + 90.. 94: ## 73 + 95.. 99: # 70 + ++++ Stats for array_of_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 7.51, stddev: 1.71, median 8, min 5, max 10 + 5: ###################################################### 834 + 6: ##################################################### 825 + 7: ##################################################### 820 + 8: ###################################################### 833 + 9: ####################################################### 844 + 10: ####################################################### 844 + ++++ Stats for array_repeat len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 42.00, stddev: 0.00, median 42, min 42, max 42 + 42: ####################################################### 5000 + ++++ Stats for int_stats_neg ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 5000, avg: 0.17, stddev: 29.68, median 0, min -99, max 99 + -99..-90: # 65 + -89..-80: # 63 + -79..-70: # 64 + -69..-60: # 58 + -59..-50: # 67 + -49..-40: # 72 + -39..-30: # 61 + -29..-20: # 61 + -19..-10: # 67 + -9.. 0: ####################################################### 2076 + 1.. 10: ############################################## 1764 + 11.. 20: # 66 + 21.. 30: # 64 + 31.. 40: # 64 + 41.. 50: # 67 + 51.. 60: # 60 + 61.. 70: # 75 + 71.. 80: # 60 + 81.. 90: # 60 + 91..100: # 66 + ++++ Stats for small_signed_int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 0.90, stddev: 28.23, median 0, min -99, max 99 + -99..-90: # 12 + -89..-80: # 11 + -79..-70: # 9 + -69..-60: 6 + -59..-50: # 11 + -49..-40: # 13 + -39..-30: # 9 + -29..-20: # 13 + -19..-10: 8 + -9.. 0: ####################################################### 453 + 1.. 10: ######################################### 340 + 11.. 20: # 15 + 21.. 30: # 11 + 31.. 40: # 12 + 41.. 50: # 13 + 51.. 60: # 13 + 61.. 70: # 16 + 71.. 80: # 9 + 81.. 90: # 16 + 91..100: # 10 + ++++ Stats for small_nat dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 15.11, stddev: 23.27, median 6, min 0, max 99 + 0.. 4: #################################################### 377 + 5.. 9: ####################################################### 392 + 10.. 14: ## 20 + 15.. 19: ## 15 + 20.. 24: # 11 + 25.. 29: ## 17 + 30.. 34: ## 19 + 35.. 39: ## 17 + 40.. 44: # 10 + 45.. 49: # 9 + 50.. 54: # 8 + 55.. 59: # 9 + 60.. 64: ## 15 + 65.. 69: # 10 + 70.. 74: # 13 + 75.. 79: ## 19 + 80.. 84: # 11 + 85.. 89: # 13 + 90.. 94: 5 + 95.. 99: # 10 + ++++ Stats for nat dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 363.02, stddev: 1215.04, median 9, min 0, max 9476 + 0.. 473: ####################################################### 847 + 474.. 947: ###### 95 + 948..1421: 14 + 1422..1895: 3 + 1896..2369: 0 + 2370..2843: 3 + 2844..3317: 2 + 3318..3791: 3 + 3792..4265: 2 + 4266..4739: 4 + 4740..5213: 3 + 5214..5687: 4 + 5688..6161: 3 + 6162..6635: 4 + 6636..7109: 1 + 7110..7583: 4 + 7584..8057: 2 + 8058..8531: 1 + 8532..9005: 1 + 9006..9479: 4 + ++++ Stats for int_range (-43643) 435434 dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 195335.64, stddev: 136803.99, median 195583, min -43624, max 435210 + -43624..-19683: ############################################ 52 + -19682.. 4259: ######################################## 47 + 4260.. 28201: ############################## 36 + 28202.. 52143: ############################################ 52 + 52144.. 76085: ########################################## 50 + 76086..100027: ####################################################### 64 + 100028..123969: ############################################### 55 + 123970..147911: ######################################## 47 + 147912..171853: ############################################## 54 + 171854..195795: #################################### 43 + 195796..219737: ############################################## 54 + 219738..243679: ########################################### 51 + 243680..267621: ################################################ 57 + 267622..291563: ########################################## 49 + 291564..315505: #################################### 42 + 315506..339447: ###################################### 45 + 339448..363389: ################################################ 57 + 363390..387331: ###################################### 45 + 387332..411273: ########################################## 49 + 411274..435215: ########################################### 51 + ++++ Stats for int_range (-40000) 40000 dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: -173.78, stddev: 23042.92, median 180, min -39859, max 39942 + -39859..-35869: ############################################# 56 + -35868..-31878: ################################### 43 + -31877..-27887: ################################################# 60 + -27886..-23896: ##################################### 46 + -23895..-19905: ######################################## 49 + -19904..-15914: #################################### 45 + -15913..-11923: ############################################ 54 + -11922.. -7932: ############################################### 58 + -7931.. -3941: ######################################### 51 + -3940.. 50: ############################ 35 + 51.. 4041: ####################################### 48 + 4042.. 8032: ########################################## 52 + 8033.. 12023: ######################################### 51 + 12024.. 16014: ########################################### 53 + 16015.. 20005: ############################################ 54 + 20006.. 23996: ################################## 42 + 23997.. 27987: ####################################################### 67 + 27988.. 31978: ################################ 40 + 31979.. 35969: ######################################### 51 + 35970.. 39960: #################################### 45 + ++++ Stats for int_range (-4) 4 dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 0.02, stddev: 2.55, median 0, min -4, max 4 + -4: ############################################ 99 + -3: ##################################################### 118 + -2: ################################################## 111 + -1: ################################################## 113 + 0: ################################################## 113 + 1: ##################################################### 118 + 2: ############################################# 102 + 3: ####################################################### 122 + 4: ############################################## 104 + ++++ Stats for int_range (-4) 17 dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 6.67, stddev: 6.39, median 7, min -4, max 17 + -4..-3: ############################################# 90 + -2..-1: ############################################# 91 + 0.. 1: ########################################## 84 + 2.. 3: ############################################## 92 + 4.. 5: ########################################### 87 + 6.. 7: ########################################### 86 + 8.. 9: ############################################ 89 + 10..11: ########################################### 87 + 12..13: ####################################################### 110 + 14..15: ############################################# 91 + 16..17: ############################################## 93 + 18..19: 0 + 20..21: 0 + 22..23: 0 + 24..25: 0 + 26..27: 0 + 28..29: 0 + 30..31: 0 + 32..33: 0 + 34..35: 0 + ++++ Stats for int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 100000, avg: 336840.90, stddev: 619301756.02, median 895228, min -1073728193, max 1073739280 + -1073728193.. -966354820: ##################################################### 5009 + -966354819.. -858981446: #################################################### 5004 + -858981445.. -751608072: #################################################### 4917 + -751608071.. -644234698: ##################################################### 5028 + -644234697.. -536861324: #################################################### 4962 + -536861323.. -429487950: ##################################################### 5039 + -429487949.. -322114576: #################################################### 4927 + -322114575.. -214741202: ##################################################### 5054 + -214741201.. -107367828: ##################################################### 5065 + -107367827.. 5546: #################################################### 4954 + 5547.. 107378920: #################################################### 4943 + 107378921.. 214752294: ################################################### 4900 + 214752295.. 322125668: ###################################################### 5126 + 322125669.. 429499042: ####################################################### 5198 + 429499043.. 536872416: #################################################### 4988 + 536872417.. 644245790: #################################################### 4940 + 644245791.. 751619164: #################################################### 5002 + 751619165.. 858992538: #################################################### 4928 + 858992539.. 966365912: ##################################################### 5070 + 966365913.. 1073739286: #################################################### 4946 + ++++ Stats for oneof int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 1073741.63, stddev: 676575790.92, median 0, min -1073741824, max 1073741823 + -1073741824.. -966367642: ################## 208 + -966367641.. -858993459: 0 + -858993458.. -751619276: 0 + -751619275.. -644245093: 0 + -644245092.. -536870910: 0 + -536870909.. -429496727: 0 + -429496726.. -322122544: 0 + -322122543.. -214748361: 0 + -214748360.. -107374178: 0 + -107374177.. 5: ####################################################### 603 + 6.. 107374188: 0 + 107374189.. 214748371: 0 + 214748372.. 322122554: 0 + 322122555.. 429496737: 0 + 429496738.. 536870920: 0 + 536870921.. 644245103: 0 + 644245104.. 751619286: 0 + 751619287.. 858993469: 0 + 858993470.. 966367652: 0 + 966367653.. 1073741823: ################# 189 +================================================================================ +1 warning(s) +failure (60 tests failed, 3 tests errored, ran 140 tests) +random seed: 153870556 + ++++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 10351291.88, stddev: 432212939.52, median 9, min -1066972208, max 1073741823 + -1066972208.. -959936507: ## 27 + -959936506.. -852900805: ## 22 + -852900804.. -745865103: ## 22 + -745865102.. -638829401: # 18 + -638829400.. -531793699: # 17 + -531793698.. -424757997: ## 21 + -424757996.. -317722295: ### 33 + -317722294.. -210686593: ### 33 + -210686592.. -103650891: ### 32 + -103650890.. 3384811: ####################################################### 516 + 3384812.. 110420513: ### 34 + 110420514.. 217456215: ### 34 + 217456216.. 324491917: # 17 + 324491918.. 431527619: ## 24 + 431527620.. 538563321: ## 26 + 538563322.. 645599023: ## 20 + 645599024.. 752634725: ## 24 + 752634726.. 859670427: ## 27 + 859670428.. 966706129: ## 27 + 966706130.. 1073741823: ## 26 +================================================================================ +success (ran 1 tests) diff --git a/test/core/QCheck_expect_test.expected b/test/core/QCheck_expect_test.expected.64 similarity index 100% rename from test/core/QCheck_expect_test.expected rename to test/core/QCheck_expect_test.expected.64 diff --git a/test/core/dune b/test/core/dune index f14c8571..a60f71ae 100644 --- a/test/core/dune +++ b/test/core/dune @@ -1,3 +1,7 @@ +(* -*- tuareg -*- *) + +let dune = Printf.sprintf {| + (library (name QCheck_tests) (modules QCheck_tests) @@ -8,16 +12,38 @@ (modules QCheck2_tests) (libraries qcheck-core)) -(tests - (names QCheck_expect_test) +(executable + (name QCheck_expect_test) (modules QCheck_expect_test) (libraries qcheck-core qcheck-core.runner QCheck_tests)) -(tests - (names QCheck2_expect_test) +(rule + (targets QCheck_expect_test.out) + (action + (with-stdout-to %%{targets} + (run ./QCheck_expect_test.exe --no-colors -s 1234)))) + +(rule + (alias runtest) + (package qcheck-core) + (action (diff QCheck_expect_test.expected.%i QCheck_expect_test.out))) + +(executable + (name QCheck2_expect_test) (modules QCheck2_expect_test) (libraries qcheck-core qcheck-core.runner QCheck2_tests)) +(rule + (targets QCheck2_expect_test.out) + (action + (with-stdout-to %%{targets} + (run ./QCheck2_expect_test.exe --no-colors -s 1234)))) + +(rule + (alias runtest) + (package qcheck-core) + (action (diff QCheck2_expect_test.expected.%i QCheck2_expect_test.out))) + (tests (names QCheck_unit_tests QCheck2_unit_tests) (modules QCheck_unit_tests QCheck2_unit_tests) @@ -28,3 +54,7 @@ (name shrink_benchmark) (modules shrink_benchmark) (libraries qcheck-core qcheck-core.runner QCheck_tests QCheck2_tests)) + +|} Sys.word_size Sys.word_size + +let () = Jbuild_plugin.V1.send dune From 474aa3d10981c039a4e6524e9c29703502243004 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 6 Jul 2022 20:37:36 +0200 Subject: [PATCH 058/391] update CHANGELOG --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee28ed08..9fdd7e0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,8 @@ - add environment variable `QCHECK_LONG_FACTOR` similar to `QCHECK_COUNT` [#220](https://github.com/c-cube/qcheck/pull/220) +- make test suite run on 32-bit architectures + ## 0.18.1 - fix `Gen.{nat,pos}_split{2,}` From 55f29e9b6fd30e445e8dc4d292cf0165bb9fc50d Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 7 Jul 2022 17:57:46 +0200 Subject: [PATCH 059/391] 0.19 not available on ppc64 because segfaults --- qcheck-alcotest.opam | 1 + qcheck-core.opam | 1 + qcheck-ounit.opam | 1 + qcheck.opam | 1 + 4 files changed, 4 insertions(+) diff --git a/qcheck-alcotest.opam b/qcheck-alcotest.opam index d13e995a..dcfc512e 100644 --- a/qcheck-alcotest.opam +++ b/qcheck-alcotest.opam @@ -26,5 +26,6 @@ depends: [ "odoc" {with-doc} "ocaml" {>= "4.08.0"} ] +available: [ arch != "ppc64" ] dev-repo: "git+https://github.com/c-cube/qcheck.git" bug-reports: "https://github.com/c-cube/qcheck/issues" diff --git a/qcheck-core.opam b/qcheck-core.opam index a565434c..d237ff3f 100644 --- a/qcheck-core.opam +++ b/qcheck-core.opam @@ -26,6 +26,7 @@ depends: [ ] dev-repo: "git+https://github.com/c-cube/qcheck.git" bug-reports: "https://github.com/c-cube/qcheck/issues" +available: [ arch != "ppc64" ] conflicts: [ "ounit" { < "2.0" } ] diff --git a/qcheck-ounit.opam b/qcheck-ounit.opam index 4c597d9f..838d7fa4 100644 --- a/qcheck-ounit.opam +++ b/qcheck-ounit.opam @@ -25,5 +25,6 @@ depends: [ "odoc" {with-doc} "ocaml" {>= "4.08.0"} ] +available: [ arch != "ppc64" ] dev-repo: "git+https://github.com/c-cube/qcheck.git" bug-reports: "https://github.com/c-cube/qcheck/issues" diff --git a/qcheck.opam b/qcheck.opam index 6fe33c00..83ddad21 100644 --- a/qcheck.opam +++ b/qcheck.opam @@ -28,6 +28,7 @@ depends: [ ] dev-repo: "git+https://github.com/c-cube/qcheck.git" bug-reports: "https://github.com/c-cube/qcheck/issues" +available: [ arch != "ppc64" ] conflicts: [ "ounit" { < "2.0" } ] From 536abb23ccc95d22c493269105834c542bcec001 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 7 Jul 2022 19:22:55 +0200 Subject: [PATCH 060/391] ppx_deriving_qcheck requires Gen.option which is 0.19 --- ppx_deriving_qcheck.opam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ppx_deriving_qcheck.opam b/ppx_deriving_qcheck.opam index 7732445c..119431cf 100644 --- a/ppx_deriving_qcheck.opam +++ b/ppx_deriving_qcheck.opam @@ -10,7 +10,7 @@ author: [ "the qcheck contributors" ] depends: [ "dune" {>= "2.8.0"} "ocaml" {>= "4.08.0"} - "qcheck" {>= "0.17"} + "qcheck" {>= "0.19"} "ppxlib" {>= "0.22.0"} "ppx_deriving" {>= "5.2.1"} "odoc" {with-doc} From 3516aeb2b1296be3da51f222e3d21fd51ce7a2b5 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 8 Jul 2022 16:36:47 +0200 Subject: [PATCH 061/391] reenable 0.19 on ppc64 --- qcheck-alcotest.opam | 1 - qcheck-core.opam | 1 - qcheck-ounit.opam | 1 - qcheck.opam | 1 - 4 files changed, 4 deletions(-) diff --git a/qcheck-alcotest.opam b/qcheck-alcotest.opam index dcfc512e..d13e995a 100644 --- a/qcheck-alcotest.opam +++ b/qcheck-alcotest.opam @@ -26,6 +26,5 @@ depends: [ "odoc" {with-doc} "ocaml" {>= "4.08.0"} ] -available: [ arch != "ppc64" ] dev-repo: "git+https://github.com/c-cube/qcheck.git" bug-reports: "https://github.com/c-cube/qcheck/issues" diff --git a/qcheck-core.opam b/qcheck-core.opam index d237ff3f..a565434c 100644 --- a/qcheck-core.opam +++ b/qcheck-core.opam @@ -26,7 +26,6 @@ depends: [ ] dev-repo: "git+https://github.com/c-cube/qcheck.git" bug-reports: "https://github.com/c-cube/qcheck/issues" -available: [ arch != "ppc64" ] conflicts: [ "ounit" { < "2.0" } ] diff --git a/qcheck-ounit.opam b/qcheck-ounit.opam index 838d7fa4..4c597d9f 100644 --- a/qcheck-ounit.opam +++ b/qcheck-ounit.opam @@ -25,6 +25,5 @@ depends: [ "odoc" {with-doc} "ocaml" {>= "4.08.0"} ] -available: [ arch != "ppc64" ] dev-repo: "git+https://github.com/c-cube/qcheck.git" bug-reports: "https://github.com/c-cube/qcheck/issues" diff --git a/qcheck.opam b/qcheck.opam index 83ddad21..6fe33c00 100644 --- a/qcheck.opam +++ b/qcheck.opam @@ -28,7 +28,6 @@ depends: [ ] dev-repo: "git+https://github.com/c-cube/qcheck.git" bug-reports: "https://github.com/c-cube/qcheck/issues" -available: [ arch != "ppc64" ] conflicts: [ "ounit" { < "2.0" } ] From 542cffde1abb252ab6ae95607fd1247472e36069 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 8 Jul 2022 16:39:53 +0200 Subject: [PATCH 062/391] disable list_equal_dupl b/c ppc64 stackoverflow segfault --- test/core/QCheck2_tests.ml | 2 +- test/core/QCheck_tests.ml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/core/QCheck2_tests.ml b/test/core/QCheck2_tests.ml index 24954dbc..118c8bbb 100644 --- a/test/core/QCheck2_tests.ml +++ b/test/core/QCheck2_tests.ml @@ -634,7 +634,7 @@ module Shrink = struct list_shorter_10; list_shorter_432; list_shorter_4332; - list_equal_dupl; + (*list_equal_dupl;*) list_unique_elems; tree_contains_only_42; ] diff --git a/test/core/QCheck_tests.ml b/test/core/QCheck_tests.ml index 805b28cd..0b26559c 100644 --- a/test/core/QCheck_tests.ml +++ b/test/core/QCheck_tests.ml @@ -711,7 +711,7 @@ module Shrink = struct list_shorter_10; list_shorter_432; list_shorter_4332; - list_equal_dupl; + (*list_equal_dupl;*) list_unique_elems; tree_contains_only_42; ] From 481e933309c44a9d62931ec538db90310ff28e9d Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 8 Jul 2022 16:49:22 +0200 Subject: [PATCH 063/391] update expected 64-bit output --- test/core/QCheck2_expect_test.expected.64 | 8 +------- test/core/QCheck_expect_test.expected.64 | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/test/core/QCheck2_expect_test.expected.64 b/test/core/QCheck2_expect_test.expected.64 index 64b857ef..08c67baf 100644 --- a/test/core/QCheck2_expect_test.expected.64 +++ b/test/core/QCheck2_expect_test.expected.64 @@ -556,12 +556,6 @@ Test lists shorter than 4332 failed (4022 shrink steps): --- Failure -------------------------------------------------------------------- -Test lists equal to duplication failed (4 shrink steps): - -[0] - ---- Failure -------------------------------------------------------------------- - Test lists have unique elems failed (11 shrink steps): [0; 0; 0; 0; 0] @@ -1326,7 +1320,7 @@ stats dist: 4150517416584649600.. 4611686018427387903: ################# 189 ================================================================================ 1 warning(s) -failure (60 tests failed, 3 tests errored, ran 131 tests) +failure (59 tests failed, 3 tests errored, ran 130 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_expect_test.expected.64 b/test/core/QCheck_expect_test.expected.64 index 3d828e7b..e6a4e83b 100644 --- a/test/core/QCheck_expect_test.expected.64 +++ b/test/core/QCheck_expect_test.expected.64 @@ -494,12 +494,6 @@ Test lists shorter than 4332 failed (13 shrink steps): --- Failure -------------------------------------------------------------------- -Test lists equal to duplication failed (26 shrink steps): - -[0] - ---- Failure -------------------------------------------------------------------- - Test lists have unique elems failed (8 shrink steps): [1; 1] @@ -1290,7 +1284,7 @@ stats dist: 4150517416584649600.. 4611686018427387903: ################# 189 ================================================================================ 1 warning(s) -failure (60 tests failed, 3 tests errored, ran 140 tests) +failure (59 tests failed, 3 tests errored, ran 139 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ From 0ad4e0a8994c7198aa941b2b47ab2e333ca62778 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 8 Jul 2022 15:55:59 +0100 Subject: [PATCH 064/391] and update expected 32-bit output --- test/core/QCheck2_expect_test.expected.32 | 8 +------- test/core/QCheck_expect_test.expected.32 | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/test/core/QCheck2_expect_test.expected.32 b/test/core/QCheck2_expect_test.expected.32 index 157dcbf4..4762e562 100644 --- a/test/core/QCheck2_expect_test.expected.32 +++ b/test/core/QCheck2_expect_test.expected.32 @@ -492,12 +492,6 @@ Test lists shorter than 4332 failed (4022 shrink steps): --- Failure -------------------------------------------------------------------- -Test lists equal to duplication failed (4 shrink steps): - -[0] - ---- Failure -------------------------------------------------------------------- - Test lists have unique elems failed (11 shrink steps): [0; 0; 0; 0; 0] @@ -1262,7 +1256,7 @@ stats dist: 966367653.. 1073741823: ################# 189 ================================================================================ 1 warning(s) -failure (60 tests failed, 3 tests errored, ran 131 tests) +failure (59 tests failed, 3 tests errored, ran 130 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_expect_test.expected.32 b/test/core/QCheck_expect_test.expected.32 index 6d139ddd..de696d1f 100644 --- a/test/core/QCheck_expect_test.expected.32 +++ b/test/core/QCheck_expect_test.expected.32 @@ -462,12 +462,6 @@ Test lists shorter than 4332 failed (13 shrink steps): --- Failure -------------------------------------------------------------------- -Test lists equal to duplication failed (26 shrink steps): - -[0] - ---- Failure -------------------------------------------------------------------- - Test lists have unique elems failed (8 shrink steps): [1; 1] @@ -1258,7 +1252,7 @@ stats dist: 966367653.. 1073741823: ################# 189 ================================================================================ 1 warning(s) -failure (60 tests failed, 3 tests errored, ran 140 tests) +failure (59 tests failed, 3 tests errored, ran 139 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ From 96a8189ba71368b5c35312be1a9be78729327517 Mon Sep 17 00:00:00 2001 From: Valentin Chaboche <valentin.chaboche@nomadic-labs.com> Date: Wed, 13 Jul 2022 12:37:36 +0200 Subject: [PATCH 065/391] Fix: allow 0 count and 0 long_factor --- CHANGELOG.md | 6 ++++++ src/core/QCheck2.ml | 8 ++++---- test/core/QCheck2_unit_tests.ml | 24 ++++++++++++++++++++++ test/core/QCheck_unit_tests.ml | 36 +++++++++++++++++++++++++++------ 4 files changed, 64 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9fdd7e0d..20e2c5df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changes +## 0.19.1 + +- fix: allow `~count` in `Test.make` to be 0 + +- fix: allow `~long_factor` in `Test.make` to be 0 + ## 0.19 - use `Float.equal` for comparing `float`s in the `Observable` module underlying function generators. diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index 3f0e90e8..0a4f1b3e 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -1424,17 +1424,17 @@ module Test = struct let default_long_factor = 1 - let global_positive_var default env_var var = + let global_nonnegative_var default env_var var = let var = match (var, Sys.getenv_opt env_var) with | (Some x, _) -> x | (_, Some x) -> int_of_string x | (None, None) -> default in - if var <= 0 then invalid_arg (env_var ^ " must be > 0 but value is " ^ string_of_int var) else var + if var < 0 then invalid_arg (env_var ^ " must be >= 0 but value is " ^ string_of_int var) else var - let global_count count = global_positive_var default_count "QCHECK_COUNT" count + let global_count count = global_nonnegative_var default_count "QCHECK_COUNT" count - let global_long_factor long_factor = global_positive_var default_long_factor "QCHECK_LONG_FACTOR" long_factor + let global_long_factor long_factor = global_nonnegative_var default_long_factor "QCHECK_LONG_FACTOR" long_factor let fresh_name = let r = ref 0 in diff --git a/test/core/QCheck2_unit_tests.ml b/test/core/QCheck2_unit_tests.ml index 36b8d8f9..773e130a 100644 --- a/test/core/QCheck2_unit_tests.ml +++ b/test/core/QCheck2_unit_tests.ml @@ -179,11 +179,23 @@ module TestCount = struct let actual = QCheck2.Test.test_get_count t in Alcotest.(check int) "default count is from QCHECK_COUNT" 5 actual + let test_count_0 () = test_count_n ~count:0 0 + + let test_count_negative_fail () = + try + let _ = test_count_n ~count:(-1) (-1) in + Alcotest.fail "A negative count in a test should fail" + with + | _ -> () + let tests = ("Test.make ~count", Alcotest.[ test_case "make with custom count" `Quick test_count_10; test_case "make with default count" `Quick test_count_default; test_case "make with env count" `Quick test_count_env; + test_case "make with 0 count" `Quick test_count_0; + test_case "make with negative count should fail" + `Quick test_count_negative_fail; ]) end @@ -205,11 +217,23 @@ module TestLongFactor = struct let actual = QCheck2.Test.test_get_long_factor t in Alcotest.(check int) "default long factor is from QCHECK_LONG_FACTOR" 5 actual + let test_long_factor_0 () = test_long_factor_n ~long_factor:0 0 + + let test_long_factor_negative_fail () = + try + let _ = test_long_factor_n ~long_factor:(-1) (-1) in + Alcotest.fail "A negative long factor in a test should fail" + with + | _ -> () + let tests = ("Test.make ~long_factor", Alcotest.[ test_case "make with custom long_factor" `Quick test_long_factor_10; test_case "make with default long_factor" `Quick test_long_factor_default; test_case "make with env long_factor" `Quick test_long_factor_env; + test_case "make with 0 long_factor" `Quick test_long_factor_0; + test_case "make with negative long_factor fail should" + `Quick test_long_factor_negative_fail; ]) end diff --git a/test/core/QCheck_unit_tests.ml b/test/core/QCheck_unit_tests.ml index c0d64011..b9042025 100644 --- a/test/core/QCheck_unit_tests.ml +++ b/test/core/QCheck_unit_tests.ml @@ -179,11 +179,23 @@ module TestCount = struct let actual = QCheck.Test.get_count cell in Alcotest.(check int) "default count is from QCHECK_COUNT" 5 actual + let test_count_0 () = test_count_n ~count:0 0 + + let test_count_negative_fail () = + try + let _ = test_count_n ~count:(-1) (-1) in + Alcotest.fail "A negative count in a test should fail" + with + | _ -> () + let tests = ("Test.make ~count", Alcotest.[ test_case "make with custom count" `Quick test_count_10; test_case "make with default count" `Quick test_count_default; test_case "make with env count" `Quick test_count_env; + test_case "make with 0 count" `Quick test_count_0; + test_case "make with negative count should fail" + `Quick test_count_negative_fail; ]) end @@ -205,12 +217,24 @@ module TestLongFactor = struct let actual = QCheck.Test.get_long_factor cell in Alcotest.(check int) "default long factor is from QCHECK_LONG_FACTOR" 5 actual - let tests = - ("Test.make ~long_factor", Alcotest.[ - test_case "make with custom long_factor" `Quick test_long_factor_10; - test_case "make with default long_factor" `Quick test_long_factor_default; - test_case "make with env long_factor" `Quick test_long_factor_env; - ]) + let test_long_factor_0 () = test_long_factor_n ~long_factor:0 0 + + let test_long_factor_negative_fail () = + try + let _ = test_long_factor_n ~long_factor:(-1) (-1) in + Alcotest.fail "A negative long factor in a test should fail" + with + | _ -> () + + let tests = + ("Test.make ~long_factor", Alcotest.[ + test_case "make with custom long_factor" `Quick test_long_factor_10; + test_case "make with default long_factor" `Quick test_long_factor_default; + test_case "make with env long_factor" `Quick test_long_factor_env; + test_case "make with 0 long_factor" `Quick test_long_factor_0; + test_case "make with negative long_factor should fail" + `Quick test_long_factor_negative_fail; + ]) end let () = From 2ce01956ef54c9a67127492d1d183f3ea936b602 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 13 Jul 2022 18:11:04 +0200 Subject: [PATCH 066/391] prepare for 0.19.1 --- CHANGELOG.md | 1 - qcheck-alcotest.opam | 2 +- qcheck-core.opam | 2 +- qcheck-ounit.opam | 2 +- qcheck.opam | 2 +- 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20e2c5df..7ec1ec18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,6 @@ ## 0.19.1 - fix: allow `~count` in `Test.make` to be 0 - - fix: allow `~long_factor` in `Test.make` to be 0 ## 0.19 diff --git a/qcheck-alcotest.opam b/qcheck-alcotest.opam index d13e995a..45715e5d 100644 --- a/qcheck-alcotest.opam +++ b/qcheck-alcotest.opam @@ -5,7 +5,7 @@ homepage: "https://github.com/c-cube/qcheck/" license: "BSD-2-Clause" synopsis: "Alcotest backend for qcheck" doc: ["http://c-cube.github.io/qcheck/"] -version: "0.19" +version: "0.19.1" tags: [ "test" "quickcheck" diff --git a/qcheck-core.opam b/qcheck-core.opam index a565434c..211211c9 100644 --- a/qcheck-core.opam +++ b/qcheck-core.opam @@ -5,7 +5,7 @@ homepage: "https://github.com/c-cube/qcheck/" license: "BSD-2-Clause" synopsis: "Core qcheck library" doc: ["http://c-cube.github.io/qcheck/"] -version: "0.19" +version: "0.19.1" tags: [ "test" "property" diff --git a/qcheck-ounit.opam b/qcheck-ounit.opam index 4c597d9f..4d38176f 100644 --- a/qcheck-ounit.opam +++ b/qcheck-ounit.opam @@ -5,7 +5,7 @@ license: "BSD-2-Clause" homepage: "https://github.com/c-cube/qcheck/" doc: ["http://c-cube.github.io/qcheck/"] synopsis: "OUnit backend for qcheck" -version: "0.19" +version: "0.19.1" tags: [ "qcheck" "quickcheck" diff --git a/qcheck.opam b/qcheck.opam index 6fe33c00..73550ec8 100644 --- a/qcheck.opam +++ b/qcheck.opam @@ -5,7 +5,7 @@ synopsis: "Compatibility package for qcheck" homepage: "https://github.com/c-cube/qcheck/" license: "BSD-2-Clause" doc: ["http://c-cube.github.io/qcheck/"] -version: "0.19" +version: "0.19.1" tags: [ "test" "property" From fa6481fb3ecdc8fe4406ad95c883a136e4cf92f7 Mon Sep 17 00:00:00 2001 From: Simon Cruanes <simon.cruanes.2007@m4x.org> Date: Mon, 18 Jul 2022 11:57:06 -0400 Subject: [PATCH 067/391] upstream opam patches --- qcheck-alcotest.opam | 1 + qcheck-core.opam | 1 + qcheck-ounit.opam | 1 + qcheck.opam | 1 + 4 files changed, 4 insertions(+) diff --git a/qcheck-alcotest.opam b/qcheck-alcotest.opam index 45715e5d..8f4a5767 100644 --- a/qcheck-alcotest.opam +++ b/qcheck-alcotest.opam @@ -25,6 +25,7 @@ depends: [ "alcotest" {>= "0.8.1"} "odoc" {with-doc} "ocaml" {>= "4.08.0"} + "ocaml" {with-test & < "5.0"} ] dev-repo: "git+https://github.com/c-cube/qcheck.git" bug-reports: "https://github.com/c-cube/qcheck/issues" diff --git a/qcheck-core.opam b/qcheck-core.opam index 211211c9..c8ac3c36 100644 --- a/qcheck-core.opam +++ b/qcheck-core.opam @@ -23,6 +23,7 @@ depends: [ "alcotest" {with-test} "odoc" {with-doc} "ocaml" {>= "4.08.0"} + "ocaml" {with-test & < "5.0"} ] dev-repo: "git+https://github.com/c-cube/qcheck.git" bug-reports: "https://github.com/c-cube/qcheck/issues" diff --git a/qcheck-ounit.opam b/qcheck-ounit.opam index 4d38176f..771f570e 100644 --- a/qcheck-ounit.opam +++ b/qcheck-ounit.opam @@ -24,6 +24,7 @@ depends: [ "ounit2" "odoc" {with-doc} "ocaml" {>= "4.08.0"} + "ocaml" {with-test & < "5.0"} ] dev-repo: "git+https://github.com/c-cube/qcheck.git" bug-reports: "https://github.com/c-cube/qcheck/issues" diff --git a/qcheck.opam b/qcheck.opam index 73550ec8..790e5d4e 100644 --- a/qcheck.opam +++ b/qcheck.opam @@ -25,6 +25,7 @@ depends: [ "alcotest" {with-test} "odoc" {with-doc} "ocaml" {>= "4.08.0"} + "ocaml" {with-test & < "5.0"} ] dev-repo: "git+https://github.com/c-cube/qcheck.git" bug-reports: "https://github.com/c-cube/qcheck/issues" From c464f6fb44d2f399796ee7af98f44e597bb39830 Mon Sep 17 00:00:00 2001 From: n-osborne <nicolas.osborne@tarides.com> Date: Fri, 7 Oct 2022 11:06:43 +0200 Subject: [PATCH 068/391] parametirize string shrinker with a char shrinker --- CHANGELOG.md | 3 +++ src/core/QCheck.ml | 27 ++++++++++++++++++++------- src/core/QCheck.mli | 2 +- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ec1ec18..7ea87d5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changes +- add an optional argument with conservative default to `Shrink.string` +- fix shrinkers in `QCheck.{printable_string,printable_string_of_size,small_printable_string,numeral_string,numeral_string_of_size}` [#257](https://github.com/c-cube/qcheck/issues/257) + ## 0.19.1 - fix: allow `~count` in `Test.make` to be 0 diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index 0b22950c..ca267b69 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -770,9 +770,9 @@ module Shrink = struct | None -> () | Some shrink -> list_elems shrink l yield - let string s yield = + let string ?(shrink = char) s yield = let buf = Buffer.create 42 in - list ~shrink:char + list ~shrink (string_fold_right (fun c acc -> c::acc) s []) (fun cs -> List.iter (fun c -> Buffer.add_char buf c) cs; @@ -1120,12 +1120,25 @@ let string = string_gen Gen.char let string_of_size size = string_gen_of_size size Gen.char let small_string = string_gen_of_size Gen.small_nat Gen.char -let printable_string = string_gen Gen.printable -let printable_string_of_size size = string_gen_of_size size Gen.printable -let small_printable_string = string_gen_of_size Gen.small_nat Gen.printable +let printable_string = + make ~shrink:(Shrink.string ~shrink:Shrink.char_printable) ~small:String.length + ~print:(sprintf "%S") (Gen.string ~gen:Gen.printable) -let numeral_string = string_gen Gen.numeral -let numeral_string_of_size size = string_gen_of_size size Gen.numeral +let printable_string_of_size size = + make ~shrink:(Shrink.string ~shrink:Shrink.char_printable) ~small:String.length + ~print:(sprintf "%S") (Gen.string_size ~gen:Gen.printable size) + +let small_printable_string = + make ~shrink:(Shrink.string ~shrink:Shrink.char_printable) ~small:String.length + ~print:(sprintf "%S") (Gen.string_size ~gen:Gen.printable Gen.small_nat) + +let numeral_string = + make ~shrink:(Shrink.string ~shrink:Shrink.char_numeral) ~small:String.length + ~print:(sprintf "%S") (Gen.string ~gen:Gen.numeral) + +let numeral_string_of_size size = + make ~shrink:(Shrink.string ~shrink:Shrink.char_numeral) ~small:String.length + ~print:(sprintf "%S") (Gen.string_size ~gen:Gen.numeral size) let list_sum_ f l = List.fold_left (fun acc x-> f x+acc) 0 l diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index a45017f2..6e342c9f 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -709,7 +709,7 @@ module Shrink : sig val option : 'a t -> 'a option t - val string : string t + val string : ?shrink:(char t) -> string t val filter : ('a -> bool) -> 'a t -> 'a t (** [filter f shrink] shrinks values the same as [shrink], but From c4f4db89a593549f1c895beb570fc9a29731aa1d Mon Sep 17 00:00:00 2001 From: Valentin Chaboche <valentin.chaboche@nomadic-labs.com> Date: Tue, 12 Jul 2022 10:47:17 +0200 Subject: [PATCH 069/391] Add [set_shrink] to [QCheck2.Gen] --- CHANGELOG.md | 3 +++ src/core/QCheck2.ml | 5 +++++ src/core/QCheck2.mli | 3 +++ 3 files changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ea87d5d..16750aa3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,10 @@ # Changes +## 0.20 + - add an optional argument with conservative default to `Shrink.string` - fix shrinkers in `QCheck.{printable_string,printable_string_of_size,small_printable_string,numeral_string,numeral_string_of_size}` [#257](https://github.com/c-cube/qcheck/issues/257) +- add `QCheck2.Gen.set_shrink` to modify the generator's shrinker ## 0.19.1 diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index 0a4f1b3e..58234073 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -750,6 +750,11 @@ module Gen = struct let add_shrink_invariant (p : 'a -> bool) (gen : 'a t) : 'a t = fun st -> gen st |> Tree.add_shrink_invariant p + let set_shrink shrink gen = + make_primitive + ~gen:(fun st -> gen st |> Tree.root) + ~shrink + let (let+) = (>|=) let (and+) = pair diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index fee3fd9e..6c27d2b4 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -373,6 +373,9 @@ module Gen : sig keep it and wait for users feedback (hence deprecation to raise attention). *) + val set_shrink : ('a -> 'a Seq.t) -> 'a t -> 'a t + (** [set_shrink shrink gen] sets the shrinker to [shrink] for [gen]. *) + (** {3 Ranges} *) val int_bound : int -> int t From 72c6f4788cb038c26964d0db33da2cc09f65786a Mon Sep 17 00:00:00 2001 From: Valentin Chaboche <valentin.chaboche@nomadic-labs.com> Date: Mon, 11 Jul 2022 22:14:40 +0200 Subject: [PATCH 070/391] Add [no_shrink] to [QCheck2.Gen] --- CHANGELOG.md | 1 + src/core/QCheck2.ml | 2 ++ src/core/QCheck2.mli | 4 ++++ test/core/QCheck2_expect_test.expected.64 | 8 +++++++- test/core/QCheck2_tests.ml | 6 ++++++ 5 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16750aa3..463f1d05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - add an optional argument with conservative default to `Shrink.string` - fix shrinkers in `QCheck.{printable_string,printable_string_of_size,small_printable_string,numeral_string,numeral_string_of_size}` [#257](https://github.com/c-cube/qcheck/issues/257) - add `QCheck2.Gen.set_shrink` to modify the generator's shrinker +- add `QCheck2.Gen.no_shrink` to build a generator with no shrinking ## 0.19.1 diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index 58234073..ec346577 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -755,6 +755,8 @@ module Gen = struct ~gen:(fun st -> gen st |> Tree.root) ~shrink + let no_shrink (gen: 'a t) : 'a t = set_shrink (fun _ -> Seq.empty) gen + let (let+) = (>|=) let (and+) = pair diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index 6c27d2b4..f5810ea0 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -376,6 +376,10 @@ module Gen : sig val set_shrink : ('a -> 'a Seq.t) -> 'a t -> 'a t (** [set_shrink shrink gen] sets the shrinker to [shrink] for [gen]. *) + val no_shrink : 'a t -> 'a t + (** [no_shrink gen] returns a generator using [gen] but with shrinking + disabled *) + (** {3 Ranges} *) val int_bound : int -> int t diff --git a/test/core/QCheck2_expect_test.expected.64 b/test/core/QCheck2_expect_test.expected.64 index 08c67baf..803bc65b 100644 --- a/test/core/QCheck2_expect_test.expected.64 +++ b/test/core/QCheck2_expect_test.expected.64 @@ -568,6 +568,12 @@ Leaf 0 --- Failure -------------------------------------------------------------------- +Test sum list = 0 failed (0 shrink steps): + +[7; 1; 42; 1; 8; 5; 3; 9; 5; 38; 3; 3; 0; 1; 98; 1; 4; 13; 9; 2; 6; 9; 47; 6; 5; 8; 8; 6; 0; 9; 7; 2; 8; 6; 62; 6; 4; 31; 19; 1; 41; 60; 6; 5; 8; 1; 1; 4; 7; 7; 0; 5; 5; 71; 14; 26; 47; 5; 1; 6; 34; 9; 4; 2; 37; 3; 8; 4; 31; 6; 2; 1; 0; 7; 5; 1; 0; 15; 6; 1; 8; 13; 0; 6; 2; 4; 2; 6; 6; 1; 4; 1; 9; 79; 0; 87; 6; 8; 8; 62; 1; 4; 62; 6; 31; 1; 5; 6; 5; 9; 3; 3; 1; 79; 4; 3; 2; 67; 5; 7; 12; 70; 8; 8; 6; 1; 3; 14; 15; 1; 61; 4; 1; 4; 1; 7; 4; 4; 4; 2; 8; 8; 7; 5; 4; 27; 0; 9; 80; 25; 1; 8; 1; 3; 7; 4; 3; 5; 5; 6; 5; 5; 31; 7; 0; 3; 3; 6; 71; 76; 28; 60; 6; 2; 6; 3; 0; 4; 1; 0; 5; 7; 0; 28; 86; 4; 7; 51; 36; 0; 5; 0; 1; 4; 3; 6; 0; 1; 1; 8; 18; 4; 2; 8; 8; 1; 4; 7; 1; 0; 93; 5; 3; 0; 80; 1; 7; 7; 8; 8; 5; 7; 8; 9; 24; 4; 25; 8; 8; 5; 4; 90; 4; 6; 8; 4; 4; 0; 60; 8; 9; 7; 44; 5; 1; 2; 9; 74; 7; 7] + +--- Failure -------------------------------------------------------------------- + Test fail_pred_map_commute failed (122 shrink steps): ([0], {0 -> 1; 2 -> 0; 20 -> 0; 4 -> 0; 54 -> 0; 6 -> 0; 8 -> 0; 60 -> 0; 12 -> 0; _ -> 0}, {0 -> true; -1487654178632829215 -> false; -2792235260416531278 -> false; 2 -> false; 3324124342680534771 -> false; 20 -> false; 4 -> false; -2849913598173370635 -> false; 54 -> false; 6 -> false; 8 -> false; 815755449952469177 -> false; 4035005642433201833 -> false; -2961585594425353332 -> false; 60 -> false; 12 -> false; 3780670741311086221 -> false; _ -> false}) @@ -1320,7 +1326,7 @@ stats dist: 4150517416584649600.. 4611686018427387903: ################# 189 ================================================================================ 1 warning(s) -failure (59 tests failed, 3 tests errored, ran 130 tests) +failure (60 tests failed, 3 tests errored, ran 131 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_tests.ml b/test/core/QCheck2_tests.ml index 118c8bbb..ab6c78fe 100644 --- a/test/core/QCheck2_tests.ml +++ b/test/core/QCheck2_tests.ml @@ -588,6 +588,11 @@ module Shrink = struct IntTree.gen_tree (fun tree -> IntTree.contains_only_n tree 42) + let test_gen_no_shrink = + Test.make ~name:"sum list = 0" ~print:Print.(list int) + Gen.(no_shrink @@ list small_int) + (fun xs -> List.fold_left (+) 0 xs = 0) + let tests = [ (*test_fac_issue59;*) big_bound_issue59; @@ -637,6 +642,7 @@ module Shrink = struct (*list_equal_dupl;*) list_unique_elems; tree_contains_only_42; + test_gen_no_shrink; ] end From e6aa87c8d12bda8a99a94e1cbe2f02ab3ff59b4c Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Sun, 9 Oct 2022 10:48:26 +0200 Subject: [PATCH 071/391] add QCHECK_MSG_INTERVAL environment variable --- src/runner/QCheck_base_runner.ml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/runner/QCheck_base_runner.ml b/src/runner/QCheck_base_runner.ml index f9463a58..6fc75cb0 100644 --- a/src/runner/QCheck_base_runner.ml +++ b/src/runner/QCheck_base_runner.ml @@ -60,7 +60,14 @@ let set_seed_ ~colors s = (* time of last printed message. Useful for rate limiting in verbose mode *) let last_msg = ref 0. -let time_between_msg = ref 0.1 +let time_between_msg = + let env_var = "QCHECK_MSG_INTERVAL" in + let default_interval = 0.1 in + let interval = match Sys.getenv_opt env_var with + | None -> default_interval + | Some f -> float_of_string f in + if interval < 0. then invalid_arg (env_var ^ " must be >= 0 but value is " ^ string_of_float interval); + ref interval let get_time_between_msg () = !time_between_msg From 473cf0de6a7a8acb63639d6b5674857a961d8beb Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Sun, 9 Oct 2022 10:51:01 +0200 Subject: [PATCH 072/391] update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 463f1d05..cdefd0b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - fix shrinkers in `QCheck.{printable_string,printable_string_of_size,small_printable_string,numeral_string,numeral_string_of_size}` [#257](https://github.com/c-cube/qcheck/issues/257) - add `QCheck2.Gen.set_shrink` to modify the generator's shrinker - add `QCheck2.Gen.no_shrink` to build a generator with no shrinking +- add an environment variable `QCHECK_MSG_INTERVAL` to control `QCheck_base_runner.time_between_msg` ## 0.19.1 From d3beee9c9f4bc469107a9fd51466a27aa3aa4067 Mon Sep 17 00:00:00 2001 From: n-osborne <nicolas.osborne@tarides.com> Date: Wed, 8 Jun 2022 16:39:22 +0200 Subject: [PATCH 073/391] add bytes gen and Co --- src/core/QCheck.ml | 58 +++++++++++++++++++++++++++++++++++++++---- src/core/QCheck.mli | 60 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 113 insertions(+), 5 deletions(-) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index ca267b69..3c5d2bc0 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -86,15 +86,20 @@ let _opt_sum a b = match a, b with let sum_int = List.fold_left (+) 0 -(* Included for backwards compatibility, pre 4.13 *) -let string_fold_right f s acc = - let len = String.length s in +let _fold_righ length get f x acc = + let len = length x in let rec loop i acc = if i<0 then acc - else loop (i-1) (f s.[i] acc) in + else loop (i-1) (f (get x i) acc) in loop (len-1) acc +(* Included for backwards compatibility, pre 4.13 *) +let bytes_fold_right = _fold_righ Bytes.length Bytes.get + +(* Included for backwards compatibility, pre 4.13 *) +let string_fold_right = _fold_righ String.length String.get + exception No_example_found of string (* raised if an example failed to be found *) @@ -365,16 +370,26 @@ module Gen = struct let printable st = printable_chars.[RS.int st (String.length printable_chars)] let numeral st = char_of_int (48 + RS.int st 10) - let string_size ?(gen = char) size st = + let bytes_size ?(gen = char) size st = let s = Bytes.create (size st) in for i = 0 to Bytes.length s - 1 do Bytes.set s i (gen st) done; + s + + let string_size ?(gen = char) size st = + let s = bytes_size ~gen size st in Bytes.unsafe_to_string s + + let bytes ?gen st = bytes_size ?gen nat st let string ?gen st = string_size ?gen nat st + let bytes_of gen = bytes_size ~gen nat let string_of gen = string_size ~gen nat + let bytes_printable = bytes_size ~gen:printable nat let string_printable = string_size ~gen:printable nat + let bytes_readable = bytes_printable let string_readable = string_printable + let small_bytes ?gen st = bytes_size ?gen small_nat st let small_string ?gen st = string_size ?gen small_nat st let small_list gen = list_size small_nat gen let small_array gen = array_size small_nat gen @@ -462,6 +477,7 @@ module Print = struct let int = string_of_int let bool = string_of_bool let float = string_of_float + let bytes = Bytes.to_string let string s = s let char c = String.make 1 c @@ -771,6 +787,16 @@ module Shrink = struct | Some shrink -> list_elems shrink l yield let string ?(shrink = char) s yield = + let buf = Buffer.create 42 in + list ~shrink + (bytes_fold_right (fun c acc -> c::acc) b []) + (fun cs -> + List.iter (fun c -> Buffer.add_char buf c) cs; + let b = Buffer.contents buf |> Bytes.of_string in + Buffer.clear buf; + yield b) + + let bytes (b : bytes) (yield : bytes -> unit) = let buf = Buffer.create 42 in list ~shrink (string_fold_right (fun c acc -> c::acc) s []) @@ -940,6 +966,7 @@ module Observable = struct let int i = i land max_int let bool b = if b then 1 else 2 let char x = Char.code x + let bytes (x:bytes) = Hashtbl.hash x let string (x:string) = Hashtbl.hash x let opt f = function | None -> 42 @@ -953,6 +980,7 @@ module Observable = struct type 'a t = 'a -> 'a -> bool let int : int t = (=) + let bytes : bytes t = (=) let string : string t = (=) let bool : bool t = (=) let float = Float.equal @@ -986,6 +1014,7 @@ module Observable = struct let bool : bool t = make ~hash:H.bool ~eq:Eq.bool Print.bool let int : int t = make ~hash:H.int ~eq:Eq.int Print.int let float : float t = make ~eq:Eq.float Print.float + let bytes = make ~hash:H.bytes ~eq:Eq.bytes Print.bytes let string = make ~hash:H.string ~eq:Eq.string Print.string let char = make ~hash:H.char ~eq:Eq.char Print.char @@ -1109,6 +1138,25 @@ let printable_char = let numeral_char = make ~print:(sprintf "%C") ~small:(small_char '0') ~shrink:Shrink.char_numeral Gen.numeral + +let bytes_gen_of_size size gen = + make ~shrink:Shrink.bytes ~small:Bytes.length + ~print:(Print.bytes) (Gen.bytes_size ~gen size) +let bytes_gen gen = + make ~shrink:Shrink.bytes ~small:Bytes.length + ~print:(Print.bytes) (Gen.bytes ~gen) + +let bytes = bytes_gen Gen.char +let bytes_of_size size = bytes_gen_of_size size Gen.char +let small_bytes = bytes_gen_of_size Gen.small_nat Gen.char + +let printable_bytes = bytes_gen Gen.printable +let printable_bytes_of_size size = bytes_gen_of_size size Gen.printable +let small_printable_bytes = bytes_gen_of_size Gen.small_nat Gen.printable + +let numeral_bytes = bytes_gen Gen.numeral +let numeral_bytes_of_size size = bytes_gen_of_size size Gen.numeral + let string_gen_of_size size gen = make ~shrink:Shrink.string ~small:String.length ~print:(sprintf "%S") (Gen.string_size ~gen size) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 6e342c9f..89cf1580 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -397,6 +397,26 @@ module Gen : sig Example: [char_range 'a' 'z'] for all lower case ascii letters. @since 0.13 *) + val bytes_size : ?gen:char t -> int t -> bytes t + (** Builds a bytes generator from a (non-negative) size generator. + Accepts an optional character generator (the default is {!char}). *) + + val bytes : ?gen:char t -> bytes t + (** Builds a bytes generator. Bytes size is generated by {!nat}. + Accepts an optional character generator (the default is {!char}). + See also {!bytes_of} and {!bytes_readable} for versions without + optional parameters. *) + + val bytes_of : char t -> bytes t + (** Builds a bytes generator using the given character generator. *) + + val bytes_printable : bytes t + (** Builds a bytes generator using the {!printable} character generator. *) + + val small_bytes : ?gen:char t -> bytes t + (** Builds a bytes generator, length is {!small_nat} + Accepts an optional character generator (the default is {!char}). *) + val string_size : ?gen:char t -> int t -> string t (** Builds a string generator from a (non-negative) size generator. Accepts an optional character generator (the default is {!char}). *) @@ -577,6 +597,8 @@ module Print : sig val char : char t (** Character printer. *) + val bytes : bytes t (** Bytes printer. *) + val string : string t (** String printer. *) val option : 'a t -> 'a option t (** Option printer. *) @@ -709,6 +731,9 @@ module Shrink : sig val option : 'a t -> 'a option t + val bytes : bytes t + (** @since NEXT_RELEASE *) + val string : ?shrink:(char t) -> string t val filter : ('a -> bool) -> 'a t -> 'a t @@ -811,6 +836,7 @@ module Observable : sig val int : int t val float : float t val string : string t + val bytes : bytes t val char : char t val make : @@ -1241,6 +1267,19 @@ val printable_char : char arbitrary val numeral_char : char arbitrary (** Uniformly distributed over ['0'..'9']. *) +val bytes_gen_of_size : int Gen.t -> char Gen.t -> bytes arbitrary +(** Builds a bytes generator from a (non-negative) size generator and a character generator. *) + +val bytes_gen : char Gen.t -> bytes arbitrary +(** Generates bytess with a distribution of length of {!Gen.nat}. *) + +val bytes : bytes arbitrary +(** Generates bytess with a distribution of length of {!Gen.nat} + and distribution of characters of [char]. *) + +val small_bytes : bytes arbitrary +(** Same as {!bytes} but with a small length (ie {!Gen.small_nat} ). *) + val string_gen_of_size : int Gen.t -> char Gen.t -> string arbitrary (** Builds a string generator from a (non-negative) size generator and a character generator. *) @@ -1258,6 +1297,27 @@ val small_list : 'a arbitrary -> 'a list arbitrary (** Generates lists of small size (see {!Gen.small_nat}). @since 0.5.3 *) +val bytes_of_size : int Gen.t -> bytes arbitrary +(** Generates bytess with distribution of characters of [char]. *) + +val printable_bytes : bytes arbitrary +(** Generates bytess with a distribution of length of {!Gen.nat} + and distribution of characters of [printable_char]. *) + +val printable_bytes_of_size : int Gen.t -> bytes arbitrary +(** Generates bytess with distribution of characters of [printable_char]. *) + +val small_printable_bytes : bytes arbitrary +(** Generates bytess with a length of [small_nat] + and distribution of characters of [printable_char]. *) + +val numeral_bytes : bytes arbitrary +(** Generates bytess with a distribution of length of {!Gen.nat} + and distribution of characters of [numeral_char]. *) + +val numeral_bytes_of_size : int Gen.t -> bytes arbitrary +(** Generates bytess with a distribution of characters of [numeral_char]. *) + val string_of_size : int Gen.t -> string arbitrary (** Generates strings with distribution of characters of [char]. *) From f2fa08305bfdc15ebebb31d230573cc627eb363b Mon Sep 17 00:00:00 2001 From: Nicolas Osborne <nicolas.osborne@tarides.com> Date: Thu, 9 Jun 2022 09:12:23 +0200 Subject: [PATCH 074/391] Update src/core/QCheck.mli Co-authored-by: Valentin Chaboche <valentinchb@gmail.Com> --- src/core/QCheck.mli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 89cf1580..e8246a53 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -411,7 +411,7 @@ module Gen : sig (** Builds a bytes generator using the given character generator. *) val bytes_printable : bytes t - (** Builds a bytes generator using the {!printable} character generator. *) + (** Generator using the {!printable} character generator. *) val small_bytes : ?gen:char t -> bytes t (** Builds a bytes generator, length is {!small_nat} From dec48c83584528317b8559879d2007bd7487bd15 Mon Sep 17 00:00:00 2001 From: n-osborne <nicolas.osborne@tarides.com> Date: Thu, 9 Jun 2022 10:09:13 +0200 Subject: [PATCH 075/391] add tests for bytes --- src/core/QCheck.ml | 24 ++-- test/core/QCheck_expect_test.expected.64 | 139 ++++++++++++++++++++++- test/core/QCheck_tests.ml | 45 ++++++++ 3 files changed, 194 insertions(+), 14 deletions(-) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index 3c5d2bc0..134e515a 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -86,7 +86,7 @@ let _opt_sum a b = match a, b with let sum_int = List.fold_left (+) 0 -let _fold_righ length get f x acc = +let _fold_right length get f x acc = let len = length x in let rec loop i acc = if i<0 @@ -95,10 +95,10 @@ let _fold_righ length get f x acc = loop (len-1) acc (* Included for backwards compatibility, pre 4.13 *) -let bytes_fold_right = _fold_righ Bytes.length Bytes.get +let bytes_fold_right = _fold_right Bytes.length Bytes.get (* Included for backwards compatibility, pre 4.13 *) -let string_fold_right = _fold_righ String.length String.get +let string_fold_right = _fold_right String.length String.get exception No_example_found of string (* raised if an example failed to be found *) @@ -789,22 +789,22 @@ module Shrink = struct let string ?(shrink = char) s yield = let buf = Buffer.create 42 in list ~shrink - (bytes_fold_right (fun c acc -> c::acc) b []) + (string_fold_right (fun c acc -> c::acc) s []) (fun cs -> - List.iter (fun c -> Buffer.add_char buf c) cs; - let b = Buffer.contents buf |> Bytes.of_string in - Buffer.clear buf; - yield b) + List.iter (fun c -> Buffer.add_char buf c) cs; + let s = Buffer.contents buf in + Buffer.clear buf; + yield s) let bytes (b : bytes) (yield : bytes -> unit) = let buf = Buffer.create 42 in - list ~shrink - (string_fold_right (fun c acc -> c::acc) s []) + list ~shrink:char + (bytes_fold_right (fun c acc -> c::acc) b []) (fun cs -> List.iter (fun c -> Buffer.add_char buf c) cs; - let s = Buffer.contents buf in + let b = Buffer.contents buf |> Bytes.of_string in Buffer.clear buf; - yield s) + yield b) let pair a b (x,y) yield = a x (fun x' -> yield (x',y)); diff --git a/test/core/QCheck_expect_test.expected.64 b/test/core/QCheck_expect_test.expected.64 index e6a4e83b..ae65c3c7 100644 --- a/test/core/QCheck_expect_test.expected.64 +++ b/test/core/QCheck_expect_test.expected.64 @@ -196,7 +196,7 @@ Test FAIL_bad_gen failed: ERROR: uncaught exception in generator for test FAIL_bad_gen after 100 steps: Exception: Invalid_argument("Gen.int_bound") -Backtrace: +Backtrace: --- Failure -------------------------------------------------------------------- @@ -284,6 +284,30 @@ Test printable never produces less than '5 failed (3 shrink steps): --- Failure -------------------------------------------------------------------- +Test bytes are empty failed (15 shrink steps): + +a + +--- Failure -------------------------------------------------------------------- + +Test bytes never has a \000 char failed (8 shrink steps): + +� + +--- Failure -------------------------------------------------------------------- + +Test bytes never has a \255 char failed (14 shrink steps): + +� + +--- Failure -------------------------------------------------------------------- + +Test bytes have unique chars failed (13 shrink steps): + +�� + +--- Failure -------------------------------------------------------------------- + Test strings are empty failed (15 shrink steps): "a" @@ -553,7 +577,7 @@ Test FAIL_#99_1 failed: ERROR: uncaught exception in generator for test FAIL_#99_1 after 100 steps: Exception: QCheck.No_example_found("<example>") -Backtrace: +Backtrace: +++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -673,6 +697,117 @@ stats dist: 19: ################################################## 253 20: ############################################## 230 ++++ Stats for bytes_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 7.49, stddev: 1.70, median 7, min 5, max 10 + 5: ##################################################### 837 + 6: ##################################################### 826 + 7: ###################################################### 843 + 8: ####################################################### 855 + 9: #################################################### 813 + 10: ##################################################### 826 + ++++ Stats for bytes len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 384.53, stddev: 1330.61, median 9, min 0, max 9969 + 0.. 498: ####################################################### 4246 + 499.. 997: ###### 518 + 998..1496: 21 + 1497..1995: 10 + 1996..2494: 11 + 2495..2993: 10 + 2994..3492: 13 + 3493..3991: 13 + 3992..4490: 5 + 4491..4989: 10 + 4990..5488: 19 + 5489..5987: 9 + 5988..6486: 10 + 6487..6985: 12 + 6986..7484: 17 + 7485..7983: 16 + 7984..8482: 16 + 8483..8981: 16 + 8982..9480: 16 + 9481..9979: 12 + ++++ Stats for bytes_of len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 363.14, stddev: 1245.80, median 9, min 0, max 9986 + 0.. 499: ####################################################### 4270 + 500.. 999: ###### 493 + 1000.. 1499: 16 + 1500.. 1999: 11 + 2000.. 2499: 15 + 2500.. 2999: 17 + 3000.. 3499: 11 + 3500.. 3999: 19 + 4000.. 4499: 14 + 4500.. 4999: 10 + 5000.. 5499: 16 + 5500.. 5999: 11 + 6000.. 6499: 15 + 6500.. 6999: 13 + 7000.. 7499: 12 + 7500.. 7999: 16 + 8000.. 8499: 11 + 8500.. 8999: 4 + 9000.. 9499: 13 + 9500.. 9999: 13 + ++++ Stats for printable_bytes len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 384.53, stddev: 1330.61, median 9, min 0, max 9969 + 0.. 498: ####################################################### 4246 + 499.. 997: ###### 518 + 998..1496: 21 + 1497..1995: 10 + 1996..2494: 11 + 2495..2993: 10 + 2994..3492: 13 + 3493..3991: 13 + 3992..4490: 5 + 4491..4989: 10 + 4990..5488: 19 + 5489..5987: 9 + 5988..6486: 10 + 6487..6985: 12 + 6986..7484: 17 + 7485..7983: 16 + 7984..8482: 16 + 8483..8981: 16 + 8982..9480: 16 + 9481..9979: 12 + ++++ Stats for small_bytes len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 15.57, stddev: 24.36, median 6, min 0, max 99 + 0.. 4: #################################################### 1925 + 5.. 9: ####################################################### 2005 + 10.. 14: # 52 + 15.. 19: # 50 + 20.. 24: # 55 + 25.. 29: # 56 + 30.. 34: # 55 + 35.. 39: # 49 + 40.. 44: # 65 + 45.. 49: # 65 + 50.. 54: # 55 + 55.. 59: # 68 + 60.. 64: # 61 + 65.. 69: # 65 + 70.. 74: # 57 + 75.. 79: # 66 + 80.. 84: # 65 + 85.. 89: # 64 + 90.. 94: # 60 + 95.. 99: # 62 + +++ Stats for string_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: diff --git a/test/core/QCheck_tests.ml b/test/core/QCheck_tests.ml index 0b26559c..929c9824 100644 --- a/test/core/QCheck_tests.ml +++ b/test/core/QCheck_tests.ml @@ -201,6 +201,15 @@ module Generator = struct Test.make ~name:"nat has right range" ~count:1000 (make ~print:Print.int Gen.nat) (fun n -> 0 <= n && n < 10000) + let bytes_test = + Test.make ~name:"bytes has right length and content" ~count:1000 + bytes + (fun b -> + let len = Bytes.length b in + 0 <= len && len < 10000 + && Bytes.to_seq b |> + Seq.fold_left (fun acc c -> acc && '\000' <= c && c <= '\255') true) + let string_test = Test.make ~name:"string has right length and content" ~count:1000 string @@ -389,6 +398,7 @@ module Generator = struct printable_test; numeral_test; nat_test; + bytes_test; string_test; pair_test; triple_test; @@ -471,6 +481,26 @@ module Shrink = struct let numeral_is_never_less_5 = Test.make ~name:"printable never produces less than '5" ~count:1000 numeral_char (fun c -> c >= '5') + let bytes_are_empty = + Test.make ~name:"bytes are empty" ~count:1000 + bytes (fun b -> b = Bytes.empty) + + let bytes_never_has_000_char = + Test.make ~name:"bytes never has a \\000 char" ~count:1000 + bytes + (fun b -> Bytes.to_seq b |> Seq.fold_left (fun acc c -> acc && c <> '\000') true) + + let bytes_never_has_255_char = + Test.make ~name:"bytes never has a \\255 char" ~count:1000 + bytes + (fun s -> Bytes.to_seq s |> Seq.fold_left (fun acc c -> acc && c <> '\255') true) + + let bytes_unique_chars = + Test.make ~name:"bytes have unique chars" ~count:1000 + bytes + (fun s -> + let ch_list = Bytes.to_seq s |> List.of_seq in + List.length ch_list = List.length (List.sort_uniq Char.compare ch_list)) let strings_are_empty = Test.make ~name:"strings are empty" ~count:1000 @@ -676,6 +706,10 @@ module Shrink = struct char_is_never_abcdef; printable_is_never_sign; numeral_is_never_less_5; + bytes_are_empty; + bytes_never_has_000_char; + bytes_never_has_255_char; + bytes_unique_chars; strings_are_empty; string_never_has_000_char; string_never_has_255_char; @@ -842,6 +876,16 @@ module Stats = struct Test.make ~name:"numeral char code dist" ~count:500_000 (add_stat ("char code", Char.code) numeral_char) (fun _ -> true); ] + let bytes_len_tests = + let len = ("len",Bytes.length) in + [ + Test.make ~name:"bytes_size len dist" ~count:5_000 (add_stat len (bytes_of_size (Gen.int_range 5 10))) (fun _ -> true); + Test.make ~name:"bytes len dist" ~count:5_000 (add_stat len bytes) (fun _ -> true); + Test.make ~name:"bytes_of len dist" ~count:5_000 (add_stat len (bytes_gen (Gen.return 'a'))) (fun _ -> true); + Test.make ~name:"printable_bytes len dist" ~count:5_000 (add_stat len printable_bytes) (fun _ -> true); + Test.make ~name:"small_bytes len dist" ~count:5_000 (add_stat len small_bytes) (fun _ -> true); + ] + let string_len_tests = let len = ("len",String.length) in [ @@ -924,6 +968,7 @@ module Stats = struct @ char_dist_tests @ [tree_depth_test; range_subset_test;] + @ bytes_len_tests @ string_len_tests @ [pair_dist; triple_dist; From 1584cf319efc3be95ae09762ed1c4cc562ddab37 Mon Sep 17 00:00:00 2001 From: n-osborne <nicolas.osborne@tarides.com> Date: Thu, 9 Jun 2022 14:04:31 +0200 Subject: [PATCH 076/391] add bytes to QCheck2 --- CHANGELOG.md | 4 + src/core/QCheck.mli | 57 +++++---- src/core/QCheck2.ml | 16 +++ src/core/QCheck2.mli | 49 ++++++++ test/core/QCheck2_expect_test.expected.64 | 137 +++++++++++++++++++++- test/core/QCheck2_tests.ml | 46 ++++++++ test/core/QCheck_expect_test.expected.64 | 6 +- 7 files changed, 290 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 463f1d05..8752b5e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## 0.20 +- add `{QCheck,QCheck2}.Gen.{bytes_size,bytes,bytes_of,bytes_printable,small_bytes}` +- add `QCheck.{Print,Shrink,Observable}.bytes` +- add `QCheck2.{Print,Shrink}.bytes` +- add `QCheck.{bytes_gen_of_size,bytes_gen,bytes,small_bytes,bytes_of_size,printable_bytes,printable_bytes_of_size,numeral_bytes,numeral_bytes_of_size}` - add an optional argument with conservative default to `Shrink.string` - fix shrinkers in `QCheck.{printable_string,printable_string_of_size,small_printable_string,numeral_string,numeral_string_of_size}` [#257](https://github.com/c-cube/qcheck/issues/257) - add `QCheck2.Gen.set_shrink` to modify the generator's shrinker diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index e8246a53..82f6a35f 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -399,23 +399,28 @@ module Gen : sig val bytes_size : ?gen:char t -> int t -> bytes t (** Builds a bytes generator from a (non-negative) size generator. - Accepts an optional character generator (the default is {!char}). *) + Accepts an optional character generator (the default is {!char}). + @since NEXT_RELEASE *) val bytes : ?gen:char t -> bytes t (** Builds a bytes generator. Bytes size is generated by {!nat}. Accepts an optional character generator (the default is {!char}). See also {!bytes_of} and {!bytes_readable} for versions without - optional parameters. *) + optional parameters. + @since NEXT_RELEASE *) val bytes_of : char t -> bytes t - (** Builds a bytes generator using the given character generator. *) + (** Builds a bytes generator using the given character generator. + @since NEXT_RELEASE *) val bytes_printable : bytes t - (** Generator using the {!printable} character generator. *) + (** Generator using the {!printable} character generator. + @since NEXT_RELEASE *) val small_bytes : ?gen:char t -> bytes t (** Builds a bytes generator, length is {!small_nat} - Accepts an optional character generator (the default is {!char}). *) + Accepts an optional character generator (the default is {!char}). + @since NEXT_RELEASE *) val string_size : ?gen:char t -> int t -> string t (** Builds a string generator from a (non-negative) size generator. @@ -597,7 +602,7 @@ module Print : sig val char : char t (** Character printer. *) - val bytes : bytes t (** Bytes printer. *) + val bytes : bytes t (** Bytes printer. @since NEXT_RELEASE *) val string : string t (** String printer. *) @@ -836,7 +841,7 @@ module Observable : sig val int : int t val float : float t val string : string t - val bytes : bytes t + val bytes : bytes t (** @since NEXT_RELEASE *) val char : char t val make : @@ -1268,17 +1273,21 @@ val numeral_char : char arbitrary (** Uniformly distributed over ['0'..'9']. *) val bytes_gen_of_size : int Gen.t -> char Gen.t -> bytes arbitrary -(** Builds a bytes generator from a (non-negative) size generator and a character generator. *) +(** Builds a bytes generator from a (non-negative) size generator and a character generator. + @since NEXT_RELEASE *) val bytes_gen : char Gen.t -> bytes arbitrary -(** Generates bytess with a distribution of length of {!Gen.nat}. *) +(** Generates bytes with a distribution of length of {!Gen.nat}. + @since NEXT_RELEASE *) val bytes : bytes arbitrary -(** Generates bytess with a distribution of length of {!Gen.nat} - and distribution of characters of [char]. *) +(** Generates bytes with a distribution of length of {!Gen.nat} + and distribution of characters of [char]. + @since NEXT_RELEASE *) val small_bytes : bytes arbitrary -(** Same as {!bytes} but with a small length (ie {!Gen.small_nat} ). *) +(** Same as {!bytes} but with a small length (ie {!Gen.small_nat} ). + @since NEXT_RELEASE *) val string_gen_of_size : int Gen.t -> char Gen.t -> string arbitrary (** Builds a string generator from a (non-negative) size generator and a character generator. *) @@ -1298,25 +1307,31 @@ val small_list : 'a arbitrary -> 'a list arbitrary @since 0.5.3 *) val bytes_of_size : int Gen.t -> bytes arbitrary -(** Generates bytess with distribution of characters of [char]. *) +(** Generates bytes with distribution of characters of [char]. + @since NEXT_RELEASE *) val printable_bytes : bytes arbitrary -(** Generates bytess with a distribution of length of {!Gen.nat} - and distribution of characters of [printable_char]. *) +(** Generates bytes with a distribution of length of {!Gen.nat} + and distribution of characters of [printable_char]. + @since NEXT_RELEASE *) val printable_bytes_of_size : int Gen.t -> bytes arbitrary -(** Generates bytess with distribution of characters of [printable_char]. *) +(** Generates bytes with distribution of characters of [printable_char]. + @since NEXT_RELEASE *) val small_printable_bytes : bytes arbitrary -(** Generates bytess with a length of [small_nat] - and distribution of characters of [printable_char]. *) +(** Generates bytes with a length of [small_nat] + and distribution of characters of [printable_char]. + @since NEXT_RELEASE *) val numeral_bytes : bytes arbitrary -(** Generates bytess with a distribution of length of {!Gen.nat} - and distribution of characters of [numeral_char]. *) +(** Generates bytes with a distribution of length of {!Gen.nat} + and distribution of characters of [numeral_char]. + @since NEXT_RELEASE *) val numeral_bytes_of_size : int Gen.t -> bytes arbitrary -(** Generates bytess with a distribution of characters of [numeral_char]. *) +(** Generates bytes with a distribution of characters of [numeral_char]. + @since NEXT_RELEASE *) val string_of_size : int Gen.t -> string arbitrary (** Generates strings with distribution of characters of [char]. *) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index ec346577..a3593e53 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -698,6 +698,14 @@ module Gen = struct let string_size ?(gen = char) (size : int t) : string t = bytes_size ~gen size >|= Bytes.unsafe_to_string + let bytes : bytes t = bytes_size nat + + let bytes_of gen = bytes_size ~gen nat + + let bytes_printable = bytes_size ~gen:printable nat + + let small_bytes ?gen st = bytes_size ?gen small_nat st + let string : string t = string_size nat let string_of gen = string_size ~gen nat @@ -777,6 +785,8 @@ module Print = struct let float = string_of_float + let bytes = Bytes.to_string + let string s = Printf.sprintf "%S" s let char c = Printf.sprintf "%C" c @@ -962,6 +972,8 @@ module Observable = struct let char x = Char.code x + let bytes (x:bytes) = Hashtbl.hash x + let string (x:string) = Hashtbl.hash x let option f = function @@ -979,6 +991,8 @@ module Observable = struct let int : int t = (=) + let bytes : bytes t = (=) + let string : string t = (=) let bool : bool t = (=) @@ -1020,6 +1034,8 @@ module Observable = struct let float : float t = make ~eq:Eq.float Print.float + let bytes = make ~hash:H.bytes ~eq:Eq.bytes Print.bytes + let string = make ~hash:H.string ~eq:Eq.string Print.string let char = make ~hash:H.char ~eq:Eq.char Print.char diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index f5810ea0..f78ddc9c 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -289,6 +289,47 @@ module Gen : sig Shrinks towards ['0']. *) + val bytes_size : ?gen:char t -> int t -> bytes t + (** Builds a bytes generator from a (non-negative) size generator. + Accepts an optional character generator (the default is {!char}). + + Shrinks on the number of characters first, then on the characters. + + @since NEXT_RELEASE *) + + val bytes : bytes t + (** Builds a bytes generator. Bytes size is generated by {!nat}. + The default character generator is {!char}. + See also {!bytes_of} and {!bytes_printable} for versions with + custom char generator. + + Shrinks on the number of characters first, then on the characters. + + @since NEXT_RELEASE *) + + val bytes_of : char t -> bytes t + (** Builds a bytes generator using the given character generator. + + Shrinks on the number of characters first, then on the characters. + + @since NEXT_RELEASE *) + + val bytes_printable : bytes t + (** Builds a bytes generator using the {!printable} character generator. + + Shrinks on the number of characters first, then on the characters. + + @since NEXT_RELEASE *) + + val small_bytes : ?gen:char t -> bytes t + (** Builds a bytes generator, length is {!small_nat}. + Accepts an optional character generator (the default is {!char}). + + Shrinks on the number of characters first, then on the characters. + + @since NEXT_RELEASE *) + + val string_size : ?gen:char t -> int t -> string t (** Builds a string generator from a (non-negative) size generator. Accepts an optional character generator (the default is {!char}). @@ -1036,6 +1077,10 @@ module Print : sig val char : char t (** [char] is a printer of character. *) + val bytes : bytes t + (** [bytes] is a printer of bytes. + @since NEXT_RELEASE *) + val string : string t (** [string] is a printer of string. *) @@ -1234,6 +1279,10 @@ module Observable : sig val float : float t (** [float] is an observable of [float]. *) + val bytes : bytes t + (** [bytes] is an observable of [bytes]. + @since NEXT_RELEASE *) + val string : string t (** [string] is an observable of [string]. *) diff --git a/test/core/QCheck2_expect_test.expected.64 b/test/core/QCheck2_expect_test.expected.64 index 803bc65b..30df1c04 100644 --- a/test/core/QCheck2_expect_test.expected.64 +++ b/test/core/QCheck2_expect_test.expected.64 @@ -346,6 +346,30 @@ Test printable never produces less than '5 failed (1 shrink steps): --- Failure -------------------------------------------------------------------- +Test bytes are empty failed (8 shrink steps): + +a + +--- Failure -------------------------------------------------------------------- + +Test bytes never has a \000 char failed (22 shrink steps): + +aaaaaa�aaaaaaaaaaaaaaaa + +--- Failure -------------------------------------------------------------------- + +Test bytes never has a \255 char failed (59 shrink steps): + +aaaaaaaaaaaaaaaaaaaaaaaaaa�aaaaaaaaaaaaaaaaaaaaaaaa + +--- Failure -------------------------------------------------------------------- + +Test bytes have unique chars failed (18 shrink steps): + +aaaaaaaaaaaaa + +--- Failure -------------------------------------------------------------------- + Test strings are empty failed (8 shrink steps): "a" @@ -715,6 +739,117 @@ stats depth: 14: # 7 15: 4 ++++ Stats for bytes_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 7.49, stddev: 1.70, median 7, min 5, max 10 + 5: ##################################################### 837 + 6: ##################################################### 826 + 7: ###################################################### 843 + 8: ####################################################### 855 + 9: #################################################### 813 + 10: ##################################################### 826 + ++++ Stats for bytes len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 384.53, stddev: 1330.61, median 9, min 0, max 9969 + 0.. 498: ####################################################### 4246 + 499.. 997: ###### 518 + 998..1496: 21 + 1497..1995: 10 + 1996..2494: 11 + 2495..2993: 10 + 2994..3492: 13 + 3493..3991: 13 + 3992..4490: 5 + 4491..4989: 10 + 4990..5488: 19 + 5489..5987: 9 + 5988..6486: 10 + 6487..6985: 12 + 6986..7484: 17 + 7485..7983: 16 + 7984..8482: 16 + 8483..8981: 16 + 8982..9480: 16 + 9481..9979: 12 + ++++ Stats for bytes_of len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 363.14, stddev: 1245.80, median 9, min 0, max 9986 + 0.. 499: ####################################################### 4270 + 500.. 999: ###### 493 + 1000.. 1499: 16 + 1500.. 1999: 11 + 2000.. 2499: 15 + 2500.. 2999: 17 + 3000.. 3499: 11 + 3500.. 3999: 19 + 4000.. 4499: 14 + 4500.. 4999: 10 + 5000.. 5499: 16 + 5500.. 5999: 11 + 6000.. 6499: 15 + 6500.. 6999: 13 + 7000.. 7499: 12 + 7500.. 7999: 16 + 8000.. 8499: 11 + 8500.. 8999: 4 + 9000.. 9499: 13 + 9500.. 9999: 13 + ++++ Stats for bytes_printable len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 384.53, stddev: 1330.61, median 9, min 0, max 9969 + 0.. 498: ####################################################### 4246 + 499.. 997: ###### 518 + 998..1496: 21 + 1497..1995: 10 + 1996..2494: 11 + 2495..2993: 10 + 2994..3492: 13 + 3493..3991: 13 + 3992..4490: 5 + 4491..4989: 10 + 4990..5488: 19 + 5489..5987: 9 + 5988..6486: 10 + 6487..6985: 12 + 6986..7484: 17 + 7485..7983: 16 + 7984..8482: 16 + 8483..8981: 16 + 8982..9480: 16 + 9481..9979: 12 + ++++ Stats for small_bytes len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 15.57, stddev: 24.36, median 6, min 0, max 99 + 0.. 4: #################################################### 1925 + 5.. 9: ####################################################### 2005 + 10.. 14: # 52 + 15.. 19: # 50 + 20.. 24: # 55 + 25.. 29: # 56 + 30.. 34: # 55 + 35.. 39: # 49 + 40.. 44: # 65 + 45.. 49: # 65 + 50.. 54: # 55 + 55.. 59: # 68 + 60.. 64: # 61 + 65.. 69: # 65 + 70.. 74: # 57 + 75.. 79: # 66 + 80.. 84: # 65 + 85.. 89: # 64 + 90.. 94: # 60 + 95.. 99: # 62 + +++ Stats for string_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: @@ -1326,7 +1461,7 @@ stats dist: 4150517416584649600.. 4611686018427387903: ################# 189 ================================================================================ 1 warning(s) -failure (60 tests failed, 3 tests errored, ran 131 tests) +failure (64 tests failed, 3 tests errored, ran 141 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_tests.ml b/test/core/QCheck2_tests.ml index ab6c78fe..fb0fce3a 100644 --- a/test/core/QCheck2_tests.ml +++ b/test/core/QCheck2_tests.ml @@ -193,6 +193,15 @@ module Generator = struct Test.make ~name:"nat has right range" ~count:1000 ~print:Print.int Gen.nat (fun n -> 0 <= n && n < 10000) + let bytes_test = + Test.make ~name:"bytes has right length and content" ~count:1000 ~print:Print.bytes + Gen.bytes + (fun s -> + let len = Bytes.length s in + 0 <= len && len < 10000 + && Bytes.to_seq s |> + Seq.fold_left (fun acc c -> acc && '\000' <= c && c <= '\255') true) + let string_test = Test.make ~name:"string has right length and content" ~count:1000 ~print:Print.string Gen.string @@ -308,6 +317,7 @@ module Generator = struct char_dist_issue_23; char_test; nat_test; + bytes_test; string_test; pair_test; triple_test; @@ -386,6 +396,27 @@ module Shrink = struct Test.make ~name:"printable never produces less than '5" ~count:1000 ~print:Print.char Gen.numeral (fun c -> c >= '5') + let bytes_are_empty = + Test.make ~name:"bytes are empty" ~count:1000 ~print:Print.bytes + Gen.bytes (fun s -> s = Bytes.empty) + + let bytes_never_has_000_char = + Test.make ~name:"bytes never has a \\000 char" ~count:1000 ~print:Print.bytes + Gen.bytes + (fun s -> Bytes.to_seq s |> Seq.fold_left (fun acc c -> acc && c <> '\000') true) + + let bytes_never_has_255_char = + Test.make ~name:"bytes never has a \\255 char" ~count:1000 ~print:Print.bytes + Gen.bytes + (fun s -> Bytes.to_seq s |> Seq.fold_left (fun acc c -> acc && c <> '\255') true) + + let bytes_unique_chars = + Test.make ~name:"bytes have unique chars" ~count:1000 ~print:Print.bytes + Gen.bytes + (fun s -> + let ch_list = Bytes.to_seq s |> List.of_seq in + List.length ch_list = List.length (List.sort_uniq Char.compare ch_list)) + let strings_are_empty = Test.make ~name:"strings are empty" ~count:1000 ~print:Print.string Gen.string (fun s -> s = "") @@ -604,6 +635,10 @@ module Shrink = struct char_is_never_abcdef; printable_is_never_sign; numeral_is_never_less_5; + bytes_are_empty; + bytes_never_has_000_char; + bytes_never_has_255_char; + bytes_unique_chars; strings_are_empty; string_never_has_000_char; string_never_has_255_char; @@ -776,6 +811,16 @@ module Stats = struct Test.make ~name:"numeral char code dist" ~count:500_000 ~stats:[("char code", Char.code)] Gen.numeral (fun _ -> true); ] + let bytes_len_tests = + let len = ("len",Bytes.length) in + [ + Test.make ~name:"bytes_size len dist" ~count:5_000 ~stats:[len] Gen.(bytes_size (int_range 5 10)) (fun _ -> true); + Test.make ~name:"bytes len dist" ~count:5_000 ~stats:[len] Gen.bytes (fun _ -> true); + Test.make ~name:"bytes_of len dist" ~count:5_000 ~stats:[len] Gen.(bytes_of (return 'a')) (fun _ -> true); + Test.make ~name:"bytes_printable len dist" ~count:5_000 ~stats:[len] Gen.bytes_printable (fun _ -> true); + Test.make ~name:"small_bytes len dist" ~count:5_000 ~stats:[len] Gen.(small_bytes ~gen:char)(*ugh*)(fun _ -> true); + ] + let string_len_tests = let len = ("len",String.length) in [ @@ -850,6 +895,7 @@ module Stats = struct [ bool_dist; ] @ char_dist_tests @ [ tree_depth_test;] + @ bytes_len_tests @ string_len_tests @ [pair_dist; triple_dist; diff --git a/test/core/QCheck_expect_test.expected.64 b/test/core/QCheck_expect_test.expected.64 index ae65c3c7..15cc10c8 100644 --- a/test/core/QCheck_expect_test.expected.64 +++ b/test/core/QCheck_expect_test.expected.64 @@ -196,7 +196,7 @@ Test FAIL_bad_gen failed: ERROR: uncaught exception in generator for test FAIL_bad_gen after 100 steps: Exception: Invalid_argument("Gen.int_bound") -Backtrace: +Backtrace: --- Failure -------------------------------------------------------------------- @@ -577,7 +577,7 @@ Test FAIL_#99_1 failed: ERROR: uncaught exception in generator for test FAIL_#99_1 after 100 steps: Exception: QCheck.No_example_found("<example>") -Backtrace: +Backtrace: +++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -1419,7 +1419,7 @@ stats dist: 4150517416584649600.. 4611686018427387903: ################# 189 ================================================================================ 1 warning(s) -failure (59 tests failed, 3 tests errored, ran 139 tests) +failure (63 tests failed, 3 tests errored, ran 149 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ From b3ee03e2e0a4a53f685e4cf9e9b535031934943d Mon Sep 17 00:00:00 2001 From: Nicolas Osborne <nicolas.osborne@tarides.com> Date: Fri, 10 Jun 2022 09:47:51 +0200 Subject: [PATCH 077/391] Update src/core/QCheck2.mli Co-authored-by: Valentin Chaboche <valentinchb@gmail.Com> --- src/core/QCheck2.mli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index f78ddc9c..1d953fb6 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -315,7 +315,7 @@ module Gen : sig @since NEXT_RELEASE *) val bytes_printable : bytes t - (** Builds a bytes generator using the {!printable} character generator. + (** Generator using the {!printable} character generator. Shrinks on the number of characters first, then on the characters. From ea3ce087353235827f8ebc81cf1d8bb95a2605d4 Mon Sep 17 00:00:00 2001 From: Nicolas Osborne <nicolas.osborne@tarides.com> Date: Fri, 10 Jun 2022 09:48:02 +0200 Subject: [PATCH 078/391] Update src/core/QCheck2.mli Co-authored-by: Valentin Chaboche <valentinchb@gmail.Com> --- src/core/QCheck2.mli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index 1d953fb6..01da8d83 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -298,7 +298,7 @@ module Gen : sig @since NEXT_RELEASE *) val bytes : bytes t - (** Builds a bytes generator. Bytes size is generated by {!nat}. + (** Bytes generator. Bytes size is generated by {!nat}. The default character generator is {!char}. See also {!bytes_of} and {!bytes_printable} for versions with custom char generator. From 4d61e56bac235cae5db0922a92ac72a0b821e8cc Mon Sep 17 00:00:00 2001 From: n-osborne <nicolas.osborne@tarides.com> Date: Fri, 10 Jun 2022 13:31:13 +0200 Subject: [PATCH 079/391] no optional gen in QCheck2 --- src/core/QCheck2.ml | 24 ++++++++++++------------ src/core/QCheck2.mli | 19 ++++++++----------- test/core/QCheck2_tests.ml | 24 ++++++++++++------------ 3 files changed, 32 insertions(+), 35 deletions(-) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index a3593e53..670d897f 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -672,7 +672,7 @@ module Gen = struct let nine = 57 in int_range ~origin:zero zero nine >|= char_of_int - let bytes_size ?(gen = char) (size : int t) : bytes t = fun st -> + let bytes_size gen (size : int t) : bytes t = fun st -> let open Tree in size st >>= fun size -> (* Adding char shrinks to a mutable list is expensive: ~20-30% cost increase *) @@ -695,24 +695,24 @@ module Gen = struct in Tree (bytes, shrink) - let string_size ?(gen = char) (size : int t) : string t = - bytes_size ~gen size >|= Bytes.unsafe_to_string + let string_size gen (size : int t) : string t = + bytes_size gen size >|= Bytes.unsafe_to_string - let bytes : bytes t = bytes_size nat + let bytes : bytes t = bytes_size char nat - let bytes_of gen = bytes_size ~gen nat + let bytes_of gen = bytes_size gen nat - let bytes_printable = bytes_size ~gen:printable nat + let bytes_printable = bytes_size printable nat - let small_bytes ?gen st = bytes_size ?gen small_nat st + let small_bytes gen st = bytes_size gen small_nat st - let string : string t = string_size nat + let string : string t = string_size char nat - let string_of gen = string_size ~gen nat + let string_of gen = string_size gen nat - let string_printable = string_size ~gen:printable nat + let string_printable = string_size printable nat - let small_string ?gen st = string_size ?gen small_nat st + let small_string gen st = string_size gen small_nat st let small_list gen = list_size small_nat gen @@ -786,7 +786,7 @@ module Print = struct let float = string_of_float let bytes = Bytes.to_string - + let string s = Printf.sprintf "%S" s let char c = Printf.sprintf "%C" c diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index 01da8d83..3cae909e 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -289,9 +289,8 @@ module Gen : sig Shrinks towards ['0']. *) - val bytes_size : ?gen:char t -> int t -> bytes t + val bytes_size : char t -> int t -> bytes t (** Builds a bytes generator from a (non-negative) size generator. - Accepts an optional character generator (the default is {!char}). Shrinks on the number of characters first, then on the characters. @@ -321,18 +320,17 @@ module Gen : sig @since NEXT_RELEASE *) - val small_bytes : ?gen:char t -> bytes t + val small_bytes : char t -> bytes t (** Builds a bytes generator, length is {!small_nat}. - Accepts an optional character generator (the default is {!char}). Shrinks on the number of characters first, then on the characters. @since NEXT_RELEASE *) - val string_size : ?gen:char t -> int t -> string t - (** Builds a string generator from a (non-negative) size generator. - Accepts an optional character generator (the default is {!char}). + val string_size : char t -> int t -> string t + (** Builds a string generator from a character generator and a + (non-negative) size generator. Shrinks on the number of characters first, then on the characters. *) @@ -360,9 +358,8 @@ module Gen : sig @since 0.11 *) - val small_string : ?gen:char t -> string t + val small_string : char t -> string t (** Builds a string generator, length is {!small_nat}. - Accepts an optional character generator (the default is {!char}). Shrinks on the number of characters first, then on the characters. *) @@ -1078,7 +1075,7 @@ module Print : sig (** [char] is a printer of character. *) val bytes : bytes t - (** [bytes] is a printer of bytes. + (** [bytes] is a printer of bytes. @since NEXT_RELEASE *) val string : string t @@ -1323,7 +1320,7 @@ module Observable : sig (** [quad o1 o2 o3 o4] is an observable of quadruples of [('a * 'b * 'c * 'd)]. *) end - + (** Utils on combining function arguments. *) module Tuple : sig (** Heterogeneous tuple, used to pass any number of arguments to diff --git a/test/core/QCheck2_tests.ml b/test/core/QCheck2_tests.ml index fb0fce3a..c816408c 100644 --- a/test/core/QCheck2_tests.ml +++ b/test/core/QCheck2_tests.ml @@ -748,8 +748,8 @@ module Function = struct let fold_left_test = Test.make ~name:"fold_left test, fun first" ~print:Print.(quad Fn.print string (list int) (list int)) Gen.(quad (* string -> int -> string *) - (fun2 ~print:Print.string Observable.string Observable.int (small_string ~gen:char)) - (small_string ~gen:char) + (fun2 ~print:Print.string Observable.string Observable.int (small_string char)) + (small_string char) (list small_int) (list small_int)) (fun (f,acc,is,js) -> @@ -814,21 +814,21 @@ module Stats = struct let bytes_len_tests = let len = ("len",Bytes.length) in [ - Test.make ~name:"bytes_size len dist" ~count:5_000 ~stats:[len] Gen.(bytes_size (int_range 5 10)) (fun _ -> true); - Test.make ~name:"bytes len dist" ~count:5_000 ~stats:[len] Gen.bytes (fun _ -> true); - Test.make ~name:"bytes_of len dist" ~count:5_000 ~stats:[len] Gen.(bytes_of (return 'a')) (fun _ -> true); - Test.make ~name:"bytes_printable len dist" ~count:5_000 ~stats:[len] Gen.bytes_printable (fun _ -> true); - Test.make ~name:"small_bytes len dist" ~count:5_000 ~stats:[len] Gen.(small_bytes ~gen:char)(*ugh*)(fun _ -> true); + Test.make ~name:"bytes_size len dist" ~count:5_000 ~stats:[len] Gen.(bytes_size char (int_range 5 10)) (fun _ -> true); + Test.make ~name:"bytes len dist" ~count:5_000 ~stats:[len] Gen.bytes (fun _ -> true); + Test.make ~name:"bytes_of len dist" ~count:5_000 ~stats:[len] Gen.(bytes_of (return 'a')) (fun _ -> true); + Test.make ~name:"bytes_printable len dist" ~count:5_000 ~stats:[len] Gen.bytes_printable (fun _ -> true); + Test.make ~name:"small_bytes len dist" ~count:5_000 ~stats:[len] Gen.(small_bytes char) (fun _ -> true); ] let string_len_tests = let len = ("len",String.length) in [ - Test.make ~name:"string_size len dist" ~count:5_000 ~stats:[len] Gen.(string_size (int_range 5 10)) (fun _ -> true); - Test.make ~name:"string len dist" ~count:5_000 ~stats:[len] Gen.string (fun _ -> true); - Test.make ~name:"string_of len dist" ~count:5_000 ~stats:[len] Gen.(string_of (return 'a')) (fun _ -> true); - Test.make ~name:"string_printable len dist" ~count:5_000 ~stats:[len] Gen.string_printable (fun _ -> true); - Test.make ~name:"small_string len dist" ~count:5_000 ~stats:[len] Gen.(small_string ~gen:char)(*ugh*)(fun _ -> true); + Test.make ~name:"string_size len dist" ~count:5_000 ~stats:[len] Gen.(string_size char (int_range 5 10)) (fun _ -> true); + Test.make ~name:"string len dist" ~count:5_000 ~stats:[len] Gen.string (fun _ -> true); + Test.make ~name:"string_of len dist" ~count:5_000 ~stats:[len] Gen.(string_of (return 'a')) (fun _ -> true); + Test.make ~name:"string_printable len dist" ~count:5_000 ~stats:[len] Gen.string_printable (fun _ -> true); + Test.make ~name:"small_string len dist" ~count:5_000 ~stats:[len] Gen.(small_string char) (fun _ -> true); ] let pair_dist = From 712830ccc73a69368b674337a2fbd2d8fff58368 Mon Sep 17 00:00:00 2001 From: n-osborne <nicolas.osborne@tarides.com> Date: Tue, 14 Jun 2022 14:50:19 +0200 Subject: [PATCH 080/391] Revert "no optional gen in QCheck2" This reverts commit dad4bb81693d4999fb349923821057276f17a6ab. --- src/core/QCheck2.ml | 26 +++++++++++++------------- src/core/QCheck2.mli | 23 +++++++++++++---------- test/core/QCheck2_tests.ml | 24 ++++++++++++------------ 3 files changed, 38 insertions(+), 35 deletions(-) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index 670d897f..d26d7d91 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -672,7 +672,7 @@ module Gen = struct let nine = 57 in int_range ~origin:zero zero nine >|= char_of_int - let bytes_size gen (size : int t) : bytes t = fun st -> + let bytes_size ?(gen = char) (size : int t) : bytes t = fun st -> let open Tree in size st >>= fun size -> (* Adding char shrinks to a mutable list is expensive: ~20-30% cost increase *) @@ -695,24 +695,24 @@ module Gen = struct in Tree (bytes, shrink) - let string_size gen (size : int t) : string t = - bytes_size gen size >|= Bytes.unsafe_to_string + let string_size ?(gen = char) (size : int t) : string t = + bytes_size ~gen size >|= Bytes.unsafe_to_string - let bytes : bytes t = bytes_size char nat + let bytes : bytes t = bytes_size nat - let bytes_of gen = bytes_size gen nat + let bytes_of gen = bytes_size ~gen nat - let bytes_printable = bytes_size printable nat + let bytes_printable = bytes_size ~gen:printable nat - let small_bytes gen st = bytes_size gen small_nat st + let small_bytes ?gen st = bytes_size ?gen small_nat st - let string : string t = string_size char nat + let string : string t = string_size nat - let string_of gen = string_size gen nat + let string_of gen = string_size ~gen nat - let string_printable = string_size printable nat + let string_printable = string_size ~gen:printable nat - let small_string gen st = string_size gen small_nat st + let small_string ?gen st = string_size ?gen small_nat st let small_list gen = list_size small_nat gen @@ -786,7 +786,7 @@ module Print = struct let float = string_of_float let bytes = Bytes.to_string - + let string s = Printf.sprintf "%S" s let char c = Printf.sprintf "%C" c @@ -1524,7 +1524,7 @@ module Test = struct let make_neg = make' ~negative:true let test_get_count (Test cell) = get_count cell - + let test_get_long_factor (Test cell) = get_long_factor cell (** {6 Running the test} *) diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index 3cae909e..114bed38 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -289,8 +289,9 @@ module Gen : sig Shrinks towards ['0']. *) - val bytes_size : char t -> int t -> bytes t + val bytes_size : ?gen:char t -> int t -> bytes t (** Builds a bytes generator from a (non-negative) size generator. + Accepts an optional character generator (the default is {!char}). Shrinks on the number of characters first, then on the characters. @@ -320,17 +321,18 @@ module Gen : sig @since NEXT_RELEASE *) - val small_bytes : char t -> bytes t + val small_bytes : ?gen:char t -> bytes t (** Builds a bytes generator, length is {!small_nat}. + Accepts an optional character generator (the default is {!char}). Shrinks on the number of characters first, then on the characters. @since NEXT_RELEASE *) - val string_size : char t -> int t -> string t - (** Builds a string generator from a character generator and a - (non-negative) size generator. + val string_size : ?gen:char t -> int t -> string t + (** Builds a string generator from a (non-negative) size generator. + Accepts an optional character generator (the default is {!char}). Shrinks on the number of characters first, then on the characters. *) @@ -358,8 +360,9 @@ module Gen : sig @since 0.11 *) - val small_string : char t -> string t + val small_string : ?gen:char t -> string t (** Builds a string generator, length is {!small_nat}. + Accepts an optional character generator (the default is {!char}). Shrinks on the number of characters first, then on the characters. *) @@ -1075,7 +1078,7 @@ module Print : sig (** [char] is a printer of character. *) val bytes : bytes t - (** [bytes] is a printer of bytes. + (** [bytes] is a printer of bytes. @since NEXT_RELEASE *) val string : string t @@ -1320,7 +1323,7 @@ module Observable : sig (** [quad o1 o2 o3 o4] is an observable of quadruples of [('a * 'b * 'c * 'd)]. *) end - + (** Utils on combining function arguments. *) module Tuple : sig (** Heterogeneous tuple, used to pass any number of arguments to @@ -1645,7 +1648,7 @@ module Test : sig type 'a cell (** A single property test on a value of type ['a]. A {!Test.t} wraps a [cell] and hides its type parameter. *) - + val make_cell : ?if_assumptions_fail:([`Fatal | `Warning] * float) -> ?count:int -> ?long_factor:int -> ?negative:bool -> ?max_gen:int -> ?max_fail:int -> ?retries:int -> @@ -1684,7 +1687,7 @@ module Test : sig ?retries:int -> ?name:string -> gen:(Random.State.t -> 'a) -> ?shrink:('a -> ('a -> unit) -> unit) -> ?print:('a -> string) -> ?collect:('a -> string) -> stats:'a stat list -> ('a -> bool) -> 'a cell - (** ⚠️ Do not use, this is exposed for internal reasons only. ⚠️ + (** ⚠️ Do not use, this is exposed for internal reasons only. ⚠️ @deprecated Migrate to QCheck2 and use {!make_cell} instead. *) diff --git a/test/core/QCheck2_tests.ml b/test/core/QCheck2_tests.ml index c816408c..c6a6d070 100644 --- a/test/core/QCheck2_tests.ml +++ b/test/core/QCheck2_tests.ml @@ -748,8 +748,8 @@ module Function = struct let fold_left_test = Test.make ~name:"fold_left test, fun first" ~print:Print.(quad Fn.print string (list int) (list int)) Gen.(quad (* string -> int -> string *) - (fun2 ~print:Print.string Observable.string Observable.int (small_string char)) - (small_string char) + (fun2 ~print:Print.string Observable.string Observable.int (small_string ~gen:char)) + (small_string ~gen:char) (list small_int) (list small_int)) (fun (f,acc,is,js) -> @@ -814,21 +814,21 @@ module Stats = struct let bytes_len_tests = let len = ("len",Bytes.length) in [ - Test.make ~name:"bytes_size len dist" ~count:5_000 ~stats:[len] Gen.(bytes_size char (int_range 5 10)) (fun _ -> true); - Test.make ~name:"bytes len dist" ~count:5_000 ~stats:[len] Gen.bytes (fun _ -> true); - Test.make ~name:"bytes_of len dist" ~count:5_000 ~stats:[len] Gen.(bytes_of (return 'a')) (fun _ -> true); - Test.make ~name:"bytes_printable len dist" ~count:5_000 ~stats:[len] Gen.bytes_printable (fun _ -> true); - Test.make ~name:"small_bytes len dist" ~count:5_000 ~stats:[len] Gen.(small_bytes char) (fun _ -> true); + Test.make ~name:"bytes_size len dist" ~count:5_000 ~stats:[len] Gen.(bytes_size (int_range 5 10)) (fun _ -> true); + Test.make ~name:"bytes len dist" ~count:5_000 ~stats:[len] Gen.bytes (fun _ -> true); + Test.make ~name:"bytes_of len dist" ~count:5_000 ~stats:[len] Gen.(bytes_of (return 'a')) (fun _ -> true); + Test.make ~name:"bytes_printable len dist" ~count:5_000 ~stats:[len] Gen.bytes_printable (fun _ -> true); + Test.make ~name:"small_bytes len dist" ~count:5_000 ~stats:[len] Gen.(small_bytes ~gen:char) (fun _ -> true); ] let string_len_tests = let len = ("len",String.length) in [ - Test.make ~name:"string_size len dist" ~count:5_000 ~stats:[len] Gen.(string_size char (int_range 5 10)) (fun _ -> true); - Test.make ~name:"string len dist" ~count:5_000 ~stats:[len] Gen.string (fun _ -> true); - Test.make ~name:"string_of len dist" ~count:5_000 ~stats:[len] Gen.(string_of (return 'a')) (fun _ -> true); - Test.make ~name:"string_printable len dist" ~count:5_000 ~stats:[len] Gen.string_printable (fun _ -> true); - Test.make ~name:"small_string len dist" ~count:5_000 ~stats:[len] Gen.(small_string char) (fun _ -> true); + Test.make ~name:"string_size len dist" ~count:5_000 ~stats:[len] Gen.(string_size (int_range 5 10)) (fun _ -> true); + Test.make ~name:"string len dist" ~count:5_000 ~stats:[len] Gen.string (fun _ -> true); + Test.make ~name:"string_of len dist" ~count:5_000 ~stats:[len] Gen.(string_of (return 'a')) (fun _ -> true); + Test.make ~name:"string_printable len dist" ~count:5_000 ~stats:[len] Gen.string_printable (fun _ -> true); + Test.make ~name:"small_string len dist" ~count:5_000 ~stats:[len] Gen.(small_string ~gen:char)(*ugh*)(fun _ -> true); ] let pair_dist = From 96abba4735f3de5e18496a88bc62ee8f57942aa0 Mon Sep 17 00:00:00 2001 From: n-osborne <nicolas.osborne@tarides.com> Date: Mon, 20 Jun 2022 13:16:53 +0200 Subject: [PATCH 081/391] reverse fix on Eq.float (other PR) --- src/core/QCheck2.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index d26d7d91..4e2a39e1 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -997,7 +997,7 @@ module Observable = struct let bool : bool t = (=) - let float = Float.equal + let float = (=) let unit () () = true From 49c133569206e8694fbbbc5330828e7d32c8c648 Mon Sep 17 00:00:00 2001 From: n-osborne <nicolas.osborne@tarides.com> Date: Mon, 20 Jun 2022 15:17:08 +0200 Subject: [PATCH 082/391] naming consistency --- CHANGELOG.md | 4 ++++ src/core/QCheck.ml | 20 ++++++++++---------- src/core/QCheck.mli | 22 ++-------------------- src/core/QCheck2.ml | 9 +++++---- src/core/QCheck2.mli | 20 ++++++++++++-------- test/core/QCheck2_tests.ml | 2 +- test/core/QCheck_tests.ml | 3 +-- 7 files changed, 35 insertions(+), 45 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8752b5e6..ef4bf1d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ - add `QCheck.{Print,Shrink,Observable}.bytes` - add `QCheck2.{Print,Shrink}.bytes` - add `QCheck.{bytes_gen_of_size,bytes_gen,bytes,small_bytes,bytes_of_size,printable_bytes,printable_bytes_of_size,numeral_bytes,numeral_bytes_of_size}` +- add `{QCheck,QCheck2}.Gen.{bytes_size,bytes,bytes_of,bytes_printable,bytes_small,string_small}` +- add `QCheck.{Print,Shrink,Observable}.bytes` +- add `QCheck2.{Print,Shrink}.bytes` +- add `QCheck.{bytes_gen_of_size,bytes_gen,bytes,bytes_small,bytes_of_size,bytes_printable}` - add an optional argument with conservative default to `Shrink.string` - fix shrinkers in `QCheck.{printable_string,printable_string_of_size,small_printable_string,numeral_string,numeral_string_of_size}` [#257](https://github.com/c-cube/qcheck/issues/257) - add `QCheck2.Gen.set_shrink` to modify the generator's shrinker diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index 134e515a..bc440e55 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -1138,7 +1138,6 @@ let printable_char = let numeral_char = make ~print:(sprintf "%C") ~small:(small_char '0') ~shrink:Shrink.char_numeral Gen.numeral - let bytes_gen_of_size size gen = make ~shrink:Shrink.bytes ~small:Bytes.length ~print:(Print.bytes) (Gen.bytes_size ~gen size) @@ -1148,14 +1147,8 @@ let bytes_gen gen = let bytes = bytes_gen Gen.char let bytes_of_size size = bytes_gen_of_size size Gen.char -let small_bytes = bytes_gen_of_size Gen.small_nat Gen.char - -let printable_bytes = bytes_gen Gen.printable -let printable_bytes_of_size size = bytes_gen_of_size size Gen.printable -let small_printable_bytes = bytes_gen_of_size Gen.small_nat Gen.printable - -let numeral_bytes = bytes_gen Gen.numeral -let numeral_bytes_of_size size = bytes_gen_of_size size Gen.numeral +let bytes_small = bytes_gen_of_size Gen.small_nat Gen.char +let bytes_printable = bytes_gen Gen.printable let string_gen_of_size size gen = make ~shrink:Shrink.string ~small:String.length @@ -1166,7 +1159,8 @@ let string_gen gen = let string = string_gen Gen.char let string_of_size size = string_gen_of_size size Gen.char -let small_string = string_gen_of_size Gen.small_nat Gen.char +let string_small = string_gen_of_size Gen.small_nat Gen.char +let small_string = string_small let printable_string = make ~shrink:(Shrink.string ~shrink:Shrink.char_printable) ~small:String.length @@ -1188,6 +1182,12 @@ let numeral_string_of_size size = make ~shrink:(Shrink.string ~shrink:Shrink.char_numeral) ~small:String.length ~print:(sprintf "%S") (Gen.string_size ~gen:Gen.numeral size) +let string_printable = printable_string +let string_printable_of_size = printable_string_of_size +let string_small_printable = small_printable_string +let string_numeral = numeral_string +let string_numeral_of_size = numeral_string_of_size + let list_sum_ f l = List.fold_left (fun acc x-> f x+acc) 0 l let mk_list a gen = diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 82f6a35f..0e78761b 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -1285,7 +1285,7 @@ val bytes : bytes arbitrary and distribution of characters of [char]. @since NEXT_RELEASE *) -val small_bytes : bytes arbitrary +val bytes_small : bytes arbitrary (** Same as {!bytes} but with a small length (ie {!Gen.small_nat} ). @since NEXT_RELEASE *) @@ -1310,29 +1310,11 @@ val bytes_of_size : int Gen.t -> bytes arbitrary (** Generates bytes with distribution of characters of [char]. @since NEXT_RELEASE *) -val printable_bytes : bytes arbitrary +val bytes_printable : bytes arbitrary (** Generates bytes with a distribution of length of {!Gen.nat} and distribution of characters of [printable_char]. @since NEXT_RELEASE *) -val printable_bytes_of_size : int Gen.t -> bytes arbitrary -(** Generates bytes with distribution of characters of [printable_char]. - @since NEXT_RELEASE *) - -val small_printable_bytes : bytes arbitrary -(** Generates bytes with a length of [small_nat] - and distribution of characters of [printable_char]. - @since NEXT_RELEASE *) - -val numeral_bytes : bytes arbitrary -(** Generates bytes with a distribution of length of {!Gen.nat} - and distribution of characters of [numeral_char]. - @since NEXT_RELEASE *) - -val numeral_bytes_of_size : int Gen.t -> bytes arbitrary -(** Generates bytes with a distribution of characters of [numeral_char]. - @since NEXT_RELEASE *) - val string_of_size : int Gen.t -> string arbitrary (** Generates strings with distribution of characters of [char]. *) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index 4e2a39e1..3e6cbd10 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -704,7 +704,7 @@ module Gen = struct let bytes_printable = bytes_size ~gen:printable nat - let small_bytes ?gen st = bytes_size ?gen small_nat st + let bytes_small ~gen st = bytes_size ~gen small_nat st let string : string t = string_size nat @@ -712,7 +712,8 @@ module Gen = struct let string_printable = string_size ~gen:printable nat - let small_string ?gen st = string_size ?gen small_nat st + let string_small ?gen st = string_size ?gen small_nat st + let small_string ?gen = string_small ?gen let small_list gen = list_size small_nat gen @@ -786,7 +787,7 @@ module Print = struct let float = string_of_float let bytes = Bytes.to_string - + let string s = Printf.sprintf "%S" s let char c = Printf.sprintf "%C" c @@ -1524,7 +1525,7 @@ module Test = struct let make_neg = make' ~negative:true let test_get_count (Test cell) = get_count cell - + let test_get_long_factor (Test cell) = get_long_factor cell (** {6 Running the test} *) diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index 114bed38..6a8a609e 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -321,9 +321,8 @@ module Gen : sig @since NEXT_RELEASE *) - val small_bytes : ?gen:char t -> bytes t - (** Builds a bytes generator, length is {!small_nat}. - Accepts an optional character generator (the default is {!char}). + val bytes_small : gen:char t -> bytes t + (** Builds a bytes generator using the given character generator, length is {!small_nat}. Shrinks on the number of characters first, then on the characters. @@ -360,13 +359,18 @@ module Gen : sig @since 0.11 *) - val small_string : ?gen:char t -> string t + val string_small : ?gen:char t -> string t (** Builds a string generator, length is {!small_nat}. Accepts an optional character generator (the default is {!char}). Shrinks on the number of characters first, then on the characters. + + @since NEXT_RELEASE *) + val small_string : ?gen:char t -> string t + (** alias for [string_small] for backward compatibility *) + val pure : 'a -> 'a t (** [pure a] creates a generator that always returns [a]. @@ -1078,7 +1082,7 @@ module Print : sig (** [char] is a printer of character. *) val bytes : bytes t - (** [bytes] is a printer of bytes. + (** [bytes] is a printer of bytes. @since NEXT_RELEASE *) val string : string t @@ -1323,7 +1327,7 @@ module Observable : sig (** [quad o1 o2 o3 o4] is an observable of quadruples of [('a * 'b * 'c * 'd)]. *) end - + (** Utils on combining function arguments. *) module Tuple : sig (** Heterogeneous tuple, used to pass any number of arguments to @@ -1648,7 +1652,7 @@ module Test : sig type 'a cell (** A single property test on a value of type ['a]. A {!Test.t} wraps a [cell] and hides its type parameter. *) - + val make_cell : ?if_assumptions_fail:([`Fatal | `Warning] * float) -> ?count:int -> ?long_factor:int -> ?negative:bool -> ?max_gen:int -> ?max_fail:int -> ?retries:int -> @@ -1687,7 +1691,7 @@ module Test : sig ?retries:int -> ?name:string -> gen:(Random.State.t -> 'a) -> ?shrink:('a -> ('a -> unit) -> unit) -> ?print:('a -> string) -> ?collect:('a -> string) -> stats:'a stat list -> ('a -> bool) -> 'a cell - (** ⚠️ Do not use, this is exposed for internal reasons only. ⚠️ + (** ⚠️ Do not use, this is exposed for internal reasons only. ⚠️ @deprecated Migrate to QCheck2 and use {!make_cell} instead. *) diff --git a/test/core/QCheck2_tests.ml b/test/core/QCheck2_tests.ml index c6a6d070..4b51b63b 100644 --- a/test/core/QCheck2_tests.ml +++ b/test/core/QCheck2_tests.ml @@ -818,7 +818,7 @@ module Stats = struct Test.make ~name:"bytes len dist" ~count:5_000 ~stats:[len] Gen.bytes (fun _ -> true); Test.make ~name:"bytes_of len dist" ~count:5_000 ~stats:[len] Gen.(bytes_of (return 'a')) (fun _ -> true); Test.make ~name:"bytes_printable len dist" ~count:5_000 ~stats:[len] Gen.bytes_printable (fun _ -> true); - Test.make ~name:"small_bytes len dist" ~count:5_000 ~stats:[len] Gen.(small_bytes ~gen:char) (fun _ -> true); + Test.make ~name:"bytes_small len dist" ~count:5_000 ~stats:[len] Gen.(bytes_small ~gen:char) (fun _ -> true); ] let string_len_tests = diff --git a/test/core/QCheck_tests.ml b/test/core/QCheck_tests.ml index 929c9824..7bd596d1 100644 --- a/test/core/QCheck_tests.ml +++ b/test/core/QCheck_tests.ml @@ -882,8 +882,7 @@ module Stats = struct Test.make ~name:"bytes_size len dist" ~count:5_000 (add_stat len (bytes_of_size (Gen.int_range 5 10))) (fun _ -> true); Test.make ~name:"bytes len dist" ~count:5_000 (add_stat len bytes) (fun _ -> true); Test.make ~name:"bytes_of len dist" ~count:5_000 (add_stat len (bytes_gen (Gen.return 'a'))) (fun _ -> true); - Test.make ~name:"printable_bytes len dist" ~count:5_000 (add_stat len printable_bytes) (fun _ -> true); - Test.make ~name:"small_bytes len dist" ~count:5_000 (add_stat len small_bytes) (fun _ -> true); + Test.make ~name:"small_bytes len dist" ~count:5_000 (add_stat len bytes_small) (fun _ -> true); ] let string_len_tests = From 659a2b650dcec5db6748bc885d8643a4b1b67f18 Mon Sep 17 00:00:00 2001 From: n-osborne <nicolas.osborne@tarides.com> Date: Mon, 20 Jun 2022 15:32:43 +0200 Subject: [PATCH 083/391] small_string no longer takes optional argument --- CHANGELOG.md | 1 + src/core/QCheck2.ml | 4 ++-- src/core/QCheck2.mli | 7 +++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef4bf1d1..cdb92da1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - add `QCheck.{Print,Shrink,Observable}.bytes` - add `QCheck2.{Print,Shrink}.bytes` - add `QCheck.{bytes_gen_of_size,bytes_gen,bytes,bytes_small,bytes_of_size,bytes_printable}` +- `QCheck2.{small_string}` character generator argument is no more optional - add an optional argument with conservative default to `Shrink.string` - fix shrinkers in `QCheck.{printable_string,printable_string_of_size,small_printable_string,numeral_string,numeral_string_of_size}` [#257](https://github.com/c-cube/qcheck/issues/257) - add `QCheck2.Gen.set_shrink` to modify the generator's shrinker diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index 3e6cbd10..1c9032dc 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -712,8 +712,8 @@ module Gen = struct let string_printable = string_size ~gen:printable nat - let string_small ?gen st = string_size ?gen small_nat st - let small_string ?gen = string_small ?gen + let string_small ~gen st = string_size ~gen small_nat st + let small_string ~gen = string_small ~gen let small_list gen = list_size small_nat gen diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index 6a8a609e..ea21a496 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -359,16 +359,15 @@ module Gen : sig @since 0.11 *) - val string_small : ?gen:char t -> string t - (** Builds a string generator, length is {!small_nat}. - Accepts an optional character generator (the default is {!char}). + val string_small : gen:char t -> string t + (** Builds a string generator using the given characher generator, length is {!small_nat}. Shrinks on the number of characters first, then on the characters. @since NEXT_RELEASE *) - val small_string : ?gen:char t -> string t + val small_string : gen:char t -> string t (** alias for [string_small] for backward compatibility *) val pure : 'a -> 'a t From d9555228aec5921af5a55e133e65441116aaae78 Mon Sep 17 00:00:00 2001 From: n-osborne <nicolas.osborne@tarides.com> Date: Mon, 20 Jun 2022 16:25:49 +0200 Subject: [PATCH 084/391] Iter.map version of bytes shrinker --- src/core/QCheck.ml | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index bc440e55..5c0d0e69 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -86,20 +86,15 @@ let _opt_sum a b = match a, b with let sum_int = List.fold_left (+) 0 -let _fold_right length get f x acc = - let len = length x in +(* Included for backwards compatibility, pre 4.13 *) +let string_fold_right f s acc = + let len = String.length s in let rec loop i acc = if i<0 then acc - else loop (i-1) (f (get x i) acc) in + else loop (i-1) (f (String.get s i) acc) in loop (len-1) acc -(* Included for backwards compatibility, pre 4.13 *) -let bytes_fold_right = _fold_right Bytes.length Bytes.get - -(* Included for backwards compatibility, pre 4.13 *) -let string_fold_right = _fold_right String.length String.get - exception No_example_found of string (* raised if an example failed to be found *) @@ -796,15 +791,7 @@ module Shrink = struct Buffer.clear buf; yield s) - let bytes (b : bytes) (yield : bytes -> unit) = - let buf = Buffer.create 42 in - list ~shrink:char - (bytes_fold_right (fun c acc -> c::acc) b []) - (fun cs -> - List.iter (fun c -> Buffer.add_char buf c) cs; - let b = Buffer.contents buf |> Bytes.of_string in - Buffer.clear buf; - yield b) + let bytes b = Iter.map Bytes.of_string (string (Bytes.to_string b)) let pair a b (x,y) yield = a x (fun x' -> yield (x',y)); From b4b7a8906a7a54956c96b2436ec867bde24988af Mon Sep 17 00:00:00 2001 From: n-osborne <nicolas.osborne@tarides.com> Date: Wed, 22 Jun 2022 11:10:05 +0200 Subject: [PATCH 085/391] smaller diff --- src/core/QCheck.ml | 5 ++-- src/core/QCheck.mli | 2 +- src/core/QCheck2.ml | 3 +-- test/core/QCheck2_expect_test.expected.64 | 2 +- test/core/QCheck_expect_test.expected.64 | 29 ++--------------------- test/core/QCheck_tests.ml | 2 +- 6 files changed, 8 insertions(+), 35 deletions(-) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index 5c0d0e69..5fb20694 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -92,7 +92,7 @@ let string_fold_right f s acc = let rec loop i acc = if i<0 then acc - else loop (i-1) (f (String.get s i) acc) in + else loop (i-1) (f s.[i] acc) in loop (len-1) acc exception No_example_found of string @@ -382,9 +382,8 @@ module Gen = struct let string_of gen = string_size ~gen nat let bytes_printable = bytes_size ~gen:printable nat let string_printable = string_size ~gen:printable nat - let bytes_readable = bytes_printable let string_readable = string_printable - let small_bytes ?gen st = bytes_size ?gen small_nat st + let bytes_small ?gen st = bytes_size ?gen small_nat st let small_string ?gen st = string_size ?gen small_nat st let small_list gen = list_size small_nat gen let small_array gen = array_size small_nat gen diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 0e78761b..29ca5db4 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -417,7 +417,7 @@ module Gen : sig (** Generator using the {!printable} character generator. @since NEXT_RELEASE *) - val small_bytes : ?gen:char t -> bytes t + val bytes_small : ?gen:char t -> bytes t (** Builds a bytes generator, length is {!small_nat} Accepts an optional character generator (the default is {!char}). @since NEXT_RELEASE *) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index 1c9032dc..3e81ba4a 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -998,7 +998,7 @@ module Observable = struct let bool : bool t = (=) - let float = (=) + let float : float t = (=) let unit () () = true @@ -1525,7 +1525,6 @@ module Test = struct let make_neg = make' ~negative:true let test_get_count (Test cell) = get_count cell - let test_get_long_factor (Test cell) = get_long_factor cell (** {6 Running the test} *) diff --git a/test/core/QCheck2_expect_test.expected.64 b/test/core/QCheck2_expect_test.expected.64 index 30df1c04..9854be8a 100644 --- a/test/core/QCheck2_expect_test.expected.64 +++ b/test/core/QCheck2_expect_test.expected.64 @@ -825,7 +825,7 @@ stats len: 8982..9480: 16 9481..9979: 12 -+++ Stats for small_bytes len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++ Stats for bytes_small len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: num: 5000, avg: 15.57, stddev: 24.36, median 6, min 0, max 99 diff --git a/test/core/QCheck_expect_test.expected.64 b/test/core/QCheck_expect_test.expected.64 index 15cc10c8..26cb5722 100644 --- a/test/core/QCheck_expect_test.expected.64 +++ b/test/core/QCheck_expect_test.expected.64 @@ -758,32 +758,7 @@ stats len: 9000.. 9499: 13 9500.. 9999: 13 -+++ Stats for printable_bytes len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -stats len: - num: 5000, avg: 384.53, stddev: 1330.61, median 9, min 0, max 9969 - 0.. 498: ####################################################### 4246 - 499.. 997: ###### 518 - 998..1496: 21 - 1497..1995: 10 - 1996..2494: 11 - 2495..2993: 10 - 2994..3492: 13 - 3493..3991: 13 - 3992..4490: 5 - 4491..4989: 10 - 4990..5488: 19 - 5489..5987: 9 - 5988..6486: 10 - 6487..6985: 12 - 6986..7484: 17 - 7485..7983: 16 - 7984..8482: 16 - 8483..8981: 16 - 8982..9480: 16 - 9481..9979: 12 - -+++ Stats for small_bytes len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++ Stats for bytes_small len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: num: 5000, avg: 15.57, stddev: 24.36, median 6, min 0, max 99 @@ -1419,7 +1394,7 @@ stats dist: 4150517416584649600.. 4611686018427387903: ################# 189 ================================================================================ 1 warning(s) -failure (63 tests failed, 3 tests errored, ran 149 tests) +failure (63 tests failed, 3 tests errored, ran 148 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_tests.ml b/test/core/QCheck_tests.ml index 7bd596d1..c27fadee 100644 --- a/test/core/QCheck_tests.ml +++ b/test/core/QCheck_tests.ml @@ -882,7 +882,7 @@ module Stats = struct Test.make ~name:"bytes_size len dist" ~count:5_000 (add_stat len (bytes_of_size (Gen.int_range 5 10))) (fun _ -> true); Test.make ~name:"bytes len dist" ~count:5_000 (add_stat len bytes) (fun _ -> true); Test.make ~name:"bytes_of len dist" ~count:5_000 (add_stat len (bytes_gen (Gen.return 'a'))) (fun _ -> true); - Test.make ~name:"small_bytes len dist" ~count:5_000 (add_stat len bytes_small) (fun _ -> true); + Test.make ~name:"bytes_small len dist" ~count:5_000 (add_stat len bytes_small) (fun _ -> true); ] let string_len_tests = From b7ca0dab0da2f608ff104ba56e8d5de5a5a0c67a Mon Sep 17 00:00:00 2001 From: n-osborne <nicolas.osborne@tarides.com> Date: Tue, 13 Sep 2022 11:38:44 +0200 Subject: [PATCH 086/391] expose missing string arbitrary --- CHANGELOG.md | 1 + src/core/QCheck.mli | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cdb92da1..e39dd0e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - add `QCheck.{Print,Shrink,Observable}.bytes` - add `QCheck2.{Print,Shrink}.bytes` - add `QCheck.{bytes_gen_of_size,bytes_gen,bytes,bytes_small,bytes_of_size,bytes_printable}` +- add `QCheck.{string_small,string_printable,string_printable_of_size,string_small_printable,string_numeral,string_numeral_of_size}` - `QCheck2.{small_string}` character generator argument is no more optional - add an optional argument with conservative default to `Shrink.string` - fix shrinkers in `QCheck.{printable_string,printable_string_of_size,small_printable_string,numeral_string,numeral_string_of_size}` [#257](https://github.com/c-cube/qcheck/issues/257) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 29ca5db4..693e9f6c 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -1302,6 +1302,10 @@ val string : string arbitrary val small_string : string arbitrary (** Same as {!string} but with a small length (ie {!Gen.small_nat} ). *) +val string_small : string arbitrary +(** Same as {!string} but with a small length (ie {!Gen.small_nat} ). + @since NEXT_RELEASE *) + val small_list : 'a arbitrary -> 'a list arbitrary (** Generates lists of small size (see {!Gen.small_nat}). @since 0.5.3 *) @@ -1322,20 +1326,43 @@ val printable_string : string arbitrary (** Generates strings with a distribution of length of {!Gen.nat} and distribution of characters of [printable_char]. *) +val string_printable : string arbitrary +(** Generates strings with a distribution of length of {!Gen.nat} + and distribution of characters of [printable_char]. + @since NEXT_RELEASE *) + val printable_string_of_size : int Gen.t -> string arbitrary (** Generates strings with distribution of characters of [printable_char]. *) +val string_printable_of_size : int Gen.t -> string arbitrary +(** Generates strings with distribution of characters of [printable_char]. + @since NEXT_RELEASE *) + val small_printable_string : string arbitrary (** Generates strings with a length of [small_nat] and distribution of characters of [printable_char]. *) +val string_small_printable : string arbitrary +(** Generates strings with a length of [small_nat] + and distribution of characters of [printable_char]. + @since NEXT_RELEASE *) + val numeral_string : string arbitrary (** Generates strings with a distribution of length of {!Gen.nat} and distribution of characters of [numeral_char]. *) +val string_numeral : string arbitrary +(** Generates strings with a distribution of length of {!Gen.nat} + and distribution of characters of [numeral_char]. + @since NEXT_RELEASE *) + val numeral_string_of_size : int Gen.t -> string arbitrary (** Generates strings with a distribution of characters of [numeral_char]. *) +val string_numeral_of_size : int Gen.t -> string arbitrary +(** Generates strings with a distribution of characters of [numeral_char]. + @since NEXT_RELEASE *) + val list : 'a arbitrary -> 'a list arbitrary (** Generates lists with length generated by {!Gen.nat}. *) From c15418cc0791353d9ddfbdbeff43463991f88041 Mon Sep 17 00:00:00 2001 From: n-osborne <nicolas.osborne@tarides.com> Date: Wed, 26 Oct 2022 10:07:52 +0200 Subject: [PATCH 087/391] Update documentation for string arbitraries synomyms. Indicate what the new name is a synonym of, so that newcommers can easily make their choice. --- src/core/QCheck.mli | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 693e9f6c..335a8c0b 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -1303,7 +1303,7 @@ val small_string : string arbitrary (** Same as {!string} but with a small length (ie {!Gen.small_nat} ). *) val string_small : string arbitrary -(** Same as {!string} but with a small length (ie {!Gen.small_nat} ). +(** Synonym to [small_string] added for convenience. @since NEXT_RELEASE *) val small_list : 'a arbitrary -> 'a list arbitrary @@ -1327,15 +1327,14 @@ val printable_string : string arbitrary and distribution of characters of [printable_char]. *) val string_printable : string arbitrary -(** Generates strings with a distribution of length of {!Gen.nat} - and distribution of characters of [printable_char]. +(** Synonym to [printable_string] added for convenience. @since NEXT_RELEASE *) val printable_string_of_size : int Gen.t -> string arbitrary (** Generates strings with distribution of characters of [printable_char]. *) val string_printable_of_size : int Gen.t -> string arbitrary -(** Generates strings with distribution of characters of [printable_char]. +(** Synonym to [printable_string_of_size] added for convenience. @since NEXT_RELEASE *) val small_printable_string : string arbitrary @@ -1343,8 +1342,7 @@ val small_printable_string : string arbitrary and distribution of characters of [printable_char]. *) val string_small_printable : string arbitrary -(** Generates strings with a length of [small_nat] - and distribution of characters of [printable_char]. +(** Synonym to [small_printable_string] added for convenience. @since NEXT_RELEASE *) val numeral_string : string arbitrary @@ -1352,15 +1350,14 @@ val numeral_string : string arbitrary and distribution of characters of [numeral_char]. *) val string_numeral : string arbitrary -(** Generates strings with a distribution of length of {!Gen.nat} - and distribution of characters of [numeral_char]. +(** Synonym to [numeral_string] added for convenience. @since NEXT_RELEASE *) val numeral_string_of_size : int Gen.t -> string arbitrary (** Generates strings with a distribution of characters of [numeral_char]. *) val string_numeral_of_size : int Gen.t -> string arbitrary -(** Generates strings with a distribution of characters of [numeral_char]. +(** Synonym to [numeral_string_of_size] added for convenience. @since NEXT_RELEASE *) val list : 'a arbitrary -> 'a list arbitrary From 0d6b8f84a8d5d78fdefd480cd9f846fb9d71a47b Mon Sep 17 00:00:00 2001 From: n-osborne <nicolas.osborne@tarides.com> Date: Wed, 26 Oct 2022 10:26:56 +0200 Subject: [PATCH 088/391] Fix shrinker for QCheck.bytes_printable. This is the same fix that has been made in #258 for strings. `Shrink.bytes` now takes an optional char shrinker (default value being `Shrink.char`). So `bytes_printable` can shrink only on printable chars. --- src/core/QCheck.ml | 6 ++++-- src/core/QCheck.mli | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index 5fb20694..9787e3b8 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -790,7 +790,7 @@ module Shrink = struct Buffer.clear buf; yield s) - let bytes b = Iter.map Bytes.of_string (string (Bytes.to_string b)) + let bytes ?(shrink = char) b = Iter.map Bytes.of_string (string ~shrink (Bytes.to_string b)) let pair a b (x,y) yield = a x (fun x' -> yield (x',y)); @@ -1134,7 +1134,9 @@ let bytes_gen gen = let bytes = bytes_gen Gen.char let bytes_of_size size = bytes_gen_of_size size Gen.char let bytes_small = bytes_gen_of_size Gen.small_nat Gen.char -let bytes_printable = bytes_gen Gen.printable +let bytes_printable = + make ~shrink:(Shrink.bytes ~shrink:Shrink.char_printable) ~small:Bytes.length + ~print:(Print.bytes) (Gen.bytes ~gen:Gen.printable) let string_gen_of_size size gen = make ~shrink:Shrink.string ~small:String.length diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 335a8c0b..e3e18e55 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -736,7 +736,7 @@ module Shrink : sig val option : 'a t -> 'a option t - val bytes : bytes t + val bytes : ?shrink:(char t) -> bytes t (** @since NEXT_RELEASE *) val string : ?shrink:(char t) -> string t From efd8f3e9523dc3b8b2ae50d1a005c061108c0ca5 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 27 Oct 2022 12:36:40 +0200 Subject: [PATCH 089/391] improve error handling on non-float environment variable --- src/runner/QCheck_base_runner.ml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/runner/QCheck_base_runner.ml b/src/runner/QCheck_base_runner.ml index 6fc75cb0..741086c4 100644 --- a/src/runner/QCheck_base_runner.ml +++ b/src/runner/QCheck_base_runner.ml @@ -65,7 +65,10 @@ let time_between_msg = let default_interval = 0.1 in let interval = match Sys.getenv_opt env_var with | None -> default_interval - | Some f -> float_of_string f in + | Some f -> + match float_of_string_opt f with + | None -> invalid_arg (env_var ^ " must be a float") + | Some i -> i in if interval < 0. then invalid_arg (env_var ^ " must be >= 0 but value is " ^ string_of_float interval); ref interval From 7fd6376548c441be1938a35a60d47faf4fbcbc05 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 1 Nov 2022 16:31:55 +0100 Subject: [PATCH 090/391] Fix error message --- src/runner/QCheck_base_runner.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runner/QCheck_base_runner.ml b/src/runner/QCheck_base_runner.ml index 741086c4..915501aa 100644 --- a/src/runner/QCheck_base_runner.ml +++ b/src/runner/QCheck_base_runner.ml @@ -190,7 +190,7 @@ module Raw = struct ; "--debug-shrink-list", Arg.String set_debug_shrink_list, " filter test to debug shrinking on" ] ) in - Arg.parse_argv argv options (fun _ ->()) "run qtest suite"; + Arg.parse_argv argv options (fun _ ->()) "run QCheck test suite"; let cli_rand = setup_random_state_ ~colors:!colors () in { cli_verbose=verbose(); cli_long_tests=long_tests(); cli_rand; cli_print_list= !print_list; cli_slow_test= !slow; From 9bdbad8aebca2b92eee1f60b430c49695b522e1c Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 2 Nov 2022 09:15:50 +0100 Subject: [PATCH 091/391] update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cdefd0b5..d898edd3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## 0.20 +- fix unknown option error message referring to `qtest` - add an optional argument with conservative default to `Shrink.string` - fix shrinkers in `QCheck.{printable_string,printable_string_of_size,small_printable_string,numeral_string,numeral_string_of_size}` [#257](https://github.com/c-cube/qcheck/issues/257) - add `QCheck2.Gen.set_shrink` to modify the generator's shrinker From 2b4110678ffedb960d145f87b1d40dbe1ee604f9 Mon Sep 17 00:00:00 2001 From: n-osborne <nicolas.osborne@tarides.com> Date: Fri, 28 Oct 2022 14:15:13 +0200 Subject: [PATCH 092/391] fix CHANGELOG and restore Float.equal --- CHANGELOG.md | 9 +++------ src/core/QCheck.mli | 18 +++++++++--------- src/core/QCheck2.ml | 2 +- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e39dd0e8..35c66a71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,16 +2,13 @@ ## 0.20 -- add `{QCheck,QCheck2}.Gen.{bytes_size,bytes,bytes_of,bytes_printable,small_bytes}` -- add `QCheck.{Print,Shrink,Observable}.bytes` -- add `QCheck2.{Print,Shrink}.bytes` -- add `QCheck.{bytes_gen_of_size,bytes_gen,bytes,small_bytes,bytes_of_size,printable_bytes,printable_bytes_of_size,numeral_bytes,numeral_bytes_of_size}` -- add `{QCheck,QCheck2}.Gen.{bytes_size,bytes,bytes_of,bytes_printable,bytes_small,string_small}` +- add `{QCheck,QCheck2}.Gen.{bytes_size,bytes,bytes_of,bytes_printable,bytes_small}` +- add `QCheck2.Gen.string_small` - add `QCheck.{Print,Shrink,Observable}.bytes` - add `QCheck2.{Print,Shrink}.bytes` - add `QCheck.{bytes_gen_of_size,bytes_gen,bytes,bytes_small,bytes_of_size,bytes_printable}` - add `QCheck.{string_small,string_printable,string_printable_of_size,string_small_printable,string_numeral,string_numeral_of_size}` -- `QCheck2.{small_string}` character generator argument is no more optional +- `QCheck2.small_string` character generator argument is no more optional - add an optional argument with conservative default to `Shrink.string` - fix shrinkers in `QCheck.{printable_string,printable_string_of_size,small_printable_string,numeral_string,numeral_string_of_size}` [#257](https://github.com/c-cube/qcheck/issues/257) - add `QCheck2.Gen.set_shrink` to modify the generator's shrinker diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index e3e18e55..9b61b9e9 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -1289,6 +1289,15 @@ val bytes_small : bytes arbitrary (** Same as {!bytes} but with a small length (ie {!Gen.small_nat} ). @since NEXT_RELEASE *) +val bytes_of_size : int Gen.t -> bytes arbitrary +(** Generates bytes with distribution of characters of [char]. + @since NEXT_RELEASE *) + +val bytes_printable : bytes arbitrary +(** Generates bytes with a distribution of length of {!Gen.nat} + and distribution of characters of [printable_char]. + @since NEXT_RELEASE *) + val string_gen_of_size : int Gen.t -> char Gen.t -> string arbitrary (** Builds a string generator from a (non-negative) size generator and a character generator. *) @@ -1310,15 +1319,6 @@ val small_list : 'a arbitrary -> 'a list arbitrary (** Generates lists of small size (see {!Gen.small_nat}). @since 0.5.3 *) -val bytes_of_size : int Gen.t -> bytes arbitrary -(** Generates bytes with distribution of characters of [char]. - @since NEXT_RELEASE *) - -val bytes_printable : bytes arbitrary -(** Generates bytes with a distribution of length of {!Gen.nat} - and distribution of characters of [printable_char]. - @since NEXT_RELEASE *) - val string_of_size : int Gen.t -> string arbitrary (** Generates strings with distribution of characters of [char]. *) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index 3e81ba4a..58929c0a 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -998,7 +998,7 @@ module Observable = struct let bool : bool t = (=) - let float : float t = (=) + let float = Float.equal let unit () () = true From a3d6b34b3a38359ba216f6a2a1a3f7dfb859174a Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 2 Nov 2022 11:45:04 +0100 Subject: [PATCH 093/391] update expect tests in test/core to OCaml5 PRNG --- test/core/QCheck2_expect_test.expected.ocaml5 | 1350 +++++++++++++++++ test/core/QCheck_expect_test.expected.ocaml5 | 1326 ++++++++++++++++ test/core/dune | 13 +- 3 files changed, 2685 insertions(+), 4 deletions(-) create mode 100644 test/core/QCheck2_expect_test.expected.ocaml5 create mode 100644 test/core/QCheck_expect_test.expected.ocaml5 diff --git a/test/core/QCheck2_expect_test.expected.ocaml5 b/test/core/QCheck2_expect_test.expected.ocaml5 new file mode 100644 index 00000000..3aba6b6a --- /dev/null +++ b/test/core/QCheck2_expect_test.expected.ocaml5 @@ -0,0 +1,1350 @@ +random seed: 1234 +45 4 0 0 0 0 0 0 0 0 0 0 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 (8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) +(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) +(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) +(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) +(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) +(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) +(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) +(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) +-1592932412304362665 +98783772632201765 +0 +49391886316100882 +0 +24695943158050441 +0 +12347971579025220 +0 +6173985789512610 +0 +3086992894756305 +0 +1543496447378152 +0 +771748223689076 +0 +385874111844538 +0 +192937055922269 +0 +96468527961134 +0 +48234263980567 +0 +24117131990283 +0 +12058565995141 +0 +6029282997570 +0 +3014641498785 +0 +1507320749392 +0 +753660374696 +0 +376830187348 +0 +188415093674 +0 +94207546837 +0 +47103773418 +0 +23551886709 +0 +11775943354 +0 +5887971677 +0 +2943985838 +0 +1471992919 +0 +735996459 +0 +367998229 +0 +183999114 +0 +91999557 +0 +45999778 +0 +22999889 +0 +11499944 +0 +5749972 +0 +2874986 +0 +1437493 +0 +718746 +0 +359373 +0 +179686 +0 +89843 +0 +44921 +0 +22460 +0 +11230 +0 +5615 +0 +2807 +0 +1403 +0 +701 +0 +350 +0 +175 +0 +87 +0 +43 +0 +21 +0 +10 +0 +5 +0 +2 +0 +1 +0 +[46; 2; 22; 4; 4; 2; 6; 5; 88; 24; 7; 9; 9; 2; 5; 1; 55; 8; 45; 1; 96; 0; 1; 2; 7; 4; 1; 5; 95; 6; 8; 6; 4; 0; 5; 5; 22; 87; 2; 1; 1; 0; 2; 2; 9; 5; 9; 3; 7; 59; 7; 96; 6; 5; 1; 3; 9; 9; 65; 6; 7; 7; 2; 5; 0; 0; 70; 5; 5; 2; 1; 57; 9; 7; 8; 10; 9; 7; 9; 75; 73; 80; 7; 9; 4; 3; 16; 5; 79; 1; 8; 6; 2; 3; 4; 9; 2; 8; 4; 6; 50; 2; 1; 5; 9; 5; 4; 3; 56; 6; 5; 9; 4; 1; 47; 1; 2; 5; 2; 0; 7; 31; 55; 6; 7; 4; 7; 8; 8; 2; 4; 40; 4; 6; 9; 3; 59; 5; 1; 0; 2; 6; 90; 1; 6; 81; 0; 1; 3; 7; 2; 4; 5; 4; 7; 3; 62; 0; 1; 6; 7; 5; 97; 83; 41; 7; 2; 6; 3; 0; 4; 8; 99; 8; 6; 0; 7; 9; 7; 1; 55; 30; 25; 3; 4; 7; 1; 6; 80; 8; 0; 4; 21; 3; 5; 9; 27; 10; 60; 47; 54; 6; 5; 8; 1; 5; 9; 65; 9; 5; 7; 7; 6; 48; 9; 5; 6; 4; 9; 7; 1; 2; 71; 6; 9; 2; 7; 8; 14; 59; 71; 30; 7; 3; 5; 4; 6; 7; 3; 6; 9; 8; 2; 38; 6; 6; 7; 1; 5; 2; 43; 5; 2; 9; 3; 0; 3; 2; 7; 71; 26; 3; 9; 11; 5; 1; 5; 2; 53; 46; 4; 6; 7; 67; 1; 0; 34; 0; 48; 5; 5; 0; 7; 49; 92; 8; 3; 0; 67; 1; 5; 2; 9; 5; 9; 3; 1; 4; 8; 0; 3; 6; 46; 58; 1; 54; 77; 0; 96; 1; 6; 2; 8; 22; 3; 9; 2; 6; 25; 49; 9; 6; 3; 8; 5; 9; 54; 1; 7; 5; 6; 5; 1; 7; 8; 23; 4; 6; 4; 2; 5; 8; 4; 7; 4] +[] +[7; 79; 86; 1; 70; 98; 1; 4; 7; 9; 5; 8; 0; 1; 2; 0; 6; 0; 37; 6; 8; 26; 6; 8; 8; 98; 6; 8; 1; 6; 2; 4; 4; 7; 26; 1; 77; 2; 9; 9; 81; 8; 9; 4; 0; 86; 9; 3; 7; 0; 54; 2; 4; 1; 6; 4; 55; 5; 0; 9; 2; 1; 3; 8; 7; 1; 1; 3; 92; 1; 3; 4; 5; 2; 8; 51; 2; 94; 6; 82; 0; 11; 86; 1; 36; 31; 3; 2; 3; 8; 2; 8; 14; 26; 89; 1; 6; 0; 9; 5; 6; 7; 1; 6; 1; 6; 4; 7; 8; 8; 4; 1; 6; 3; 1; 5; 0; 6; 0; 5; 0; 4; 3; 49; 5; 8; 37; 8; 38; 0; 1; 8; 59; 5; 0; 7; 37; 87; 9; 3; 1; 5; 59; 8; 7; 6; 26; 4; 8; 8; 8; 9; 3; 2; 6; 64; 6; 7; 2; 8; 5; 2; 94; 26; 98; 3; 29; 2; 1; 72; 2; 49] +[] +[8; 13; 1; 18; 0; 69; 15; 2; 5; 78; 7; 32; 8; 36; 7; 3; 0; 9; 1; 1; 1; 29; 3; 8; 7; 2; 1; 8; 7; 8; 22; 5; 49; 5; 0; 1; 8; 5; 6; 7; 5; 1; 9; 73; 55; 2; 4; 7; 3; 4; 2; 27; 0; 6; 9; 1; 7; 8; 5; 12; 5; 8; 9; 1; 95; 1; 0; 1; 4; 8; 6; 7; 0; 8; 2; 3; 7; 3; 9; 0; 86; 96; 72; 3; 4; 25] +[] +[4; 3; 6; 5; 0; 0; 9; 7; 0; 6; 5; 3; 0; 24; 5; 6; 86; 9; 9; 0; 7; 2; 6; 6; 3; 45; 6; 1; 17; 1; 2; 2; 3; 0; 4; 1; 8; 2; 6; 9; 5; 0; 2] +[] +[9; 7; 62; 0; 73; 0; 8; 94; 0; 6; 50; 9; 83; 0; 5; 40; 6; 1; 6; 6; 6] +[] +[6; 5; 2; 54; 33; 9; 1; 1; 1; 61] +[] +[5; 7; 0; 65; 0] +[] +[2; 7] +[] +[6] +[] +[0] +[46; 2; 22; 4; 4; 2; 6; 5; 88; 24; 7; 9; 9; 2; 5; 1; 55; 8; 45; 1; 96; 0; 1; 2; 7; 4; 1; 5; 95; 6; 8; 6; 4; 0; 5; 5; 22; 87; 2; 1; 1; 0; 2; 2; 9; 5; 9; 3; 7; 59; 7; 96; 6; 5; 1; 3; 9; 9; 65; 6; 7; 7; 2; 5; 0; 0; 70; 5; 5; 2; 1; 57; 9; 7; 8; 10; 9; 7; 9; 75; 73; 80; 7; 9; 4; 3; 16; 5; 79; 1; 8; 6; 2; 3; 4; 9; 2; 8; 4; 6; 50; 2; 1; 5; 9; 5; 4; 3; 56; 6; 5; 9; 4; 1; 47; 1; 2; 5; 2; 0; 7; 31; 55; 6; 7; 4; 7; 8; 8; 2; 4; 40; 4; 6; 9; 3; 59; 5; 1; 0; 2; 6; 90; 1; 6; 81; 0; 1; 3; 7; 2; 4; 5; 4; 7; 3; 62; 0; 1; 6; 7; 5; 97; 83; 41; 7; 2; 6; 3; 0; 4; 8; 99; 8; 6; 0; 7; 9; 7; 1; 55; 30; 25; 3; 4; 7; 1; 6; 80; 8; 0; 4; 21; 3; 5; 9; 27; 10; 60; 47; 54; 6; 5; 8; 1; 5; 9; 65; 9; 5; 7; 7; 6; 48; 9; 5; 6; 4; 9; 7; 1; 2; 71; 6; 9; 2; 7; 8; 14; 59; 71; 30; 7; 3; 5; 4; 6; 7; 3; 6; 9; 8; 2; 38; 6; 6; 7; 1; 5; 2; 43; 5; 2; 9; 3; 0; 3; 2; 7; 71; 26; 3; 9; 11; 5; 1; 5; 2; 53; 46; 4; 6; 7; 67; 1; 0; 34; 0; 48; 5; 5; 0; 7; 49; 92; 8; 3; 0; 67; 1; 5; 2; 9; 5; 9; 3; 1; 4; 8; 0; 3; 6; 46; 58; 1; 54; 77; 0; 96; 1; 6; 2; 8; 22; 3; 9; 2; 6; 25; 49; 9; 6; 3; 8; 5; 9; 54; 1; 7; 5; 6; 5; 1; 7; 8; 23; 4; 6; 4; 2; 5; 8; 4; 7; 4] +[] +[7; 79; 86; 1; 70; 98; 1; 4; 7; 9; 5; 8; 0; 1; 2; 0; 6; 0; 37; 6; 8; 26; 6; 8; 8; 98; 6; 8; 1; 6; 2; 4; 4; 7; 26; 1; 77; 2; 9; 9; 81; 8; 9; 4; 0; 86; 9; 3; 7; 0; 54; 2; 4; 1; 6; 4; 55; 5; 0; 9; 2; 1; 3; 8; 7; 1; 1; 3; 92; 1; 3; 4; 5; 2; 8; 51; 2; 94; 6; 82; 0; 11; 86; 1; 36; 31; 3; 2; 3; 8; 2; 8; 14; 26; 89; 1; 6; 0; 9; 5; 6; 7; 1; 6; 1; 6; 4; 7; 8; 8; 4; 1; 6; 3; 1; 5; 0; 6; 0; 5; 0; 4; 3; 49; 5; 8; 37; 8; 38; 0; 1; 8; 59; 5; 0; 7; 37; 87; 9; 3; 1; 5; 59; 8; 7; 6; 26; 4; 8; 8; 8; 9; 3; 2; 6; 64; 6; 7; 2; 8; 5; 2; 94; 26; 98; 3; 29; 2; 1; 72; 2; 49] +[] +[8; 13; 1; 18; 0; 69; 15; 2; 5; 78; 7; 32; 8; 36; 7; 3; 0; 9; 1; 1; 1; 29; 3; 8; 7; 2; 1; 8; 7; 8; 22; 5; 49; 5; 0; 1; 8; 5; 6; 7; 5; 1; 9; 73; 55; 2; 4; 7; 3; 4; 2; 27; 0; 6; 9; 1; 7; 8; 5; 12; 5; 8; 9; 1; 95; 1; 0; 1; 4; 8; 6; 7; 0; 8; 2; 3; 7; 3; 9; 0; 86; 96; 72; 3; 4; 25] +[] +[4; 3; 6; 5; 0; 0; 9; 7; 0; 6; 5; 3; 0; 24; 5; 6; 86; 9; 9; 0; 7; 2; 6; 6; 3; 45; 6; 1; 17; 1; 2; 2; 3; 0; 4; 1; 8; 2; 6; 9; 5; 0; 2] +[] +[9; 7; 62; 0; 73; 0; 8; 94; 0; 6; 50; 9; 83; 0; 5; 40; 6; 1; 6; 6; 6] +[] +[6; 5; 2; 54; 33; 9; 1; 1; 1; 61] +[] +[5; 7; 0; 65; 0] +[] +[2; 7] +[4; 6; 6] +[] +[7] +[6; 41] +[0; 6; 6] +[0; 0; 6] +[0; 0; 0] + +--- Failure -------------------------------------------------------------------- + +Test should_fail_sort_id failed (11 shrink steps): + +[1; 0] + +=== Error ====================================================================== + +Test should_error_raise_exn errored on (2 shrink steps): + +0 + +exception QCheck2_tests.Overall.Error + + ++++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Collect results for test collect_results: + +4: 24 cases +3: 20 cases +2: 18 cases +1: 21 cases +0: 17 cases + ++++ Stats for with_stats ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats mod4: + num: 100, avg: 1.56, stddev: 1.18, median 2, min 0, max 3 + 0: ################################################# 27 + 1: #################################### 20 + 2: ########################################## 23 + 3: ####################################################### 30 + +stats num: + num: 100, avg: 62.24, stddev: 33.15, median 62, min 2, max 120 + 2.. 7: ######### 2 + 8.. 13: ################################ 7 + 14.. 19: ########################### 6 + 20.. 25: ############# 3 + 26.. 31: ###################### 5 + 32.. 37: ################## 4 + 38.. 43: ############# 3 + 44.. 49: ################################ 7 + 50.. 55: ################################ 7 + 56.. 61: ###################### 5 + 62.. 67: #################################### 8 + 68.. 73: ######### 2 + 74.. 79: ###################### 5 + 80.. 85: ######### 2 + 86.. 91: ####################################################### 12 + 92.. 97: ###################### 5 + 98..103: ################## 4 + 104..109: ################## 4 + 110..115: ############# 3 + 116..121: ########################### 6 + +--- Failure -------------------------------------------------------------------- + +Test with shrinking retries failed (0 shrink steps): + +4 + +!!! Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +Warning for test WARN_unlikely_precond: + +WARNING: only 0.8% tests (of 2000) passed precondition for "WARN_unlikely_precond" + +NOTE: it is likely that the precondition is too strong, or that the generator is buggy. + +--- Failure -------------------------------------------------------------------- + +Test FAIL_unlikely_precond failed: + +ERROR: only 0.8% tests (of 2000) passed precondition for "FAIL_unlikely_precond" + +NOTE: it is likely that the precondition is too strong, or that the generator is buggy. + + +--- Failure -------------------------------------------------------------------- + +Test FAIL_bad_gen failed: + +ERROR: uncaught exception in generator for test FAIL_bad_gen after 100 steps: +Exception: Invalid_argument("Gen.int_bound") +Backtrace: + +--- Failure -------------------------------------------------------------------- + +Test int double failed: + +Negative test int double succeeded but was expected to fail + +=== Error ====================================================================== + +Test pos fail with error errored on (1 shrink steps): + +0 + +exception QCheck2_tests.Overall.Error + + +=== Error ====================================================================== + +Test neg fail with error errored on (1 shrink steps): + +0 + +exception QCheck2_tests.Overall.Error + + +--- Failure -------------------------------------------------------------------- + +Test char never produces '\255' failed (0 shrink steps): + +'\255' + +--- Failure -------------------------------------------------------------------- + +Test big bound issue59 failed (0 shrink steps): + +4611686018427387903 + +--- Failure -------------------------------------------------------------------- + +Test long_shrink failed (3029 shrink steps): + +([0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0], [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 1]) + +--- Failure -------------------------------------------------------------------- + +Test ints arent 0 mod 3 failed (1 shrink steps): + +0 + +--- Failure -------------------------------------------------------------------- + +Test ints are 0 failed (57 shrink steps): + +1 + +--- Failure -------------------------------------------------------------------- + +Test ints < 209609 failed (0 shrink steps): + +4611686018427387903 + +--- Failure -------------------------------------------------------------------- + +Test nat < 5001 failed (6 shrink steps): + +5001 + +--- Failure -------------------------------------------------------------------- + +Test char never produces 'abcdef' failed (1 shrink steps): + +'a' + +--- Failure -------------------------------------------------------------------- + +Test printable never produces '!"#$%&'' failed (1 shrink steps): + +'!' + +--- Failure -------------------------------------------------------------------- + +Test printable never produces less than '5 failed (0 shrink steps): + +'0' + +--- Failure -------------------------------------------------------------------- + +Test strings are empty failed (9 shrink steps): + +"a" + +--- Failure -------------------------------------------------------------------- + +Test string never has a \000 char failed (55 shrink steps): + +"aaaaaaaaaaaaaaa\000aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + +--- Failure -------------------------------------------------------------------- + +Test string never has a \255 char failed (75 shrink steps): + +"aaaaaaa\255aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + +--- Failure -------------------------------------------------------------------- + +Test strings have unique chars failed (14 shrink steps): + +"aaaaaaa" + +--- Failure -------------------------------------------------------------------- + +Test pairs have different components failed (0 shrink steps): + +(6, 6) + +--- Failure -------------------------------------------------------------------- + +Test pairs have same components failed (63 shrink steps): + +(0, 1) + +--- Failure -------------------------------------------------------------------- + +Test pairs have a zero component failed (122 shrink steps): + +(1, 1) + +--- Failure -------------------------------------------------------------------- + +Test pairs are (0,0) failed (63 shrink steps): + +(0, 1) + +--- Failure -------------------------------------------------------------------- + +Test pairs are ordered failed (88 shrink steps): + +(1, 0) + +--- Failure -------------------------------------------------------------------- + +Test pairs are ordered reversely failed (62 shrink steps): + +(0, 1) + +--- Failure -------------------------------------------------------------------- + +Test pairs sum to less than 128 failed (58 shrink steps): + +(0, 128) + +--- Failure -------------------------------------------------------------------- + +Test pairs lists rev concat failed (72 shrink steps): + +([0], [1]) + +--- Failure -------------------------------------------------------------------- + +Test pairs lists no overlap failed (22 shrink steps): + +([0], [0; 0; 0; 0; 0; 0; 0; 0]) + +--- Failure -------------------------------------------------------------------- + +Test triples have pair-wise different components failed (3 shrink steps): + +(0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test triples have same components failed (63 shrink steps): + +(0, 1, 0) + +--- Failure -------------------------------------------------------------------- + +Test triples are ordered failed (3 shrink steps): + +(0, 0, -1) + +--- Failure -------------------------------------------------------------------- + +Test triples are ordered reversely failed (122 shrink steps): + +(0, 0, 1) + +--- Failure -------------------------------------------------------------------- + +Test quadruples have pair-wise different components failed (3 shrink steps): + +(0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test quadruples have same components failed (122 shrink steps): + +(0, 1, 0, 1) + +--- Failure -------------------------------------------------------------------- + +Test quadruples are ordered failed (4 shrink steps): + +(0, 0, 0, -1) + +--- Failure -------------------------------------------------------------------- + +Test quadruples are ordered reversely failed (124 shrink steps): + +(0, 0, 0, 1) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b) in nat: a < b failed (3 shrink steps): + +(0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c) in nat: a < b < c failed (5 shrink steps): + +(0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c, d) in nat: a < b < c < d failed (4 shrink steps): + +(0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c, d, e) in nat: a < b < c < d < e failed (5 shrink steps): + +(0, 0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c, d, e, f) in nat: a < b < c < d < e < f failed (6 shrink steps): + +(0, 0, 0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c, d, e, f, g) in nat: a < b < c < d < e < f < g failed (7 shrink steps): + +(0, 0, 0, 0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c, d, e, f, g, h) in nat: a < b < c < d < e < f < g < h failed (8 shrink steps): + +(0, 0, 0, 0, 0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c, d, e, f, g, h, i) in nat: a < b < c < d < e < f < g < h < i failed (9 shrink steps): + +(0, 0, 0, 0, 0, 0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test bind ordered pairs failed (1 shrink steps): + +(0, 0) + +--- Failure -------------------------------------------------------------------- + +Test bind list_size constant failed (12 shrink steps): + +(4, [0; 0; 0; 0]) + +--- Failure -------------------------------------------------------------------- + +Test lists are empty failed (9 shrink steps): + +[0] + +--- Failure -------------------------------------------------------------------- + +Test lists shorter than 10 failed (15 shrink steps): + +[0; 0; 0; 0; 0; 0; 0; 0; 0; 0] + +--- Failure -------------------------------------------------------------------- + +Test lists shorter than 432 failed (413 shrink steps): + +[...] list length: 432 + +--- Failure -------------------------------------------------------------------- + +Test lists shorter than 4332 failed (4002 shrink steps): + +[...] list length: 4332 + +--- Failure -------------------------------------------------------------------- + +Test lists have unique elems failed (10 shrink steps): + +[0; 0; 0] + +--- Failure -------------------------------------------------------------------- + +Test tree contains only 42 failed (2 shrink steps): + +Leaf 0 + +--- Failure -------------------------------------------------------------------- + +Test sum list = 0 failed (0 shrink steps): + +[46; 2; 22; 4; 4; 2; 6; 5; 88; 24; 7; 9; 9; 2; 5; 1; 55; 8; 45; 1; 96; 0; 1; 2; 7; 4; 1; 5; 95; 6; 8; 6; 4; 0; 5; 5; 22; 87; 2; 1; 1; 0; 2; 2; 9; 5; 9; 3; 7; 59; 7; 96; 6; 5; 1; 3; 9; 9; 65; 6; 7; 7; 2; 5; 0; 0; 70; 5; 5; 2; 1; 57; 9; 7; 8; 10; 9; 7; 9; 75; 73; 80; 7; 9; 4; 3; 16; 5; 79; 1; 8; 6; 2; 3; 4; 9; 2; 8; 4; 6; 50; 2; 1; 5; 9; 5; 4; 3; 56; 6; 5; 9; 4; 1; 47; 1; 2; 5; 2; 0; 7; 31; 55; 6; 7; 4; 7; 8; 8; 2; 4; 40; 4; 6; 9; 3; 59; 5; 1; 0; 2; 6; 90; 1; 6; 81; 0; 1; 3; 7; 2; 4; 5; 4; 7; 3; 62; 0; 1; 6; 7; 5; 97; 83; 41; 7; 2; 6; 3; 0; 4; 8; 99; 8; 6; 0; 7; 9; 7; 1; 55; 30; 25; 3; 4; 7; 1; 6; 80; 8; 0; 4; 21; 3; 5; 9; 27; 10; 60; 47; 54; 6; 5; 8; 1; 5; 9; 65; 9; 5; 7; 7; 6; 48; 9; 5; 6; 4; 9; 7; 1; 2; 71; 6; 9; 2; 7; 8; 14; 59; 71; 30; 7; 3; 5; 4; 6; 7; 3; 6; 9; 8; 2; 38; 6; 6; 7; 1; 5; 2; 43; 5; 2; 9; 3; 0; 3; 2; 7; 71; 26; 3; 9; 11; 5; 1; 5; 2; 53; 46; 4; 6; 7; 67; 1; 0; 34; 0; 48; 5; 5; 0; 7; 49; 92; 8; 3; 0; 67; 1; 5; 2; 9; 5; 9; 3; 1; 4; 8; 0; 3; 6; 46; 58; 1; 54; 77; 0; 96; 1; 6; 2; 8; 22; 3; 9; 2; 6; 25; 49; 9; 6; 3; 8; 5; 9; 54; 1; 7; 5; 6; 5; 1; 7; 8; 23; 4; 6; 4; 2; 5; 8; 4; 7; 4] + +--- Failure -------------------------------------------------------------------- + +Test fail_pred_map_commute failed (244 shrink steps): + +([0; 0], {16 -> 0; 32 -> 0; 0 -> 13; 65 -> 0; 18 -> 0; 2 -> 0; 19 -> 0; 3 -> 0; 20 -> 0; 68 -> 0; 21 -> 0; 5 -> 0; 37 -> 0; 53 -> 0; 86 -> 0; 7 -> 0; 24 -> 0; 8 -> 0; 9 -> 0; 10 -> 0; 43 -> 0; 28 -> 0; 14 -> 0; 78 -> 0; 15 -> 0; _ -> 0}, {66275786897687936 -> false; 0 -> false; 37585042864641 -> false; 182146 -> false; 54366856439509634 -> false; -381189003139879806 -> false; 2 -> false; 30621323267 -> false; 166274844009475 -> false; 3 -> false; 364293 -> false; 5 -> false; 7 -> false; 10526600 -> false; 8 -> false; 9 -> false; 2954 -> false; 19210 -> false; 728586 -> false; 38660875690317962 -> false; 10 -> false; 5515 -> false; 14035467 -> false; 155189854408843 -> false; 13 -> true; -3511326262846579571 -> false; 25614 -> false; 14 -> false; 28815 -> false; 427189276652303 -> false; 8640826060088079 -> false; 15 -> false; 272 -> false; 74855824 -> false; 943820830864 -> false; 16 -> false; 17 -> false; 21053201 -> false; 650955088232081 -> false; 1843063293562136465 -> false; 18 -> false; -1207743061799580782 -> false; 2582479384970564114 -> false; 32215751026835 -> false; 19 -> false; 558005797129117203 -> false; 28579901716 -> false; 20 -> false; 5909 -> false; 38421 -> false; 99807765 -> false; 1258427774485 -> false; 77321751380635925 -> false; 21 -> false; 28070934 -> false; 116134203798 -> false; 867940117642775 -> false; 408 -> false; 43550326424 -> false; 24 -> false; 6257335833 -> false; 16686228889 -> false; 26 -> false; 43493485151607707 -> false; 51228 -> false; 1825056284 -> false; 23731525532 -> false; 133019875207580 -> false; 28 -> false; 6303 -> false; 544 -> false; 149711648 -> false; 1887641661728 -> false; 32 -> false; 136609 -> false; 1295265 -> false; 34 -> false; -796804578571543518 -> false; -3143884152072092894 -> false; 7203 -> false; 1301910176464163 -> false; 933 -> false; 37 -> false; 7894950 -> false; 2215 -> false; 56179084987493288 -> false; 2737584426 -> false; 199615531 -> false; 2516855548971 -> false; 88367715863583915 -> false; 1724444827403006379 -> false; 43 -> false; 1727020 -> false; 798462124 -> false; 45 -> false; 10067422195886 -> false; 1735880235285551 -> false; 10533578435154991 -> false; 3193848497 -> false; 366162237130545 -> false; 7406422337218353 -> false; 6908082 -> false; 51 -> false; -2381024303006854989 -> false; -3341657596864116300 -> false; 10805 -> false; 17798644149 -> false; 50742399343542325 -> false; 53 -> false; 24497058614 -> false; 353932811574 -> false; 99543603255 -> false; 21477167351223 -> false; -119319574914777289 -> false; 102456 -> false; 971448 -> false; 40269688783544 -> false; 3650112569 -> false; 5921213 -> false; 15821017021 -> false; 88679916805053 -> false; 830 -> false; 12606 -> false; 171817338809791 -> false; 6943520941142207 -> false; 1089 -> false; 65 -> false; 2590530 -> false; 273219 -> false; 68 -> false; 14407 -> false; 13348983111 -> false; 15800367652732487 -> false; 37427912 -> false; 325477544116040 -> false; 1417674849728090569 -> false; 58067101899 -> false; 204 -> false; 15789900 -> false; 8343114444 -> false; 21775163212 -> false; 77 -> false; 11865762766 -> false; 78 -> false; 4431 -> false; 3151 -> false; 57991313535476943 -> false; 68304 -> false; 647632 -> false; 530899217361 -> false; 3947475 -> false; 18433762261521235 -> false; 28089542493746644 -> false; 44183857931791957 -> false; 399231062 -> false; -1759927375200850090 -> false; 86 -> false; 5033711097943 -> false; 1596924248 -> false; 1415731246296 -> false; 3454041 -> false; 19750459565915609 -> false; 90 -> false; 8899322074 -> false; 3234503663319679322 -> false; 485724 -> false; 20134844391772 -> false; 1245 -> false; -2772163063813019426 -> false; 85908669404895 -> false; 3471760470571103 -> false; 21067156870309983 -> false; 909328030552912351 -> false; 18713956 -> false; 29033550949 -> false; -2219752219093363099 -> false; 102 -> false; 4171557222 -> false; 2325595319255300198 -> false; -3390706662452617370 -> false; 28995656767738471 -> false; 265449608680 -> false; 2118364168588763240 -> false; 1158207106723147241 -> false; 14044771246873322 -> false; 707865623148 -> false; 488216316174060 -> false; 9875229782957804 -> false; -4251440306801319700 -> false; 2441230840770586092 -> false; 622 -> false; 42954334702447 -> false; 32662744818 -> false; 7300225139 -> false; 132724804340 -> false; 472959556293621 -> false; 244108158087030 -> false; 4937614891478902 -> false; 4727 -> false; 354719667220215 -> false; 16331372409 -> false; 66362402170 -> false; 236479778146810 -> false; -127238344995975558 -> false; 3323 -> false; 31642034043 -> false; 177359833610107 -> false; 1661 -> false; 15573813630 -> false; 457702796413182 -> false; 9258027921522942 -> false; 4629013960761471 -> false; _ -> false}) + +--- Failure -------------------------------------------------------------------- + +Test fail_pred_strings failed (2 shrink steps): + +{"some random string" -> true; _ -> false} + +--- Failure -------------------------------------------------------------------- + +Test fold_left fold_right failed (32 shrink steps): + +(0, [1], {(5, 5) -> 0; (3, 8) -> 0; (1, 0) -> 1; (3, 0) -> 0; (8, 0) -> 0; (6, 4) -> 0; (9, 2) -> 0; (5, 0) -> 0; (0, 2) -> 0; (2, 0) -> 0; (2, 1) -> 0; (8, 6) -> 0; (0, 3) -> 0; (0, 23) -> 0; (1, 8) -> 0; (0, 4) -> 0; (4, 0) -> 0; (7, 2) -> 0; (2, 5) -> 0; (0, 8) -> 0; (23, 6) -> 0; (0, 0) -> 0; (4, 80) -> 0; _ -> 0}) + ++++ Messages ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Messages for test fold_left fold_right: + +l=[1], fold_left=1, fold_right=0 + + +--- Failure -------------------------------------------------------------------- + +Test fold_left fold_right uncurried failed (434 shrink steps): + +({(5, 2) -> 0; (0, 2) -> 0; (2, 80) -> 0; (8, 6) -> 0; (76, 6) -> 0; (3, 8) -> 0; (75, 57) -> 0; (7, 2) -> 0; (43, 1) -> 0; (2, 7) -> 0; (7, 1) -> 0; (76, 3) -> 0; (4, 50) -> 0; (70, 5) -> 0; (49, 46) -> 0; (71, 31) -> 0; (67, 0) -> 0; (32, 96) -> 0; (9, 1) -> 0; (8, 8) -> 0; (53, 8) -> 0; (76, 5) -> 0; (2, 5) -> 0; (5, 4) -> 0; (9, 3) -> 0; (6, 65) -> 0; (75, 2) -> 0; (35, 96) -> 0; (3, 2) -> 0; (24, 1) -> 0; (75, 4) -> 0; (48, 8) -> 0; (0, 16) -> 0; (26, 73) -> 0; (2, 88) -> 0; (76, 7) -> 0; (6, 9) -> 0; (71, 59) -> 0; (4, 7) -> 0; (1, 1) -> 0; (4, 22) -> 0; (0, 5) -> 0; (1, 5) -> 0; (1, 4) -> 0; (8, 45) -> 0; (2, 47) -> 0; (0, 1) -> 0; (6, 10) -> 0; (73, 0) -> 0; (27, 3) -> 0; (88, 7) -> 0; (5, 1) -> 0; (3, 6) -> 0; (77, 8) -> 0; (2, 1) -> 0; (1, 2) -> 0; (4, 1) -> 0; (47, 6) -> 0; (76, 9) -> 0; (6, 5) -> 0; (7, 3) -> 0; (9, 87) -> 0; (3, 7) -> 0; (17, 0) -> 0; (43, 55) -> 0; (4, 2) -> 0; (12, 7) -> 0; (7, 79) -> 0; (2, 56) -> 0; (52, 0) -> 0; (9, 2) -> 0; (49, 0) -> 0; (7, 9) -> 0; (2, 75) -> 0; (75, 5) -> 0; (2, 2) -> 0; (6, 4) -> 0; (1, 3) -> 0; (19, 6) -> 0; (4, 55) -> 0; (1, 6) -> 0; (6, 7) -> 0; (6, 24) -> 0; (0, 6) -> 0; (86, 6) -> 0; (3, 1) -> 0; (4, 5) -> 0; (82, 4) -> 0; (5, 70) -> 0; (5, 9) -> 0; (37, 2) -> 0; (45, 1) -> 0; (7, 4) -> 0; (0, 4) -> 1; (6, 95) -> 0; (6, 2) -> 0; (1, 0) -> 0; (8, 4) -> 0; (1, 22) -> 0; (67, 7) -> 0; (92, 7) -> 0; (7, 5) -> 0; (4, 4) -> 0; (9, 8) -> 0; (49, 5) -> 0; (1, 9) -> 0; _ -> 0}, 0, [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 4]) + +--- Failure -------------------------------------------------------------------- + +Test fold_left fold_right uncurried fun last failed (37 shrink steps): + +(0, [0; 0; 0; 0], {(9, 5) -> 0; (0, 2) -> 0; (56, 0) -> 0; (4, 1) -> 0; (8, 5) -> 0; (5, 9) -> 0; (8, 6) -> 0; (3, 8) -> 0; (8, 0) -> 0; (84, 8) -> 0; (23, 4) -> 0; (4, 0) -> 0; (0, 7) -> 0; (7, 8) -> 0; (0, 5) -> 0; (0, 4) -> 0; (1, 5) -> 0; (80, 8) -> 0; (5, 7) -> 0; (2, 2) -> 0; (6, 4) -> 0; (0, 0) -> 56; (0, 23) -> 0; (0, 56) -> 1; (1, 3) -> 0; (0, 1) -> 0; (56, 2) -> 0; (89, 8) -> 0; (7, 7) -> 0; (2, 5) -> 0; (4, 3) -> 0; _ -> 0}) + +--- Failure -------------------------------------------------------------------- + +Test fold_left test, fun first failed (925 shrink steps): + +({("\167$\000\199\169\156V\241\027\212\178d3\196\136\249\1941_=#\216\196\226\186\220\153\150Z)\000\255\184\132`\225\239&uS\235]\212\231\021\028\204\020\t,", 9) -> ""; ("\156\031\194\253\204B\188\154 \167\012\253\2322;", 8) -> ""; ("{\182\172t", 5) -> ""; ("\169\240\228A#\212U\193\172\019\150\238\236\133\209\188\240\135\225\191\241\181\179\243\139\\.\"\190m\204&9\209?\001\171\247\160T\2049\153\0028\184\014;X", 13) -> ""; ("\003\212\207\236\178\162\182m\147\190\b>W\141\242\195\206j\201\202\166B\145k\229\211J\015\139(\224\143\149\190\196(_\017\170\138", 4) -> ""; ("\130\229\219\227\133\160\213\236\2221\245\129-\183\141r\146sXj\000\2210\200\1576\209\1396s '\026\172\251\236\166X\220\200\176$Z0\024\190", 2) -> ""; ("a\0171\198^,5\170C\139\157\\h\001\026\199", 8) -> ""; ("\189\221\014\254\188\175\205JF", 5) -> ""; ("", 2) -> "a"; ("\165\233\214\166\195\197", 5) -> ""; ("&\169\2415\201", 2) -> ""; ("S\194irBA", 37) -> ""; ("\224\2280\186", 1) -> ""; ("!\209\194\238\0266s\001!\233\234(7\127\228C\136n$\21162^^\012\014\199\178`\148\141\228\18599\205\136\136\189\213\134\019|\197\005\235\151\003\197D%\172\144\238\173[\228\191\235p\177I\180\237\189y\247\250w\143z~\016\003\142\149\157\142\234\\3P\140\030\000\028\205K\188&\202w\1519`\188\015", 2) -> ""; ("\128]\190\164\164\151)\214", 22) -> ""; ("u\251\19988\194\165\242J", 7) -> ""; ("}\129\237\213\203\137\197(W\172Q\171\188\140\205\014\143k~\163\187\140o\130\146r", 0) -> ""; ("\133+\142\011\209\135", 1) -> ""; ("E\212\169=n", 9) -> ""; ("l\022\133\005\016D\026\230\156", 18) -> ""; ("\031\131g\029\215", 31) -> ""; ("/*j", 6) -> ""; ("h\031\226a\226\148\128", 9) -> ""; ("\151", 1) -> ""; ("\221\184V\247\225\254\209iW;_d\144\t\179>2\252\221pO<\134F\005\252\151\163\138\007\219z\136\215\237]92G\000A\135\139\166\214\186\232\199\236\000\132_\006\241\169Gz\"\155\183\215-\233\249", 1) -> ""; ("z\211oC\210\198\155", 8) -> ""; ("}P8\147\167\142j9u\187\007\128\213Y\181E'\130\r\242ng\2088\198\004\136GJ\179-\197Iw\017\197\223\173\250\229D\160\171\t\222\223>6\219\201@^X\221(s\029\127\005-F+\232\213B\170\150\188\018f+>\215\240k\135\023\214P\157", 9) -> ""; ("~f-L\151\011", 2) -> ""; ("!\178\019\016\134%\026", 2) -> ""; ("\255U\t4f*\254\237\181S\020\181\130\184\230\017C\185\200\187:Q\002\210\028\152G\228O\026\012\003\234\011\148z\177\166&\024\178F\188\213u\128R~\\\171\194\r~v\020\160\221(\157wa!a\bAf\127^\169\241;\246\011B\b+\249\179\193\230\137\232\147\247\251\180ey\166q<\150_\158", 6) -> ""; ("\005\140\184\232$", 78) -> ""; (".NF\153", 6) -> ""; ("\180\130\236\011(\210M9", 9) -> ""; ("I\219\224\171\142\155\209\027\011\237\020;\245\176\141(\202\248\023\174\216\156\173+\028\209\193?\154t\196\146\147\181\252#\229\128jz\199\212\194\2302\185\162\208UXq>\024F&\241i\182\165\214I\249*?\136_\142f\163\230\167\210U`W \150X\157=\235pe\200\019\208\138j", 1) -> ""; ("\196\210\239\158\131\198\1516\208\165\163\011\251B\219\161\001\237\224\194T\t\148\158\197\031\145\025\192\148\210t1\235\159\015\176\197.\248a\028'\222r\200= \208w", 36) -> ""; ("\228x[", 91) -> ""; ("\001\143", 7) -> ""; ("\136u\1473\235\255\232\211\129\129\172\n\012\004\\O2.a\228(\218\205\223\011\"\n<\181$\245v\002\016s]\161\170\000q\205\161wM\230\223\143%\t\232\175\171j\129x\022\159\215\182\019\240\002\014}\0052\234\202\226\157,\148-\147\200\158\181\189\196\143f", 38) -> ""; ("@\192\163\234", 72) -> ""; ("\131\158Y\139\199\014\149d$", 9) -> ""; ("-\152", 9) -> ""; _ -> ""}, "", [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 2], [0]) + +--- Failure -------------------------------------------------------------------- + +Test FAIL_#99_1 failed: + +ERROR: uncaught exception in generator for test FAIL_#99_1 after 100 steps: +Exception: QCheck2.No_example_found("<example>") +Backtrace: + ++++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Collect results for test bool dist: + +true: 250511 cases +false: 249489 cases + ++++ Stats for char code dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats char code: + num: 500000, avg: 127.68, stddev: 73.87, median 128, min 0, max 255 + 0.. 12: ##################################################### 25272 + 13.. 25: ###################################################### 25326 + 26.. 38: ##################################################### 25194 + 39.. 51: ###################################################### 25359 + 52.. 64: ###################################################### 25338 + 65.. 77: ###################################################### 25349 + 78.. 90: ###################################################### 25397 + 91..103: ##################################################### 25243 + 104..116: ###################################################### 25420 + 117..129: ###################################################### 25438 + 130..142: ###################################################### 25346 + 143..155: ##################################################### 25177 + 156..168: ####################################################### 25755 + 169..181: ###################################################### 25408 + 182..194: ###################################################### 25633 + 195..207: ###################################################### 25613 + 208..220: ###################################################### 25459 + 221..233: ###################################################### 25322 + 234..246: ##################################################### 25229 + 247..259: ##################################### 17722 + ++++ Stats for printable char code dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats char code: + num: 500000, avg: 78.23, stddev: 28.13, median 78, min 10, max 126 + 10.. 15: ######### 5167 + 16.. 21: 0 + 22.. 27: 0 + 28.. 33: ################## 10338 + 34.. 39: ###################################################### 31469 + 40.. 45: ###################################################### 30994 + 46.. 51: ###################################################### 31366 + 52.. 57: ###################################################### 31369 + 58.. 63: ####################################################### 31531 + 64.. 69: ###################################################### 31208 + 70.. 75: ###################################################### 31228 + 76.. 81: ###################################################### 31514 + 82.. 87: ###################################################### 31209 + 88.. 93: ###################################################### 31207 + 94.. 99: ###################################################### 31342 + 100..105: ###################################################### 31273 + 106..111: ###################################################### 31116 + 112..117: ###################################################### 31022 + 118..123: ##################################################### 30911 + 124..129: ########################### 15736 + ++++ Stats for numeral char code dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats char code: + num: 500000, avg: 52.50, stddev: 2.87, median 53, min 48, max 57 + 48: ###################################################### 49848 + 49: ###################################################### 50118 + 50: ###################################################### 49837 + 51: ###################################################### 50252 + 52: ###################################################### 49765 + 53: ####################################################### 50369 + 54: ###################################################### 50270 + 55: ###################################################### 49885 + 56: ###################################################### 49821 + 57: ###################################################### 49835 + ++++ Stats for tree's depth ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats depth: + num: 1000, avg: 4.13, stddev: 3.52, median 3, min 1, max 15 + 1: ####################################################### 339 + 2: ################ 104 + 3: ############### 98 + 4: ##################### 133 + 5: ######### 60 + 6: #### 29 + 7: ######## 54 + 8: ####### 48 + 9: ## 16 + 10: ### 21 + 11: ########### 68 + 12: 1 + 13: # 8 + 14: ## 16 + 15: 5 + ++++ Stats for string_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 7.51, stddev: 1.69, median 8, min 5, max 10 + 5: ################################################## 817 + 6: ################################################# 797 + 7: ####################################################### 885 + 8: ################################################### 834 + 9: ###################################################### 877 + 10: ################################################# 790 + ++++ Stats for string len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 370.05, stddev: 1282.91, median 9, min 0, max 9947 + 0.. 497: ####################################################### 4270 + 498.. 995: ###### 497 + 996..1493: 17 + 1494..1991: 9 + 1992..2489: 13 + 2490..2987: 13 + 2988..3485: 9 + 3486..3983: 14 + 3984..4481: 14 + 4482..4979: 17 + 4980..5477: 9 + 5478..5975: 10 + 5976..6473: 15 + 6474..6971: 16 + 6972..7469: 16 + 7470..7967: 9 + 7968..8465: 12 + 8466..8963: 15 + 8964..9461: 9 + 9462..9959: 16 + ++++ Stats for string_of len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 359.22, stddev: 1249.46, median 9, min 0, max 9958 + 0.. 497: ####################################################### 4275 + 498.. 995: ###### 479 + 996..1493: 22 + 1494..1991: 12 + 1992..2489: 21 + 2490..2987: 16 + 2988..3485: 13 + 3486..3983: 17 + 3984..4481: 14 + 4482..4979: 14 + 4980..5477: 8 + 5478..5975: 14 + 5976..6473: 13 + 6474..6971: 9 + 6972..7469: 7 + 7470..7967: 17 + 7968..8465: 13 + 8466..8963: 15 + 8964..9461: 10 + 9462..9959: 11 + ++++ Stats for string_printable len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 370.05, stddev: 1282.91, median 9, min 0, max 9947 + 0.. 497: ####################################################### 4270 + 498.. 995: ###### 497 + 996..1493: 17 + 1494..1991: 9 + 1992..2489: 13 + 2490..2987: 13 + 2988..3485: 9 + 3486..3983: 14 + 3984..4481: 14 + 4482..4979: 17 + 4980..5477: 9 + 5478..5975: 10 + 5976..6473: 15 + 6474..6971: 16 + 6972..7469: 16 + 7470..7967: 9 + 7968..8465: 12 + 8466..8963: 15 + 8964..9461: 9 + 9462..9959: 16 + ++++ Stats for small_string len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 15.99, stddev: 24.58, median 6, min 0, max 99 + 0.. 4: ###################################################### 1920 + 5.. 9: ####################################################### 1929 + 10.. 14: # 69 + 15.. 19: # 62 + 20.. 24: # 63 + 25.. 29: # 59 + 30.. 34: # 68 + 35.. 39: # 62 + 40.. 44: # 57 + 45.. 49: ## 83 + 50.. 54: # 59 + 55.. 59: ## 80 + 60.. 64: # 48 + 65.. 69: # 53 + 70.. 74: # 61 + 75.. 79: # 66 + 80.. 84: # 61 + 85.. 89: ## 72 + 90.. 94: # 66 + 95.. 99: # 62 + ++++ Stats for pair dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats pair sum: + num: 500000, avg: 100.05, stddev: 41.29, median 100, min 0, max 200 + 0.. 9: ### 2618 + 10.. 19: ######## 7630 + 20.. 29: ############## 12505 + 30.. 39: #################### 17451 + 40.. 49: ########################## 22280 + 50.. 59: ############################### 27307 + 60.. 69: ##################################### 32151 + 70.. 79: ########################################### 37199 + 80.. 89: ################################################# 41901 + 90.. 99: ###################################################### 46313 + 100..109: ####################################################### 46965 + 110..119: ################################################# 42462 + 120..129: ########################################### 37348 + 130..139: ###################################### 32613 + 140..149: ################################ 27606 + 150..159: ########################### 23221 + 160..169: ##################### 18125 + 170..179: ############### 12890 + 180..189: ######### 8059 + 190..199: ### 3297 + 200..209: 59 + ++++ Stats for triple dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats triple sum: + num: 500000, avg: 150.04, stddev: 50.53, median 150, min 1, max 300 + 1.. 15: 360 + 16.. 30: ## 2261 + 31.. 45: ##### 5712 + 46.. 60: ########## 10854 + 61.. 75: ################# 17760 + 76.. 90: ########################## 26151 + 91..105: ################################### 36079 + 106..120: ############################################# 45498 + 121..135: ################################################### 51977 + 136..150: ####################################################### 55179 + 151..165: ###################################################### 54821 + 166..180: ################################################### 51709 + 181..195: ############################################# 45166 + 196..210: ################################### 35354 + 211..225: ######################### 25436 + 226..240: ################# 17179 + 241..255: ########## 10652 + 256..270: ##### 5447 + 271..285: ## 2065 + 286..300: 340 + ++++ Stats for quad dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats quad sum: + num: 500000, avg: 200.06, stddev: 58.39, median 200, min 2, max 394 + 2.. 21: 61 + 22.. 41: 658 + 42.. 61: ## 2534 + 62.. 81: ##### 6444 + 82..101: ########### 13334 + 102..121: ################### 23279 + 122..141: ############################## 35888 + 142..161: ######################################### 48824 + 162..181: ################################################## 59008 + 182..201: ####################################################### 64896 + 202..221: ###################################################### 64051 + 222..241: ################################################# 57864 + 242..261: ####################################### 46793 + 262..281: ############################ 33955 + 282..301: ################## 21775 + 302..321: ########## 12187 + 322..341: #### 5645 + 342..361: # 2244 + 362..381: 529 + 382..401: 31 + ++++ Stats for bind dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats ordered pair difference: + num: 1000000, avg: 25.01, stddev: 22.38, median 19, min 0, max 100 + 0.. 4: ####################################################### 193610 + 5.. 9: #################################### 130051 + 10.. 14: ############################# 104209 + 15.. 19: ######################## 86993 + 20.. 24: ##################### 74295 + 25.. 29: ################## 64874 + 30.. 34: ################ 56447 + 35.. 39: ############## 49416 + 40.. 44: ############ 43051 + 45.. 49: ########## 37580 + 50.. 54: ######### 32378 + 55.. 59: ######## 28558 + 60.. 64: ###### 23971 + 65.. 69: ##### 20146 + 70.. 74: #### 16446 + 75.. 79: ### 13215 + 80.. 84: ## 10294 + 85.. 89: ## 7639 + 90.. 94: # 4698 + 95.. 99: 2041 + 100..104: 88 + +stats ordered pair sum: + num: 1000000, avg: 74.97, stddev: 46.86, median 72, min 0, max 200 + 0.. 9: ####################################################### 70320 + 10.. 19: ##################################################### 68731 + 20.. 29: ##################################################### 68374 + 30.. 39: ##################################################### 68544 + 40.. 49: ##################################################### 68756 + 50.. 59: ##################################################### 68837 + 60.. 69: ##################################################### 68759 + 70.. 79: ##################################################### 68517 + 80.. 89: ##################################################### 68692 + 90.. 99: ###################################################### 69123 + 100..109: ################################################## 64777 + 110..119: ########################################### 55288 + 120..129: #################################### 47156 + 130..139: ############################### 39635 + 140..149: ######################### 32590 + 150..159: #################### 25685 + 160..169: ############### 19842 + 170..179: ########## 14038 + 180..189: ###### 8631 + 190..199: ## 3580 + 200..209: 125 + ++++ Stats for list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 381.08, stddev: 1328.05, median 9, min 0, max 9993 + 0.. 499: ####################################################### 4260 + 500.. 999: ###### 515 + 1000.. 1499: 8 + 1500.. 1999: 11 + 2000.. 2499: 10 + 2500.. 2999: 10 + 3000.. 3499: 9 + 3500.. 3999: 18 + 4000.. 4499: 14 + 4500.. 4999: 9 + 5000.. 5499: 9 + 5500.. 5999: 14 + 6000.. 6499: 15 + 6500.. 6999: 7 + 7000.. 7499: 10 + 7500.. 7999: 23 + 8000.. 8499: 10 + 8500.. 8999: 22 + 9000.. 9499: 16 + 9500.. 9999: 10 + ++++ Stats for small_list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 16.58, stddev: 25.30, median 6, min 0, max 99 + 0.. 4: ################################################### 1848 + 5.. 9: ####################################################### 1992 + 10.. 14: # 47 + 15.. 19: # 62 + 20.. 24: # 56 + 25.. 29: # 67 + 30.. 34: # 66 + 35.. 39: # 57 + 40.. 44: # 59 + 45.. 49: # 62 + 50.. 54: ## 75 + 55.. 59: # 70 + 60.. 64: # 55 + 65.. 69: # 68 + 70.. 74: ## 74 + 75.. 79: # 56 + 80.. 84: # 66 + 85.. 89: ## 74 + 90.. 94: # 64 + 95.. 99: ## 82 + ++++ Stats for list_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 7.50, stddev: 1.72, median 8, min 5, max 10 + 5: ####################################################### 854 + 6: ################################################### 802 + 7: ##################################################### 835 + 8: ##################################################### 838 + 9: #################################################### 818 + 10: ###################################################### 853 + ++++ Stats for list_repeat len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 42.00, stddev: 0.00, median 42, min 42, max 42 + 42: ####################################################### 5000 + ++++ Stats for array len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 381.08, stddev: 1328.05, median 9, min 0, max 9993 + 0.. 499: ####################################################### 4260 + 500.. 999: ###### 515 + 1000.. 1499: 8 + 1500.. 1999: 11 + 2000.. 2499: 10 + 2500.. 2999: 10 + 3000.. 3499: 9 + 3500.. 3999: 18 + 4000.. 4499: 14 + 4500.. 4999: 9 + 5000.. 5499: 9 + 5500.. 5999: 14 + 6000.. 6499: 15 + 6500.. 6999: 7 + 7000.. 7499: 10 + 7500.. 7999: 23 + 8000.. 8499: 10 + 8500.. 8999: 22 + 9000.. 9499: 16 + 9500.. 9999: 10 + ++++ Stats for small_array len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 16.58, stddev: 25.30, median 6, min 0, max 99 + 0.. 4: ################################################### 1848 + 5.. 9: ####################################################### 1992 + 10.. 14: # 47 + 15.. 19: # 62 + 20.. 24: # 56 + 25.. 29: # 67 + 30.. 34: # 66 + 35.. 39: # 57 + 40.. 44: # 59 + 45.. 49: # 62 + 50.. 54: ## 75 + 55.. 59: # 70 + 60.. 64: # 55 + 65.. 69: # 68 + 70.. 74: ## 74 + 75.. 79: # 56 + 80.. 84: # 66 + 85.. 89: ## 74 + 90.. 94: # 64 + 95.. 99: ## 82 + ++++ Stats for array_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 7.50, stddev: 1.72, median 8, min 5, max 10 + 5: ####################################################### 854 + 6: ################################################### 802 + 7: ##################################################### 835 + 8: ##################################################### 838 + 9: #################################################### 818 + 10: ###################################################### 853 + ++++ Stats for array_repeat len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 42.00, stddev: 0.00, median 42, min 42, max 42 + 42: ####################################################### 5000 + ++++ Stats for int_stats_neg ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 5000, avg: 0.43, stddev: 28.63, median 0, min -99, max 99 + -99..-90: # 45 + -89..-80: # 57 + -79..-70: # 68 + -69..-60: # 58 + -59..-50: # 76 + -49..-40: # 67 + -39..-30: # 52 + -29..-20: # 54 + -19..-10: # 47 + -9.. 0: ####################################################### 2205 + 1.. 10: ########################################## 1697 + 11.. 20: # 57 + 21.. 30: # 70 + 31.. 40: # 60 + 41.. 50: # 66 + 51.. 60: # 75 + 61.. 70: # 68 + 71.. 80: # 63 + 81.. 90: # 66 + 91..100: # 49 + ++++ Stats for small_signed_int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 0.86, stddev: 29.11, median 0, min -97, max 99 + -97..-88: # 12 + -87..-78: # 12 + -77..-68: # 13 + -67..-58: # 12 + -57..-48: # 9 + -47..-38: ## 17 + -37..-28: # 13 + -27..-18: # 8 + -17.. -8: ######### 76 + -7.. 2: ####################################################### 437 + 3.. 12: ################################## 276 + 13.. 22: ## 16 + 23.. 32: # 11 + 33.. 42: ## 16 + 43.. 52: # 9 + 53.. 62: # 12 + 63.. 72: # 14 + 73.. 82: # 12 + 83.. 92: # 13 + 93..102: # 12 + ++++ Stats for small_nat dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 15.86, stddev: 24.57, median 6, min 0, max 99 + 0.. 4: ###################################################### 387 + 5.. 9: ####################################################### 390 + 10.. 14: # 11 + 15.. 19: # 8 + 20.. 24: # 11 + 25.. 29: ## 15 + 30.. 34: # 9 + 35.. 39: # 11 + 40.. 44: # 11 + 45.. 49: ## 19 + 50.. 54: # 10 + 55.. 59: ## 19 + 60.. 64: # 9 + 65.. 69: # 9 + 70.. 74: ## 19 + 75.. 79: # 13 + 80.. 84: # 11 + 85.. 89: ## 16 + 90.. 94: # 9 + 95.. 99: # 13 + ++++ Stats for nat dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 382.03, stddev: 1290.55, median 9, min 0, max 9890 + 0.. 494: ####################################################### 850 + 495.. 989: ###### 93 + 990..1484: 8 + 1485..1979: 3 + 1980..2474: 7 + 2475..2969: 1 + 2970..3464: 3 + 3465..3959: 3 + 3960..4454: 3 + 4455..4949: 4 + 4950..5444: 3 + 5445..5939: 3 + 5940..6434: 3 + 6435..6929: 1 + 6930..7424: 2 + 7425..7919: 1 + 7920..8414: 1 + 8415..8909: 5 + 8910..9404: 3 + 9405..9899: 3 + ++++ Stats for int_range (-43643) 435434 dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 193479.13, stddev: 136696.70, median 189823, min -43164, max 434961 + -43164..-19258: ################################### 42 + -19257.. 4649: ############################################## 56 + 4650.. 28556: ############################################# 55 + 28557.. 52463: ############################################### 57 + 52464.. 76370: ######################################### 50 + 76371..100277: ############################# 35 + 100278..124184: ############################################### 57 + 124185..148091: #################################### 44 + 148092..171998: ############################################## 56 + 171999..195905: ####################################################### 66 + 195906..219812: ########################################### 52 + 219813..243719: ######################################## 49 + 243720..267626: ################################ 39 + 267627..291533: ##################################### 45 + 291534..315440: ##################################### 45 + 315441..339347: ################################################# 59 + 339348..363254: ################################################## 60 + 363255..387161: ################################# 40 + 387162..411068: ########################################## 51 + 411069..434975: ################################### 42 + ++++ Stats for int_range (-40000) 40000 dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: -591.06, stddev: 23026.79, median -911, min -39911, max 39959 + -39911..-35918: ####################################### 45 + -35917..-31924: #################################################### 59 + -31923..-27930: ########################################### 49 + -27929..-23936: ########################################## 48 + -23935..-19942: ####################################################### 62 + -19941..-15948: ############################################# 51 + -15947..-11954: ######################################### 47 + -11953.. -7960: ################################################# 56 + -7959.. -3966: ################################### 40 + -3965.. 28: ################################################### 58 + 29.. 4022: ########################################### 49 + 4023.. 8016: ############################################### 53 + 8017.. 12010: ############################################ 50 + 12011.. 16004: ################################### 40 + 16005.. 19998: ####################################### 44 + 19999.. 23992: ####################################################### 62 + 23993.. 27986: ##################################### 42 + 27987.. 31980: ######################################### 47 + 31981.. 35974: ########################################## 48 + 35975.. 39968: ############################################ 50 + ++++ Stats for int_range (-4) 4 dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: -0.12, stddev: 2.52, median 0, min -4, max 4 + -4: ########################################## 116 + -3: ###################################### 103 + -2: ############################################## 125 + -1: ########################################## 115 + 0: ####################################### 106 + 1: ####################################################### 149 + 2: ################################# 92 + 3: ################################# 92 + 4: ##################################### 102 + ++++ Stats for int_range (-4) 17 dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 6.42, stddev: 6.43, median 6, min -4, max 17 + -4..-3: ########################################### 89 + -2..-1: ################################################# 101 + 0.. 1: ############################################## 95 + 2.. 3: ########################################### 89 + 4.. 5: ############################################## 95 + 6.. 7: ##################################### 78 + 8.. 9: ####################################### 81 + 10..11: ######################################## 84 + 12..13: ####################################################### 113 + 14..15: ######################################## 84 + 16..17: ############################################ 91 + 18..19: 0 + 20..21: 0 + 22..23: 0 + 24..25: 0 + 26..27: 0 + 28..29: 0 + 30..31: 0 + 32..33: 0 + 34..35: 0 + ++++ Stats for int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 100000, avg: -7215552342607541.00, stddev: 2666234426234218496.00, median -16620417636667326, min -4611371852367564818, max 4611613630315464842 + -4611371852367564818..-4150222578233413331: ##################################################### 5003 + -4150222578233413330..-3689073304099261843: ####################################################### 5106 + -3689073304099261842..-3227924029965110355: ###################################################### 5052 + -3227924029965110354..-2766774755830958867: ###################################################### 5017 + -2766774755830958866..-2305625481696807379: #################################################### 4852 + -2305625481696807378..-1844476207562655891: ###################################################### 5016 + -1844476207562655890..-1383326933428504403: ###################################################### 5083 + -1383326933428504402.. -922177659294352915: ##################################################### 4986 + -922177659294352914.. -461028385160201427: ###################################################### 5042 + -461028385160201426.. 120888973950061: ###################################################### 5017 + 120888973950062.. 461270163108101549: ##################################################### 4977 + 461270163108101550.. 922419437242253037: ##################################################### 5000 + 922419437242253038.. 1383568711376404525: ###################################################### 5022 + 1383568711376404526.. 1844717985510556013: #################################################### 4896 + 1844717985510556014.. 2305867259644707501: #################################################### 4884 + 2305867259644707502.. 2767016533778858989: ##################################################### 4981 + 2767016533778858990.. 3228165807913010477: ###################################################### 5026 + 3228165807913010478.. 3689315082047161965: ###################################################### 5016 + 3689315082047161966.. 4150464356181313453: ###################################################### 5021 + 4150464356181313454.. 4611613630315464941: ##################################################### 5003 + ++++ Stats for oneof int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 4611686018427388.00, stddev: 2891078433912002560.00, median 0, min -4611686018427387904, max 4611686018427387903 + -4611686018427387904..-4150517416584649089: ################# 198 + -4150517416584649088..-3689348814741910273: 0 + -3689348814741910272..-3228180212899171457: 0 + -3228180212899171456..-2767011611056432641: 0 + -2767011611056432640..-2305843009213693825: 0 + -2305843009213693824..-1844674407370955009: 0 + -1844674407370955008..-1383505805528216193: 0 + -1383505805528216192.. -922337203685477377: 0 + -922337203685477376.. -461168601842738561: 0 + -461168601842738560.. 255: ####################################################### 607 + 256.. 461168601842739071: 0 + 461168601842739072.. 922337203685477887: 0 + 922337203685477888.. 1383505805528216703: 0 + 1383505805528216704.. 1844674407370955519: 0 + 1844674407370955520.. 2305843009213694335: 0 + 2305843009213694336.. 2767011611056433151: 0 + 2767011611056433152.. 3228180212899171967: 0 + 3228180212899171968.. 3689348814741910783: 0 + 3689348814741910784.. 4150517416584649599: 0 + 4150517416584649600.. 4611686018427387903: ################# 195 +================================================================================ +1 warning(s) +failure (60 tests failed, 3 tests errored, ran 131 tests) +random seed: 153870556 + ++++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: -38152533987928128.00, stddev: 1828925617669212928.00, median 9, min -4606614955625884935, max 4611686018427387903 + -4606614955625884935..-4145699906923221320: ## 27 + -4145699906923221319..-3684784858220557704: ## 22 + -3684784858220557703..-3223869809517894088: ## 29 + -3223869809517894087..-2762954760815230472: ## 22 + -2762954760815230471..-2302039712112566856: ## 20 + -2302039712112566855..-1841124663409903240: ## 22 + -1841124663409903239..-1380209614707239624: ## 26 + -1380209614707239623.. -919294566004576008: ## 27 + -919294566004576007.. -458379517301912392: ## 24 + -458379517301912391.. 2535531400751224: ####################################################### 547 + 2535531400751225.. 463450580103414840: ## 25 + 463450580103414841.. 924365628806078456: ## 25 + 924365628806078457.. 1385280677508742072: ## 22 + 1385280677508742073.. 1846195726211405688: ### 30 + 1846195726211405689.. 2307110774914069304: ## 27 + 2307110774914069305.. 2768025823616732920: # 16 + 2768025823616732921.. 3228940872319396536: ## 23 + 3228940872319396537.. 3689855921022060152: # 19 + 3689855921022060153.. 4150770969724723768: # 18 + 4150770969724723769.. 4611686018427387384: ## 28 + 4611686018427387385.. 4611686018427387903: 1 +================================================================================ +success (ran 1 tests) diff --git a/test/core/QCheck_expect_test.expected.ocaml5 b/test/core/QCheck_expect_test.expected.ocaml5 new file mode 100644 index 00000000..7c4bde1c --- /dev/null +++ b/test/core/QCheck_expect_test.expected.ocaml5 @@ -0,0 +1,1326 @@ +random seed: 1234 +45 4 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 (8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) +(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) +(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) +(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) +(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) +(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) +(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) +(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) +-1592932412304362665 +-796466206152181333 +-398233103076090667 +-199116551538045334 +-99558275769022667 +-49779137884511334 +-24889568942255667 +-12444784471127834 +-6222392235563917 +-3111196117781959 +-1555598058890980 +-777799029445490 +-388899514722745 +-194449757361373 +-97224878680687 +-48612439340344 +-24306219670172 +-12153109835086 +-6076554917543 +-3038277458772 +-1519138729386 +-759569364693 +-379784682347 +-189892341174 +-94946170587 +-47473085294 +-23736542647 +-11868271324 +-5934135662 +-2967067831 +-1483533916 +-741766958 +-370883479 +-185441740 +-92720870 +-46360435 +-23180218 +-11590109 +-5795055 +-2897528 +-1448764 +-724382 +-362191 +-181096 +-90548 +-45274 +-22637 +-11319 +-5660 +-2830 +-1415 +-708 +-354 +-177 +-89 +-45 +-23 +-12 +-6 +-3 +-2 +-1 +0 +[46; 2; 22; 4; 4; 2; 6; 5; 88; 24; 7; 9; 9; 2; 5; 1; 55; 8; 45; 1; 96; 0; 1; 2; 7; 4; 1; 5; 95; 6; 8; 6; 4; 0; 5; 5; 22; 87; 2; 1; 1; 0; 2; 2; 9; 5; 9; 3; 7; 59; 7; 96; 6; 5; 1; 3; 9; 9; 65; 6; 7; 7; 2; 5; 0; 0; 70; 5; 5; 2; 1; 57; 9; 7; 8; 10; 9; 7; 9; 75; 73; 80; 7; 9; 4; 3; 16; 5; 79; 1; 8; 6; 2; 3; 4; 9; 2; 8; 4; 6; 50; 2; 1; 5; 9; 5; 4; 3; 56; 6; 5; 9; 4; 1; 47; 1; 2; 5; 2; 0; 7; 31; 55; 6; 7; 4; 7; 8; 8; 2; 4; 40; 4; 6; 9; 3; 59; 5; 1; 0; 2; 6; 90; 1; 6; 81; 0; 1; 3; 7; 2; 4; 5; 4; 7; 3; 62; 0; 1; 6; 7; 5; 97; 83; 41; 7; 2; 6; 3; 0; 4; 8; 99; 8; 6; 0; 7; 9; 7; 1; 55; 30; 25; 3; 4; 7; 1; 6; 80; 8; 0; 4; 21; 3; 5; 9; 27; 10; 60; 47; 54; 6; 5; 8; 1; 5; 9; 65; 9; 5; 7; 7; 6; 48; 9; 5; 6; 4; 9; 7; 1; 2; 71; 6; 9; 2; 7; 8; 14; 59; 71; 30; 7; 3; 5; 4; 6; 7; 3; 6; 9; 8; 2; 38; 6; 6; 7; 1; 5; 2; 43; 5; 2; 9; 3; 0; 3; 2; 7; 71; 26; 3; 9; 11; 5; 1; 5; 2; 53; 46; 4; 6; 7; 67; 1; 0; 34; 0; 48; 5; 5; 0; 7; 49; 92; 8; 3; 0; 67; 1; 5; 2; 9; 5; 9; 3; 1; 4; 8; 0; 3; 6; 46; 58; 1; 54; 77; 0; 96; 1; 6; 2; 8; 22; 3; 9; 2; 6; 25; 49; 9; 6; 3; 8; 5; 9; 54; 1; 7; 5; 6; 5; 1; 7; 8; 23; 4; 6; 4; 2; 5; 8; 4; 7; 4] +[46; 2; 22; 4; 4; 2; 6; 5; 88; 24; 7; 9; 9; 2; 5; 1; 55; 8; 45; 1; 96; 0; 1; 2; 7; 4; 1; 5; 95; 6; 8; 6; 4; 0; 5; 5; 22; 87; 2; 1; 1; 0; 2; 2; 9; 5; 9; 3; 7; 59; 7; 96; 6; 5; 1; 3; 9; 9; 65; 6; 7; 7; 2; 5; 0; 0; 70; 5; 5; 2; 1; 57; 9; 7; 8; 10; 9; 7; 9; 75; 73; 80; 7; 9; 4; 3; 16; 5; 79; 1; 8; 6; 2; 3; 4; 9; 2; 8; 4; 6; 50; 2; 1; 5; 9; 5; 4; 3; 56; 6; 5; 9; 4; 1; 47; 1; 2; 5; 2; 0; 7; 31; 55; 6; 7; 4; 7; 8; 8; 2; 4; 40; 4; 6; 9; 3; 59; 5; 1; 0; 2; 6; 90; 1; 6; 81; 0; 1; 3; 7; 2; 4; 5; 4; 7; 3; 62; 0; 1; 6; 7; 5; 97; 83; 41; 7; 2; 6; 3; 0; 4; 8; 99] +[46; 2; 22; 4; 4; 2; 6; 5; 88; 24; 7; 9; 9; 2; 5; 1; 55; 8; 45; 1; 96; 0; 1; 2; 7; 4; 1; 5; 95; 6; 8; 6; 4; 0; 5; 5; 22; 87; 2; 1; 1; 0; 2; 2; 9; 5; 9; 3; 7; 59; 7; 96; 6; 5; 1; 3; 9; 9; 65; 6; 7; 7; 2; 5; 0; 0; 70; 5; 5; 2; 1; 57; 9; 7; 8; 10; 9; 7; 9; 75; 73; 80; 7; 9; 4; 3; 16] +[46; 2; 22; 4; 4; 2; 6; 5; 88; 24; 7; 9; 9; 2; 5; 1; 55; 8; 45; 1; 96; 0; 1; 2; 7; 4; 1; 5; 95; 6; 8; 6; 4; 0; 5; 5; 22; 87; 2; 1; 1; 0; 2; 2] +[46; 2; 22; 4; 4; 2; 6; 5; 88; 24; 7; 9; 9; 2; 5; 1; 55; 8; 45; 1; 96; 0] +[46; 2; 22; 4; 4; 2; 6; 5; 88; 24; 7] +[46; 2; 22; 4; 4; 2] +[46; 2; 22] +[46; 2] +[] +[46] +[] +[23] +[] +[12] +[] +[6] +[] +[3] +[] +[2] +[] +[1] +[] +[0] +[] +[46; 2; 22; 4; 4; 2; 6; 5; 88; 24; 7; 9; 9; 2; 5; 1; 55; 8; 45; 1; 96; 0; 1; 2; 7; 4; 1; 5; 95; 6; 8; 6; 4; 0; 5; 5; 22; 87; 2; 1; 1; 0; 2; 2; 9; 5; 9; 3; 7; 59; 7; 96; 6; 5; 1; 3; 9; 9; 65; 6; 7; 7; 2; 5; 0; 0; 70; 5; 5; 2; 1; 57; 9; 7; 8; 10; 9; 7; 9; 75; 73; 80; 7; 9; 4; 3; 16; 5; 79; 1; 8; 6; 2; 3; 4; 9; 2; 8; 4; 6; 50; 2; 1; 5; 9; 5; 4; 3; 56; 6; 5; 9; 4; 1; 47; 1; 2; 5; 2; 0; 7; 31; 55; 6; 7; 4; 7; 8; 8; 2; 4; 40; 4; 6; 9; 3; 59; 5; 1; 0; 2; 6; 90; 1; 6; 81; 0; 1; 3; 7; 2; 4; 5; 4; 7; 3; 62; 0; 1; 6; 7; 5; 97; 83; 41; 7; 2; 6; 3; 0; 4; 8; 99; 8; 6; 0; 7; 9; 7; 1; 55; 30; 25; 3; 4; 7; 1; 6; 80; 8; 0; 4; 21; 3; 5; 9; 27; 10; 60; 47; 54; 6; 5; 8; 1; 5; 9; 65; 9; 5; 7; 7; 6; 48; 9; 5; 6; 4; 9; 7; 1; 2; 71; 6; 9; 2; 7; 8; 14; 59; 71; 30; 7; 3; 5; 4; 6; 7; 3; 6; 9; 8; 2; 38; 6; 6; 7; 1; 5; 2; 43; 5; 2; 9; 3; 0; 3; 2; 7; 71; 26; 3; 9; 11; 5; 1; 5; 2; 53; 46; 4; 6; 7; 67; 1; 0; 34; 0; 48; 5; 5; 0; 7; 49; 92; 8; 3; 0; 67; 1; 5; 2; 9; 5; 9; 3; 1; 4; 8; 0; 3; 6; 46; 58; 1; 54; 77; 0; 96; 1; 6; 2; 8; 22; 3; 9; 2; 6; 25; 49; 9; 6; 3; 8; 5; 9; 54; 1; 7; 5; 6; 5; 1; 7; 8; 23; 4; 6; 4; 2; 5; 8; 4; 7; 4] +[46; 2; 22; 4; 4; 2; 6; 5; 88; 24; 7; 9; 9; 2; 5; 1; 55; 8; 45; 1; 96; 0; 1; 2; 7; 4; 1; 5; 95; 6; 8; 6; 4; 0; 5; 5; 22; 87; 2; 1; 1; 0; 2; 2; 9; 5; 9; 3; 7; 59; 7; 96; 6; 5; 1; 3; 9; 9; 65; 6; 7; 7; 2; 5; 0; 0; 70; 5; 5; 2; 1; 57; 9; 7; 8; 10; 9; 7; 9; 75; 73; 80; 7; 9; 4; 3; 16; 5; 79; 1; 8; 6; 2; 3; 4; 9; 2; 8; 4; 6; 50; 2; 1; 5; 9; 5; 4; 3; 56; 6; 5; 9; 4; 1; 47; 1; 2; 5; 2; 0; 7; 31; 55; 6; 7; 4; 7; 8; 8; 2; 4; 40; 4; 6; 9; 3; 59; 5; 1; 0; 2; 6; 90; 1; 6; 81; 0; 1; 3; 7; 2; 4; 5; 4; 7; 3; 62; 0; 1; 6; 7; 5; 97; 83; 41; 7; 2; 6; 3; 0; 4; 8; 99] +[46; 2; 22; 4; 4; 2; 6; 5; 88; 24; 7; 9; 9; 2; 5; 1; 55; 8; 45; 1; 96; 0; 1; 2; 7; 4; 1; 5; 95; 6; 8; 6; 4; 0; 5; 5; 22; 87; 2; 1; 1; 0; 2; 2; 9; 5; 9; 3; 7; 59; 7; 96; 6; 5; 1; 3; 9; 9; 65; 6; 7; 7; 2; 5; 0; 0; 70; 5; 5; 2; 1; 57; 9; 7; 8; 10; 9; 7; 9; 75; 73; 80; 7; 9; 4; 3; 16] +[46; 2; 22; 4; 4; 2; 6; 5; 88; 24; 7; 9; 9; 2; 5; 1; 55; 8; 45; 1; 96; 0; 1; 2; 7; 4; 1; 5; 95; 6; 8; 6; 4; 0; 5; 5; 22; 87; 2; 1; 1; 0; 2; 2] +[46; 2; 22; 4; 4; 2; 6; 5; 88; 24; 7; 9; 9; 2; 5; 1; 55; 8; 45; 1; 96; 0] +[46; 2; 22; 4; 4; 2; 6; 5; 88; 24; 7] +[46; 2; 22; 4; 4; 2] +[46; 2; 22] +[46; 2; 4; 4; 2] +[46; 2; 4] +[46; 2; 4; 2] +[46; 2] +[4; 2] +[46; 4; 2] +[2; 4; 2] +[2; 4] +[2] +[2; 2] +[] +[2] +[2] +[1; 2] +[2; 1] + +--- Failure -------------------------------------------------------------------- + +Test should_fail_sort_id failed (10 shrink steps): + +[1; 0] + +=== Error ====================================================================== + +Test should_error_raise_exn errored on (62 shrink steps): + +0 + +exception QCheck_tests.Overall.Error + + ++++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Collect results for test collect_results: + +4: 24 cases +3: 20 cases +2: 18 cases +1: 21 cases +0: 17 cases + ++++ Stats for with_stats ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats mod4: + num: 100, avg: 1.56, stddev: 1.18, median 2, min 0, max 3 + 0: ################################################# 27 + 1: #################################### 20 + 2: ########################################## 23 + 3: ####################################################### 30 + +stats num: + num: 100, avg: 62.24, stddev: 33.15, median 62, min 2, max 120 + 2.. 7: ######### 2 + 8.. 13: ################################ 7 + 14.. 19: ########################### 6 + 20.. 25: ############# 3 + 26.. 31: ###################### 5 + 32.. 37: ################## 4 + 38.. 43: ############# 3 + 44.. 49: ################################ 7 + 50.. 55: ################################ 7 + 56.. 61: ###################### 5 + 62.. 67: #################################### 8 + 68.. 73: ######### 2 + 74.. 79: ###################### 5 + 80.. 85: ######### 2 + 86.. 91: ####################################################### 12 + 92.. 97: ###################### 5 + 98..103: ################## 4 + 104..109: ################## 4 + 110..115: ############# 3 + 116..121: ########################### 6 + +--- Failure -------------------------------------------------------------------- + +Test with shrinking retries failed (0 shrink steps): + +4 + +!!! Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +Warning for test WARN_unlikely_precond: + +WARNING: only 0.8% tests (of 2000) passed precondition for "WARN_unlikely_precond" + +NOTE: it is likely that the precondition is too strong, or that the generator is buggy. + +--- Failure -------------------------------------------------------------------- + +Test FAIL_unlikely_precond failed: + +ERROR: only 0.8% tests (of 2000) passed precondition for "FAIL_unlikely_precond" + +NOTE: it is likely that the precondition is too strong, or that the generator is buggy. + + +--- Failure -------------------------------------------------------------------- + +Test FAIL_bad_gen failed: + +ERROR: uncaught exception in generator for test FAIL_bad_gen after 100 steps: +Exception: Invalid_argument("Gen.int_bound") +Backtrace: + +--- Failure -------------------------------------------------------------------- + +Test int double failed: + +Negative test int double succeeded but was expected to fail + +=== Error ====================================================================== + +Test pos fail with error errored on (7 shrink steps): + +0 + +exception QCheck_tests.Overall.Error + + +=== Error ====================================================================== + +Test neg fail with error errored on (7 shrink steps): + +0 + +exception QCheck_tests.Overall.Error + + +--- Failure -------------------------------------------------------------------- + +Test char never produces '\255' failed (0 shrink steps): + +'\255' + +--- Failure -------------------------------------------------------------------- + +Test big bound issue59 failed (52 shrink steps): + +209609 + +--- Failure -------------------------------------------------------------------- + +Test long_shrink failed (149 shrink steps): + +([0], [1]) + +--- Failure -------------------------------------------------------------------- + +Test ints arent 0 mod 3 failed (75 shrink steps): + +4161 + +--- Failure -------------------------------------------------------------------- + +Test ints are 0 failed (61 shrink steps): + +-1 + +--- Failure -------------------------------------------------------------------- + +Test ints < 209609 failed (52 shrink steps): + +209609 + +--- Failure -------------------------------------------------------------------- + +Test nat < 5001 failed (4 shrink steps): + +5001 + +--- Failure -------------------------------------------------------------------- + +Test char never produces 'abcdef' failed (2 shrink steps): + +'a' + +--- Failure -------------------------------------------------------------------- + +Test printable never produces '!"#$%&' failed (1 shrink steps): + +'&' + +--- Failure -------------------------------------------------------------------- + +Test printable never produces less than '5 failed (0 shrink steps): + +'0' + +--- Failure -------------------------------------------------------------------- + +Test strings are empty failed (13 shrink steps): + +"a" + +--- Failure -------------------------------------------------------------------- + +Test string never has a \000 char failed (13 shrink steps): + +"\000" + +--- Failure -------------------------------------------------------------------- + +Test string never has a \255 char failed (15 shrink steps): + +"\255" + +--- Failure -------------------------------------------------------------------- + +Test strings have unique chars failed (14 shrink steps): + +"\232\232" + +--- Failure -------------------------------------------------------------------- + +Test pairs have different components failed (0 shrink steps): + +(6, 6) + +--- Failure -------------------------------------------------------------------- + +Test pairs have same components failed (123 shrink steps): + +(0, -1) + +--- Failure -------------------------------------------------------------------- + +Test pairs have a zero component failed (122 shrink steps): + +(1, -1) + +--- Failure -------------------------------------------------------------------- + +Test pairs are (0,0) failed (123 shrink steps): + +(0, -1) + +--- Failure -------------------------------------------------------------------- + +Test pairs are ordered failed (554 shrink steps): + +(1, 0) + +--- Failure -------------------------------------------------------------------- + +Test pairs are ordered reversely failed (123 shrink steps): + +(0, 1) + +--- Failure -------------------------------------------------------------------- + +Test pairs sum to less than 128 failed (118 shrink steps): + +(0, 128) + +--- Failure -------------------------------------------------------------------- + +Test pairs lists rev concat failed (138 shrink steps): + +([0], [1]) + +--- Failure -------------------------------------------------------------------- + +Test pairs lists no overlap failed (24 shrink steps): + +([0], [0]) + +--- Failure -------------------------------------------------------------------- + +Test triples have pair-wise different components failed (4 shrink steps): + +(6, 6, 0) + +--- Failure -------------------------------------------------------------------- + +Test triples have same components failed (184 shrink steps): + +(0, 1, 0) + +--- Failure -------------------------------------------------------------------- + +Test triples are ordered failed (184 shrink steps): + +(0, 0, -1) + +--- Failure -------------------------------------------------------------------- + +Test triples are ordered reversely failed (184 shrink steps): + +(0, 1, 0) + +--- Failure -------------------------------------------------------------------- + +Test quadruples have pair-wise different components failed (7 shrink steps): + +(0, 5, 5, 0) + +--- Failure -------------------------------------------------------------------- + +Test quadruples have same components failed (245 shrink steps): + +(0, 1, 2, 0) + +--- Failure -------------------------------------------------------------------- + +Test quadruples are ordered failed (247 shrink steps): + +(0, 0, 0, -1) + +--- Failure -------------------------------------------------------------------- + +Test quadruples are ordered reversely failed (247 shrink steps): + +(0, 0, 1, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b) in nat: a < b failed (5 shrink steps): + +(0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c) in nat: a < b < c failed (14 shrink steps): + +(0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c, d) in nat: a < b < c < d failed (17 shrink steps): + +(0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c, d, e) in nat: a < b < c < d < e failed (21 shrink steps): + +(0, 0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c, d, e, f) in nat: a < b < c < d < e < f failed (25 shrink steps): + +(0, 0, 0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c, d, e, f, g) in nat: a < b < c < d < e < f < g failed (27 shrink steps): + +(0, 0, 0, 0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c, d, e, f, g, h) in nat: a < b < c < d < e < f < g < h failed (30 shrink steps): + +(0, 0, 0, 0, 0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c, d, e, f, g, h, i) in nat: a < b < c < d < e < f < g < h < i failed (34 shrink steps): + +(0, 0, 0, 0, 0, 0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test bind ordered pairs failed (124 shrink steps): + +(0, 0) + +--- Failure -------------------------------------------------------------------- + +Test bind list_size constant failed (52 shrink steps): + +(4, [0; 0; 0; 0]) + +--- Failure -------------------------------------------------------------------- + +Test lists are empty failed (16 shrink steps): + +[0] + +--- Failure -------------------------------------------------------------------- + +Test lists shorter than 10 failed (49 shrink steps): + +[0; 0; 0; 0; 0; 0; 0; 0; 0; 0] + +--- Failure -------------------------------------------------------------------- + +Test lists shorter than 432 failed (1738 shrink steps): + +[...] list length: 432 + +--- Failure -------------------------------------------------------------------- + +Test lists shorter than 4332 failed (11 shrink steps): + +[...] list length: 4332 + +--- Failure -------------------------------------------------------------------- + +Test lists have unique elems failed (10 shrink steps): + +[2; 2] + +--- Failure -------------------------------------------------------------------- + +Test tree contains only 42 failed (9 shrink steps): + +Leaf 0 + +--- Failure -------------------------------------------------------------------- + +Test fail_pred_map_commute failed (79 shrink steps): + +([11], {_ -> 0}, {11 -> false; _ -> true}) + +--- Failure -------------------------------------------------------------------- + +Test fail_pred_strings failed (1 shrink steps): + +{some other string -> false; _ -> true} + +--- Failure -------------------------------------------------------------------- + +Test fold_left fold_right failed (21 shrink steps): + +(0, [1], {(0, 1) -> 1; _ -> 0}) + ++++ Messages ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Messages for test fold_left fold_right: + +l=[1], fold_left=0, fold_right=1 + + +--- Failure -------------------------------------------------------------------- + +Test fold_left fold_right uncurried failed (41 shrink steps): + +({(0, 4) -> 1; _ -> 0}, 0, [4]) + +--- Failure -------------------------------------------------------------------- + +Test fold_left fold_right uncurried fun last failed (25 shrink steps): + +(0, [1], {(0, 1) -> 1; _ -> 0}) + +--- Failure -------------------------------------------------------------------- + +Test fold_left test, fun first failed (66 shrink steps): + +({(, 2) -> "a"; _ -> ""}, "", [], [2]) + +--- Failure -------------------------------------------------------------------- + +Test FAIL_#99_1 failed: + +ERROR: uncaught exception in generator for test FAIL_#99_1 after 100 steps: +Exception: QCheck.No_example_found("<example>") +Backtrace: + ++++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Collect results for test bool dist: + +true: 250511 cases +false: 249489 cases + ++++ Stats for char code dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats char code: + num: 500000, avg: 127.68, stddev: 73.87, median 128, min 0, max 255 + 0.. 12: ##################################################### 25272 + 13.. 25: ###################################################### 25326 + 26.. 38: ##################################################### 25194 + 39.. 51: ###################################################### 25359 + 52.. 64: ###################################################### 25338 + 65.. 77: ###################################################### 25349 + 78.. 90: ###################################################### 25397 + 91..103: ##################################################### 25243 + 104..116: ###################################################### 25420 + 117..129: ###################################################### 25438 + 130..142: ###################################################### 25346 + 143..155: ##################################################### 25177 + 156..168: ####################################################### 25755 + 169..181: ###################################################### 25408 + 182..194: ###################################################### 25633 + 195..207: ###################################################### 25613 + 208..220: ###################################################### 25459 + 221..233: ###################################################### 25322 + 234..246: ##################################################### 25229 + 247..259: ##################################### 17722 + ++++ Stats for printable char code dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats char code: + num: 500000, avg: 77.76, stddev: 27.87, median 78, min 10, max 125 + 10.. 15: ######### 5255 + 16.. 21: 0 + 22.. 27: 0 + 28.. 33: ################# 10417 + 34.. 39: ###################################################### 31730 + 40.. 45: ###################################################### 31499 + 46.. 51: ###################################################### 31657 + 52.. 57: ###################################################### 31704 + 58.. 63: ###################################################### 31502 + 64.. 69: ###################################################### 31643 + 70.. 75: ###################################################### 31630 + 76.. 81: ###################################################### 31481 + 82.. 87: ###################################################### 31594 + 88.. 93: ###################################################### 31817 + 94.. 99: ###################################################### 31536 + 100..105: ###################################################### 31528 + 106..111: ###################################################### 31467 + 112..117: ##################################################### 31246 + 118..123: ####################################################### 31861 + 124..129: ################## 10433 + ++++ Stats for numeral char code dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats char code: + num: 500000, avg: 52.50, stddev: 2.87, median 53, min 48, max 57 + 48: ###################################################### 49848 + 49: ###################################################### 50118 + 50: ###################################################### 49837 + 51: ###################################################### 50252 + 52: ###################################################### 49765 + 53: ####################################################### 50369 + 54: ###################################################### 50270 + 55: ###################################################### 49885 + 56: ###################################################### 49821 + 57: ###################################################### 49835 + ++++ Stats for tree's depth ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats depth: + num: 1000, avg: 4.13, stddev: 3.52, median 3, min 1, max 15 + 1: ####################################################### 339 + 2: ################ 104 + 3: ############### 98 + 4: ##################### 133 + 5: ######### 60 + 6: #### 29 + 7: ######## 54 + 8: ####### 48 + 9: ## 16 + 10: ### 21 + 11: ########### 68 + 12: 1 + 13: # 8 + 14: ## 16 + 15: 5 + ++++ Stats for range_subset_spec ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 5000, avg: 9.99, stddev: 6.01, median 10, min 0, max 20 + 0: ############################################### 231 + 1: ############################################## 223 + 2: ##################################################### 258 + 3: ################################################ 233 + 4: ############################################### 228 + 5: ############################################### 231 + 6: #################################################### 254 + 7: ############################################### 228 + 8: #################################################### 254 + 9: ####################################################### 266 + 10: ############################################## 224 + 11: ################################################## 245 + 12: ############################################### 230 + 13: #################################################### 253 + 14: ############################################## 223 + 15: ################################################# 239 + 16: ################################################## 243 + 17: ################################################## 245 + 18: ############################################# 220 + 19: ################################################## 242 + 20: ############################################### 230 + ++++ Stats for string_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 7.51, stddev: 1.69, median 8, min 5, max 10 + 5: ################################################## 817 + 6: ################################################# 797 + 7: ####################################################### 885 + 8: ################################################### 834 + 9: ###################################################### 877 + 10: ################################################# 790 + ++++ Stats for string len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 370.05, stddev: 1282.91, median 9, min 0, max 9947 + 0.. 497: ####################################################### 4270 + 498.. 995: ###### 497 + 996..1493: 17 + 1494..1991: 9 + 1992..2489: 13 + 2490..2987: 13 + 2988..3485: 9 + 3486..3983: 14 + 3984..4481: 14 + 4482..4979: 17 + 4980..5477: 9 + 5478..5975: 10 + 5976..6473: 15 + 6474..6971: 16 + 6972..7469: 16 + 7470..7967: 9 + 7968..8465: 12 + 8466..8963: 15 + 8964..9461: 9 + 9462..9959: 16 + ++++ Stats for string_of len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 359.22, stddev: 1249.46, median 9, min 0, max 9958 + 0.. 497: ####################################################### 4275 + 498.. 995: ###### 479 + 996..1493: 22 + 1494..1991: 12 + 1992..2489: 21 + 2490..2987: 16 + 2988..3485: 13 + 3486..3983: 17 + 3984..4481: 14 + 4482..4979: 14 + 4980..5477: 8 + 5478..5975: 14 + 5976..6473: 13 + 6474..6971: 9 + 6972..7469: 7 + 7470..7967: 17 + 7968..8465: 13 + 8466..8963: 15 + 8964..9461: 10 + 9462..9959: 11 + ++++ Stats for printable_string len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 370.05, stddev: 1282.91, median 9, min 0, max 9947 + 0.. 497: ####################################################### 4270 + 498.. 995: ###### 497 + 996..1493: 17 + 1494..1991: 9 + 1992..2489: 13 + 2490..2987: 13 + 2988..3485: 9 + 3486..3983: 14 + 3984..4481: 14 + 4482..4979: 17 + 4980..5477: 9 + 5478..5975: 10 + 5976..6473: 15 + 6474..6971: 16 + 6972..7469: 16 + 7470..7967: 9 + 7968..8465: 12 + 8466..8963: 15 + 8964..9461: 9 + 9462..9959: 16 + ++++ Stats for small_string len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 15.99, stddev: 24.58, median 6, min 0, max 99 + 0.. 4: ###################################################### 1920 + 5.. 9: ####################################################### 1929 + 10.. 14: # 69 + 15.. 19: # 62 + 20.. 24: # 63 + 25.. 29: # 59 + 30.. 34: # 68 + 35.. 39: # 62 + 40.. 44: # 57 + 45.. 49: ## 83 + 50.. 54: # 59 + 55.. 59: ## 80 + 60.. 64: # 48 + 65.. 69: # 53 + 70.. 74: # 61 + 75.. 79: # 66 + 80.. 84: # 61 + 85.. 89: ## 72 + 90.. 94: # 66 + 95.. 99: # 62 + ++++ Stats for pair dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats pair sum: + num: 500000, avg: 100.05, stddev: 41.29, median 100, min 0, max 200 + 0.. 9: ### 2618 + 10.. 19: ######## 7630 + 20.. 29: ############## 12505 + 30.. 39: #################### 17451 + 40.. 49: ########################## 22280 + 50.. 59: ############################### 27307 + 60.. 69: ##################################### 32151 + 70.. 79: ########################################### 37199 + 80.. 89: ################################################# 41901 + 90.. 99: ###################################################### 46313 + 100..109: ####################################################### 46965 + 110..119: ################################################# 42462 + 120..129: ########################################### 37348 + 130..139: ###################################### 32613 + 140..149: ################################ 27606 + 150..159: ########################### 23221 + 160..169: ##################### 18125 + 170..179: ############### 12890 + 180..189: ######### 8059 + 190..199: ### 3297 + 200..209: 59 + ++++ Stats for triple dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats triple sum: + num: 500000, avg: 150.04, stddev: 50.53, median 150, min 1, max 300 + 1.. 15: 360 + 16.. 30: ## 2261 + 31.. 45: ##### 5712 + 46.. 60: ########## 10854 + 61.. 75: ################# 17760 + 76.. 90: ########################## 26151 + 91..105: ################################### 36079 + 106..120: ############################################# 45498 + 121..135: ################################################### 51977 + 136..150: ####################################################### 55179 + 151..165: ###################################################### 54821 + 166..180: ################################################### 51709 + 181..195: ############################################# 45166 + 196..210: ################################### 35354 + 211..225: ######################### 25436 + 226..240: ################# 17179 + 241..255: ########## 10652 + 256..270: ##### 5447 + 271..285: ## 2065 + 286..300: 340 + ++++ Stats for quad dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats quad sum: + num: 500000, avg: 200.06, stddev: 58.39, median 200, min 2, max 394 + 2.. 21: 61 + 22.. 41: 658 + 42.. 61: ## 2534 + 62.. 81: ##### 6444 + 82..101: ########### 13334 + 102..121: ################### 23279 + 122..141: ############################## 35888 + 142..161: ######################################### 48824 + 162..181: ################################################## 59008 + 182..201: ####################################################### 64896 + 202..221: ###################################################### 64051 + 222..241: ################################################# 57864 + 242..261: ####################################### 46793 + 262..281: ############################ 33955 + 282..301: ################## 21775 + 302..321: ########## 12187 + 322..341: #### 5645 + 342..361: # 2244 + 362..381: 529 + 382..401: 31 + ++++ Stats for bind dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats ordered pair difference: + num: 1000000, avg: 25.01, stddev: 22.38, median 19, min 0, max 100 + 0.. 4: ####################################################### 193610 + 5.. 9: #################################### 130051 + 10.. 14: ############################# 104209 + 15.. 19: ######################## 86993 + 20.. 24: ##################### 74295 + 25.. 29: ################## 64874 + 30.. 34: ################ 56447 + 35.. 39: ############## 49416 + 40.. 44: ############ 43051 + 45.. 49: ########## 37580 + 50.. 54: ######### 32378 + 55.. 59: ######## 28558 + 60.. 64: ###### 23971 + 65.. 69: ##### 20146 + 70.. 74: #### 16446 + 75.. 79: ### 13215 + 80.. 84: ## 10294 + 85.. 89: ## 7639 + 90.. 94: # 4698 + 95.. 99: 2041 + 100..104: 88 + +stats ordered pair sum: + num: 1000000, avg: 74.97, stddev: 46.86, median 72, min 0, max 200 + 0.. 9: ####################################################### 70320 + 10.. 19: ##################################################### 68731 + 20.. 29: ##################################################### 68374 + 30.. 39: ##################################################### 68544 + 40.. 49: ##################################################### 68756 + 50.. 59: ##################################################### 68837 + 60.. 69: ##################################################### 68759 + 70.. 79: ##################################################### 68517 + 80.. 89: ##################################################### 68692 + 90.. 99: ###################################################### 69123 + 100..109: ################################################## 64777 + 110..119: ########################################### 55288 + 120..129: #################################### 47156 + 130..139: ############################### 39635 + 140..149: ######################### 32590 + 150..159: #################### 25685 + 160..169: ############### 19842 + 170..179: ########## 14038 + 180..189: ###### 8631 + 190..199: ## 3580 + 200..209: 125 + ++++ Stats for list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 381.08, stddev: 1328.05, median 9, min 0, max 9993 + 0.. 499: ####################################################### 4260 + 500.. 999: ###### 515 + 1000.. 1499: 8 + 1500.. 1999: 11 + 2000.. 2499: 10 + 2500.. 2999: 10 + 3000.. 3499: 9 + 3500.. 3999: 18 + 4000.. 4499: 14 + 4500.. 4999: 9 + 5000.. 5499: 9 + 5500.. 5999: 14 + 6000.. 6499: 15 + 6500.. 6999: 7 + 7000.. 7499: 10 + 7500.. 7999: 23 + 8000.. 8499: 10 + 8500.. 8999: 22 + 9000.. 9499: 16 + 9500.. 9999: 10 + ++++ Stats for small_list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 16.58, stddev: 25.30, median 6, min 0, max 99 + 0.. 4: ################################################### 1848 + 5.. 9: ####################################################### 1992 + 10.. 14: # 47 + 15.. 19: # 62 + 20.. 24: # 56 + 25.. 29: # 67 + 30.. 34: # 66 + 35.. 39: # 57 + 40.. 44: # 59 + 45.. 49: # 62 + 50.. 54: ## 75 + 55.. 59: # 70 + 60.. 64: # 55 + 65.. 69: # 68 + 70.. 74: ## 74 + 75.. 79: # 56 + 80.. 84: # 66 + 85.. 89: ## 74 + 90.. 94: # 64 + 95.. 99: ## 82 + ++++ Stats for list_of_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 7.50, stddev: 1.72, median 8, min 5, max 10 + 5: ####################################################### 854 + 6: ################################################### 802 + 7: ##################################################### 835 + 8: ##################################################### 838 + 9: #################################################### 818 + 10: ###################################################### 853 + ++++ Stats for list_repeat len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 42.00, stddev: 0.00, median 42, min 42, max 42 + 42: ####################################################### 5000 + ++++ Stats for array len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 381.08, stddev: 1328.05, median 9, min 0, max 9993 + 0.. 499: ####################################################### 4260 + 500.. 999: ###### 515 + 1000.. 1499: 8 + 1500.. 1999: 11 + 2000.. 2499: 10 + 2500.. 2999: 10 + 3000.. 3499: 9 + 3500.. 3999: 18 + 4000.. 4499: 14 + 4500.. 4999: 9 + 5000.. 5499: 9 + 5500.. 5999: 14 + 6000.. 6499: 15 + 6500.. 6999: 7 + 7000.. 7499: 10 + 7500.. 7999: 23 + 8000.. 8499: 10 + 8500.. 8999: 22 + 9000.. 9499: 16 + 9500.. 9999: 10 + ++++ Stats for small_array len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 16.58, stddev: 25.30, median 6, min 0, max 99 + 0.. 4: ################################################### 1848 + 5.. 9: ####################################################### 1992 + 10.. 14: # 47 + 15.. 19: # 62 + 20.. 24: # 56 + 25.. 29: # 67 + 30.. 34: # 66 + 35.. 39: # 57 + 40.. 44: # 59 + 45.. 49: # 62 + 50.. 54: ## 75 + 55.. 59: # 70 + 60.. 64: # 55 + 65.. 69: # 68 + 70.. 74: ## 74 + 75.. 79: # 56 + 80.. 84: # 66 + 85.. 89: ## 74 + 90.. 94: # 64 + 95.. 99: ## 82 + ++++ Stats for array_of_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 7.50, stddev: 1.72, median 8, min 5, max 10 + 5: ####################################################### 854 + 6: ################################################### 802 + 7: ##################################################### 835 + 8: ##################################################### 838 + 9: #################################################### 818 + 10: ###################################################### 853 + ++++ Stats for array_repeat len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 42.00, stddev: 0.00, median 42, min 42, max 42 + 42: ####################################################### 5000 + ++++ Stats for int_stats_neg ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 5000, avg: 0.43, stddev: 28.63, median 0, min -99, max 99 + -99..-90: # 45 + -89..-80: # 57 + -79..-70: # 68 + -69..-60: # 58 + -59..-50: # 76 + -49..-40: # 67 + -39..-30: # 52 + -29..-20: # 54 + -19..-10: # 47 + -9.. 0: ####################################################### 2205 + 1.. 10: ########################################## 1697 + 11.. 20: # 57 + 21.. 30: # 70 + 31.. 40: # 60 + 41.. 50: # 66 + 51.. 60: # 75 + 61.. 70: # 68 + 71.. 80: # 63 + 81.. 90: # 66 + 91..100: # 49 + ++++ Stats for small_signed_int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 0.86, stddev: 29.11, median 0, min -97, max 99 + -97..-88: # 12 + -87..-78: # 12 + -77..-68: # 13 + -67..-58: # 12 + -57..-48: # 9 + -47..-38: ## 17 + -37..-28: # 13 + -27..-18: # 8 + -17.. -8: ######### 76 + -7.. 2: ####################################################### 437 + 3.. 12: ################################## 276 + 13.. 22: ## 16 + 23.. 32: # 11 + 33.. 42: ## 16 + 43.. 52: # 9 + 53.. 62: # 12 + 63.. 72: # 14 + 73.. 82: # 12 + 83.. 92: # 13 + 93..102: # 12 + ++++ Stats for small_nat dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 15.86, stddev: 24.57, median 6, min 0, max 99 + 0.. 4: ###################################################### 387 + 5.. 9: ####################################################### 390 + 10.. 14: # 11 + 15.. 19: # 8 + 20.. 24: # 11 + 25.. 29: ## 15 + 30.. 34: # 9 + 35.. 39: # 11 + 40.. 44: # 11 + 45.. 49: ## 19 + 50.. 54: # 10 + 55.. 59: ## 19 + 60.. 64: # 9 + 65.. 69: # 9 + 70.. 74: ## 19 + 75.. 79: # 13 + 80.. 84: # 11 + 85.. 89: ## 16 + 90.. 94: # 9 + 95.. 99: # 13 + ++++ Stats for nat dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 382.03, stddev: 1290.55, median 9, min 0, max 9890 + 0.. 494: ####################################################### 850 + 495.. 989: ###### 93 + 990..1484: 8 + 1485..1979: 3 + 1980..2474: 7 + 2475..2969: 1 + 2970..3464: 3 + 3465..3959: 3 + 3960..4454: 3 + 4455..4949: 4 + 4950..5444: 3 + 5445..5939: 3 + 5940..6434: 3 + 6435..6929: 1 + 6930..7424: 2 + 7425..7919: 1 + 7920..8414: 1 + 8415..8909: 5 + 8910..9404: 3 + 9405..9899: 3 + ++++ Stats for int_range (-43643) 435434 dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 193479.13, stddev: 136696.70, median 189823, min -43164, max 434961 + -43164..-19258: ################################### 42 + -19257.. 4649: ############################################## 56 + 4650.. 28556: ############################################# 55 + 28557.. 52463: ############################################### 57 + 52464.. 76370: ######################################### 50 + 76371..100277: ############################# 35 + 100278..124184: ############################################### 57 + 124185..148091: #################################### 44 + 148092..171998: ############################################## 56 + 171999..195905: ####################################################### 66 + 195906..219812: ########################################### 52 + 219813..243719: ######################################## 49 + 243720..267626: ################################ 39 + 267627..291533: ##################################### 45 + 291534..315440: ##################################### 45 + 315441..339347: ################################################# 59 + 339348..363254: ################################################## 60 + 363255..387161: ################################# 40 + 387162..411068: ########################################## 51 + 411069..434975: ################################### 42 + ++++ Stats for int_range (-40000) 40000 dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: -591.06, stddev: 23026.79, median -911, min -39911, max 39959 + -39911..-35918: ####################################### 45 + -35917..-31924: #################################################### 59 + -31923..-27930: ########################################### 49 + -27929..-23936: ########################################## 48 + -23935..-19942: ####################################################### 62 + -19941..-15948: ############################################# 51 + -15947..-11954: ######################################### 47 + -11953.. -7960: ################################################# 56 + -7959.. -3966: ################################### 40 + -3965.. 28: ################################################### 58 + 29.. 4022: ########################################### 49 + 4023.. 8016: ############################################### 53 + 8017.. 12010: ############################################ 50 + 12011.. 16004: ################################### 40 + 16005.. 19998: ####################################### 44 + 19999.. 23992: ####################################################### 62 + 23993.. 27986: ##################################### 42 + 27987.. 31980: ######################################### 47 + 31981.. 35974: ########################################## 48 + 35975.. 39968: ############################################ 50 + ++++ Stats for int_range (-4) 4 dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: -0.12, stddev: 2.52, median 0, min -4, max 4 + -4: ########################################## 116 + -3: ###################################### 103 + -2: ############################################## 125 + -1: ########################################## 115 + 0: ####################################### 106 + 1: ####################################################### 149 + 2: ################################# 92 + 3: ################################# 92 + 4: ##################################### 102 + ++++ Stats for int_range (-4) 17 dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 6.42, stddev: 6.43, median 6, min -4, max 17 + -4..-3: ########################################### 89 + -2..-1: ################################################# 101 + 0.. 1: ############################################## 95 + 2.. 3: ########################################### 89 + 4.. 5: ############################################## 95 + 6.. 7: ##################################### 78 + 8.. 9: ####################################### 81 + 10..11: ######################################## 84 + 12..13: ####################################################### 113 + 14..15: ######################################## 84 + 16..17: ############################################ 91 + 18..19: 0 + 20..21: 0 + 22..23: 0 + 24..25: 0 + 26..27: 0 + 28..29: 0 + 30..31: 0 + 32..33: 0 + 34..35: 0 + ++++ Stats for int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 100000, avg: -7215552342607541.00, stddev: 2666234426234218496.00, median -16620417636667326, min -4611371852367564818, max 4611613630315464842 + -4611371852367564818..-4150222578233413331: ##################################################### 5003 + -4150222578233413330..-3689073304099261843: ####################################################### 5106 + -3689073304099261842..-3227924029965110355: ###################################################### 5052 + -3227924029965110354..-2766774755830958867: ###################################################### 5017 + -2766774755830958866..-2305625481696807379: #################################################### 4852 + -2305625481696807378..-1844476207562655891: ###################################################### 5016 + -1844476207562655890..-1383326933428504403: ###################################################### 5083 + -1383326933428504402.. -922177659294352915: ##################################################### 4986 + -922177659294352914.. -461028385160201427: ###################################################### 5042 + -461028385160201426.. 120888973950061: ###################################################### 5017 + 120888973950062.. 461270163108101549: ##################################################### 4977 + 461270163108101550.. 922419437242253037: ##################################################### 5000 + 922419437242253038.. 1383568711376404525: ###################################################### 5022 + 1383568711376404526.. 1844717985510556013: #################################################### 4896 + 1844717985510556014.. 2305867259644707501: #################################################### 4884 + 2305867259644707502.. 2767016533778858989: ##################################################### 4981 + 2767016533778858990.. 3228165807913010477: ###################################################### 5026 + 3228165807913010478.. 3689315082047161965: ###################################################### 5016 + 3689315082047161966.. 4150464356181313453: ###################################################### 5021 + 4150464356181313454.. 4611613630315464941: ##################################################### 5003 + ++++ Stats for oneof int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 4611686018427388.00, stddev: 2891078433912002560.00, median 0, min -4611686018427387904, max 4611686018427387903 + -4611686018427387904..-4150517416584649089: ################# 198 + -4150517416584649088..-3689348814741910273: 0 + -3689348814741910272..-3228180212899171457: 0 + -3228180212899171456..-2767011611056432641: 0 + -2767011611056432640..-2305843009213693825: 0 + -2305843009213693824..-1844674407370955009: 0 + -1844674407370955008..-1383505805528216193: 0 + -1383505805528216192.. -922337203685477377: 0 + -922337203685477376.. -461168601842738561: 0 + -461168601842738560.. 255: ####################################################### 607 + 256.. 461168601842739071: 0 + 461168601842739072.. 922337203685477887: 0 + 922337203685477888.. 1383505805528216703: 0 + 1383505805528216704.. 1844674407370955519: 0 + 1844674407370955520.. 2305843009213694335: 0 + 2305843009213694336.. 2767011611056433151: 0 + 2767011611056433152.. 3228180212899171967: 0 + 3228180212899171968.. 3689348814741910783: 0 + 3689348814741910784.. 4150517416584649599: 0 + 4150517416584649600.. 4611686018427387903: ################# 195 +================================================================================ +1 warning(s) +failure (59 tests failed, 3 tests errored, ran 139 tests) +random seed: 153870556 + ++++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: -38152533987928128.00, stddev: 1828925617669212928.00, median 9, min -4606614955625884935, max 4611686018427387903 + -4606614955625884935..-4145699906923221320: ## 27 + -4145699906923221319..-3684784858220557704: ## 22 + -3684784858220557703..-3223869809517894088: ## 29 + -3223869809517894087..-2762954760815230472: ## 22 + -2762954760815230471..-2302039712112566856: ## 20 + -2302039712112566855..-1841124663409903240: ## 22 + -1841124663409903239..-1380209614707239624: ## 26 + -1380209614707239623.. -919294566004576008: ## 27 + -919294566004576007.. -458379517301912392: ## 24 + -458379517301912391.. 2535531400751224: ####################################################### 547 + 2535531400751225.. 463450580103414840: ## 25 + 463450580103414841.. 924365628806078456: ## 25 + 924365628806078457.. 1385280677508742072: ## 22 + 1385280677508742073.. 1846195726211405688: ### 30 + 1846195726211405689.. 2307110774914069304: ## 27 + 2307110774914069305.. 2768025823616732920: # 16 + 2768025823616732921.. 3228940872319396536: ## 23 + 3228940872319396537.. 3689855921022060152: # 19 + 3689855921022060153.. 4150770969724723768: # 18 + 4150770969724723769.. 4611686018427387384: ## 28 + 4611686018427387385.. 4611686018427387903: 1 +================================================================================ +success (ran 1 tests) diff --git a/test/core/dune b/test/core/dune index a60f71ae..e38f2ed7 100644 --- a/test/core/dune +++ b/test/core/dune @@ -1,7 +1,12 @@ (* -*- tuareg -*- *) -let dune = Printf.sprintf {| +let suffix = + try + let major_version = List.hd (String.split_on_char '.' Sys.ocaml_version) in + if int_of_string major_version < 5 then string_of_int Sys.word_size else "ocaml5" + with _ -> failwith ("Unknown OCaml version format: " ^ Sys.ocaml_version) +let dune = Printf.sprintf {| (library (name QCheck_tests) (modules QCheck_tests) @@ -26,7 +31,7 @@ let dune = Printf.sprintf {| (rule (alias runtest) (package qcheck-core) - (action (diff QCheck_expect_test.expected.%i QCheck_expect_test.out))) + (action (diff QCheck_expect_test.expected.%s QCheck_expect_test.out))) (executable (name QCheck2_expect_test) @@ -42,7 +47,7 @@ let dune = Printf.sprintf {| (rule (alias runtest) (package qcheck-core) - (action (diff QCheck2_expect_test.expected.%i QCheck2_expect_test.out))) + (action (diff QCheck2_expect_test.expected.%s QCheck2_expect_test.out))) (tests (names QCheck_unit_tests QCheck2_unit_tests) @@ -55,6 +60,6 @@ let dune = Printf.sprintf {| (modules shrink_benchmark) (libraries qcheck-core qcheck-core.runner QCheck_tests QCheck2_tests)) -|} Sys.word_size Sys.word_size +|} suffix suffix let () = Jbuild_plugin.V1.send dune From 59e68a029977570ab4e6b66a8d60a3b1de9ebb74 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 2 Nov 2022 11:45:40 +0100 Subject: [PATCH 094/391] update test/core/QCheck2_unit_tests to OCaml5 PRNG --- test/core/QCheck2_unit_tests.ml | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/test/core/QCheck2_unit_tests.ml b/test/core/QCheck2_unit_tests.ml index 773e130a..0f105236 100644 --- a/test/core/QCheck2_unit_tests.ml +++ b/test/core/QCheck2_unit_tests.ml @@ -12,6 +12,11 @@ let repeated_failure t = | Seq.Nil -> [] | Seq.Cons (t,ts) -> Tree.root t :: (Seq.map Tree.root ts |> List.of_seq) +let ocaml_major_version = + try + let major_version_str = List.hd (String.split_on_char '.' Sys.ocaml_version) in + int_of_string major_version_str + with _ -> failwith ("Unknown OCaml version format: " ^ Sys.ocaml_version) module Shrink = struct let test_int_towards () = @@ -74,55 +79,55 @@ module Shrink = struct Alcotest.(check' (list char)) ~msg:"'k' on repeated failure" ~actual:(Gen.(generate_tree ~rand:(rand_init 1234) char) |> repeated_failure) - ~expected:['k'; 'a'; 'f'; 'h'; 'i'; 'j']; + ~expected:(if ocaml_major_version < 5 then ['k'; 'a'; 'f'; 'h'; 'i'; 'j'] else ['>'; 'a'; 'P'; 'G'; 'C'; 'A'; '@'; '?']); Alcotest.(check' (list char)) ~msg:"'1' on repeated failure" ~actual:(Gen.(generate_tree ~rand:(rand_init 3345) char) |> repeated_failure) - ~expected:['1'; 'a'; 'I'; '='; '7'; '4'; '2']; + ~expected:(if ocaml_major_version < 5 then ['1'; 'a'; 'I'; '='; '7'; '4'; '2'] else ['O'; 'a'; 'X'; 'S'; 'Q'; 'P']); Alcotest.(check' (list char)) ~msg:"'k' on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 1234) char) |> repeated_success) - ~expected:['k'; 'a';]; + ~expected:(if ocaml_major_version < 5 then ['k'; 'a';] else ['>'; 'a']); Alcotest.(check' (list char)) ~msg:"'1' on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3345) char) |> repeated_success) - ~expected:['1'; 'a';] + ~expected:(if ocaml_major_version < 5 then ['1'; 'a';] else ['O'; 'a']) let test_char_numeral () = Alcotest.(check' (list char)) ~msg:"'3' on repeated failure" ~actual:(Gen.(generate_tree ~rand:(rand_init 1234) numeral) |> repeated_failure) - ~expected:['3'; '0'; '1'; '2']; + ~expected:(if ocaml_major_version < 5 then ['3'; '0'; '1'; '2'] else ['0']); Alcotest.(check' (list char)) ~msg:"'0' on repeated failure" ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) numeral) |> repeated_failure) - ~expected:['0']; + ~expected:(if ocaml_major_version < 5 then ['0'] else ['9'; '0'; '4'; '6'; '7'; '8']); Alcotest.(check' (list char)) ~msg:"'3' on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 1234) numeral) |> repeated_success) - ~expected:['3'; '0';]; + ~expected:(if ocaml_major_version < 5 then ['3'; '0'] else ['0']); Alcotest.(check' (list char)) ~msg:"'0' on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) numeral) |> repeated_success) - ~expected:['0';] + ~expected:(if ocaml_major_version < 5 then ['0'] else ['9'; '0']) let test_char_printable () = Alcotest.(check' (list char)) ~msg:"'l' on repeated failure" ~actual:(Gen.(generate_tree ~rand:(rand_init 1234) printable) |> repeated_failure) - ~expected:['l'; 'a'; 'f'; 'i'; 'j'; 'k']; + ~expected:(if ocaml_major_version < 5 then ['l'; 'a'; 'f'; 'i'; 'j'; 'k'] else ['D'; 'a'; '%'; '5'; '='; 'A'; 'C']); Alcotest.(check' (list char)) ~msg:"'8' on repeated failure" ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) printable) |> repeated_failure) - ~expected:['8'; 'a'; 'z'; ','; '2'; '5'; '7']; + ~expected:(if ocaml_major_version < 5 then ['8'; 'a'; 'z'; ','; '2'; '5'; '7'] else ['#'; 'a'; 'o'; 'v'; 'z'; '!'; '"']); Alcotest.(check' (list char)) ~msg:"'l' on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 1234) printable) |> repeated_success) - ~expected:['l'; 'a';]; + ~expected:(if ocaml_major_version < 5 then ['l'; 'a'] else ['D'; 'a']); Alcotest.(check' (list char)) ~msg:"'8' on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) printable) |> repeated_success) - ~expected:['8'; 'a';] + ~expected:(if ocaml_major_version < 5 then ['8'; 'a'] else ['#'; 'a']) let tests = ("Shrink", Alcotest.[ test_case "int_towards" `Quick test_int_towards; From 3c2daece999fde4fb93f3f63d1cc61bee689db4e Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 2 Nov 2022 11:55:08 +0100 Subject: [PATCH 095/391] update example/ expect tests to OCaml5 PRNG --- example/alcotest/dune | 10 +- example/alcotest/output.txt.expected.ocaml5 | 83 +++++ example/dune | 10 +- example/ounit/dune | 10 +- example/ounit/output.txt.expected.ocaml5 | 65 ++++ example/output.txt.expected.ocaml5 | 333 ++++++++++++++++++++ 6 files changed, 505 insertions(+), 6 deletions(-) create mode 100644 example/alcotest/output.txt.expected.ocaml5 create mode 100644 example/ounit/output.txt.expected.ocaml5 create mode 100644 example/output.txt.expected.ocaml5 diff --git a/example/alcotest/dune b/example/alcotest/dune index 352a7285..a9114f62 100644 --- a/example/alcotest/dune +++ b/example/alcotest/dune @@ -1,5 +1,11 @@ (* -*- tuareg -*- *) +let suffix = + try + let major_version = List.hd (String.split_on_char '.' Sys.ocaml_version) in + if int_of_string major_version < 5 then string_of_int Sys.word_size else "ocaml5" + with _ -> failwith ("Unknown OCaml version format: " ^ Sys.ocaml_version) + let dune = Printf.sprintf {| (executable @@ -23,8 +29,8 @@ let dune = Printf.sprintf {| (alias runtest) (package qcheck-alcotest) (enabled_if (= %%{os_type} "Unix")) - (action (diff output.txt.expected.%i output.txt))) + (action (diff output.txt.expected.%s output.txt))) -|} Sys.word_size +|} suffix let () = Jbuild_plugin.V1.send dune diff --git a/example/alcotest/output.txt.expected.ocaml5 b/example/alcotest/output.txt.expected.ocaml5 new file mode 100644 index 00000000..23401ac2 --- /dev/null +++ b/example/alcotest/output.txt.expected.ocaml5 @@ -0,0 +1,83 @@ +qcheck random seed: 1234 +Testing `my test'. + [OK] suite 0 list_rev_is_involutive. + [FAIL] suite 1 fail_sort_id. + [FAIL] suite 2 error_raise_exn. + [OK] suite 3 neg test pass (failing as expected). + [FAIL] suite 4 neg test unexpected success. + [FAIL] suite 5 neg fail with error. + [FAIL] suite 6 fail_check_err_message. + [OK] suite 7 tree_rev_is_involutive. + [FAIL] shrinking 0 debug_shrink. +┌──────────────────────────────────────────────────────────────────────────────┐ +│ [FAIL] suite 1 fail_sort_id. │ +└──────────────────────────────────────────────────────────────────────────────┘ +test `fail_sort_id` failed on ≥ 1 cases: [1; 0] (after 16 shrink steps) +[exception] test `fail_sort_id` failed on ≥ 1 cases: [1; 0] (after 16 shrink steps) + ────────────────────────────────────────────────────────────────────────────── +┌──────────────────────────────────────────────────────────────────────────────┐ +│ [FAIL] suite 2 error_raise_exn. │ +└──────────────────────────────────────────────────────────────────────────────┘ +test `error_raise_exn` +raised exception `Error` +on `0 (after 62 shrink steps)` +[exception] test `error_raise_exn` +raised exception `Error` +on `0 (after 62 shrink steps)` + ────────────────────────────────────────────────────────────────────────────── +┌──────────────────────────────────────────────────────────────────────────────┐ +│ [FAIL] suite 4 neg test unexpected success. │ +└──────────────────────────────────────────────────────────────────────────────┘ +negative test 'neg test unexpected success' succeeded unexpectedly +ASSERT negative test 'neg test unexpected success' succeeded unexpectedly +FAIL negative test 'neg test unexpected success' succeeded unexpectedly + ────────────────────────────────────────────────────────────────────────────── +┌──────────────────────────────────────────────────────────────────────────────┐ +│ [FAIL] suite 5 neg fail with error. │ +└──────────────────────────────────────────────────────────────────────────────┘ +test `neg fail with error` +raised exception `Error` +on `0 (after 7 shrink steps)` +[exception] test `neg fail with error` +raised exception `Error` +on `0 (after 7 shrink steps)` + ────────────────────────────────────────────────────────────────────────────── +┌──────────────────────────────────────────────────────────────────────────────┐ +│ [FAIL] suite 6 fail_check_err_message. │ +└──────────────────────────────────────────────────────────────────────────────┘ +test `fail_check_err_message` failed on ≥ 1 cases: +0 (after 7 shrink steps) +this +will +always +fail +[exception] test `fail_check_err_message` failed on ≥ 1 cases: +0 (after 7 shrink steps) +this +will +always +fail + ────────────────────────────────────────────────────────────────────────────── +┌──────────────────────────────────────────────────────────────────────────────┐ +│ [FAIL] shrinking 0 debug_shrink. │ +└──────────────────────────────────────────────────────────────────────────────┘ +~~~ Shrink ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Test debug_shrink successfully shrunk counter example (step 0) to: +(2, 3) +~~~ Shrink ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Test debug_shrink successfully shrunk counter example (step 1) to: +(1, 3) +~~~ Shrink ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Test debug_shrink successfully shrunk counter example (step 2) to: +(0, 3) +~~~ Shrink ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Test debug_shrink successfully shrunk counter example (step 3) to: +(0, 2) +~~~ Shrink ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Test debug_shrink successfully shrunk counter example (step 4) to: +(0, 1) +law debug_shrink: 1 relevant cases (1 total) +test `debug_shrink` failed on ≥ 1 cases: (0, 1) (after 4 shrink steps) +[exception] test `debug_shrink` failed on ≥ 1 cases: (0, 1) (after 4 shrink steps) + ────────────────────────────────────────────────────────────────────────────── +6 failures! 9 tests run. diff --git a/example/dune b/example/dune index 66c5c28d..cb411f49 100644 --- a/example/dune +++ b/example/dune @@ -1,5 +1,11 @@ (* -*- tuareg -*- *) +let suffix = + try + let major_version = List.hd (String.split_on_char '.' Sys.ocaml_version) in + if int_of_string major_version < 5 then string_of_int Sys.word_size else "ocaml5" + with _ -> failwith ("Unknown OCaml version format: " ^ Sys.ocaml_version) + let dune = Printf.sprintf {| (executables @@ -21,8 +27,8 @@ let dune = Printf.sprintf {| (alias runtest) (enabled_if (= %%{os_type} "Unix")) (package qcheck) - (action (diff output.txt.expected.%i output.txt))) + (action (diff output.txt.expected.%s output.txt))) -|} Sys.word_size +|} suffix let () = Jbuild_plugin.V1.send dune diff --git a/example/ounit/dune b/example/ounit/dune index bed0bfc6..fae1b11a 100644 --- a/example/ounit/dune +++ b/example/ounit/dune @@ -1,5 +1,11 @@ (* -*- tuareg -*- *) +let suffix = + try + let major_version = List.hd (String.split_on_char '.' Sys.ocaml_version) in + if int_of_string major_version < 5 then string_of_int Sys.word_size else "ocaml5" + with _ -> failwith ("Unknown OCaml version format: " ^ Sys.ocaml_version) + let dune = Printf.sprintf {| (executables @@ -21,8 +27,8 @@ let dune = Printf.sprintf {| (alias runtest) (package qcheck-ounit) (enabled_if (= %%{os_type} "Unix")) - (action (diff output.txt.expected.%i output.txt))) + (action (diff output.txt.expected.%s output.txt))) -|} Sys.word_size +|} suffix let () = Jbuild_plugin.V1.send dune diff --git a/example/ounit/output.txt.expected.ocaml5 b/example/ounit/output.txt.expected.ocaml5 new file mode 100644 index 00000000..2294b902 --- /dev/null +++ b/example/ounit/output.txt.expected.ocaml5 @@ -0,0 +1,65 @@ +.FE.FEF. +============================================================================== +Error: tests:5:neg fail with error. + +Error: tests:5:neg fail with error (in the log). + + +test `neg fail with error` +raised exception `Dune__exe__QCheck_ounit_test.Error` +on `0 (after 7 shrink steps)` + +------------------------------------------------------------------------------ +============================================================================== +Error: tests:2:error_raise_exn. + +Error: tests:2:error_raise_exn (in the log). + + +test `error_raise_exn` raised exception `Dune__exe__QCheck_ounit_test.Error` +on `0 (after 62 shrink steps)` + +------------------------------------------------------------------------------ +============================================================================== +Error: tests:6:fail_check_err_message. + +Error: tests:6:fail_check_err_message (in the log). + +Error: tests:6:fail_check_err_message (in the code). + + +test `fail_check_err_message` failed on ≥ 1 cases: +0 (after 7 shrink steps) +this +will +always +fail + + + +------------------------------------------------------------------------------ +============================================================================== +Error: tests:4:neg test unexpected success. + +Error: tests:4:neg test unexpected success (in the log). + +Error: tests:4:neg test unexpected success (in the code). + + +negative test 'neg test unexpected success' succeeded unexpectedly + +------------------------------------------------------------------------------ +============================================================================== +Error: tests:1:fail_sort_id. + +Error: tests:1:fail_sort_id (in the log). + +Error: tests:1:fail_sort_id (in the code). + + +test `fail_sort_id` failed on ≥ 1 cases: [1; 0] (after 16 shrink steps) + + +------------------------------------------------------------------------------ +Ran: 8 tests in: <nondet> seconds. +FAILED: Cases: 8 Tried: 8 Errors: 2 Failures: 3 Skip: 0 Todo: 0 Timeouts: 0. diff --git a/example/output.txt.expected.ocaml5 b/example/output.txt.expected.ocaml5 new file mode 100644 index 00000000..6e700e68 --- /dev/null +++ b/example/output.txt.expected.ocaml5 @@ -0,0 +1,333 @@ +random seed: 1234 + +--- Failure -------------------------------------------------------------------- + +Test should_fail_sort_id failed (10 shrink steps): + +[1; 0] + +=== Error ====================================================================== + +Test should_error_raise_exn errored on (62 shrink steps): + +0 + +exception Dune__exe__QCheck_runner_test.Error + + ++++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Collect results for test collect_results: + +4: 24 cases +3: 20 cases +2: 18 cases +1: 21 cases +0: 17 cases + ++++ Stats for with_stats ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats mod4: + num: 100, avg: 1.56, stddev: 1.18, median 2, min 0, max 3 + 0: ################################################# 27 + 1: #################################### 20 + 2: ########################################## 23 + 3: ####################################################### 30 + +stats num: + num: 100, avg: 62.24, stddev: 33.15, median 62, min 2, max 120 + 2.. 7: ######### 2 + 8.. 13: ################################ 7 + 14.. 19: ########################### 6 + 20.. 25: ############# 3 + 26.. 31: ###################### 5 + 32.. 37: ################## 4 + 38.. 43: ############# 3 + 44.. 49: ################################ 7 + 50.. 55: ################################ 7 + 56.. 61: ###################### 5 + 62.. 67: #################################### 8 + 68.. 73: ######### 2 + 74.. 79: ###################### 5 + 80.. 85: ######### 2 + 86.. 91: ####################################################### 12 + 92.. 97: ###################### 5 + 98..103: ################## 4 + 104..109: ################## 4 + 110..115: ############# 3 + 116..121: ########################### 6 + +--- Failure -------------------------------------------------------------------- + +Test neg test unexpected success failed: + +Negative test neg test unexpected success succeeded but was expected to fail + +=== Error ====================================================================== + +Test neg fail with error errored on (7 shrink steps): + +0 + +exception Dune__exe__QCheck_runner_test.Error + + +--- Failure -------------------------------------------------------------------- + +Test FAIL_pred_map_commute failed (79 shrink steps): + +([11], {_ -> 0}, {11 -> false; _ -> true}) + +--- Failure -------------------------------------------------------------------- + +Test FAIL_fun2_pred_strings failed (1 shrink steps): + +{some other string -> false; _ -> true} + +--- Failure -------------------------------------------------------------------- + +Test fold_left fold_right failed (21 shrink steps): + +(0, [1], {(0, 1) -> 1; _ -> 0}) + ++++ Messages ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Messages for test fold_left fold_right: + +l=[1], fold_left=0, fold_right=1 + + +--- Failure -------------------------------------------------------------------- + +Test fold_left fold_right uncurried failed (41 shrink steps): + +({(0, 4) -> 1; _ -> 0}, 0, [4]) + +--- Failure -------------------------------------------------------------------- + +Test long_shrink failed (149 shrink steps): + +([0], [1]) + +--- Failure -------------------------------------------------------------------- + +Test mod3_should_fail failed (75 shrink steps): + +4161 + ++++ Stats for stats_neg ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 5000, avg: 0.43, stddev: 28.63, median 0, min -99, max 99 + -99..-90: # 45 + -89..-80: # 57 + -79..-70: # 68 + -69..-60: # 58 + -59..-50: # 76 + -49..-40: # 67 + -39..-30: # 52 + -29..-20: # 54 + -19..-10: # 47 + -9.. 0: ####################################################### 2205 + 1.. 10: ########################################## 1697 + 11.. 20: # 57 + 21.. 30: # 70 + 31.. 40: # 60 + 41.. 50: # 66 + 51.. 60: # 75 + 61.. 70: # 68 + 71.. 80: # 63 + 81.. 90: # 66 + 91..100: # 49 + +!!! Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +Warning for test WARN_unlikely_precond: + +WARNING: only 0.8% tests (of 2000) passed precondition for "WARN_unlikely_precond" + +NOTE: it is likely that the precondition is too strong, or that the generator is buggy. + +--- Failure -------------------------------------------------------------------- + +Test FAIL_unlikely_precond failed: + +ERROR: only 0.8% tests (of 2000) passed precondition for "FAIL_unlikely_precond" + +NOTE: it is likely that the precondition is too strong, or that the generator is buggy. + + +--- Failure -------------------------------------------------------------------- + +Test FAIL_#99_1 failed: + +ERROR: uncaught exception in generator for test FAIL_#99_1 after 100 steps: +Exception: QCheck.No_example_found("<example>") +Backtrace: + ++++ Stats for stat_display_test_1 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 0.86, stddev: 29.11, median 0, min -97, max 99 + -97..-88: # 12 + -87..-78: # 12 + -77..-68: # 13 + -67..-58: # 12 + -57..-48: # 9 + -47..-38: ## 17 + -37..-28: # 13 + -27..-18: # 8 + -17.. -8: ######### 76 + -7.. 2: ####################################################### 437 + 3.. 12: ################################## 276 + 13.. 22: ## 16 + 23.. 32: # 11 + 33.. 42: ## 16 + 43.. 52: # 9 + 53.. 62: # 12 + 63.. 72: # 14 + 73.. 82: # 12 + 83.. 92: # 13 + 93..102: # 12 + ++++ Stats for stat_display_test_2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 15.86, stddev: 24.57, median 6, min 0, max 99 + 0.. 4: ###################################################### 387 + 5.. 9: ####################################################### 390 + 10.. 14: # 11 + 15.. 19: # 8 + 20.. 24: # 11 + 25.. 29: ## 15 + 30.. 34: # 9 + 35.. 39: # 11 + 40.. 44: # 11 + 45.. 49: ## 19 + 50.. 54: # 10 + 55.. 59: ## 19 + 60.. 64: # 9 + 65.. 69: # 9 + 70.. 74: ## 19 + 75.. 79: # 13 + 80.. 84: # 11 + 85.. 89: ## 16 + 90.. 94: # 9 + 95.. 99: # 13 + ++++ Stats for stat_display_test_3 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 193479.13, stddev: 136696.70, median 189823, min -43164, max 434961 + -43164..-19258: ################################### 42 + -19257.. 4649: ############################################## 56 + 4650.. 28556: ############################################# 55 + 28557.. 52463: ############################################### 57 + 52464.. 76370: ######################################### 50 + 76371..100277: ############################# 35 + 100278..124184: ############################################### 57 + 124185..148091: #################################### 44 + 148092..171998: ############################################## 56 + 171999..195905: ####################################################### 66 + 195906..219812: ########################################### 52 + 219813..243719: ######################################## 49 + 243720..267626: ################################ 39 + 267627..291533: ##################################### 45 + 291534..315440: ##################################### 45 + 315441..339347: ################################################# 59 + 339348..363254: ################################################## 60 + 363255..387161: ################################# 40 + 387162..411068: ########################################## 51 + 411069..434975: ################################### 42 + ++++ Stats for stat_display_test_4 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: -591.06, stddev: 23026.79, median -911, min -39911, max 39959 + -39911..-35918: ####################################### 45 + -35917..-31924: #################################################### 59 + -31923..-27930: ########################################### 49 + -27929..-23936: ########################################## 48 + -23935..-19942: ####################################################### 62 + -19941..-15948: ############################################# 51 + -15947..-11954: ######################################### 47 + -11953.. -7960: ################################################# 56 + -7959.. -3966: ################################### 40 + -3965.. 28: ################################################### 58 + 29.. 4022: ########################################### 49 + 4023.. 8016: ############################################### 53 + 8017.. 12010: ############################################ 50 + 12011.. 16004: ################################### 40 + 16005.. 19998: ####################################### 44 + 19999.. 23992: ####################################################### 62 + 23993.. 27986: ##################################### 42 + 27987.. 31980: ######################################### 47 + 31981.. 35974: ########################################## 48 + 35975.. 39968: ############################################ 50 + ++++ Stats for stat_display_test_5 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: -0.12, stddev: 2.52, median 0, min -4, max 4 + -4: ########################################## 116 + -3: ###################################### 103 + -2: ############################################## 125 + -1: ########################################## 115 + 0: ####################################### 106 + 1: ####################################################### 149 + 2: ################################# 92 + 3: ################################# 92 + 4: ##################################### 102 + ++++ Stats for stat_display_test_6 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 6.42, stddev: 6.43, median 6, min -4, max 17 + -4..-3: ########################################### 89 + -2..-1: ################################################# 101 + 0.. 1: ############################################## 95 + 2.. 3: ########################################### 89 + 4.. 5: ############################################## 95 + 6.. 7: ##################################### 78 + 8.. 9: ####################################### 81 + 10..11: ######################################## 84 + 12..13: ####################################################### 113 + 14..15: ######################################## 84 + 16..17: ############################################ 91 + 18..19: 0 + 20..21: 0 + 22..23: 0 + 24..25: 0 + 26..27: 0 + 28..29: 0 + 30..31: 0 + 32..33: 0 + 34..35: 0 + ++++ Stats for stat_display_test_7 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 100000, avg: -7215552342607541.00, stddev: 2666234426234218496.00, median -16620417636667326, min -4611371852367564818, max 4611613630315464842 + -4611371852367564818..-4150222578233413331: ##################################################### 5003 + -4150222578233413330..-3689073304099261843: ####################################################### 5106 + -3689073304099261842..-3227924029965110355: ###################################################### 5052 + -3227924029965110354..-2766774755830958867: ###################################################### 5017 + -2766774755830958866..-2305625481696807379: #################################################### 4852 + -2305625481696807378..-1844476207562655891: ###################################################### 5016 + -1844476207562655890..-1383326933428504403: ###################################################### 5083 + -1383326933428504402.. -922177659294352915: ##################################################### 4986 + -922177659294352914.. -461028385160201427: ###################################################### 5042 + -461028385160201426.. 120888973950061: ###################################################### 5017 + 120888973950062.. 461270163108101549: ##################################################### 4977 + 461270163108101550.. 922419437242253037: ##################################################### 5000 + 922419437242253038.. 1383568711376404525: ###################################################### 5022 + 1383568711376404526.. 1844717985510556013: #################################################### 4896 + 1844717985510556014.. 2305867259644707501: #################################################### 4884 + 2305867259644707502.. 2767016533778858989: ##################################################### 4981 + 2767016533778858990.. 3228165807913010477: ###################################################### 5026 + 3228165807913010478.. 3689315082047161965: ###################################################### 5016 + 3689315082047161966.. 4150464356181313453: ###################################################### 5021 + 4150464356181313454.. 4611613630315464941: ##################################################### 5003 +================================================================================ +1 warning(s) +failure (10 tests failed, 2 tests errored, ran 28 tests) From 6965d154aea4e1b76400f84aa598c07e6d3bf8f5 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 2 Nov 2022 12:26:12 +0100 Subject: [PATCH 096/391] remove < 5.0 requirement for with-test --- qcheck-alcotest.opam | 1 - qcheck-core.opam | 1 - qcheck-ounit.opam | 1 - qcheck.opam | 1 - 4 files changed, 4 deletions(-) diff --git a/qcheck-alcotest.opam b/qcheck-alcotest.opam index 8f4a5767..45715e5d 100644 --- a/qcheck-alcotest.opam +++ b/qcheck-alcotest.opam @@ -25,7 +25,6 @@ depends: [ "alcotest" {>= "0.8.1"} "odoc" {with-doc} "ocaml" {>= "4.08.0"} - "ocaml" {with-test & < "5.0"} ] dev-repo: "git+https://github.com/c-cube/qcheck.git" bug-reports: "https://github.com/c-cube/qcheck/issues" diff --git a/qcheck-core.opam b/qcheck-core.opam index c8ac3c36..211211c9 100644 --- a/qcheck-core.opam +++ b/qcheck-core.opam @@ -23,7 +23,6 @@ depends: [ "alcotest" {with-test} "odoc" {with-doc} "ocaml" {>= "4.08.0"} - "ocaml" {with-test & < "5.0"} ] dev-repo: "git+https://github.com/c-cube/qcheck.git" bug-reports: "https://github.com/c-cube/qcheck/issues" diff --git a/qcheck-ounit.opam b/qcheck-ounit.opam index 771f570e..4d38176f 100644 --- a/qcheck-ounit.opam +++ b/qcheck-ounit.opam @@ -24,7 +24,6 @@ depends: [ "ounit2" "odoc" {with-doc} "ocaml" {>= "4.08.0"} - "ocaml" {with-test & < "5.0"} ] dev-repo: "git+https://github.com/c-cube/qcheck.git" bug-reports: "https://github.com/c-cube/qcheck/issues" diff --git a/qcheck.opam b/qcheck.opam index 790e5d4e..73550ec8 100644 --- a/qcheck.opam +++ b/qcheck.opam @@ -25,7 +25,6 @@ depends: [ "alcotest" {with-test} "odoc" {with-doc} "ocaml" {>= "4.08.0"} - "ocaml" {with-test & < "5.0"} ] dev-repo: "git+https://github.com/c-cube/qcheck.git" bug-reports: "https://github.com/c-cube/qcheck/issues" From d654be93903015986683eabd4ccf4035b20aae9e Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 2 Nov 2022 11:45:11 +0000 Subject: [PATCH 097/391] Update expected 32bit output for test_gen_no_shrink --- test/core/QCheck2_expect_test.expected.32 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/core/QCheck2_expect_test.expected.32 b/test/core/QCheck2_expect_test.expected.32 index 4762e562..90509c0e 100644 --- a/test/core/QCheck2_expect_test.expected.32 +++ b/test/core/QCheck2_expect_test.expected.32 @@ -504,6 +504,12 @@ Leaf 0 --- Failure -------------------------------------------------------------------- +Test sum list = 0 failed (0 shrink steps): + +[7; 1; 42; 1; 8; 5; 3; 9; 5; 38; 3; 3; 0; 1; 98; 1; 4; 13; 9; 2; 6; 9; 47; 6; 5; 8; 8; 6; 0; 9; 7; 2; 8; 6; 62; 6; 4; 31; 19; 1; 41; 60; 6; 5; 8; 1; 1; 4; 7; 7; 0; 5; 5; 71; 14; 26; 47; 5; 1; 6; 34; 9; 4; 2; 37; 3; 8; 4; 31; 6; 2; 1; 0; 7; 5; 1; 0; 15; 6; 1; 8; 13; 0; 6; 2; 4; 2; 6; 6; 1; 4; 1; 9; 79; 0; 87; 6; 8; 8; 62; 1; 4; 62; 6; 31; 1; 5; 6; 5; 9; 3; 3; 1; 79; 4; 3; 2; 67; 5; 7; 12; 70; 8; 8; 6; 1; 3; 14; 15; 1; 61; 4; 1; 4; 1; 7; 4; 4; 4; 2; 8; 8; 7; 5; 4; 27; 0; 9; 80; 25; 1; 8; 1; 3; 7; 4; 3; 5; 5; 6; 5; 5; 31; 7; 0; 3; 3; 6; 71; 76; 28; 60; 6; 2; 6; 3; 0; 4; 1; 0; 5; 7; 0; 28; 86; 4; 7; 51; 36; 0; 5; 0; 1; 4; 3; 6; 0; 1; 1; 8; 18; 4; 2; 8; 8; 1; 4; 7; 1; 0; 93; 5; 3; 0; 80; 1; 7; 7; 8; 8; 5; 7; 8; 9; 24; 4; 25; 8; 8; 5; 4; 90; 4; 6; 8; 4; 4; 0; 60; 8; 9; 7; 44; 5; 1; 2; 9; 74; 7; 7] + +--- Failure -------------------------------------------------------------------- + Test fail_pred_map_commute failed (37 shrink steps): ([1], {_ -> 0}, {0 -> false; 1 -> true; -489114431 -> false; -334037599 -> false; -1002044798 -> false; 3 -> false; 607479396 -> false; 4 -> false; 5 -> false; 442140485 -> false; 50542662 -> false; 38 -> false; 281414086 -> false; 757535206 -> false; 6 -> false; 7 -> false; 8 -> false; 629085609 -> false; 10 -> false; -765856245 -> false; 44 -> false; 12 -> false; -386873971 -> false; 15 -> false; 47 -> false; -842421617 -> false; 588710735 -> false; 49 -> false; 18 -> false; 51 -> false; 449695123 -> false; 20 -> false; 21 -> false; -386709771 -> false; -92591850 -> false; 136918038 -> false; 54 -> false; -484444937 -> false; -1042148456 -> false; 24 -> false; 1062551480 -> false; 747852089 -> false; 25 -> false; -737785766 -> false; 58 -> false; -530708612 -> false; -60654788 -> false; 28 -> false; 60 -> false; 29 -> false; 947455871 -> false; _ -> false}) @@ -1256,7 +1262,7 @@ stats dist: 966367653.. 1073741823: ################# 189 ================================================================================ 1 warning(s) -failure (59 tests failed, 3 tests errored, ran 130 tests) +failure (60 tests failed, 3 tests errored, ran 131 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ From abf86cd21d99b7ea150bb883a41498ad785ccd81 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 2 Nov 2022 16:42:59 +0100 Subject: [PATCH 098/391] consistent QCheck.Gen.{bytes,string}_small{,_of} combinators --- src/core/QCheck.ml | 5 ++++- src/core/QCheck.mli | 17 ++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index 9787e3b8..7b7d93e7 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -383,10 +383,13 @@ module Gen = struct let bytes_printable = bytes_size ~gen:printable nat let string_printable = string_size ~gen:printable nat let string_readable = string_printable - let bytes_small ?gen st = bytes_size ?gen small_nat st + let bytes_small st = bytes_size small_nat st + let bytes_small_of gen st = bytes_size ~gen small_nat st let small_string ?gen st = string_size ?gen small_nat st let small_list gen = list_size small_nat gen let small_array gen = array_size small_nat gen + let string_small st = string_size small_nat st + let string_small_of gen st = string_size ~gen small_nat st let join g st = (g st) st diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 9b61b9e9..41b83d9a 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -417,9 +417,12 @@ module Gen : sig (** Generator using the {!printable} character generator. @since NEXT_RELEASE *) - val bytes_small : ?gen:char t -> bytes t - (** Builds a bytes generator, length is {!small_nat} - Accepts an optional character generator (the default is {!char}). + val bytes_small : bytes t + (** Builds a bytes generator using the {!char} character generator, length is {!small_nat} + @since NEXT_RELEASE *) + + val bytes_small_of : char t -> bytes t + (** Builds a bytes generator using the given character generator, length is {!small_nat}. @since NEXT_RELEASE *) val string_size : ?gen:char t -> int t -> string t @@ -450,6 +453,14 @@ module Gen : sig (** Builds a string generator, length is {!small_nat} Accepts an optional character generator (the default is {!char}). *) + val string_small : string t + (** Builds a string generator using the {!char} character generator, length is {!small_nat} + @since NEXT_RELEASE *) + + val string_small_of : char t -> string t + (** Builds a string generator using the given character generator, length is {!small_nat}. + @since NEXT_RELEASE *) + val small_list : 'a t -> 'a list t (** Generates lists of small size (see {!small_nat}). @since 0.5.3 *) From fb1ea0ef0818b5ba3d53461f0dd6513af6d58aa1 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 2 Nov 2022 17:04:57 +0100 Subject: [PATCH 099/391] consistent QCheck.{bytes,string}_of combinators --- src/core/QCheck.ml | 9 +++++---- src/core/QCheck.mli | 6 +++++- test/core/QCheck_tests.ml | 4 ++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index 7b7d93e7..13e41a14 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -1130,11 +1130,11 @@ let numeral_char = let bytes_gen_of_size size gen = make ~shrink:Shrink.bytes ~small:Bytes.length ~print:(Print.bytes) (Gen.bytes_size ~gen size) -let bytes_gen gen = +let bytes_of gen = make ~shrink:Shrink.bytes ~small:Bytes.length ~print:(Print.bytes) (Gen.bytes ~gen) -let bytes = bytes_gen Gen.char +let bytes = bytes_of Gen.char let bytes_of_size size = bytes_gen_of_size size Gen.char let bytes_small = bytes_gen_of_size Gen.small_nat Gen.char let bytes_printable = @@ -1144,14 +1144,15 @@ let bytes_printable = let string_gen_of_size size gen = make ~shrink:Shrink.string ~small:String.length ~print:(sprintf "%S") (Gen.string_size ~gen size) -let string_gen gen = +let string_of gen = make ~shrink:Shrink.string ~small:String.length ~print:(sprintf "%S") (Gen.string ~gen) -let string = string_gen Gen.char +let string = string_of Gen.char let string_of_size size = string_gen_of_size size Gen.char let string_small = string_gen_of_size Gen.small_nat Gen.char let small_string = string_small +let string_gen = string_of let printable_string = make ~shrink:(Shrink.string ~shrink:Shrink.char_printable) ~small:String.length diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 41b83d9a..5d824479 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -1287,7 +1287,7 @@ val bytes_gen_of_size : int Gen.t -> char Gen.t -> bytes arbitrary (** Builds a bytes generator from a (non-negative) size generator and a character generator. @since NEXT_RELEASE *) -val bytes_gen : char Gen.t -> bytes arbitrary +val bytes_of : char Gen.t -> bytes arbitrary (** Generates bytes with a distribution of length of {!Gen.nat}. @since NEXT_RELEASE *) @@ -1315,6 +1315,10 @@ val string_gen_of_size : int Gen.t -> char Gen.t -> string arbitrary val string_gen : char Gen.t -> string arbitrary (** Generates strings with a distribution of length of {!Gen.nat}. *) +val string_of : char Gen.t -> string arbitrary +(** Synonym to {!string_gen} added for convenience. + @since NEXT_RELEASE *) + val string : string arbitrary (** Generates strings with a distribution of length of {!Gen.nat} and distribution of characters of [char]. *) diff --git a/test/core/QCheck_tests.ml b/test/core/QCheck_tests.ml index c27fadee..7d22045b 100644 --- a/test/core/QCheck_tests.ml +++ b/test/core/QCheck_tests.ml @@ -881,7 +881,7 @@ module Stats = struct [ Test.make ~name:"bytes_size len dist" ~count:5_000 (add_stat len (bytes_of_size (Gen.int_range 5 10))) (fun _ -> true); Test.make ~name:"bytes len dist" ~count:5_000 (add_stat len bytes) (fun _ -> true); - Test.make ~name:"bytes_of len dist" ~count:5_000 (add_stat len (bytes_gen (Gen.return 'a'))) (fun _ -> true); + Test.make ~name:"bytes_of len dist" ~count:5_000 (add_stat len (bytes_of (Gen.return 'a'))) (fun _ -> true); Test.make ~name:"bytes_small len dist" ~count:5_000 (add_stat len bytes_small) (fun _ -> true); ] @@ -890,7 +890,7 @@ module Stats = struct [ Test.make ~name:"string_size len dist" ~count:5_000 (add_stat len (string_of_size (Gen.int_range 5 10))) (fun _ -> true); Test.make ~name:"string len dist" ~count:5_000 (add_stat len string) (fun _ -> true); - Test.make ~name:"string_of len dist" ~count:5_000 (add_stat len (string_gen (Gen.return 'a'))) (fun _ -> true); + Test.make ~name:"string_of len dist" ~count:5_000 (add_stat len (string_of (Gen.return 'a'))) (fun _ -> true); Test.make ~name:"printable_string len dist" ~count:5_000 (add_stat len printable_string) (fun _ -> true); Test.make ~name:"small_string len dist" ~count:5_000 (add_stat len small_string) (fun _ -> true); ] From d1cb85e8fecd7fc2bed42631a06fdf7bbdde5feb Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 2 Nov 2022 17:26:12 +0100 Subject: [PATCH 100/391] add consistent QCheck2.Gen.small_{bytes,string}{,_of} combinators --- src/core/QCheck2.ml | 11 ++++++++--- src/core/QCheck2.mli | 20 +++++++++++++++++--- test/core/QCheck2_tests.ml | 2 +- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index 58929c0a..2ab713db 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -704,7 +704,9 @@ module Gen = struct let bytes_printable = bytes_size ~gen:printable nat - let bytes_small ~gen st = bytes_size ~gen small_nat st + let bytes_small st = bytes_size small_nat st + + let bytes_small_of gen st = bytes_size ~gen small_nat st let string : string t = string_size nat @@ -712,8 +714,11 @@ module Gen = struct let string_printable = string_size ~gen:printable nat - let string_small ~gen st = string_size ~gen small_nat st - let small_string ~gen = string_small ~gen + let string_small st = string_size small_nat st + + let string_small_of gen st = string_size ~gen small_nat st + + let small_string ~gen = string_small_of gen let small_list gen = list_size small_nat gen diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index ea21a496..d73c68c8 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -321,13 +321,19 @@ module Gen : sig @since NEXT_RELEASE *) - val bytes_small : gen:char t -> bytes t - (** Builds a bytes generator using the given character generator, length is {!small_nat}. + val bytes_small : bytes t + (** Builds a bytes generator using the {!char} character generator, length is {!small_nat}. Shrinks on the number of characters first, then on the characters. @since NEXT_RELEASE *) + val bytes_small_of : char t -> bytes t + (** Builds a bytes generator using the given character generator, length is {!small_nat}. + + Shrinks on the number of characters first, then on the characters. + + @since NEXT_RELEASE *) val string_size : ?gen:char t -> int t -> string t (** Builds a string generator from a (non-negative) size generator. @@ -359,7 +365,15 @@ module Gen : sig @since 0.11 *) - val string_small : gen:char t -> string t + val string_small : string t + (** Builds a string generator using the {!char} characher generator, length is {!small_nat}. + + Shrinks on the number of characters first, then on the characters. + + @since NEXT_RELEASE + *) + + val string_small_of : char t -> string t (** Builds a string generator using the given characher generator, length is {!small_nat}. Shrinks on the number of characters first, then on the characters. diff --git a/test/core/QCheck2_tests.ml b/test/core/QCheck2_tests.ml index 4b51b63b..87b843ce 100644 --- a/test/core/QCheck2_tests.ml +++ b/test/core/QCheck2_tests.ml @@ -818,7 +818,7 @@ module Stats = struct Test.make ~name:"bytes len dist" ~count:5_000 ~stats:[len] Gen.bytes (fun _ -> true); Test.make ~name:"bytes_of len dist" ~count:5_000 ~stats:[len] Gen.(bytes_of (return 'a')) (fun _ -> true); Test.make ~name:"bytes_printable len dist" ~count:5_000 ~stats:[len] Gen.bytes_printable (fun _ -> true); - Test.make ~name:"bytes_small len dist" ~count:5_000 ~stats:[len] Gen.(bytes_small ~gen:char) (fun _ -> true); + Test.make ~name:"bytes_small len dist" ~count:5_000 ~stats:[len] Gen.(bytes_small_of char) (fun _ -> true); ] let string_len_tests = From c587c889763f6ed345c55fc23f8a5d5f58b7deae Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 2 Nov 2022 17:29:32 +0100 Subject: [PATCH 101/391] fix comment for QCheck2.Gen.bytes --- src/core/QCheck2.mli | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index d73c68c8..03d743d3 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -298,8 +298,7 @@ module Gen : sig @since NEXT_RELEASE *) val bytes : bytes t - (** Bytes generator. Bytes size is generated by {!nat}. - The default character generator is {!char}. + (** Bytes generator using the {!char} character generator. Bytes size is generated by {!nat}. See also {!bytes_of} and {!bytes_printable} for versions with custom char generator. From 41ceeae7aab4daed7e0132a2b1fbcdad97d9408b Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 2 Nov 2022 17:40:30 +0100 Subject: [PATCH 102/391] update CHANGELOG --- CHANGELOG.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e5efd849..31e70ae5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,12 +2,14 @@ ## 0.20 -- add `{QCheck,QCheck2}.Gen.{bytes_size,bytes,bytes_of,bytes_printable,bytes_small}` -- add `QCheck2.Gen.string_small` -- add `QCheck.{Print,Shrink,Observable}.bytes` -- add `QCheck2.{Print,Shrink}.bytes` -- add `QCheck.{bytes_gen_of_size,bytes_gen,bytes,bytes_small,bytes_of_size,bytes_printable}` -- add `QCheck.{string_small,string_printable,string_printable_of_size,string_small_printable,string_numeral,string_numeral_of_size}` +- add several new `bytes` combinators: + - `{QCheck,QCheck2}.Gen.{bytes_size,bytes,bytes_of,bytes_printable,bytes_small,bytes_small_of}` + - `QCheck.{Print,Shrink,Observable}.bytes` + - `QCheck2.{Print,Shrink}.bytes` + - `QCheck.{bytes_gen_of_size,bytes_of,bytes,bytes_small,bytes_of_size,bytes_printable}` +- add new `string` combinators and aliases: + - `{QCheck,QCheck2}.Gen.{string_small,string_small_of}` + - `QCheck.{string_small,string_of,string_printable,string_printable_of_size,string_small_printable,string_numeral,string_numeral_of_size}` - `QCheck2.small_string` character generator argument is no more optional - add an optional argument with conservative default to `Shrink.string` - fix shrinkers in `QCheck.{printable_string,printable_string_of_size,small_printable_string,numeral_string,numeral_string_of_size}` [#257](https://github.com/c-cube/qcheck/issues/257) From 37d8d8a10fd4b84e24dab55b822b882185349cf0 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 2 Nov 2022 18:03:03 +0100 Subject: [PATCH 103/391] add QCheck.{bytes,string}_small_of for consistency --- src/core/QCheck.ml | 2 ++ src/core/QCheck.mli | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index 13e41a14..aca834e8 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -1137,6 +1137,7 @@ let bytes_of gen = let bytes = bytes_of Gen.char let bytes_of_size size = bytes_gen_of_size size Gen.char let bytes_small = bytes_gen_of_size Gen.small_nat Gen.char +let bytes_small_of gen = bytes_gen_of_size Gen.small_nat gen let bytes_printable = make ~shrink:(Shrink.bytes ~shrink:Shrink.char_printable) ~small:Bytes.length ~print:(Print.bytes) (Gen.bytes ~gen:Gen.printable) @@ -1151,6 +1152,7 @@ let string_of gen = let string = string_of Gen.char let string_of_size size = string_gen_of_size size Gen.char let string_small = string_gen_of_size Gen.small_nat Gen.char +let string_small_of gen = string_gen_of_size Gen.small_nat gen let small_string = string_small let string_gen = string_of diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 5d824479..910d39b7 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -1300,6 +1300,10 @@ val bytes_small : bytes arbitrary (** Same as {!bytes} but with a small length (ie {!Gen.small_nat} ). @since NEXT_RELEASE *) +val bytes_small_of : char Gen.t -> bytes arbitrary +(** Same as {!bytes_of} but with a small length (ie {!Gen.small_nat} ). + @since NEXT_RELEASE *) + val bytes_of_size : int Gen.t -> bytes arbitrary (** Generates bytes with distribution of characters of [char]. @since NEXT_RELEASE *) @@ -1330,6 +1334,10 @@ val string_small : string arbitrary (** Synonym to [small_string] added for convenience. @since NEXT_RELEASE *) +val string_small_of : char Gen.t -> string arbitrary +(** Same as {!string_of} but with a small length (ie {!Gen.small_nat} ). + @since NEXT_RELEASE *) + val small_list : 'a arbitrary -> 'a list arbitrary (** Generates lists of small size (see {!Gen.small_nat}). @since 0.5.3 *) From a14a7678dcbe87745167cbbcb594e48e02b2ec8d Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 2 Nov 2022 18:03:25 +0100 Subject: [PATCH 104/391] update CHANGELOG --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31e70ae5..c798cf16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,10 +6,10 @@ - `{QCheck,QCheck2}.Gen.{bytes_size,bytes,bytes_of,bytes_printable,bytes_small,bytes_small_of}` - `QCheck.{Print,Shrink,Observable}.bytes` - `QCheck2.{Print,Shrink}.bytes` - - `QCheck.{bytes_gen_of_size,bytes_of,bytes,bytes_small,bytes_of_size,bytes_printable}` + - `QCheck.{bytes_gen_of_size,bytes_of,bytes,bytes_small,bytes_small_of,bytes_of_size,bytes_printable}` - add new `string` combinators and aliases: - `{QCheck,QCheck2}.Gen.{string_small,string_small_of}` - - `QCheck.{string_small,string_of,string_printable,string_printable_of_size,string_small_printable,string_numeral,string_numeral_of_size}` + - `QCheck.{string_small,string_small_of,string_of,string_printable,string_printable_of_size,string_small_printable,string_numeral,string_numeral_of_size}` - `QCheck2.small_string` character generator argument is no more optional - add an optional argument with conservative default to `Shrink.string` - fix shrinkers in `QCheck.{printable_string,printable_string_of_size,small_printable_string,numeral_string,numeral_string_of_size}` [#257](https://github.com/c-cube/qcheck/issues/257) From b32cce6fe07072512eb5e3fe30c594f116c84004 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 2 Nov 2022 17:23:36 +0000 Subject: [PATCH 105/391] update expected 32-bit output --- test/core/QCheck2_expect_test.expected.32 | 143 +++++++++++++++++++++- test/core/QCheck_expect_test.expected.32 | 112 ++++++++++++++++- 2 files changed, 253 insertions(+), 2 deletions(-) diff --git a/test/core/QCheck2_expect_test.expected.32 b/test/core/QCheck2_expect_test.expected.32 index 4762e562..597728f6 100644 --- a/test/core/QCheck2_expect_test.expected.32 +++ b/test/core/QCheck2_expect_test.expected.32 @@ -282,6 +282,30 @@ Test printable never produces less than '5 failed (1 shrink steps): --- Failure -------------------------------------------------------------------- +Test bytes are empty failed (8 shrink steps): + +a + +--- Failure -------------------------------------------------------------------- + +Test bytes never has a \000 char failed (22 shrink steps): + +aaaaaa�aaaaaaaaaaaaaaaa + +--- Failure -------------------------------------------------------------------- + +Test bytes never has a \255 char failed (59 shrink steps): + +aaaaaaaaaaaaaaaaaaaaaaaaaa�aaaaaaaaaaaaaaaaaaaaaaaa + +--- Failure -------------------------------------------------------------------- + +Test bytes have unique chars failed (18 shrink steps): + +aaaaaaaaaaaaa + +--- Failure -------------------------------------------------------------------- + Test strings are empty failed (8 shrink steps): "a" @@ -504,6 +528,12 @@ Leaf 0 --- Failure -------------------------------------------------------------------- +Test sum list = 0 failed (0 shrink steps): + +[7; 1; 42; 1; 8; 5; 3; 9; 5; 38; 3; 3; 0; 1; 98; 1; 4; 13; 9; 2; 6; 9; 47; 6; 5; 8; 8; 6; 0; 9; 7; 2; 8; 6; 62; 6; 4; 31; 19; 1; 41; 60; 6; 5; 8; 1; 1; 4; 7; 7; 0; 5; 5; 71; 14; 26; 47; 5; 1; 6; 34; 9; 4; 2; 37; 3; 8; 4; 31; 6; 2; 1; 0; 7; 5; 1; 0; 15; 6; 1; 8; 13; 0; 6; 2; 4; 2; 6; 6; 1; 4; 1; 9; 79; 0; 87; 6; 8; 8; 62; 1; 4; 62; 6; 31; 1; 5; 6; 5; 9; 3; 3; 1; 79; 4; 3; 2; 67; 5; 7; 12; 70; 8; 8; 6; 1; 3; 14; 15; 1; 61; 4; 1; 4; 1; 7; 4; 4; 4; 2; 8; 8; 7; 5; 4; 27; 0; 9; 80; 25; 1; 8; 1; 3; 7; 4; 3; 5; 5; 6; 5; 5; 31; 7; 0; 3; 3; 6; 71; 76; 28; 60; 6; 2; 6; 3; 0; 4; 1; 0; 5; 7; 0; 28; 86; 4; 7; 51; 36; 0; 5; 0; 1; 4; 3; 6; 0; 1; 1; 8; 18; 4; 2; 8; 8; 1; 4; 7; 1; 0; 93; 5; 3; 0; 80; 1; 7; 7; 8; 8; 5; 7; 8; 9; 24; 4; 25; 8; 8; 5; 4; 90; 4; 6; 8; 4; 4; 0; 60; 8; 9; 7; 44; 5; 1; 2; 9; 74; 7; 7] + +--- Failure -------------------------------------------------------------------- + Test fail_pred_map_commute failed (37 shrink steps): ([1], {_ -> 0}, {0 -> false; 1 -> true; -489114431 -> false; -334037599 -> false; -1002044798 -> false; 3 -> false; 607479396 -> false; 4 -> false; 5 -> false; 442140485 -> false; 50542662 -> false; 38 -> false; 281414086 -> false; 757535206 -> false; 6 -> false; 7 -> false; 8 -> false; 629085609 -> false; 10 -> false; -765856245 -> false; 44 -> false; 12 -> false; -386873971 -> false; 15 -> false; 47 -> false; -842421617 -> false; 588710735 -> false; 49 -> false; 18 -> false; 51 -> false; 449695123 -> false; 20 -> false; 21 -> false; -386709771 -> false; -92591850 -> false; 136918038 -> false; 54 -> false; -484444937 -> false; -1042148456 -> false; 24 -> false; 1062551480 -> false; 747852089 -> false; 25 -> false; -737785766 -> false; 58 -> false; -530708612 -> false; -60654788 -> false; 28 -> false; 60 -> false; 29 -> false; 947455871 -> false; _ -> false}) @@ -645,6 +675,117 @@ stats depth: 14: # 7 15: 4 ++++ Stats for bytes_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 7.49, stddev: 1.70, median 7, min 5, max 10 + 5: ##################################################### 837 + 6: ##################################################### 826 + 7: ###################################################### 843 + 8: ####################################################### 855 + 9: #################################################### 813 + 10: ##################################################### 826 + ++++ Stats for bytes len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 384.53, stddev: 1330.61, median 9, min 0, max 9969 + 0.. 498: ####################################################### 4246 + 499.. 997: ###### 518 + 998..1496: 21 + 1497..1995: 10 + 1996..2494: 11 + 2495..2993: 10 + 2994..3492: 13 + 3493..3991: 13 + 3992..4490: 5 + 4491..4989: 10 + 4990..5488: 19 + 5489..5987: 9 + 5988..6486: 10 + 6487..6985: 12 + 6986..7484: 17 + 7485..7983: 16 + 7984..8482: 16 + 8483..8981: 16 + 8982..9480: 16 + 9481..9979: 12 + ++++ Stats for bytes_of len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 363.14, stddev: 1245.80, median 9, min 0, max 9986 + 0.. 499: ####################################################### 4270 + 500.. 999: ###### 493 + 1000.. 1499: 16 + 1500.. 1999: 11 + 2000.. 2499: 15 + 2500.. 2999: 17 + 3000.. 3499: 11 + 3500.. 3999: 19 + 4000.. 4499: 14 + 4500.. 4999: 10 + 5000.. 5499: 16 + 5500.. 5999: 11 + 6000.. 6499: 15 + 6500.. 6999: 13 + 7000.. 7499: 12 + 7500.. 7999: 16 + 8000.. 8499: 11 + 8500.. 8999: 4 + 9000.. 9499: 13 + 9500.. 9999: 13 + ++++ Stats for bytes_printable len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 384.53, stddev: 1330.61, median 9, min 0, max 9969 + 0.. 498: ####################################################### 4246 + 499.. 997: ###### 518 + 998..1496: 21 + 1497..1995: 10 + 1996..2494: 11 + 2495..2993: 10 + 2994..3492: 13 + 3493..3991: 13 + 3992..4490: 5 + 4491..4989: 10 + 4990..5488: 19 + 5489..5987: 9 + 5988..6486: 10 + 6487..6985: 12 + 6986..7484: 17 + 7485..7983: 16 + 7984..8482: 16 + 8483..8981: 16 + 8982..9480: 16 + 9481..9979: 12 + ++++ Stats for bytes_small len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 15.57, stddev: 24.36, median 6, min 0, max 99 + 0.. 4: #################################################### 1925 + 5.. 9: ####################################################### 2005 + 10.. 14: # 52 + 15.. 19: # 50 + 20.. 24: # 55 + 25.. 29: # 56 + 30.. 34: # 55 + 35.. 39: # 49 + 40.. 44: # 65 + 45.. 49: # 65 + 50.. 54: # 55 + 55.. 59: # 68 + 60.. 64: # 61 + 65.. 69: # 65 + 70.. 74: # 57 + 75.. 79: # 66 + 80.. 84: # 65 + 85.. 89: # 64 + 90.. 94: # 60 + 95.. 99: # 62 + +++ Stats for string_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: @@ -1256,7 +1397,7 @@ stats dist: 966367653.. 1073741823: ################# 189 ================================================================================ 1 warning(s) -failure (59 tests failed, 3 tests errored, ran 130 tests) +failure (64 tests failed, 3 tests errored, ran 141 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_expect_test.expected.32 b/test/core/QCheck_expect_test.expected.32 index de696d1f..50d79b29 100644 --- a/test/core/QCheck_expect_test.expected.32 +++ b/test/core/QCheck_expect_test.expected.32 @@ -252,6 +252,30 @@ Test printable never produces less than '5 failed (3 shrink steps): --- Failure -------------------------------------------------------------------- +Test bytes are empty failed (15 shrink steps): + +a + +--- Failure -------------------------------------------------------------------- + +Test bytes never has a \000 char failed (8 shrink steps): + +� + +--- Failure -------------------------------------------------------------------- + +Test bytes never has a \255 char failed (14 shrink steps): + +� + +--- Failure -------------------------------------------------------------------- + +Test bytes have unique chars failed (13 shrink steps): + +�� + +--- Failure -------------------------------------------------------------------- + Test strings are empty failed (15 shrink steps): "a" @@ -641,6 +665,92 @@ stats dist: 19: ################################################## 253 20: ############################################## 230 ++++ Stats for bytes_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 7.49, stddev: 1.70, median 7, min 5, max 10 + 5: ##################################################### 837 + 6: ##################################################### 826 + 7: ###################################################### 843 + 8: ####################################################### 855 + 9: #################################################### 813 + 10: ##################################################### 826 + ++++ Stats for bytes len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 384.53, stddev: 1330.61, median 9, min 0, max 9969 + 0.. 498: ####################################################### 4246 + 499.. 997: ###### 518 + 998..1496: 21 + 1497..1995: 10 + 1996..2494: 11 + 2495..2993: 10 + 2994..3492: 13 + 3493..3991: 13 + 3992..4490: 5 + 4491..4989: 10 + 4990..5488: 19 + 5489..5987: 9 + 5988..6486: 10 + 6487..6985: 12 + 6986..7484: 17 + 7485..7983: 16 + 7984..8482: 16 + 8483..8981: 16 + 8982..9480: 16 + 9481..9979: 12 + ++++ Stats for bytes_of len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 363.14, stddev: 1245.80, median 9, min 0, max 9986 + 0.. 499: ####################################################### 4270 + 500.. 999: ###### 493 + 1000.. 1499: 16 + 1500.. 1999: 11 + 2000.. 2499: 15 + 2500.. 2999: 17 + 3000.. 3499: 11 + 3500.. 3999: 19 + 4000.. 4499: 14 + 4500.. 4999: 10 + 5000.. 5499: 16 + 5500.. 5999: 11 + 6000.. 6499: 15 + 6500.. 6999: 13 + 7000.. 7499: 12 + 7500.. 7999: 16 + 8000.. 8499: 11 + 8500.. 8999: 4 + 9000.. 9499: 13 + 9500.. 9999: 13 + ++++ Stats for bytes_small len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 15.57, stddev: 24.36, median 6, min 0, max 99 + 0.. 4: #################################################### 1925 + 5.. 9: ####################################################### 2005 + 10.. 14: # 52 + 15.. 19: # 50 + 20.. 24: # 55 + 25.. 29: # 56 + 30.. 34: # 55 + 35.. 39: # 49 + 40.. 44: # 65 + 45.. 49: # 65 + 50.. 54: # 55 + 55.. 59: # 68 + 60.. 64: # 61 + 65.. 69: # 65 + 70.. 74: # 57 + 75.. 79: # 66 + 80.. 84: # 65 + 85.. 89: # 64 + 90.. 94: # 60 + 95.. 99: # 62 + +++ Stats for string_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: @@ -1252,7 +1362,7 @@ stats dist: 966367653.. 1073741823: ################# 189 ================================================================================ 1 warning(s) -failure (59 tests failed, 3 tests errored, ran 139 tests) +failure (63 tests failed, 3 tests errored, ran 148 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ From d4eba3726784323dd461068372ebd4aeac82d30a Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 2 Nov 2022 18:34:50 +0100 Subject: [PATCH 106/391] use 'synonym for' consistently --- src/core/QCheck.mli | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 910d39b7..d448999d 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -315,7 +315,7 @@ module Gen : sig (** All corner cases for int. @since 0.6 *) - val (--) : int -> int -> int t (** Synonym to {!int_range}. *) + val (--) : int -> int -> int t (** Synonym for {!int_range}. *) val ui32 : int32 t (** Generates (unsigned) [int32] values. *) @@ -683,7 +683,7 @@ module Iter : sig val map2 : ('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t val (>|=) : 'a t -> ('a -> 'b) -> 'b t val append : 'a t -> 'a t -> 'a t - val (<+>) : 'a t -> 'a t -> 'a t (** Synonym to {!append}. *) + val (<+>) : 'a t -> 'a t -> 'a t (** Synonym for {!append}. *) val of_list : 'a list -> 'a t val of_array : 'a array -> 'a t @@ -1249,7 +1249,7 @@ val small_signed_int : int arbitrary @since 0.5.2 *) val (--) : int -> int -> int arbitrary -(** Synonym to {!int_range}. *) +(** Synonym for {!int_range}. *) val int32 : int32 arbitrary (** Int32 generator. Uniformly distributed. *) @@ -1320,7 +1320,7 @@ val string_gen : char Gen.t -> string arbitrary (** Generates strings with a distribution of length of {!Gen.nat}. *) val string_of : char Gen.t -> string arbitrary -(** Synonym to {!string_gen} added for convenience. +(** Synonym for {!string_gen} added for convenience. @since NEXT_RELEASE *) val string : string arbitrary @@ -1331,7 +1331,7 @@ val small_string : string arbitrary (** Same as {!string} but with a small length (ie {!Gen.small_nat} ). *) val string_small : string arbitrary -(** Synonym to [small_string] added for convenience. +(** Synonym for [small_string] added for convenience. @since NEXT_RELEASE *) val string_small_of : char Gen.t -> string arbitrary @@ -1350,14 +1350,14 @@ val printable_string : string arbitrary and distribution of characters of [printable_char]. *) val string_printable : string arbitrary -(** Synonym to [printable_string] added for convenience. +(** Synonym for [printable_string] added for convenience. @since NEXT_RELEASE *) val printable_string_of_size : int Gen.t -> string arbitrary (** Generates strings with distribution of characters of [printable_char]. *) val string_printable_of_size : int Gen.t -> string arbitrary -(** Synonym to [printable_string_of_size] added for convenience. +(** Synonym for [printable_string_of_size] added for convenience. @since NEXT_RELEASE *) val small_printable_string : string arbitrary @@ -1365,7 +1365,7 @@ val small_printable_string : string arbitrary and distribution of characters of [printable_char]. *) val string_small_printable : string arbitrary -(** Synonym to [small_printable_string] added for convenience. +(** Synonym for [small_printable_string] added for convenience. @since NEXT_RELEASE *) val numeral_string : string arbitrary @@ -1373,14 +1373,14 @@ val numeral_string : string arbitrary and distribution of characters of [numeral_char]. *) val string_numeral : string arbitrary -(** Synonym to [numeral_string] added for convenience. +(** Synonym for [numeral_string] added for convenience. @since NEXT_RELEASE *) val numeral_string_of_size : int Gen.t -> string arbitrary (** Generates strings with a distribution of characters of [numeral_char]. *) val string_numeral_of_size : int Gen.t -> string arbitrary -(** Synonym to [numeral_string_of_size] added for convenience. +(** Synonym for [numeral_string_of_size] added for convenience. @since NEXT_RELEASE *) val list : 'a arbitrary -> 'a list arbitrary From e5edb3a9664dd98adb025d51d9c52f3a5dd3f14a Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 3 Nov 2022 09:57:59 +0100 Subject: [PATCH 107/391] CI dune runtest on latest MacOSX too --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9bc599de..11e03d21 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,4 +29,4 @@ jobs: - run: opam install -t . --deps-only - run: opam exec -- dune build - run: opam exec -- dune runtest - if: ${{ matrix.os == 'ubuntu-latest'}} + if: ${{ matrix.os != 'windows-latest'}} From a69778ce3ec004cbd2ab675669ae8b0db97a4992 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 3 Nov 2022 10:46:39 +0100 Subject: [PATCH 108/391] relax acceptable ratio for QCheck2.Gen.option --- test/core/QCheck2_unit_tests.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/core/QCheck2_unit_tests.ml b/test/core/QCheck2_unit_tests.ml index 773e130a..84f65150 100644 --- a/test/core/QCheck2_unit_tests.ml +++ b/test/core/QCheck2_unit_tests.ml @@ -151,7 +151,7 @@ module Gen = struct let test_gen_option_custom () = let nb = test_gen_option ~ratio:(Some 0.5) in - let b = nb > 450 && nb < 550 in + let b = nb > 400 && nb < 600 in Alcotest.(check bool) "Gen.option produces around 50% of Some" b true let tests = From f88496a3538d25b6e314e11f0cc8c51d10b4f3a3 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 3 Nov 2022 09:53:05 +0100 Subject: [PATCH 109/391] run CI workflow on OCaml5 too --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 11e03d21..e801569c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,6 +18,7 @@ jobs: ocaml-compiler: - 4.08.x - 4.12.x + - ocaml-base-compiler.5.0.0~beta1 runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 From a0bd8ab39584e247c06c27b00916614f06f16ccf Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 3 Nov 2022 13:23:38 +0100 Subject: [PATCH 110/391] exclude windows-ocaml5 combination from CI --- .github/workflows/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e801569c..f0eef32f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,6 +19,9 @@ jobs: - 4.08.x - 4.12.x - ocaml-base-compiler.5.0.0~beta1 + exclude: + - os: windows-latest + ocaml-compiler: ocaml-base-compiler.5.0.0~beta1 runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 From 32ef553ac313f3f5a519a4c8d93e836af7c09a25 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 4 Nov 2022 19:18:09 +0100 Subject: [PATCH 111/391] update expected OCaml5 output --- test/core/QCheck2_expect_test.expected.ocaml5 | 137 +++++++++++++++++- test/core/QCheck_expect_test.expected.ocaml5 | 112 +++++++++++++- 2 files changed, 247 insertions(+), 2 deletions(-) diff --git a/test/core/QCheck2_expect_test.expected.ocaml5 b/test/core/QCheck2_expect_test.expected.ocaml5 index 3aba6b6a..228b96e6 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5 +++ b/test/core/QCheck2_expect_test.expected.ocaml5 @@ -338,6 +338,30 @@ Test printable never produces less than '5 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- +Test bytes are empty failed (9 shrink steps): + +a + +--- Failure -------------------------------------------------------------------- + +Test bytes never has a \000 char failed (55 shrink steps): + +aaaaaaaaaaaaaaa�aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + +--- Failure -------------------------------------------------------------------- + +Test bytes never has a \255 char failed (75 shrink steps): + +aaaaaaa�aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + +--- Failure -------------------------------------------------------------------- + +Test bytes have unique chars failed (14 shrink steps): + +aaaaaaa + +--- Failure -------------------------------------------------------------------- + Test strings are empty failed (9 shrink steps): "a" @@ -707,6 +731,117 @@ stats depth: 14: ## 16 15: 5 ++++ Stats for bytes_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 7.51, stddev: 1.69, median 8, min 5, max 10 + 5: ################################################## 817 + 6: ################################################# 797 + 7: ####################################################### 885 + 8: ################################################### 834 + 9: ###################################################### 877 + 10: ################################################# 790 + ++++ Stats for bytes len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 370.05, stddev: 1282.91, median 9, min 0, max 9947 + 0.. 497: ####################################################### 4270 + 498.. 995: ###### 497 + 996..1493: 17 + 1494..1991: 9 + 1992..2489: 13 + 2490..2987: 13 + 2988..3485: 9 + 3486..3983: 14 + 3984..4481: 14 + 4482..4979: 17 + 4980..5477: 9 + 5478..5975: 10 + 5976..6473: 15 + 6474..6971: 16 + 6972..7469: 16 + 7470..7967: 9 + 7968..8465: 12 + 8466..8963: 15 + 8964..9461: 9 + 9462..9959: 16 + ++++ Stats for bytes_of len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 359.22, stddev: 1249.46, median 9, min 0, max 9958 + 0.. 497: ####################################################### 4275 + 498.. 995: ###### 479 + 996..1493: 22 + 1494..1991: 12 + 1992..2489: 21 + 2490..2987: 16 + 2988..3485: 13 + 3486..3983: 17 + 3984..4481: 14 + 4482..4979: 14 + 4980..5477: 8 + 5478..5975: 14 + 5976..6473: 13 + 6474..6971: 9 + 6972..7469: 7 + 7470..7967: 17 + 7968..8465: 13 + 8466..8963: 15 + 8964..9461: 10 + 9462..9959: 11 + ++++ Stats for bytes_printable len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 370.05, stddev: 1282.91, median 9, min 0, max 9947 + 0.. 497: ####################################################### 4270 + 498.. 995: ###### 497 + 996..1493: 17 + 1494..1991: 9 + 1992..2489: 13 + 2490..2987: 13 + 2988..3485: 9 + 3486..3983: 14 + 3984..4481: 14 + 4482..4979: 17 + 4980..5477: 9 + 5478..5975: 10 + 5976..6473: 15 + 6474..6971: 16 + 6972..7469: 16 + 7470..7967: 9 + 7968..8465: 12 + 8466..8963: 15 + 8964..9461: 9 + 9462..9959: 16 + ++++ Stats for bytes_small len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 15.99, stddev: 24.58, median 6, min 0, max 99 + 0.. 4: ###################################################### 1920 + 5.. 9: ####################################################### 1929 + 10.. 14: # 69 + 15.. 19: # 62 + 20.. 24: # 63 + 25.. 29: # 59 + 30.. 34: # 68 + 35.. 39: # 62 + 40.. 44: # 57 + 45.. 49: ## 83 + 50.. 54: # 59 + 55.. 59: ## 80 + 60.. 64: # 48 + 65.. 69: # 53 + 70.. 74: # 61 + 75.. 79: # 66 + 80.. 84: # 61 + 85.. 89: ## 72 + 90.. 94: # 66 + 95.. 99: # 62 + +++ Stats for string_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: @@ -1318,7 +1453,7 @@ stats dist: 4150517416584649600.. 4611686018427387903: ################# 195 ================================================================================ 1 warning(s) -failure (60 tests failed, 3 tests errored, ran 131 tests) +failure (64 tests failed, 3 tests errored, ran 141 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_expect_test.expected.ocaml5 b/test/core/QCheck_expect_test.expected.ocaml5 index 7c4bde1c..0cf4036b 100644 --- a/test/core/QCheck_expect_test.expected.ocaml5 +++ b/test/core/QCheck_expect_test.expected.ocaml5 @@ -294,6 +294,30 @@ Test printable never produces less than '5 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- +Test bytes are empty failed (13 shrink steps): + +a + +--- Failure -------------------------------------------------------------------- + +Test bytes never has a \000 char failed (13 shrink steps): + +� + +--- Failure -------------------------------------------------------------------- + +Test bytes never has a \255 char failed (15 shrink steps): + +� + +--- Failure -------------------------------------------------------------------- + +Test bytes have unique chars failed (14 shrink steps): + +�� + +--- Failure -------------------------------------------------------------------- + Test strings are empty failed (13 shrink steps): "a" @@ -683,6 +707,92 @@ stats dist: 19: ################################################## 242 20: ############################################### 230 ++++ Stats for bytes_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 7.51, stddev: 1.69, median 8, min 5, max 10 + 5: ################################################## 817 + 6: ################################################# 797 + 7: ####################################################### 885 + 8: ################################################### 834 + 9: ###################################################### 877 + 10: ################################################# 790 + ++++ Stats for bytes len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 370.05, stddev: 1282.91, median 9, min 0, max 9947 + 0.. 497: ####################################################### 4270 + 498.. 995: ###### 497 + 996..1493: 17 + 1494..1991: 9 + 1992..2489: 13 + 2490..2987: 13 + 2988..3485: 9 + 3486..3983: 14 + 3984..4481: 14 + 4482..4979: 17 + 4980..5477: 9 + 5478..5975: 10 + 5976..6473: 15 + 6474..6971: 16 + 6972..7469: 16 + 7470..7967: 9 + 7968..8465: 12 + 8466..8963: 15 + 8964..9461: 9 + 9462..9959: 16 + ++++ Stats for bytes_of len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 359.22, stddev: 1249.46, median 9, min 0, max 9958 + 0.. 497: ####################################################### 4275 + 498.. 995: ###### 479 + 996..1493: 22 + 1494..1991: 12 + 1992..2489: 21 + 2490..2987: 16 + 2988..3485: 13 + 3486..3983: 17 + 3984..4481: 14 + 4482..4979: 14 + 4980..5477: 8 + 5478..5975: 14 + 5976..6473: 13 + 6474..6971: 9 + 6972..7469: 7 + 7470..7967: 17 + 7968..8465: 13 + 8466..8963: 15 + 8964..9461: 10 + 9462..9959: 11 + ++++ Stats for bytes_small len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 15.99, stddev: 24.58, median 6, min 0, max 99 + 0.. 4: ###################################################### 1920 + 5.. 9: ####################################################### 1929 + 10.. 14: # 69 + 15.. 19: # 62 + 20.. 24: # 63 + 25.. 29: # 59 + 30.. 34: # 68 + 35.. 39: # 62 + 40.. 44: # 57 + 45.. 49: ## 83 + 50.. 54: # 59 + 55.. 59: ## 80 + 60.. 64: # 48 + 65.. 69: # 53 + 70.. 74: # 61 + 75.. 79: # 66 + 80.. 84: # 61 + 85.. 89: ## 72 + 90.. 94: # 66 + 95.. 99: # 62 + +++ Stats for string_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: @@ -1294,7 +1404,7 @@ stats dist: 4150517416584649600.. 4611686018427387903: ################# 195 ================================================================================ 1 warning(s) -failure (59 tests failed, 3 tests errored, ran 139 tests) +failure (63 tests failed, 3 tests errored, ran 148 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ From a3c5fbb1cfd32a13ce3ce84b18d15e4ddf73fbfb Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 7 Nov 2022 10:41:14 +0100 Subject: [PATCH 112/391] update expected QCheck2 output for derived option --- test/ppx_deriving_qcheck/deriver/qcheck2/test_textual.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/ppx_deriving_qcheck/deriver/qcheck2/test_textual.ml b/test/ppx_deriving_qcheck/deriver/qcheck2/test_textual.ml index 092519ab..04e879bf 100644 --- a/test/ppx_deriving_qcheck/deriver/qcheck2/test_textual.ml +++ b/test/ppx_deriving_qcheck/deriver/qcheck2/test_textual.ml @@ -147,7 +147,7 @@ let test_tuple () = check_eq ~expected ~actual "deriving tuples" let test_option () = - let expected = [ [%stri let gen = QCheck2.Gen.opt QCheck2.Gen.int] ] in + let expected = [ [%stri let gen = QCheck2.Gen.option QCheck2.Gen.int] ] in let actual = f' @@ extract' [ [%stri type t = int option] ] in check_eq ~expected ~actual "deriving option" From 7d602317a97c88d99c4027bdb438bc48114fdd5e Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 7 Nov 2022 16:36:41 +0100 Subject: [PATCH 113/391] prepare for 0.20 --- ppx_deriving_qcheck.opam | 2 +- qcheck-alcotest.opam | 2 +- qcheck-core.opam | 2 +- qcheck-ounit.opam | 2 +- qcheck.opam | 2 +- src/core/QCheck.mli | 52 ++++++++++++++++++++-------------------- src/core/QCheck2.mli | 20 ++++++++-------- 7 files changed, 41 insertions(+), 41 deletions(-) diff --git a/ppx_deriving_qcheck.opam b/ppx_deriving_qcheck.opam index 119431cf..699597ea 100644 --- a/ppx_deriving_qcheck.opam +++ b/ppx_deriving_qcheck.opam @@ -1,6 +1,6 @@ opam-version: "2.0" name: "ppx_deriving_qcheck" -version: "0.2.0" +version: "0.3.0" license: "BSD-2-Clause" synopsis: "PPX Deriver for QCheck" diff --git a/qcheck-alcotest.opam b/qcheck-alcotest.opam index 45715e5d..ad1a06b5 100644 --- a/qcheck-alcotest.opam +++ b/qcheck-alcotest.opam @@ -5,7 +5,7 @@ homepage: "https://github.com/c-cube/qcheck/" license: "BSD-2-Clause" synopsis: "Alcotest backend for qcheck" doc: ["http://c-cube.github.io/qcheck/"] -version: "0.19.1" +version: "0.20" tags: [ "test" "quickcheck" diff --git a/qcheck-core.opam b/qcheck-core.opam index 211211c9..0bb42124 100644 --- a/qcheck-core.opam +++ b/qcheck-core.opam @@ -5,7 +5,7 @@ homepage: "https://github.com/c-cube/qcheck/" license: "BSD-2-Clause" synopsis: "Core qcheck library" doc: ["http://c-cube.github.io/qcheck/"] -version: "0.19.1" +version: "0.20" tags: [ "test" "property" diff --git a/qcheck-ounit.opam b/qcheck-ounit.opam index 4d38176f..4b9242d2 100644 --- a/qcheck-ounit.opam +++ b/qcheck-ounit.opam @@ -5,7 +5,7 @@ license: "BSD-2-Clause" homepage: "https://github.com/c-cube/qcheck/" doc: ["http://c-cube.github.io/qcheck/"] synopsis: "OUnit backend for qcheck" -version: "0.19.1" +version: "0.20" tags: [ "qcheck" "quickcheck" diff --git a/qcheck.opam b/qcheck.opam index 73550ec8..3c72f47e 100644 --- a/qcheck.opam +++ b/qcheck.opam @@ -5,7 +5,7 @@ synopsis: "Compatibility package for qcheck" homepage: "https://github.com/c-cube/qcheck/" license: "BSD-2-Clause" doc: ["http://c-cube.github.io/qcheck/"] -version: "0.19.1" +version: "0.20" tags: [ "test" "property" diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index d448999d..7e8d4b46 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -400,30 +400,30 @@ module Gen : sig val bytes_size : ?gen:char t -> int t -> bytes t (** Builds a bytes generator from a (non-negative) size generator. Accepts an optional character generator (the default is {!char}). - @since NEXT_RELEASE *) + @since 0.20 *) val bytes : ?gen:char t -> bytes t (** Builds a bytes generator. Bytes size is generated by {!nat}. Accepts an optional character generator (the default is {!char}). See also {!bytes_of} and {!bytes_readable} for versions without optional parameters. - @since NEXT_RELEASE *) + @since 0.20 *) val bytes_of : char t -> bytes t (** Builds a bytes generator using the given character generator. - @since NEXT_RELEASE *) + @since 0.20 *) val bytes_printable : bytes t (** Generator using the {!printable} character generator. - @since NEXT_RELEASE *) + @since 0.20 *) val bytes_small : bytes t (** Builds a bytes generator using the {!char} character generator, length is {!small_nat} - @since NEXT_RELEASE *) + @since 0.20 *) val bytes_small_of : char t -> bytes t (** Builds a bytes generator using the given character generator, length is {!small_nat}. - @since NEXT_RELEASE *) + @since 0.20 *) val string_size : ?gen:char t -> int t -> string t (** Builds a string generator from a (non-negative) size generator. @@ -455,11 +455,11 @@ module Gen : sig val string_small : string t (** Builds a string generator using the {!char} character generator, length is {!small_nat} - @since NEXT_RELEASE *) + @since 0.20 *) val string_small_of : char t -> string t (** Builds a string generator using the given character generator, length is {!small_nat}. - @since NEXT_RELEASE *) + @since 0.20 *) val small_list : 'a t -> 'a list t (** Generates lists of small size (see {!small_nat}). @@ -613,7 +613,7 @@ module Print : sig val char : char t (** Character printer. *) - val bytes : bytes t (** Bytes printer. @since NEXT_RELEASE *) + val bytes : bytes t (** Bytes printer. @since 0.20 *) val string : string t (** String printer. *) @@ -748,7 +748,7 @@ module Shrink : sig val option : 'a t -> 'a option t val bytes : ?shrink:(char t) -> bytes t - (** @since NEXT_RELEASE *) + (** @since 0.20 *) val string : ?shrink:(char t) -> string t @@ -852,7 +852,7 @@ module Observable : sig val int : int t val float : float t val string : string t - val bytes : bytes t (** @since NEXT_RELEASE *) + val bytes : bytes t (** @since 0.20 *) val char : char t val make : @@ -1285,33 +1285,33 @@ val numeral_char : char arbitrary val bytes_gen_of_size : int Gen.t -> char Gen.t -> bytes arbitrary (** Builds a bytes generator from a (non-negative) size generator and a character generator. - @since NEXT_RELEASE *) + @since 0.20 *) val bytes_of : char Gen.t -> bytes arbitrary (** Generates bytes with a distribution of length of {!Gen.nat}. - @since NEXT_RELEASE *) + @since 0.20 *) val bytes : bytes arbitrary (** Generates bytes with a distribution of length of {!Gen.nat} and distribution of characters of [char]. - @since NEXT_RELEASE *) + @since 0.20 *) val bytes_small : bytes arbitrary (** Same as {!bytes} but with a small length (ie {!Gen.small_nat} ). - @since NEXT_RELEASE *) + @since 0.20 *) val bytes_small_of : char Gen.t -> bytes arbitrary (** Same as {!bytes_of} but with a small length (ie {!Gen.small_nat} ). - @since NEXT_RELEASE *) + @since 0.20 *) val bytes_of_size : int Gen.t -> bytes arbitrary (** Generates bytes with distribution of characters of [char]. - @since NEXT_RELEASE *) + @since 0.20 *) val bytes_printable : bytes arbitrary (** Generates bytes with a distribution of length of {!Gen.nat} and distribution of characters of [printable_char]. - @since NEXT_RELEASE *) + @since 0.20 *) val string_gen_of_size : int Gen.t -> char Gen.t -> string arbitrary (** Builds a string generator from a (non-negative) size generator and a character generator. *) @@ -1321,7 +1321,7 @@ val string_gen : char Gen.t -> string arbitrary val string_of : char Gen.t -> string arbitrary (** Synonym for {!string_gen} added for convenience. - @since NEXT_RELEASE *) + @since 0.20 *) val string : string arbitrary (** Generates strings with a distribution of length of {!Gen.nat} @@ -1332,11 +1332,11 @@ val small_string : string arbitrary val string_small : string arbitrary (** Synonym for [small_string] added for convenience. - @since NEXT_RELEASE *) + @since 0.20 *) val string_small_of : char Gen.t -> string arbitrary (** Same as {!string_of} but with a small length (ie {!Gen.small_nat} ). - @since NEXT_RELEASE *) + @since 0.20 *) val small_list : 'a arbitrary -> 'a list arbitrary (** Generates lists of small size (see {!Gen.small_nat}). @@ -1351,14 +1351,14 @@ val printable_string : string arbitrary val string_printable : string arbitrary (** Synonym for [printable_string] added for convenience. - @since NEXT_RELEASE *) + @since 0.20 *) val printable_string_of_size : int Gen.t -> string arbitrary (** Generates strings with distribution of characters of [printable_char]. *) val string_printable_of_size : int Gen.t -> string arbitrary (** Synonym for [printable_string_of_size] added for convenience. - @since NEXT_RELEASE *) + @since 0.20 *) val small_printable_string : string arbitrary (** Generates strings with a length of [small_nat] @@ -1366,7 +1366,7 @@ val small_printable_string : string arbitrary val string_small_printable : string arbitrary (** Synonym for [small_printable_string] added for convenience. - @since NEXT_RELEASE *) + @since 0.20 *) val numeral_string : string arbitrary (** Generates strings with a distribution of length of {!Gen.nat} @@ -1374,14 +1374,14 @@ val numeral_string : string arbitrary val string_numeral : string arbitrary (** Synonym for [numeral_string] added for convenience. - @since NEXT_RELEASE *) + @since 0.20 *) val numeral_string_of_size : int Gen.t -> string arbitrary (** Generates strings with a distribution of characters of [numeral_char]. *) val string_numeral_of_size : int Gen.t -> string arbitrary (** Synonym for [numeral_string_of_size] added for convenience. - @since NEXT_RELEASE *) + @since 0.20 *) val list : 'a arbitrary -> 'a list arbitrary (** Generates lists with length generated by {!Gen.nat}. *) diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index 03d743d3..a6889f48 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -295,7 +295,7 @@ module Gen : sig Shrinks on the number of characters first, then on the characters. - @since NEXT_RELEASE *) + @since 0.20 *) val bytes : bytes t (** Bytes generator using the {!char} character generator. Bytes size is generated by {!nat}. @@ -304,35 +304,35 @@ module Gen : sig Shrinks on the number of characters first, then on the characters. - @since NEXT_RELEASE *) + @since 0.20 *) val bytes_of : char t -> bytes t (** Builds a bytes generator using the given character generator. Shrinks on the number of characters first, then on the characters. - @since NEXT_RELEASE *) + @since 0.20 *) val bytes_printable : bytes t (** Generator using the {!printable} character generator. Shrinks on the number of characters first, then on the characters. - @since NEXT_RELEASE *) + @since 0.20 *) val bytes_small : bytes t (** Builds a bytes generator using the {!char} character generator, length is {!small_nat}. Shrinks on the number of characters first, then on the characters. - @since NEXT_RELEASE *) + @since 0.20 *) val bytes_small_of : char t -> bytes t (** Builds a bytes generator using the given character generator, length is {!small_nat}. Shrinks on the number of characters first, then on the characters. - @since NEXT_RELEASE *) + @since 0.20 *) val string_size : ?gen:char t -> int t -> string t (** Builds a string generator from a (non-negative) size generator. @@ -369,7 +369,7 @@ module Gen : sig Shrinks on the number of characters first, then on the characters. - @since NEXT_RELEASE + @since 0.20 *) val string_small_of : char t -> string t @@ -377,7 +377,7 @@ module Gen : sig Shrinks on the number of characters first, then on the characters. - @since NEXT_RELEASE + @since 0.20 *) val small_string : gen:char t -> string t @@ -1095,7 +1095,7 @@ module Print : sig val bytes : bytes t (** [bytes] is a printer of bytes. - @since NEXT_RELEASE *) + @since 0.20 *) val string : string t (** [string] is a printer of string. *) @@ -1297,7 +1297,7 @@ module Observable : sig val bytes : bytes t (** [bytes] is an observable of [bytes]. - @since NEXT_RELEASE *) + @since 0.20 *) val string : string t (** [string] is an observable of [string]. *) From 129c8e0ce90a9bd98582d256cb11e1578d4d06d0 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 7 Nov 2022 17:18:07 +0100 Subject: [PATCH 114/391] add missing package on QCheck2 ppx_deriving_qcheck test --- test/ppx_deriving_qcheck/deriver/qcheck2/dune | 1 + 1 file changed, 1 insertion(+) diff --git a/test/ppx_deriving_qcheck/deriver/qcheck2/dune b/test/ppx_deriving_qcheck/deriver/qcheck2/dune index a154c752..ce1de538 100644 --- a/test/ppx_deriving_qcheck/deriver/qcheck2/dune +++ b/test/ppx_deriving_qcheck/deriver/qcheck2/dune @@ -1,4 +1,5 @@ (tests + (package ppx_deriving_qcheck) (names test_textual test_primitives From f765fdb1958ede5feb9479a57792e286a757efe8 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 7 Nov 2022 18:16:47 +0100 Subject: [PATCH 115/391] revert QCheck2.Gen.small_string incompatible change --- src/core/QCheck2.ml | 2 +- src/core/QCheck2.mli | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index 2ab713db..58cb1713 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -718,7 +718,7 @@ module Gen = struct let string_small_of gen st = string_size ~gen small_nat st - let small_string ~gen = string_small_of gen + let small_string ?(gen=char) = string_small_of gen let small_list gen = list_size small_nat gen diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index a6889f48..e5392b47 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -380,8 +380,14 @@ module Gen : sig @since 0.20 *) - val small_string : gen:char t -> string t - (** alias for [string_small] for backward compatibility *) + val small_string : ?gen:char t -> string t + (** Builds a string generator, length is {!small_nat}. + Accepts an optional character generator (the default is {!char}). + Shrinks on the number of characters first, then on the characters. + This function is kept for backward compatibility: + The optional argument is in fact a mandatory [option], see c-cube/qcheck#162. + Use {!string_small} instead. + *) val pure : 'a -> 'a t (** [pure a] creates a generator that always returns [a]. From 063c1d74795a24eb77fa661d218c4715382df566 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 7 Nov 2022 22:42:33 +0100 Subject: [PATCH 116/391] prepare for future PRs, mention small_string revert --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 73d809ac..04faafd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes +## NEXT RELEASE + +- ... + ## 0.20 - add several new `bytes` combinators: @@ -10,7 +14,7 @@ - add new `string` combinators and aliases: - `{QCheck,QCheck2}.Gen.{string_small,string_small_of}` - `QCheck.{string_small,string_small_of,string_of,string_printable,string_printable_of_size,string_small_printable,string_numeral,string_numeral_of_size}` -- `QCheck2.small_string` character generator argument is no more optional +- (`QCheck2.small_string` character generator argument is no more optional - reverted again due to backwards incompatibility) - add an optional argument with conservative default to `Shrink.string` - fix shrinkers in `QCheck.{printable_string,printable_string_of_size,small_printable_string,numeral_string,numeral_string_of_size}` [#257](https://github.com/c-cube/qcheck/issues/257) - add `QCheck2.Gen.set_shrink` to modify the generator's shrinker From b3308e38f30ddcae4ece01f11623e112fb62c180 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 1 May 2023 16:33:10 +0200 Subject: [PATCH 117/391] Update workflow master->main to trigger on PRs --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f0eef32f..74bf5c78 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,10 +2,10 @@ name: build on: push: branches: - - master + - main pull_request: branches: - - master + - main jobs: run: name: Build From 9c8c74b01b29b00d2db47978cce464bc168c9945 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 1 May 2023 16:34:12 +0200 Subject: [PATCH 118/391] Update to test of 5.0.0 and 4.14 while we are at it --- .github/workflows/main.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 74bf5c78..dea1dee2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,10 +18,11 @@ jobs: ocaml-compiler: - 4.08.x - 4.12.x - - ocaml-base-compiler.5.0.0~beta1 + - 4.14.x + - ocaml-base-compiler.5.0.0 exclude: - os: windows-latest - ocaml-compiler: ocaml-base-compiler.5.0.0~beta1 + ocaml-compiler: ocaml-base-compiler.5.0.0 runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 From 36e804637c972be04e83523198f5364edc2a4bd7 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 1 May 2023 17:00:49 +0200 Subject: [PATCH 119/391] Don't run alcotest expect tests with CI=true as it alters the output --- example/alcotest/dune | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/example/alcotest/dune b/example/alcotest/dune index a9114f62..93b58d19 100644 --- a/example/alcotest/dune +++ b/example/alcotest/dune @@ -8,6 +8,12 @@ let suffix = let dune = Printf.sprintf {| +(env + (_ + (env-vars + ; Don't run tests as if Alcotest was run in CI + (CI false)))) + (executable (name QCheck_alcotest_test) (libraries qcheck-core qcheck-alcotest alcotest)) From 64ed409d371907deb57cfd5dee39baa6eb5f3929 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 1 May 2023 15:52:32 +0200 Subject: [PATCH 120/391] Realign shrinker benchmarks --- test/core/QCheck2_tests.ml | 2 +- test/core/QCheck_tests.ml | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/test/core/QCheck2_tests.ml b/test/core/QCheck2_tests.ml index 87b843ce..66b107b4 100644 --- a/test/core/QCheck2_tests.ml +++ b/test/core/QCheck2_tests.ml @@ -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 = diff --git a/test/core/QCheck_tests.ml b/test/core/QCheck_tests.ml index 7d22045b..1d1779ab 100644 --- a/test/core/QCheck_tests.ml +++ b/test/core/QCheck_tests.ml @@ -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; @@ -748,6 +753,7 @@ module Shrink = struct (*list_equal_dupl;*) list_unique_elems; tree_contains_only_42; + test_gen_no_shrink; ] end From c61be8d3bf41cb04148c2f2f2f7c6643d4223f3b Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 1 May 2023 16:08:38 +0200 Subject: [PATCH 121/391] Update QCheck2 test to match new title --- test/core/QCheck2_tests.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/core/QCheck2_tests.ml b/test/core/QCheck2_tests.ml index 66b107b4..1da328ae 100644 --- a/test/core/QCheck2_tests.ml +++ b/test/core/QCheck2_tests.ml @@ -390,7 +390,7 @@ module Shrink = struct let printable_is_never_sign = (* should shrink towards '!' with lowest ascii code 33 *) Test.make ~name:"printable never produces '!\"#$%&'" ~count:1000 ~print:Print.char - Gen.printable (fun c -> not (List.mem c ['!';'@';'#';'$';'%'])) + Gen.printable (fun c -> not (List.mem c ['!';'"';'#';'$';'%';'&'])) let numeral_is_never_less_5 = Test.make ~name:"printable never produces less than '5" ~count:1000 ~print:Print.char From 7fcebd2d9dfdbd2e7fd8817436762fea6fa191d5 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 1 May 2023 16:13:22 +0200 Subject: [PATCH 122/391] Update expect test outputs --- test/core/QCheck2_expect_test.expected.64 | 2 +- test/core/QCheck2_expect_test.expected.ocaml5 | 2 +- test/core/QCheck_expect_test.expected.64 | 8 +++++++- test/core/QCheck_expect_test.expected.ocaml5 | 8 +++++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/test/core/QCheck2_expect_test.expected.64 b/test/core/QCheck2_expect_test.expected.64 index 9854be8a..b1d73a60 100644 --- a/test/core/QCheck2_expect_test.expected.64 +++ b/test/core/QCheck2_expect_test.expected.64 @@ -334,7 +334,7 @@ Test char never produces 'abcdef' failed (1 shrink steps): --- Failure -------------------------------------------------------------------- -Test printable never produces '!"#$%&'' failed (1 shrink steps): +Test printable never produces '!"#$%&' failed (1 shrink steps): '!' diff --git a/test/core/QCheck2_expect_test.expected.ocaml5 b/test/core/QCheck2_expect_test.expected.ocaml5 index 228b96e6..bce5b4b9 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5 +++ b/test/core/QCheck2_expect_test.expected.ocaml5 @@ -326,7 +326,7 @@ Test char never produces 'abcdef' failed (1 shrink steps): --- Failure -------------------------------------------------------------------- -Test printable never produces '!"#$%&'' failed (1 shrink steps): +Test printable never produces '!"#$%&' failed (1 shrink steps): '!' diff --git a/test/core/QCheck_expect_test.expected.64 b/test/core/QCheck_expect_test.expected.64 index 26cb5722..7accc9a8 100644 --- a/test/core/QCheck_expect_test.expected.64 +++ b/test/core/QCheck_expect_test.expected.64 @@ -530,6 +530,12 @@ Leaf 0 --- Failure -------------------------------------------------------------------- +Test sum list = 0 failed (0 shrink steps): + +[7; 1; 42; 1; 8; 5; 3; 9; 5; 38; 3; 3; 0; 1; 98; 1; 4; 13; 9; 2; 6; 9; 47; 6; 5; 8; 8; 6; 0; 9; 7; 2; 8; 6; 62; 6; 4; 31; 19; 1; 41; 60; 6; 5; 8; 1; 1; 4; 7; 7; 0; 5; 5; 71; 14; 26; 47; 5; 1; 6; 34; 9; 4; 2; 37; 3; 8; 4; 31; 6; 2; 1; 0; 7; 5; 1; 0; 15; 6; 1; 8; 13; 0; 6; 2; 4; 2; 6; 6; 1; 4; 1; 9; 79; 0; 87; 6; 8; 8; 62; 1; 4; 62; 6; 31; 1; 5; 6; 5; 9; 3; 3; 1; 79; 4; 3; 2; 67; 5; 7; 12; 70; 8; 8; 6; 1; 3; 14; 15; 1; 61; 4; 1; 4; 1; 7; 4; 4; 4; 2; 8; 8; 7; 5; 4; 27; 0; 9; 80; 25; 1; 8; 1; 3; 7; 4; 3; 5; 5; 6; 5; 5; 31; 7; 0; 3; 3; 6; 71; 76; 28; 60; 6; 2; 6; 3; 0; 4; 1; 0; 5; 7; 0; 28; 86; 4; 7; 51; 36; 0; 5; 0; 1; 4; 3; 6; 0; 1; 1; 8; 18; 4; 2; 8; 8; 1; 4; 7; 1; 0; 93; 5; 3; 0; 80; 1; 7; 7; 8; 8; 5; 7; 8; 9; 24; 4; 25; 8; 8; 5; 4; 90; 4; 6; 8; 4; 4; 0; 60; 8; 9; 7; 44; 5; 1; 2; 9; 74; 7; 7] + +--- Failure -------------------------------------------------------------------- + Test fail_pred_map_commute failed (77 shrink steps): ([1], {_ -> 0}, {1 -> true; _ -> false}) @@ -1394,7 +1400,7 @@ stats dist: 4150517416584649600.. 4611686018427387903: ################# 189 ================================================================================ 1 warning(s) -failure (63 tests failed, 3 tests errored, ran 148 tests) +failure (64 tests failed, 3 tests errored, ran 149 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_expect_test.expected.ocaml5 b/test/core/QCheck_expect_test.expected.ocaml5 index 0cf4036b..1572ed29 100644 --- a/test/core/QCheck_expect_test.expected.ocaml5 +++ b/test/core/QCheck_expect_test.expected.ocaml5 @@ -540,6 +540,12 @@ Leaf 0 --- Failure -------------------------------------------------------------------- +Test sum list = 0 failed (0 shrink steps): + +[46; 2; 22; 4; 4; 2; 6; 5; 88; 24; 7; 9; 9; 2; 5; 1; 55; 8; 45; 1; 96; 0; 1; 2; 7; 4; 1; 5; 95; 6; 8; 6; 4; 0; 5; 5; 22; 87; 2; 1; 1; 0; 2; 2; 9; 5; 9; 3; 7; 59; 7; 96; 6; 5; 1; 3; 9; 9; 65; 6; 7; 7; 2; 5; 0; 0; 70; 5; 5; 2; 1; 57; 9; 7; 8; 10; 9; 7; 9; 75; 73; 80; 7; 9; 4; 3; 16; 5; 79; 1; 8; 6; 2; 3; 4; 9; 2; 8; 4; 6; 50; 2; 1; 5; 9; 5; 4; 3; 56; 6; 5; 9; 4; 1; 47; 1; 2; 5; 2; 0; 7; 31; 55; 6; 7; 4; 7; 8; 8; 2; 4; 40; 4; 6; 9; 3; 59; 5; 1; 0; 2; 6; 90; 1; 6; 81; 0; 1; 3; 7; 2; 4; 5; 4; 7; 3; 62; 0; 1; 6; 7; 5; 97; 83; 41; 7; 2; 6; 3; 0; 4; 8; 99; 8; 6; 0; 7; 9; 7; 1; 55; 30; 25; 3; 4; 7; 1; 6; 80; 8; 0; 4; 21; 3; 5; 9; 27; 10; 60; 47; 54; 6; 5; 8; 1; 5; 9; 65; 9; 5; 7; 7; 6; 48; 9; 5; 6; 4; 9; 7; 1; 2; 71; 6; 9; 2; 7; 8; 14; 59; 71; 30; 7; 3; 5; 4; 6; 7; 3; 6; 9; 8; 2; 38; 6; 6; 7; 1; 5; 2; 43; 5; 2; 9; 3; 0; 3; 2; 7; 71; 26; 3; 9; 11; 5; 1; 5; 2; 53; 46; 4; 6; 7; 67; 1; 0; 34; 0; 48; 5; 5; 0; 7; 49; 92; 8; 3; 0; 67; 1; 5; 2; 9; 5; 9; 3; 1; 4; 8; 0; 3; 6; 46; 58; 1; 54; 77; 0; 96; 1; 6; 2; 8; 22; 3; 9; 2; 6; 25; 49; 9; 6; 3; 8; 5; 9; 54; 1; 7; 5; 6; 5; 1; 7; 8; 23; 4; 6; 4; 2; 5; 8; 4; 7; 4] + +--- Failure -------------------------------------------------------------------- + Test fail_pred_map_commute failed (79 shrink steps): ([11], {_ -> 0}, {11 -> false; _ -> true}) @@ -1404,7 +1410,7 @@ stats dist: 4150517416584649600.. 4611686018427387903: ################# 195 ================================================================================ 1 warning(s) -failure (63 tests failed, 3 tests errored, ran 148 tests) +failure (64 tests failed, 3 tests errored, ran 149 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ From 813e5d1f9bd86407af0359275128eba4c36ddc29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20L=C3=B3pez?= <alex.lopez.zorzano@gmail.com> Date: Sat, 11 Feb 2023 08:17:02 +0100 Subject: [PATCH 123/391] Make `Test.check_exn` honor test polarity --- example/alcotest/output.txt.expected.32 | 3 +-- example/alcotest/output.txt.expected.64 | 3 +-- src/alcotest/QCheck_alcotest.ml | 10 +-------- src/core/QCheck2.ml | 17 +++++++++----- src/ounit/QCheck_ounit.ml | 30 +++++++------------------ 5 files changed, 23 insertions(+), 40 deletions(-) diff --git a/example/alcotest/output.txt.expected.32 b/example/alcotest/output.txt.expected.32 index 634312ae..d6f2301e 100644 --- a/example/alcotest/output.txt.expected.32 +++ b/example/alcotest/output.txt.expected.32 @@ -29,8 +29,7 @@ on `0 (after 31 shrink steps)` │ [FAIL] suite 4 neg test unexpected success. │ └──────────────────────────────────────────────────────────────────────────────┘ negative test 'neg test unexpected success' succeeded unexpectedly -ASSERT negative test 'neg test unexpected success' succeeded unexpectedly -FAIL negative test 'neg test unexpected success' succeeded unexpectedly +[exception] negative test `neg test unexpected success` succeeded unexpectedly ────────────────────────────────────────────────────────────────────────────── ┌──────────────────────────────────────────────────────────────────────────────┐ │ [FAIL] suite 5 neg fail with error. │ diff --git a/example/alcotest/output.txt.expected.64 b/example/alcotest/output.txt.expected.64 index ea706c72..5ab8c71a 100644 --- a/example/alcotest/output.txt.expected.64 +++ b/example/alcotest/output.txt.expected.64 @@ -29,8 +29,7 @@ on `0 (after 63 shrink steps)` │ [FAIL] suite 4 neg test unexpected success. │ └──────────────────────────────────────────────────────────────────────────────┘ negative test 'neg test unexpected success' succeeded unexpectedly -ASSERT negative test 'neg test unexpected success' succeeded unexpectedly -FAIL negative test 'neg test unexpected success' succeeded unexpectedly +[exception] negative test `neg test unexpected success` succeeded unexpectedly ────────────────────────────────────────────────────────────────────────────── ┌──────────────────────────────────────────────────────────────────────────────┐ │ [FAIL] suite 5 neg fail with error. │ diff --git a/src/alcotest/QCheck_alcotest.ml b/src/alcotest/QCheck_alcotest.ml index 0baffa40..d2f26152 100644 --- a/src/alcotest/QCheck_alcotest.ml +++ b/src/alcotest/QCheck_alcotest.ml @@ -54,14 +54,6 @@ let to_alcotest let name = T.get_name cell in let run () = let call = Raw.callback ~colors ~verbose ~print_res:true ~print in - if T.get_positive cell - then - T.check_cell_exn ~long ~call ~handler ~rand cell - else - try - T.check_cell_exn ~long ~call ~handler ~rand cell; - Alcotest.failf "negative test '%s' succeeded unexpectedly" name - with - T.Test_fail (_name,_l) -> () + T.check_cell_exn ~long ~call ~handler ~rand cell in ((name, `Slow, run) : unit Alcotest.test_case) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index 58cb1713..a0cc4e7b 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -1406,6 +1406,7 @@ module Test_exceptions = struct exception Test_fail of string * string list exception Test_error of string * string * exn * string + exception Test_unexpected_success of string end module Test = struct @@ -1882,6 +1883,8 @@ module Test = struct let print_test_fail name l = asprintf "@[%a@]@?" (pp_print_test_fail name) l + let print_unexpected_success name = Format.sprintf "@[negative test `%s`@ succeeded unexpectedly@]" name + let print_test_error name i e stack = Format.sprintf "@[test `%s`@ raised exception `%s`@ on `%s`@,%s@]" name (Printexc.to_string e) i stack @@ -1982,6 +1985,7 @@ module Test = struct (function | Test_fail (name,l) -> Some (print_test_fail name l) | Test_error (name,i,e,st) -> Some (print_test_error name i e st) + | Test_unexpected_success name -> Some (print_unexpected_success name) | User_fail s -> Some ("qcheck: user fail:\n" ^ s) | _ -> None) @@ -1998,14 +2002,17 @@ module Test = struct let print_error ?(st="") arb name (i,e) = print_test_error name (print_c_ex arb i) e st - let check_result cell res = match res.R.state with - | R.Success -> () - | R.Error {instance; exn; backtrace} -> + let check_result cell res = match res.R.state, cell.positive with + | R.Success, true -> () + | R.Success, false -> + raise (Test_unexpected_success cell.name) + | R.Error {instance; exn; backtrace}, _ -> raise (Test_error (cell.name, print_c_ex cell instance, exn, backtrace)) - | R.Failed {instances=l} -> + | R.Failed {instances=l}, true -> let l = List.map (print_c_ex cell) l in raise (Test_fail (cell.name, l)) - | R.Failed_other {msg} -> + | R.Failed _, false -> () + | R.Failed_other {msg}, _ -> raise (Test_fail (cell.name, [msg])) let check_cell_exn ?long ?call ?step ?handler ?rand cell = diff --git a/src/ounit/QCheck_ounit.ml b/src/ounit/QCheck_ounit.ml index b6b2e665..eec329d2 100644 --- a/src/ounit/QCheck_ounit.ml +++ b/src/ounit/QCheck_ounit.ml @@ -72,16 +72,8 @@ let to_ounit2_test ?(rand =default_rand()) (QCheck2.Test.Test cell) = fail = (fun fmt -> Printf.ksprintf assert_failure fmt); err = (fun fmt -> logf ctxt `Error fmt); } in - if QCheck2.Test.get_positive cell - then - T.check_cell_exn cell - ~long ~rand ~call:(Raw.callback ~colors:false ~verbose ~print_res:true ~print) - else - try - T.check_cell_exn cell - ~long ~rand ~call:(Raw.callback ~colors:false ~verbose ~print_res:true ~print); - () - with T.Test_fail (_,_) -> ()) + T.check_cell_exn cell + ~long ~rand ~call:(Raw.callback ~colors:false ~verbose ~print_res:true ~print)) let to_ounit2_test_list ?rand lst = List.rev (List.rev_map (to_ounit2_test ?rand) lst) @@ -93,18 +85,12 @@ let to_ounit_test_cell ?(verbose=verbose()) ?(long=long_tests()) let module T = QCheck2.Test in let name = T.get_name cell in let run () = - - let res = - try - T.check_cell_exn cell ~long ~rand - ~call:(Raw.callback ~colors:false ~verbose ~print_res:verbose ~print:Raw.print_std); - true - with T.Test_fail _ -> - false - in - if QCheck2.Test.get_positive cell - then res - else not res + try + T.check_cell_exn cell ~long ~rand + ~call:(Raw.callback ~colors:false ~verbose ~print_res:verbose ~print:Raw.print_std); + true + with T.Test_fail _ -> + false in name >:: (fun () -> assert_bool name (run ())) From 289c2143b5448e8fc53d87005d420186dbe5800f Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 14 Mar 2023 17:31:27 +0100 Subject: [PATCH 124/391] update expected output for OCaml5 too --- example/alcotest/output.txt.expected.ocaml5 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/example/alcotest/output.txt.expected.ocaml5 b/example/alcotest/output.txt.expected.ocaml5 index 23401ac2..aaf5db1e 100644 --- a/example/alcotest/output.txt.expected.ocaml5 +++ b/example/alcotest/output.txt.expected.ocaml5 @@ -29,8 +29,7 @@ on `0 (after 62 shrink steps)` │ [FAIL] suite 4 neg test unexpected success. │ └──────────────────────────────────────────────────────────────────────────────┘ negative test 'neg test unexpected success' succeeded unexpectedly -ASSERT negative test 'neg test unexpected success' succeeded unexpectedly -FAIL negative test 'neg test unexpected success' succeeded unexpectedly +[exception] negative test `neg test unexpected success` succeeded unexpectedly ────────────────────────────────────────────────────────────────────────────── ┌──────────────────────────────────────────────────────────────────────────────┐ │ [FAIL] suite 5 neg fail with error. │ From 840419897b319d5d062c9573dbb52ebc8386a93b Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 14 Mar 2023 17:54:58 +0100 Subject: [PATCH 125/391] Document the test polarity behaviour --- src/core/QCheck2.mli | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index e5392b47..6fe9d599 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -1801,9 +1801,11 @@ module Test : sig @since 0.6 *) val check_result : 'a cell -> 'a TestResult.t -> unit - (** [check_result cell res] checks that [res] is [Ok _], and returns unit. + (** For a positive test [check_result cell res] checks that [res] is [Ok _], and returns unit. + For a negative test [check_result cell res] checks that [res] is [Failed _], and returns unit. Otherwise, it raises some exception. - @raise Test_fail if [res = Failed _] + @raise Test_fail if the test is positive and [res = Failed _] + @raise Test_unexpected_success if the test is negative and [res = Ok _] @raise Test_error if [res = Error _] *) type res = @@ -1840,6 +1842,10 @@ module Test : sig predicate [law] is called on them and if it returns [false] or raises an exception then we have a counter-example for the [law]. + Note: [check_cell] ignores a test's polarity, acting as + described above regardless of whether the tested cell is a + positive or negative test. + @param long if [true] then multiply the number of instances to generate by the cell's long_factor. @param call function called on each test case, with the result. @@ -1852,13 +1858,19 @@ module Test : sig ?step:'a step -> ?handler:'a handler -> ?rand:Random.State.t -> 'a cell -> unit (** Same as {!check_cell} but calls {!check_result} on the result. - @raise Test_fail if [res = Failed _] + [check_cell test] honors test polarity and thus expects positive tests to succeed + without finding a counterexample and expects negative tests to fail by finding one. + @raise Test_fail if the test is positive and [res = Failed _] + @raise Test_unexpected_success if the test is negative and [res = Ok _] @raise Test_error if [res = Error _] *) val check_exn : ?long:bool -> ?rand:Random.State.t -> t -> unit (** Checks the property against some test cases, and calls {!check_result}, which might raise an exception in case of failure. - @raise Test_fail if [res = Failed _] + [check_exn test] honors test polarity and thus expects positive tests to succeed + without finding a counterexample and expects negative tests to fail by finding one. + @raise Test_fail if the test is positive and [res = Failed _] + @raise Test_unexpected_success if the test is negative and [res = Ok _] @raise Test_error if [res = Error _] *) end From b05c3545934434e6f18ff10b9730397fed0761f9 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 14 Mar 2023 17:58:55 +0100 Subject: [PATCH 126/391] Document the Test_unexpected_success exception --- src/core/QCheck2.mli | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index 6fe9d599..9f53d76c 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -1649,6 +1649,11 @@ module Test_exceptions : sig [Test_error (name, i, e, st)] means [name] failed on [i] with exception [e], and [st] is the stacktrace (if enabled) or an empty string. *) + + exception Test_unexpected_success of string + (** Exception raised when a negative test failed. + [Test_unexpected_success name] means test [name] failed to find an + expected counter example. *) end (** A test is a pair of a generator and a property that all generated values must satisfy. *) From 0af5a6ae773d0b5e3f30ae174253810e2b95c906 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20L=C3=B3pez?= <alex.lopez.zorzano@gmail.com> Date: Sun, 26 Mar 2023 15:40:33 +0200 Subject: [PATCH 127/391] The succeeding value is actually `Success` rather than `Ok` --- src/core/QCheck2.mli | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index 9f53d76c..75f68ce8 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -1866,7 +1866,7 @@ module Test : sig [check_cell test] honors test polarity and thus expects positive tests to succeed without finding a counterexample and expects negative tests to fail by finding one. @raise Test_fail if the test is positive and [res = Failed _] - @raise Test_unexpected_success if the test is negative and [res = Ok _] + @raise Test_unexpected_success if the test is negative and [res = Success _] @raise Test_error if [res = Error _] *) val check_exn : ?long:bool -> ?rand:Random.State.t -> t -> unit @@ -1875,7 +1875,7 @@ module Test : sig [check_exn test] honors test polarity and thus expects positive tests to succeed without finding a counterexample and expects negative tests to fail by finding one. @raise Test_fail if the test is positive and [res = Failed _] - @raise Test_unexpected_success if the test is negative and [res = Ok _] + @raise Test_unexpected_success if the test is negative and [res = Success _] @raise Test_error if [res = Error _] *) end From 8fa296170276597ce240009e3306c68f4642b158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20L=C3=B3pez?= <alex.lopez.zorzano@gmail.com> Date: Sun, 26 Mar 2023 15:54:03 +0200 Subject: [PATCH 128/391] Link documentation from QCheck to QCheck2 for check_* functions --- src/core/QCheck.mli | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 7e8d4b46..92d31a3f 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -1137,13 +1137,16 @@ module Test : sig ?long:bool -> ?call:'a callback -> ?step:'a step -> ?handler:'a handler -> ?rand:Random.State.t -> 'a cell -> 'a TestResult.t + (** See {!QCheck2.Test.check_cell}. *) val check_cell_exn : ?long:bool -> ?call:'a callback -> ?step:'a step -> ?handler:'a handler -> ?rand:Random.State.t -> 'a cell -> unit + (** See {!QCheck2.Test.check_cell_exn}. *) val check_exn : ?long:bool -> ?rand:Random.State.t -> t -> unit + (** See {!QCheck2.Test.check_exn}. *) end (** {2 Sub-tests} *) From 374c30a7fd6133dc7f41cc762514e09ad62a7672 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20L=C3=B3pez?= <alex.lopez.zorzano@gmail.com> Date: Sun, 26 Mar 2023 16:07:16 +0200 Subject: [PATCH 129/391] Add tests for new polarity-respecting behavior --- test/core/QCheck2_unit_tests.ml | 16 ++++++++++++++++ test/core/QCheck_unit_tests.ml | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/test/core/QCheck2_unit_tests.ml b/test/core/QCheck2_unit_tests.ml index a982c5f8..999bdc81 100644 --- a/test/core/QCheck2_unit_tests.ml +++ b/test/core/QCheck2_unit_tests.ml @@ -313,6 +313,20 @@ module Check_exn = struct then Alcotest.failf "%s: counter-example prefix. Received \"%s\"" name c_ex_str + let test_negative_trivial () = + let run_test () = check_exn QCheck2.(Test.make_neg Gen.int (fun _ -> false)) in + Alcotest.(check unit) "Success-negative-trivial" () @@ run_test () + + let test_negative_test_unexpected_success () = + let name = "negative-trivial-test" in + let run_test () = check_exn QCheck2.(Test.make_neg ~name Gen.int (fun _ -> true)) in + try + run_test (); + Alcotest.failf "Negative test didn't raise expected exception." + with + Test.Test_unexpected_success n -> + Alcotest.(check string) (Printf.sprintf "%s: name" name) n name + let tests = ("Test.check_exn", Alcotest.[ test_case "check_exn pass trivial" `Quick test_pass_trivial; @@ -320,6 +334,8 @@ module Check_exn = struct test_case "check_exn fail always" `Quick test_fail_always; test_case "check_exn fail random" `Quick test_fail_random; test_case "check_exn Error" `Quick test_error; + test_case "check_exn negative pass trivial" `Quick test_negative_trivial; + test_case "check_exn Unexpected success" `Quick test_negative_test_unexpected_success; ]) end diff --git a/test/core/QCheck_unit_tests.ml b/test/core/QCheck_unit_tests.ml index b9042025..0d4ee74a 100644 --- a/test/core/QCheck_unit_tests.ml +++ b/test/core/QCheck_unit_tests.ml @@ -151,6 +151,20 @@ module Check_exn = struct then Alcotest.failf "%s: counter-example prefix. Received \"%s\"" name c_ex_str + let test_negative_trivial () = + let run_test () = check_exn QCheck2.(Test.make_neg Gen.int (fun _ -> false)) in + Alcotest.(check unit) "Success-negative-trivial" () @@ run_test () + + let test_negative_test_unexpected_success () = + let name = "negative-trivial-test" in + let run_test () = check_exn QCheck2.(Test.make_neg ~name Gen.int (fun _ -> true)) in + try + run_test (); + Alcotest.failf "Negative test didn't raise expected exception." + with + Test.Test_unexpected_success n -> + Alcotest.(check string) (Printf.sprintf "%s: name" name) n name + let tests = ("Test.check_exn", Alcotest.[ test_case "check_exn pass trivial" `Quick test_pass_trivial; @@ -158,6 +172,8 @@ module Check_exn = struct test_case "check_exn fail always" `Quick test_fail_always; test_case "check_exn fail random" `Quick test_fail_random; test_case "check_exn Error" `Quick test_error; + test_case "check_exn negative pass trivial" `Quick test_negative_trivial; + test_case "check_exn Unexpected success" `Quick test_negative_test_unexpected_success; ]) end From 4ac10da138d8b293e9cb7b336b32cbb14be75608 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 2 May 2023 12:33:11 +0200 Subject: [PATCH 130/391] Add a CHANGELOG entry --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 04faafd6..ebe3bc95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## NEXT RELEASE +- make `Test.check_result`, `Test.check_cell_exn`, and + `Test.check_exn` honor test polarity by raising + `Test_unexpected_success` when a negative test (expected to have a + counter example), unexpectedly succeeds. - ... ## 0.20 From 8685dad2eee48d93e7afd8466a17ee1fa2ac331a Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 23 Feb 2023 15:08:44 +0100 Subject: [PATCH 131/391] correct is_rec_typ --- src/ppx_deriving_qcheck/ppx_deriving_qcheck.ml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ppx_deriving_qcheck/ppx_deriving_qcheck.ml b/src/ppx_deriving_qcheck/ppx_deriving_qcheck.ml index 8c26eef3..c9c02adb 100644 --- a/src/ppx_deriving_qcheck/ppx_deriving_qcheck.ml +++ b/src/ppx_deriving_qcheck/ppx_deriving_qcheck.ml @@ -111,8 +111,9 @@ let rec longident_to_str = function Printf.sprintf "%s %s" (longident_to_str lg1) (longident_to_str lg2) let rec is_rec_typ env = function - | { ptyp_desc = Ptyp_constr ({ txt = x; _ }, _); _ } -> - List.exists (fun typ_name -> longident_to_str x = typ_name) env.Env.curr_types + | { ptyp_desc = Ptyp_constr ({ txt = x; _ }, args); _ } -> + List.exists (fun typ_name -> longident_to_str x = typ_name) env.Env.curr_types || + List.exists (is_rec_typ env) args | { ptyp_desc = Ptyp_tuple xs; _ } -> List.exists (is_rec_typ env) xs | { ptyp_desc = Ptyp_variant (rws, _, _); _ } -> List.exists (is_rec_row_field env) rws From 0c2728f0038fe228ae3645d15a4c90ed7718eef4 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 23 Feb 2023 15:09:04 +0100 Subject: [PATCH 132/391] add test case --- .../deriver/qcheck/test_textual.ml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/ppx_deriving_qcheck/deriver/qcheck/test_textual.ml b/test/ppx_deriving_qcheck/deriver/qcheck/test_textual.ml index f30bedce..3df4b3da 100644 --- a/test/ppx_deriving_qcheck/deriver/qcheck/test_textual.ml +++ b/test/ppx_deriving_qcheck/deriver/qcheck/test_textual.ml @@ -860,6 +860,20 @@ let test_unused_variable () = in check_eq ~expected ~actual "deriving variant with unused fuel parameter" +(* Regression test: https://github.com/c-cube/qcheck/issues/269 *) +let test_faulty_is_rec_typ_in_variant () = + let expected = + [ + [%stri let rec gen_sized n = + QCheck.Gen.map (fun gen0 -> Foo gen0) (QCheck.Gen.list (gen_sized (n / 2)))]; + [%stri let gen = QCheck.Gen.sized gen_sized]; + [%stri let arb_sized n = QCheck.make @@ (gen_sized n)]; + [%stri let arb = QCheck.make @@ gen]; + ] + in + let actual = f @@ extract [%stri type t = Foo of t list] + in + check_eq ~expected ~actual "deriving rec type in a type constructor inside variant" let () = Alcotest.( @@ -907,5 +921,9 @@ let () = "deriving variant with unused fuel parameter" `Quick test_unused_variable; + test_case + "deriving rec type in a type constructor inside variant" + `Quick + test_faulty_is_rec_typ_in_variant; ] ); ]) From 78e8baf6a82bdfd30ed77bbe29a103bad72e1bb1 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 23 Feb 2023 15:28:22 +0100 Subject: [PATCH 133/391] fix is_rec_constr_decl record case --- src/ppx_deriving_qcheck/ppx_deriving_qcheck.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ppx_deriving_qcheck/ppx_deriving_qcheck.ml b/src/ppx_deriving_qcheck/ppx_deriving_qcheck.ml index c9c02adb..e501e540 100644 --- a/src/ppx_deriving_qcheck/ppx_deriving_qcheck.ml +++ b/src/ppx_deriving_qcheck/ppx_deriving_qcheck.ml @@ -129,7 +129,7 @@ and is_rec_row_field env rw = let is_rec_constr_decl env cd = match cd.pcd_args with | Pcstr_tuple cts -> List.exists (is_rec_typ env) cts - | _ -> false + | Pcstr_record ldcls -> List.exists (fun ldcl -> is_rec_typ env ldcl.pld_type) ldcls (** [is_rec_type_decl env typ] looks for elements of [env.curr_types] recursively in [typ]. *) From 08db79459d47240e06fe561f6d2acffa7f29cf1c Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 23 Feb 2023 15:29:05 +0100 Subject: [PATCH 134/391] add test case for is_rec_constr_decl record case --- .../deriver/qcheck/test_textual.ml | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/test/ppx_deriving_qcheck/deriver/qcheck/test_textual.ml b/test/ppx_deriving_qcheck/deriver/qcheck/test_textual.ml index 3df4b3da..4ba46d1f 100644 --- a/test/ppx_deriving_qcheck/deriver/qcheck/test_textual.ml +++ b/test/ppx_deriving_qcheck/deriver/qcheck/test_textual.ml @@ -875,6 +875,27 @@ let test_faulty_is_rec_typ_in_variant () = in check_eq ~expected ~actual "deriving rec type in a type constructor inside variant" +let test_faulty_is_rec_constr_decl () = + let expected = + [ + [%stri let rec gen_sized n = + match n with + | 0 -> QCheck.Gen.pure Foo + | _ -> + QCheck.Gen.frequency + [(1, (QCheck.Gen.pure Foo)); + (1, + (QCheck.Gen.map (fun gen0 -> Bar { baz = gen0 }) + (gen_sized (n / 2))))]]; + [%stri let gen = QCheck.Gen.sized gen_sized]; + [%stri let arb_sized n = QCheck.make @@ (gen_sized n)]; + [%stri let arb = QCheck.make @@ gen]; + ] + in + let actual = f @@ extract [%stri type t = Foo | Bar of { baz : t }] + in + check_eq ~expected ~actual "deriving rec type in a type constructor inside record" + let () = Alcotest.( run @@ -925,5 +946,9 @@ let () = "deriving rec type in a type constructor inside variant" `Quick test_faulty_is_rec_typ_in_variant; + test_case + "deriving rec type in a type constructor inside record" + `Quick + test_faulty_is_rec_constr_decl; ] ); ]) From d779d268db163f0e4914374f4be48cedace32db6 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 2 May 2023 12:16:33 +0200 Subject: [PATCH 135/391] Add CHANGELOG entry --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ebe3bc95..24196e7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ `Test.check_exn` honor test polarity by raising `Test_unexpected_success` when a negative test (expected to have a counter example), unexpectedly succeeds. +- fix issue with `ppx_deriving_qcheck` deriving a generator with unbound + `gen` for recursive types [#269](https://github.com/c-cube/qcheck/issues/269) + and a related issue when deriving a generator for a record type - ... ## 0.20 From aef6a67fd1e4250b7416e15f43b91164ad29dded Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 1 May 2023 15:19:47 +0200 Subject: [PATCH 136/391] Add string shrinker unit tests documenting old string shrinker behaviour --- test/core/QCheck_unit_tests.ml | 36 ++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/test/core/QCheck_unit_tests.ml b/test/core/QCheck_unit_tests.ml index 0d4ee74a..0e1833dd 100644 --- a/test/core/QCheck_unit_tests.ml +++ b/test/core/QCheck_unit_tests.ml @@ -81,6 +81,41 @@ module Shrink = struct ("char '~'", '~', ['p'; 'i'; 'e'; 'c'; 'b'; 'a']); ("char '\\n'", '\n', ['p'; 'i'; 'e'; 'c'; 'b'; 'a']); ] + let test_string () = + List.iter (alco_check Alcotest.string (trace_false Shrink.string) "on repeated failure") + [ ("string \"\"", "", []); + ("string \"a\"", "a", [""]); + ("string \"aa\"", "aa", [""; "a"; "a"]); + ("string \"aaaa\"", "aaaa", ["aa"; "aa"; "aaa"; "aaa"]); + ("string \"abcd\"", "abcd", ["ab"; "cd"; "acd"; "bcd"; "aacd"; "abbd"; "abcc"; "abcc"]); + ("string \"E'*\"", "E'*", ["E'"; "*"; "E*"; "'*"; "S'*"; "L'*"; "H'*"; "F'*"; "F'*"; + "ED*"; "E5*"; "E.*"; "E**"; "E(*"; "E(*"; "E'E"; "E'7"; + "E'0"; "E'-"; "E'+"; "E'+"]); + ("string \"vi5x92xgG\"", "vi5x92xgG", (* A less exhaustive string shrinker would be preferable *) + ["vi5x9"; "vi52xgG"; "vix92xgG"; "5x92xgG"; "v5x92xgG"; + "i5x92xgG"; "li5x92xgG"; "qi5x92xgG"; "ti5x92xgG"; + "ui5x92xgG"; "ve5x92xgG"; "vg5x92xgG"; "vh5x92xgG"; + "viKx92xgG"; "vi@x92xgG"; "vi:x92xgG"; "vi7x92xgG"; + "vi6x92xgG"; "vi5m92xgG"; "vi5s92xgG"; "vi5v92xgG"; + "vi5w92xgG"; "vi5xM2xgG"; "vi5xC2xgG"; "vi5x>2xgG"; + "vi5x;2xgG"; "vi5x:2xgG"; "vi5x9IxgG"; "vi5x9=xgG"; + "vi5x97xgG"; "vi5x94xgG"; "vi5x93xgG"; "vi5x92mgG"; + "vi5x92sgG"; "vi5x92vgG"; "vi5x92wgG"; "vi5x92xdG"; + "vi5x92xfG"; "vi5x92xfG"; "vi5x92xgT"; "vi5x92xgM"; + "vi5x92xgJ"; "vi5x92xgH"; "vi5x92xgH"]); + ("string \"~~~~\"", "~~~~", ["~~"; "~~"; "~~~"; "~~~"; "p~~~"; "w~~~"; "{~~~"; "}~~~"; + "}~~~"; "~p~~"; "~w~~"; "~{~~"; "~}~~"; "~}~~"; "~~p~"; + "~~w~"; "~~{~"; "~~}~"; "~~}~"; "~~~p"; "~~~w"; "~~~{"; + "~~~}"; "~~~}"]); ]; + List.iter (alco_check Alcotest.string (trace_true Shrink.string) "on repeated success") + [ ("string \"\"", "", []); + ("string \"a\"", "a", [""]); + ("string \"aa\"", "aa", [""]); + ("string \"aaaa\"", "aaaa", ["aa"; ""]); + ("string \"abcd\"", "abcd", ["ab"; ""]); + ("string \"E'*\"", "E'*", ["E'"; ""]); + ("string \"vi5x92xgG\"", "vi5x92xgG", ["vi5x9"; "vi5"; "vi"; ""]); ] + let tests = ("Shrink", Alcotest.[ test_case "int" `Quick test_int; test_case "int32" `Quick test_int32; @@ -88,6 +123,7 @@ module Shrink = struct test_case "char" `Quick test_char; test_case "char_numeral" `Quick test_char_numeral; test_case "char_printable" `Quick test_char_printable; + test_case "string" `Quick test_string; ]) end From 2f87559366e69d53363fa1350792a7e6a0407188 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 1 May 2023 13:41:21 +0200 Subject: [PATCH 137/391] Avoid duplicate int shrinker candidates --- src/core/QCheck.ml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index aca834e8..2809e6ed 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -677,8 +677,8 @@ module Shrink = struct let y = ref x in (* try some divisors *) while !y < -2 || !y >2 do y := !y / 2; yield (x - !y); done; (* fast path *) - if x>0 then yield (x-1); - if x<0 then yield (x+1); + if x = 1 || (x>0 && !y <> 1) then yield (x-1); + if x = -1 || (x<0 && !y <> -1) then yield (x+1); () let int32 x yield = @@ -686,8 +686,8 @@ module Shrink = struct let y = ref x in (* try some divisors *) while !y < -2l || !y > 2l do y := div !y 2l; yield (sub x !y); done; (* fast path *) - if x>0l then yield (pred x); - if x<0l then yield (succ x); + if x = 1l || (x>0l && !y <> 1l) then yield (pred x); + if x = -1l || (x<0l && !y <> -1l) then yield (succ x); () let int64 x yield = @@ -695,8 +695,8 @@ module Shrink = struct let y = ref x in (* try some divisors *) while !y < -2L || !y > 2L do y := div !y 2L; yield (sub x !y); done; (* fast path *) - if x>0L then yield (pred x); - if x<0L then yield (succ x); + if x = 1L || (x>0L && !y <> 1L) then yield (pred x); + if x = -1L || (x<0L && !y <> -1L) then yield (succ x); () (* aggressive shrinker for integers, From c1a9a0a4ff1bc145425665642a77879ea54274fd Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 1 May 2023 13:42:31 +0200 Subject: [PATCH 138/391] Avoid duplicate list shrinker candidates --- src/core/QCheck.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index 2809e6ed..f64de762 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -760,7 +760,7 @@ module Shrink = struct match l with | [] -> () | [_] -> yield [] - | [x;y] -> yield []; yield [x]; yield [y] + | [x;y] -> yield []; yield [x]; if x <> y then yield [y] | _::_ -> let len = List.length l in let xs,ys = split l ((1 + len) / 2) [] in From d495a9b674b1bd8ad9355118db9c2f6cd2b29e6d Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 1 May 2023 15:13:17 +0200 Subject: [PATCH 139/391] Update expected test outputs with improvement --- test/core/QCheck_unit_tests.ml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/test/core/QCheck_unit_tests.ml b/test/core/QCheck_unit_tests.ml index 0e1833dd..bbb01194 100644 --- a/test/core/QCheck_unit_tests.ml +++ b/test/core/QCheck_unit_tests.ml @@ -19,9 +19,9 @@ module Shrink = struct let test_int () = List.iter (alco_check Alcotest.int (trace_false Shrink.int) "on repeated failure") - [ ("int 100", 100, [50; 75; 88; 94; 97; 99; 99]); (*WTF?*) - ("int 1000", 1000, [500; 750; 875; 938; 969; 985; 993; 997; 999; 999]); (*WTF?*) - ("int (-26)", -26, [-13; -20; -23; -25; -25]) ]; (*WTF?*) + [ ("int 100", 100, [50; 75; 88; 94; 97; 99]); + ("int 1000", 1000, [500; 750; 875; 938; 969; 985; 993; 997; 999]); + ("int (-26)", -26, [-13; -20; -23; -25]) ]; List.iter (alco_check Alcotest.int (trace_true Shrink.int) "on repeated success") [ ("int 100", 100, [50; 25; 13; 7; 4; 2; 1; 0]); ("int 1000", 1000, [500; 250; 125; 63; 32; 16; 8; 4; 2; 1; 0]); @@ -29,9 +29,9 @@ module Shrink = struct let test_int32 () = List.iter (alco_check Alcotest.int32 (trace_false Shrink.int32) "on repeated failure") - [ ("int 100", 100l, [50l; 75l; 88l; 94l; 97l; 99l; 99l]); - ("int 1000", 1000l, [500l; 750l; 875l; 938l; 969l; 985l; 993l; 997l; 999l; 999l]); - ("int (-26)", -26l, [-13l; -20l; -23l; -25l; -25l]) ]; + [ ("int 100", 100l, [50l; 75l; 88l; 94l; 97l; 99l]); + ("int 1000", 1000l, [500l; 750l; 875l; 938l; 969l; 985l; 993l; 997l; 999l]); + ("int (-26)", -26l, [-13l; -20l; -23l; -25l]) ]; List.iter (alco_check Alcotest.int32 (trace_true Shrink.int32) "on repeated success") [ ("int 100", 100l, [50l; 25l; 13l; 7l; 4l; 2l; 1l; 0l]); ("int 1000", 1000l, [500l; 250l; 125l; 63l; 32l; 16l; 8l; 4l; 2l; 1l; 0l]); @@ -39,9 +39,9 @@ module Shrink = struct let test_int64 () = List.iter (alco_check Alcotest.int64 (trace_false Shrink.int64) "on repeated failure") - [ ("int 100", 100L, [50L; 75L; 88L; 94L; 97L; 99L; 99L]); - ("int 1000", 1000L, [500L; 750L; 875L; 938L; 969L; 985L; 993L; 997L; 999L; 999L]); - ("int (-26)", -26L, [-13L; -20L; -23L; -25L; -25L]) ]; + [ ("int 100", 100L, [50L; 75L; 88L; 94L; 97L; 99L]); + ("int 1000", 1000L, [500L; 750L; 875L; 938L; 969L; 985L; 993L; 997L; 999L]); + ("int (-26)", -26L, [-13L; -20L; -23L; -25L]) ]; List.iter (alco_check Alcotest.int64 (trace_true Shrink.int64) "on repeated success") [ ("int 100", 100L, [50L; 25L; 13L; 7L; 4L; 2L; 1L; 0L]); ("int 1000", 1000L, [500L; 250L; 125L; 63L; 32L; 16L; 8L; 4L; 2L; 1L; 0L]); @@ -50,9 +50,9 @@ module Shrink = struct let test_char () = List.iter (alco_check Alcotest.char (trace_false Shrink.char) "on repeated failure") [ ("char 'a'", 'a', []); - ("char 'z'", 'z', ['n'; 't'; 'w'; 'y'; 'y']); (*WTF?*) + ("char 'z'", 'z', ['n'; 't'; 'w'; 'y']); ("char 'A'", 'A', ['Q'; 'I'; 'E'; 'C'; 'B']); - ("char '~'", '~', ['p'; 'w'; '{'; '}'; '}']) ]; (*WTF?*) + ("char '~'", '~', ['p'; 'w'; '{'; '}']) ]; List.iter (alco_check Alcotest.char (trace_true Shrink.char) "on repeated success") [ ("char 'a'", 'a', []); ("char 'z'", 'z', ['n'; 'h'; 'e'; 'c'; 'b'; 'a']); @@ -72,8 +72,8 @@ module Shrink = struct [ ("char 'A'", 'A', ['Q'; 'I'; 'E'; 'C'; 'B']); ("char 'a'", 'a', []); ("char ' '", ' ', ['@'; '0'; '('; '$'; '"'; '!']); - ("char '~'", '~', ['p'; 'w'; '{'; '}'; '}']); (*WTF?*) - ("char '\\n'", '\n', ['p'; 'w'; '{'; '}'; '}']); ]; (*WTF?*) + ("char '~'", '~', ['p'; 'w'; '{'; '}']); + ("char '\\n'", '\n', ['p'; 'w'; '{'; '}']); ]; List.iter (alco_check Alcotest.char (trace_true Shrink.char_printable) "on repeated success") [ ("char 'A'", 'A', ['Q'; 'Y'; ']'; '_'; '`'; 'a']); ("char 'a'", 'a', []); From 65cab91672d598d5745812d924656559d126ba61 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 1 May 2023 15:19:02 +0200 Subject: [PATCH 140/391] Update expect test output with list_spine tweak --- test/core/QCheck_expect_test.expected.32 | 1 - test/core/QCheck_expect_test.expected.64 | 1 - test/core/QCheck_expect_test.expected.ocaml5 | 1 - 3 files changed, 3 deletions(-) diff --git a/test/core/QCheck_expect_test.expected.32 b/test/core/QCheck_expect_test.expected.32 index 50d79b29..deb2071f 100644 --- a/test/core/QCheck_expect_test.expected.32 +++ b/test/core/QCheck_expect_test.expected.32 @@ -74,7 +74,6 @@ random seed: 1234 [1; 1] [] [1] -[1] [0; 1] [1; 0] diff --git a/test/core/QCheck_expect_test.expected.64 b/test/core/QCheck_expect_test.expected.64 index 7accc9a8..4b32e050 100644 --- a/test/core/QCheck_expect_test.expected.64 +++ b/test/core/QCheck_expect_test.expected.64 @@ -106,7 +106,6 @@ random seed: 1234 [1; 1] [] [1] -[1] [0; 1] [1; 0] diff --git a/test/core/QCheck_expect_test.expected.ocaml5 b/test/core/QCheck_expect_test.expected.ocaml5 index 1572ed29..ed35317c 100644 --- a/test/core/QCheck_expect_test.expected.ocaml5 +++ b/test/core/QCheck_expect_test.expected.ocaml5 @@ -116,7 +116,6 @@ random seed: 1234 [2; 2] [] [2] -[2] [1; 2] [2; 1] From db031b56fbcec3cf3ada35e237936a8c62768c0d Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 1 May 2023 15:36:01 +0200 Subject: [PATCH 141/391] Update string shrinker output to improved behaviour --- test/core/QCheck_unit_tests.ml | 39 ++++++++++++++++------------------ 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/test/core/QCheck_unit_tests.ml b/test/core/QCheck_unit_tests.ml index bbb01194..f8e3f432 100644 --- a/test/core/QCheck_unit_tests.ml +++ b/test/core/QCheck_unit_tests.ml @@ -85,28 +85,25 @@ module Shrink = struct List.iter (alco_check Alcotest.string (trace_false Shrink.string) "on repeated failure") [ ("string \"\"", "", []); ("string \"a\"", "a", [""]); - ("string \"aa\"", "aa", [""; "a"; "a"]); - ("string \"aaaa\"", "aaaa", ["aa"; "aa"; "aaa"; "aaa"]); - ("string \"abcd\"", "abcd", ["ab"; "cd"; "acd"; "bcd"; "aacd"; "abbd"; "abcc"; "abcc"]); - ("string \"E'*\"", "E'*", ["E'"; "*"; "E*"; "'*"; "S'*"; "L'*"; "H'*"; "F'*"; "F'*"; - "ED*"; "E5*"; "E.*"; "E**"; "E(*"; "E(*"; "E'E"; "E'7"; - "E'0"; "E'-"; "E'+"; "E'+"]); + ("string \"aa\"", "aa", [""; "a"]); + ("string \"aaaa\"", "aaaa", ["aa"; "aa"; "aaa"]); + ("string \"abcd\"", "abcd", ["ab"; "cd"; "acd"; "bcd"; "aacd"; "abbd"; "abcc"]); + ("string \"E'*\"", "E'*", ["E'"; "*"; "E*"; "'*"; "S'*"; "L'*"; "H'*"; "F'*"; "ED*"; + "E5*"; "E.*"; "E**"; "E(*"; "E'E"; "E'7"; "E'0"; "E'-"; "E'+"]); ("string \"vi5x92xgG\"", "vi5x92xgG", (* A less exhaustive string shrinker would be preferable *) - ["vi5x9"; "vi52xgG"; "vix92xgG"; "5x92xgG"; "v5x92xgG"; - "i5x92xgG"; "li5x92xgG"; "qi5x92xgG"; "ti5x92xgG"; - "ui5x92xgG"; "ve5x92xgG"; "vg5x92xgG"; "vh5x92xgG"; - "viKx92xgG"; "vi@x92xgG"; "vi:x92xgG"; "vi7x92xgG"; - "vi6x92xgG"; "vi5m92xgG"; "vi5s92xgG"; "vi5v92xgG"; - "vi5w92xgG"; "vi5xM2xgG"; "vi5xC2xgG"; "vi5x>2xgG"; - "vi5x;2xgG"; "vi5x:2xgG"; "vi5x9IxgG"; "vi5x9=xgG"; - "vi5x97xgG"; "vi5x94xgG"; "vi5x93xgG"; "vi5x92mgG"; - "vi5x92sgG"; "vi5x92vgG"; "vi5x92wgG"; "vi5x92xdG"; - "vi5x92xfG"; "vi5x92xfG"; "vi5x92xgT"; "vi5x92xgM"; - "vi5x92xgJ"; "vi5x92xgH"; "vi5x92xgH"]); - ("string \"~~~~\"", "~~~~", ["~~"; "~~"; "~~~"; "~~~"; "p~~~"; "w~~~"; "{~~~"; "}~~~"; - "}~~~"; "~p~~"; "~w~~"; "~{~~"; "~}~~"; "~}~~"; "~~p~"; - "~~w~"; "~~{~"; "~~}~"; "~~}~"; "~~~p"; "~~~w"; "~~~{"; - "~~~}"; "~~~}"]); ]; + ["vi5x9"; "vi52xgG"; "vix92xgG"; "5x92xgG"; + "v5x92xgG"; "i5x92xgG"; "li5x92xgG"; "qi5x92xgG"; "ti5x92xgG"; "ui5x92xgG"; + "ve5x92xgG"; "vg5x92xgG"; "vh5x92xgG"; + "viKx92xgG"; "vi@x92xgG"; "vi:x92xgG"; "vi7x92xgG"; "vi6x92xgG"; + "vi5m92xgG"; "vi5s92xgG"; "vi5v92xgG"; "vi5w92xgG"; + "vi5xM2xgG"; "vi5xC2xgG"; "vi5x>2xgG"; "vi5x;2xgG"; "vi5x:2xgG"; + "vi5x9IxgG"; "vi5x9=xgG"; "vi5x97xgG"; "vi5x94xgG"; "vi5x93xgG"; + "vi5x92mgG"; "vi5x92sgG"; "vi5x92vgG"; "vi5x92wgG"; + "vi5x92xdG"; "vi5x92xfG"; + "vi5x92xgT"; "vi5x92xgM"; "vi5x92xgJ"; "vi5x92xgH"]); + ("string \"~~~~\"", "~~~~", ["~~"; "~~"; "~~~"; "p~~~"; "w~~~"; "{~~~"; "}~~~"; "~p~~"; + "~w~~"; "~{~~"; "~}~~"; "~~p~"; "~~w~"; "~~{~"; "~~}~"; + "~~~p"; "~~~w"; "~~~{"; "~~~}"]); ]; List.iter (alco_check Alcotest.string (trace_true Shrink.string) "on repeated success") [ ("string \"\"", "", []); ("string \"a\"", "a", [""]); From ea5bd224a918589b306b4c063b994345633c46aa Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 1 May 2023 17:58:46 +0200 Subject: [PATCH 142/391] Add CHANGELOG entry --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 24196e7a..67964879 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ - fix issue with `ppx_deriving_qcheck` deriving a generator with unbound `gen` for recursive types [#269](https://github.com/c-cube/qcheck/issues/269) and a related issue when deriving a generator for a record type +- fix #241 causing `QCheck.Shrink.int*` to emit duplicates, also affecting `QCheck.Shrink.{char,string}` +- fix a cornercase where `Shrink.list_spine` would emit duplicates - ... ## 0.20 From 8a9777e889366b76d79879da467d0508c6095bd2 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 2 May 2023 21:29:29 +0100 Subject: [PATCH 143/391] Update expected output for 32-bit ... again --- test/core/QCheck2_expect_test.expected.32 | 2 +- test/core/QCheck_expect_test.expected.32 | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/test/core/QCheck2_expect_test.expected.32 b/test/core/QCheck2_expect_test.expected.32 index 597728f6..126bcd4b 100644 --- a/test/core/QCheck2_expect_test.expected.32 +++ b/test/core/QCheck2_expect_test.expected.32 @@ -270,7 +270,7 @@ Test char never produces 'abcdef' failed (1 shrink steps): --- Failure -------------------------------------------------------------------- -Test printable never produces '!"#$%&'' failed (1 shrink steps): +Test printable never produces '!"#$%&' failed (1 shrink steps): '!' diff --git a/test/core/QCheck_expect_test.expected.32 b/test/core/QCheck_expect_test.expected.32 index deb2071f..865566a8 100644 --- a/test/core/QCheck_expect_test.expected.32 +++ b/test/core/QCheck_expect_test.expected.32 @@ -497,6 +497,12 @@ Leaf 0 --- Failure -------------------------------------------------------------------- +Test sum list = 0 failed (0 shrink steps): + +[7; 1; 42; 1; 8; 5; 3; 9; 5; 38; 3; 3; 0; 1; 98; 1; 4; 13; 9; 2; 6; 9; 47; 6; 5; 8; 8; 6; 0; 9; 7; 2; 8; 6; 62; 6; 4; 31; 19; 1; 41; 60; 6; 5; 8; 1; 1; 4; 7; 7; 0; 5; 5; 71; 14; 26; 47; 5; 1; 6; 34; 9; 4; 2; 37; 3; 8; 4; 31; 6; 2; 1; 0; 7; 5; 1; 0; 15; 6; 1; 8; 13; 0; 6; 2; 4; 2; 6; 6; 1; 4; 1; 9; 79; 0; 87; 6; 8; 8; 62; 1; 4; 62; 6; 31; 1; 5; 6; 5; 9; 3; 3; 1; 79; 4; 3; 2; 67; 5; 7; 12; 70; 8; 8; 6; 1; 3; 14; 15; 1; 61; 4; 1; 4; 1; 7; 4; 4; 4; 2; 8; 8; 7; 5; 4; 27; 0; 9; 80; 25; 1; 8; 1; 3; 7; 4; 3; 5; 5; 6; 5; 5; 31; 7; 0; 3; 3; 6; 71; 76; 28; 60; 6; 2; 6; 3; 0; 4; 1; 0; 5; 7; 0; 28; 86; 4; 7; 51; 36; 0; 5; 0; 1; 4; 3; 6; 0; 1; 1; 8; 18; 4; 2; 8; 8; 1; 4; 7; 1; 0; 93; 5; 3; 0; 80; 1; 7; 7; 8; 8; 5; 7; 8; 9; 24; 4; 25; 8; 8; 5; 4; 90; 4; 6; 8; 4; 4; 0; 60; 8; 9; 7; 44; 5; 1; 2; 9; 74; 7; 7] + +--- Failure -------------------------------------------------------------------- + Test fail_pred_map_commute failed (47 shrink steps): ([1], {_ -> 0}, {0 -> false; _ -> true}) @@ -1361,7 +1367,7 @@ stats dist: 966367653.. 1073741823: ################# 189 ================================================================================ 1 warning(s) -failure (63 tests failed, 3 tests errored, ran 148 tests) +failure (64 tests failed, 3 tests errored, ran 149 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ From e6f26893f262402a21c4038c828c981984fe6439 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 3 May 2023 09:40:40 +0100 Subject: [PATCH 144/391] Add expect test output for 32-bit OCaml5 --- .../alcotest/output.txt.expected.ocaml5.32 | 82 + example/ounit/output.txt.expected.ocaml5.32 | 62 + example/output.txt.expected.ocaml5.32 | 333 ++++ .../QCheck2_expect_test.expected.ocaml5.32 | 1428 +++++++++++++++++ .../QCheck_expect_test.expected.ocaml5.32 | 1408 ++++++++++++++++ 5 files changed, 3313 insertions(+) create mode 100644 example/alcotest/output.txt.expected.ocaml5.32 create mode 100644 example/ounit/output.txt.expected.ocaml5.32 create mode 100644 example/output.txt.expected.ocaml5.32 create mode 100644 test/core/QCheck2_expect_test.expected.ocaml5.32 create mode 100644 test/core/QCheck_expect_test.expected.ocaml5.32 diff --git a/example/alcotest/output.txt.expected.ocaml5.32 b/example/alcotest/output.txt.expected.ocaml5.32 new file mode 100644 index 00000000..a50cc8eb --- /dev/null +++ b/example/alcotest/output.txt.expected.ocaml5.32 @@ -0,0 +1,82 @@ +qcheck random seed: 1234 +Testing `my test'. + [OK] suite 0 list_rev_is_involutive. + [FAIL] suite 1 fail_sort_id. + [FAIL] suite 2 error_raise_exn. + [OK] suite 3 neg test pass (failing as expected). + [FAIL] suite 4 neg test unexpected success. + [FAIL] suite 5 neg fail with error. + [FAIL] suite 6 fail_check_err_message. + [OK] suite 7 tree_rev_is_involutive. + [FAIL] shrinking 0 debug_shrink. +┌──────────────────────────────────────────────────────────────────────────────┐ +│ [FAIL] suite 1 fail_sort_id. │ +└──────────────────────────────────────────────────────────────────────────────┘ +test `fail_sort_id` failed on ≥ 1 cases: [1; 0] (after 16 shrink steps) +[exception] test `fail_sort_id` failed on ≥ 1 cases: [1; 0] (after 16 shrink steps) + ────────────────────────────────────────────────────────────────────────────── +┌──────────────────────────────────────────────────────────────────────────────┐ +│ [FAIL] suite 2 error_raise_exn. │ +└──────────────────────────────────────────────────────────────────────────────┘ +test `error_raise_exn` +raised exception `Error` +on `0 (after 30 shrink steps)` +[exception] test `error_raise_exn` +raised exception `Error` +on `0 (after 30 shrink steps)` + ────────────────────────────────────────────────────────────────────────────── +┌──────────────────────────────────────────────────────────────────────────────┐ +│ [FAIL] suite 4 neg test unexpected success. │ +└──────────────────────────────────────────────────────────────────────────────┘ +negative test 'neg test unexpected success' succeeded unexpectedly +[exception] negative test `neg test unexpected success` succeeded unexpectedly + ────────────────────────────────────────────────────────────────────────────── +┌──────────────────────────────────────────────────────────────────────────────┐ +│ [FAIL] suite 5 neg fail with error. │ +└──────────────────────────────────────────────────────────────────────────────┘ +test `neg fail with error` +raised exception `Error` +on `0 (after 7 shrink steps)` +[exception] test `neg fail with error` +raised exception `Error` +on `0 (after 7 shrink steps)` + ────────────────────────────────────────────────────────────────────────────── +┌──────────────────────────────────────────────────────────────────────────────┐ +│ [FAIL] suite 6 fail_check_err_message. │ +└──────────────────────────────────────────────────────────────────────────────┘ +test `fail_check_err_message` failed on ≥ 1 cases: +0 (after 7 shrink steps) +this +will +always +fail +[exception] test `fail_check_err_message` failed on ≥ 1 cases: +0 (after 7 shrink steps) +this +will +always +fail + ────────────────────────────────────────────────────────────────────────────── +┌──────────────────────────────────────────────────────────────────────────────┐ +│ [FAIL] shrinking 0 debug_shrink. │ +└──────────────────────────────────────────────────────────────────────────────┘ +~~~ Shrink ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Test debug_shrink successfully shrunk counter example (step 0) to: +(2, 3) +~~~ Shrink ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Test debug_shrink successfully shrunk counter example (step 1) to: +(1, 3) +~~~ Shrink ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Test debug_shrink successfully shrunk counter example (step 2) to: +(0, 3) +~~~ Shrink ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Test debug_shrink successfully shrunk counter example (step 3) to: +(0, 2) +~~~ Shrink ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Test debug_shrink successfully shrunk counter example (step 4) to: +(0, 1) +law debug_shrink: 1 relevant cases (1 total) +test `debug_shrink` failed on ≥ 1 cases: (0, 1) (after 4 shrink steps) +[exception] test `debug_shrink` failed on ≥ 1 cases: (0, 1) (after 4 shrink steps) + ────────────────────────────────────────────────────────────────────────────── +6 failures! 9 tests run. diff --git a/example/ounit/output.txt.expected.ocaml5.32 b/example/ounit/output.txt.expected.ocaml5.32 new file mode 100644 index 00000000..3c8260a8 --- /dev/null +++ b/example/ounit/output.txt.expected.ocaml5.32 @@ -0,0 +1,62 @@ +.FE.FEF. +============================================================================== +Error: tests:5:neg fail with error. + +Error: tests:5:neg fail with error (in the log). + + +test `neg fail with error` +raised exception `Dune__exe__QCheck_ounit_test.Error` +on `0 (after 7 shrink steps)` + +------------------------------------------------------------------------------ +============================================================================== +Error: tests:2:error_raise_exn. + +Error: tests:2:error_raise_exn (in the log). + + +test `error_raise_exn` raised exception `Dune__exe__QCheck_ounit_test.Error` +on `0 (after 30 shrink steps)` + +------------------------------------------------------------------------------ +============================================================================== +Error: tests:6:fail_check_err_message. + +Error: tests:6:fail_check_err_message (in the log). + + + +test `fail_check_err_message` failed on ≥ 1 cases: +0 (after 7 shrink steps) +this +will +always +fail + + + +------------------------------------------------------------------------------ +============================================================================== +Error: tests:4:neg test unexpected success. + +Error: tests:4:neg test unexpected success (in the log). + + + +negative test 'neg test unexpected success' succeeded unexpectedly + +------------------------------------------------------------------------------ +============================================================================== +Error: tests:1:fail_sort_id. + +Error: tests:1:fail_sort_id (in the log). + + + +test `fail_sort_id` failed on ≥ 1 cases: [1; 0] (after 16 shrink steps) + + +------------------------------------------------------------------------------ +Ran: 8 tests in: <nondet> seconds. +FAILED: Cases: 8 Tried: 8 Errors: 2 Failures: 3 Skip: 0 Todo: 0 Timeouts: 0. diff --git a/example/output.txt.expected.ocaml5.32 b/example/output.txt.expected.ocaml5.32 new file mode 100644 index 00000000..4a96b674 --- /dev/null +++ b/example/output.txt.expected.ocaml5.32 @@ -0,0 +1,333 @@ +random seed: 1234 + +--- Failure -------------------------------------------------------------------- + +Test should_fail_sort_id failed (10 shrink steps): + +[1; 0] + +=== Error ====================================================================== + +Test should_error_raise_exn errored on (30 shrink steps): + +0 + +exception Dune__exe__QCheck_runner_test.Error + + ++++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Collect results for test collect_results: + +4: 24 cases +3: 20 cases +2: 18 cases +1: 21 cases +0: 17 cases + ++++ Stats for with_stats ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats mod4: + num: 100, avg: 1.56, stddev: 1.18, median 2, min 0, max 3 + 0: ################################################# 27 + 1: #################################### 20 + 2: ########################################## 23 + 3: ####################################################### 30 + +stats num: + num: 100, avg: 62.24, stddev: 33.15, median 62, min 2, max 120 + 2.. 7: ######### 2 + 8.. 13: ################################ 7 + 14.. 19: ########################### 6 + 20.. 25: ############# 3 + 26.. 31: ###################### 5 + 32.. 37: ################## 4 + 38.. 43: ############# 3 + 44.. 49: ################################ 7 + 50.. 55: ################################ 7 + 56.. 61: ###################### 5 + 62.. 67: #################################### 8 + 68.. 73: ######### 2 + 74.. 79: ###################### 5 + 80.. 85: ######### 2 + 86.. 91: ####################################################### 12 + 92.. 97: ###################### 5 + 98..103: ################## 4 + 104..109: ################## 4 + 110..115: ############# 3 + 116..121: ########################### 6 + +--- Failure -------------------------------------------------------------------- + +Test neg test unexpected success failed: + +Negative test neg test unexpected success succeeded but was expected to fail + +=== Error ====================================================================== + +Test neg fail with error errored on (7 shrink steps): + +0 + +exception Dune__exe__QCheck_runner_test.Error + + +--- Failure -------------------------------------------------------------------- + +Test FAIL_pred_map_commute failed (47 shrink steps): + +([1], {_ -> 0}, {1 -> true; _ -> false}) + +--- Failure -------------------------------------------------------------------- + +Test FAIL_fun2_pred_strings failed (1 shrink steps): + +{some other string -> false; _ -> true} + +--- Failure -------------------------------------------------------------------- + +Test fold_left fold_right failed (21 shrink steps): + +(0, [1], {(0, 1) -> 1; _ -> 0}) + ++++ Messages ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Messages for test fold_left fold_right: + +l=[1], fold_left=0, fold_right=1 + + +--- Failure -------------------------------------------------------------------- + +Test fold_left fold_right uncurried failed (41 shrink steps): + +({(0, 4) -> 1; _ -> 0}, 0, [4]) + +--- Failure -------------------------------------------------------------------- + +Test long_shrink failed (86 shrink steps): + +([0], [-1]) + +--- Failure -------------------------------------------------------------------- + +Test mod3_should_fail failed (26 shrink steps): + +2061 + ++++ Stats for stats_neg ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 5000, avg: 0.43, stddev: 28.63, median 0, min -99, max 99 + -99..-90: # 45 + -89..-80: # 57 + -79..-70: # 68 + -69..-60: # 58 + -59..-50: # 76 + -49..-40: # 67 + -39..-30: # 52 + -29..-20: # 54 + -19..-10: # 47 + -9.. 0: ####################################################### 2205 + 1.. 10: ########################################## 1697 + 11.. 20: # 57 + 21.. 30: # 70 + 31.. 40: # 60 + 41.. 50: # 66 + 51.. 60: # 75 + 61.. 70: # 68 + 71.. 80: # 63 + 81.. 90: # 66 + 91..100: # 49 + +!!! Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +Warning for test WARN_unlikely_precond: + +WARNING: only 0.5% tests (of 2000) passed precondition for "WARN_unlikely_precond" + +NOTE: it is likely that the precondition is too strong, or that the generator is buggy. + +--- Failure -------------------------------------------------------------------- + +Test FAIL_unlikely_precond failed: + +ERROR: only 0.5% tests (of 2000) passed precondition for "FAIL_unlikely_precond" + +NOTE: it is likely that the precondition is too strong, or that the generator is buggy. + + +--- Failure -------------------------------------------------------------------- + +Test FAIL_#99_1 failed: + +ERROR: uncaught exception in generator for test FAIL_#99_1 after 100 steps: +Exception: QCheck.No_example_found("<example>") +Backtrace: + ++++ Stats for stat_display_test_1 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 0.86, stddev: 29.11, median 0, min -97, max 99 + -97..-88: # 12 + -87..-78: # 12 + -77..-68: # 13 + -67..-58: # 12 + -57..-48: # 9 + -47..-38: ## 17 + -37..-28: # 13 + -27..-18: # 8 + -17.. -8: ######### 76 + -7.. 2: ####################################################### 437 + 3.. 12: ################################## 276 + 13.. 22: ## 16 + 23.. 32: # 11 + 33.. 42: ## 16 + 43.. 52: # 9 + 53.. 62: # 12 + 63.. 72: # 14 + 73.. 82: # 12 + 83.. 92: # 13 + 93..102: # 12 + ++++ Stats for stat_display_test_2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 15.86, stddev: 24.57, median 6, min 0, max 99 + 0.. 4: ###################################################### 387 + 5.. 9: ####################################################### 390 + 10.. 14: # 11 + 15.. 19: # 8 + 20.. 24: # 11 + 25.. 29: ## 15 + 30.. 34: # 9 + 35.. 39: # 11 + 40.. 44: # 11 + 45.. 49: ## 19 + 50.. 54: # 10 + 55.. 59: ## 19 + 60.. 64: # 9 + 65.. 69: # 9 + 70.. 74: ## 19 + 75.. 79: # 13 + 80.. 84: # 11 + 85.. 89: ## 16 + 90.. 94: # 9 + 95.. 99: # 13 + ++++ Stats for stat_display_test_3 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 193479.13, stddev: 136696.70, median 189823, min -43164, max 434961 + -43164..-19258: ################################### 42 + -19257.. 4649: ############################################## 56 + 4650.. 28556: ############################################# 55 + 28557.. 52463: ############################################### 57 + 52464.. 76370: ######################################### 50 + 76371..100277: ############################# 35 + 100278..124184: ############################################### 57 + 124185..148091: #################################### 44 + 148092..171998: ############################################## 56 + 171999..195905: ####################################################### 66 + 195906..219812: ########################################### 52 + 219813..243719: ######################################## 49 + 243720..267626: ################################ 39 + 267627..291533: ##################################### 45 + 291534..315440: ##################################### 45 + 315441..339347: ################################################# 59 + 339348..363254: ################################################## 60 + 363255..387161: ################################# 40 + 387162..411068: ########################################## 51 + 411069..434975: ################################### 42 + ++++ Stats for stat_display_test_4 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: -591.06, stddev: 23026.79, median -911, min -39911, max 39959 + -39911..-35918: ####################################### 45 + -35917..-31924: #################################################### 59 + -31923..-27930: ########################################### 49 + -27929..-23936: ########################################## 48 + -23935..-19942: ####################################################### 62 + -19941..-15948: ############################################# 51 + -15947..-11954: ######################################### 47 + -11953.. -7960: ################################################# 56 + -7959.. -3966: ################################### 40 + -3965.. 28: ################################################### 58 + 29.. 4022: ########################################### 49 + 4023.. 8016: ############################################### 53 + 8017.. 12010: ############################################ 50 + 12011.. 16004: ################################### 40 + 16005.. 19998: ####################################### 44 + 19999.. 23992: ####################################################### 62 + 23993.. 27986: ##################################### 42 + 27987.. 31980: ######################################### 47 + 31981.. 35974: ########################################## 48 + 35975.. 39968: ############################################ 50 + ++++ Stats for stat_display_test_5 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: -0.12, stddev: 2.52, median 0, min -4, max 4 + -4: ########################################## 116 + -3: ###################################### 103 + -2: ############################################## 125 + -1: ########################################## 115 + 0: ####################################### 106 + 1: ####################################################### 149 + 2: ################################# 92 + 3: ################################# 92 + 4: ##################################### 102 + ++++ Stats for stat_display_test_6 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 6.42, stddev: 6.43, median 6, min -4, max 17 + -4..-3: ########################################### 89 + -2..-1: ################################################# 101 + 0.. 1: ############################################## 95 + 2.. 3: ########################################### 89 + 4.. 5: ############################################## 95 + 6.. 7: ##################################### 78 + 8.. 9: ####################################### 81 + 10..11: ######################################## 84 + 12..13: ####################################################### 113 + 14..15: ######################################## 84 + 16..17: ############################################ 91 + 18..19: 0 + 20..21: 0 + 22..23: 0 + 24..25: 0 + 26..27: 0 + 28..29: 0 + 30..31: 0 + 32..33: 0 + 34..35: 0 + ++++ Stats for stat_display_test_7 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 100000, avg: -2481754.31, stddev: 618398387.27, median -5669677, min -1073719962, max 1073717275 + -1073719962.. -966348101: ##################################################### 4978 + -966348100.. -858976239: ##################################################### 5008 + -858976238.. -751604377: #################################################### 4907 + -751604376.. -644232515: ###################################################### 5037 + -644232514.. -536860653: ###################################################### 5069 + -536860652.. -429488791: ###################################################### 5052 + -429488790.. -322116929: ###################################################### 5035 + -322116928.. -214745067: ####################################################### 5128 + -214745066.. -107373205: ##################################################### 5017 + -107373204.. -1343: ##################################################### 5021 + -1342.. 107370519: ##################################################### 5010 + 107370520.. 214742381: ##################################################### 4964 + 214742382.. 322114243: ##################################################### 4957 + 322114244.. 429486105: ##################################################### 4994 + 429486106.. 536857967: ##################################################### 5025 + 536857968.. 644229829: ###################################################### 5047 + 644229830.. 751601691: ##################################################### 4988 + 751601692.. 858973553: #################################################### 4924 + 858973554.. 966345415: #################################################### 4852 + 966345416.. 1073717277: ##################################################### 4987 +================================================================================ +1 warning(s) +failure (10 tests failed, 2 tests errored, ran 28 tests) diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.32 b/test/core/QCheck2_expect_test.expected.ocaml5.32 new file mode 100644 index 00000000..4526d5f9 --- /dev/null +++ b/test/core/QCheck2_expect_test.expected.ocaml5.32 @@ -0,0 +1,1428 @@ +random seed: 1234 +45 4 0 0 0 0 0 0 0 0 0 0 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 (8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) +(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) +(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) +(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) +(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) +(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) +(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) +(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) +-466273346 +409792091 +0 +204896045 +0 +102448022 +0 +51224011 +0 +25612005 +0 +12806002 +0 +6403001 +0 +3201500 +0 +1600750 +0 +800375 +0 +400187 +0 +200093 +0 +100046 +0 +50023 +0 +25011 +0 +12505 +0 +6252 +0 +3126 +0 +1563 +0 +781 +0 +390 +0 +195 +0 +97 +0 +48 +0 +24 +0 +12 +0 +6 +0 +3 +0 +1 +0 +[46; 2; 22; 4; 4; 2; 6; 5; 88; 24; 7; 9; 9; 2; 5; 1; 55; 8; 45; 1; 96; 0; 1; 2; 7; 4; 1; 5; 95; 6; 8; 6; 4; 0; 5; 5; 22; 87; 2; 1; 1; 0; 2; 2; 9; 5; 9; 3; 7; 59; 7; 96; 6; 5; 1; 3; 9; 9; 65; 6; 7; 7; 2; 5; 0; 0; 70; 5; 5; 2; 1; 57; 9; 7; 8; 10; 9; 7; 9; 75; 73; 80; 7; 9; 4; 3; 16; 5; 79; 1; 8; 6; 2; 3; 4; 9; 2; 8; 4; 6; 50; 2; 1; 5; 9; 5; 4; 3; 56; 6; 5; 9; 4; 1; 47; 1; 2; 5; 2; 0; 7; 31; 55; 6; 7; 4; 7; 8; 8; 2; 4; 40; 4; 6; 9; 3; 59; 5; 1; 0; 2; 6; 90; 1; 6; 81; 0; 1; 3; 7; 2; 4; 5; 4; 7; 3; 62; 0; 1; 6; 7; 5; 97; 83; 41; 7; 2; 6; 3; 0; 4; 8; 99; 8; 6; 0; 7; 9; 7; 1; 55; 30; 25; 3; 4; 7; 1; 6; 80; 8; 0; 4; 21; 3; 5; 9; 27; 10; 60; 47; 54; 6; 5; 8; 1; 5; 9; 65; 9; 5; 7; 7; 6; 48; 9; 5; 6; 4; 9; 7; 1; 2; 71; 6; 9; 2; 7; 8; 14; 59; 71; 30; 7; 3; 5; 4; 6; 7; 3; 6; 9; 8; 2; 38; 6; 6; 7; 1; 5; 2; 43; 5; 2; 9; 3; 0; 3; 2; 7; 71; 26; 3; 9; 11; 5; 1; 5; 2; 53; 46; 4; 6; 7; 67; 1; 0; 34; 0; 48; 5; 5; 0; 7; 49; 92; 8; 3; 0; 67; 1; 5; 2; 9; 5; 9; 3; 1; 4; 8; 0; 3; 6; 46; 58; 1; 54; 77; 0; 96; 1; 6; 2; 8; 22; 3; 9; 2; 6; 25; 49; 9; 6; 3; 8; 5; 9; 54; 1; 7; 5; 6; 5; 1; 7; 8; 23; 4; 6; 4; 2; 5; 8; 4; 7; 4] +[] +[7; 79; 86; 1; 70; 98; 1; 4; 7; 9; 5; 8; 0; 1; 2; 0; 6; 0; 37; 6; 8; 26; 6; 8; 8; 98; 6; 8; 1; 6; 2; 4; 4; 7; 26; 1; 77; 2; 9; 9; 81; 8; 9; 4; 0; 86; 9; 3; 7; 0; 54; 2; 4; 1; 6; 4; 55; 5; 0; 9; 2; 1; 3; 8; 7; 1; 1; 3; 92; 1; 3; 4; 5; 2; 8; 51; 2; 94; 6; 82; 0; 11; 86; 1; 36; 31; 3; 2; 3; 8; 2; 8; 14; 26; 89; 1; 6; 0; 9; 5; 6; 7; 1; 6; 1; 6; 4; 7; 8; 8; 4; 1; 6; 3; 1; 5; 0; 6; 0; 5; 0; 4; 3; 49; 5; 8; 37; 8; 38; 0; 1; 8; 59; 5; 0; 7; 37; 87; 9; 3; 1; 5; 59; 8; 7; 6; 26; 4; 8; 8; 8; 9; 3; 2; 6; 64; 6; 7; 2; 8; 5; 2; 94; 26; 98; 3; 29; 2; 1; 72; 2; 49] +[] +[8; 13; 1; 18; 0; 69; 15; 2; 5; 78; 7; 32; 8; 36; 7; 3; 0; 9; 1; 1; 1; 29; 3; 8; 7; 2; 1; 8; 7; 8; 22; 5; 49; 5; 0; 1; 8; 5; 6; 7; 5; 1; 9; 73; 55; 2; 4; 7; 3; 4; 2; 27; 0; 6; 9; 1; 7; 8; 5; 12; 5; 8; 9; 1; 95; 1; 0; 1; 4; 8; 6; 7; 0; 8; 2; 3; 7; 3; 9; 0; 86; 96; 72; 3; 4; 25] +[] +[4; 3; 6; 5; 0; 0; 9; 7; 0; 6; 5; 3; 0; 24; 5; 6; 86; 9; 9; 0; 7; 2; 6; 6; 3; 45; 6; 1; 17; 1; 2; 2; 3; 0; 4; 1; 8; 2; 6; 9; 5; 0; 2] +[] +[9; 7; 62; 0; 73; 0; 8; 94; 0; 6; 50; 9; 83; 0; 5; 40; 6; 1; 6; 6; 6] +[] +[6; 5; 2; 54; 33; 9; 1; 1; 1; 61] +[] +[5; 7; 0; 65; 0] +[] +[2; 7] +[] +[6] +[] +[0] +[46; 2; 22; 4; 4; 2; 6; 5; 88; 24; 7; 9; 9; 2; 5; 1; 55; 8; 45; 1; 96; 0; 1; 2; 7; 4; 1; 5; 95; 6; 8; 6; 4; 0; 5; 5; 22; 87; 2; 1; 1; 0; 2; 2; 9; 5; 9; 3; 7; 59; 7; 96; 6; 5; 1; 3; 9; 9; 65; 6; 7; 7; 2; 5; 0; 0; 70; 5; 5; 2; 1; 57; 9; 7; 8; 10; 9; 7; 9; 75; 73; 80; 7; 9; 4; 3; 16; 5; 79; 1; 8; 6; 2; 3; 4; 9; 2; 8; 4; 6; 50; 2; 1; 5; 9; 5; 4; 3; 56; 6; 5; 9; 4; 1; 47; 1; 2; 5; 2; 0; 7; 31; 55; 6; 7; 4; 7; 8; 8; 2; 4; 40; 4; 6; 9; 3; 59; 5; 1; 0; 2; 6; 90; 1; 6; 81; 0; 1; 3; 7; 2; 4; 5; 4; 7; 3; 62; 0; 1; 6; 7; 5; 97; 83; 41; 7; 2; 6; 3; 0; 4; 8; 99; 8; 6; 0; 7; 9; 7; 1; 55; 30; 25; 3; 4; 7; 1; 6; 80; 8; 0; 4; 21; 3; 5; 9; 27; 10; 60; 47; 54; 6; 5; 8; 1; 5; 9; 65; 9; 5; 7; 7; 6; 48; 9; 5; 6; 4; 9; 7; 1; 2; 71; 6; 9; 2; 7; 8; 14; 59; 71; 30; 7; 3; 5; 4; 6; 7; 3; 6; 9; 8; 2; 38; 6; 6; 7; 1; 5; 2; 43; 5; 2; 9; 3; 0; 3; 2; 7; 71; 26; 3; 9; 11; 5; 1; 5; 2; 53; 46; 4; 6; 7; 67; 1; 0; 34; 0; 48; 5; 5; 0; 7; 49; 92; 8; 3; 0; 67; 1; 5; 2; 9; 5; 9; 3; 1; 4; 8; 0; 3; 6; 46; 58; 1; 54; 77; 0; 96; 1; 6; 2; 8; 22; 3; 9; 2; 6; 25; 49; 9; 6; 3; 8; 5; 9; 54; 1; 7; 5; 6; 5; 1; 7; 8; 23; 4; 6; 4; 2; 5; 8; 4; 7; 4] +[] +[7; 79; 86; 1; 70; 98; 1; 4; 7; 9; 5; 8; 0; 1; 2; 0; 6; 0; 37; 6; 8; 26; 6; 8; 8; 98; 6; 8; 1; 6; 2; 4; 4; 7; 26; 1; 77; 2; 9; 9; 81; 8; 9; 4; 0; 86; 9; 3; 7; 0; 54; 2; 4; 1; 6; 4; 55; 5; 0; 9; 2; 1; 3; 8; 7; 1; 1; 3; 92; 1; 3; 4; 5; 2; 8; 51; 2; 94; 6; 82; 0; 11; 86; 1; 36; 31; 3; 2; 3; 8; 2; 8; 14; 26; 89; 1; 6; 0; 9; 5; 6; 7; 1; 6; 1; 6; 4; 7; 8; 8; 4; 1; 6; 3; 1; 5; 0; 6; 0; 5; 0; 4; 3; 49; 5; 8; 37; 8; 38; 0; 1; 8; 59; 5; 0; 7; 37; 87; 9; 3; 1; 5; 59; 8; 7; 6; 26; 4; 8; 8; 8; 9; 3; 2; 6; 64; 6; 7; 2; 8; 5; 2; 94; 26; 98; 3; 29; 2; 1; 72; 2; 49] +[] +[8; 13; 1; 18; 0; 69; 15; 2; 5; 78; 7; 32; 8; 36; 7; 3; 0; 9; 1; 1; 1; 29; 3; 8; 7; 2; 1; 8; 7; 8; 22; 5; 49; 5; 0; 1; 8; 5; 6; 7; 5; 1; 9; 73; 55; 2; 4; 7; 3; 4; 2; 27; 0; 6; 9; 1; 7; 8; 5; 12; 5; 8; 9; 1; 95; 1; 0; 1; 4; 8; 6; 7; 0; 8; 2; 3; 7; 3; 9; 0; 86; 96; 72; 3; 4; 25] +[] +[4; 3; 6; 5; 0; 0; 9; 7; 0; 6; 5; 3; 0; 24; 5; 6; 86; 9; 9; 0; 7; 2; 6; 6; 3; 45; 6; 1; 17; 1; 2; 2; 3; 0; 4; 1; 8; 2; 6; 9; 5; 0; 2] +[] +[9; 7; 62; 0; 73; 0; 8; 94; 0; 6; 50; 9; 83; 0; 5; 40; 6; 1; 6; 6; 6] +[] +[6; 5; 2; 54; 33; 9; 1; 1; 1; 61] +[] +[5; 7; 0; 65; 0] +[] +[2; 7] +[4; 6; 6] +[] +[7] +[6; 41] +[0; 6; 6] +[0; 0; 6] +[0; 0; 0] + +--- Failure -------------------------------------------------------------------- + +Test should_fail_sort_id failed (11 shrink steps): + +[1; 0] + +=== Error ====================================================================== + +Test should_error_raise_exn errored on (2 shrink steps): + +0 + +exception QCheck2_tests.Overall.Error + + ++++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Collect results for test collect_results: + +4: 24 cases +3: 20 cases +2: 18 cases +1: 21 cases +0: 17 cases + ++++ Stats for with_stats ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats mod4: + num: 100, avg: 1.56, stddev: 1.18, median 2, min 0, max 3 + 0: ################################################# 27 + 1: #################################### 20 + 2: ########################################## 23 + 3: ####################################################### 30 + +stats num: + num: 100, avg: 62.24, stddev: 33.15, median 62, min 2, max 120 + 2.. 7: ######### 2 + 8.. 13: ################################ 7 + 14.. 19: ########################### 6 + 20.. 25: ############# 3 + 26.. 31: ###################### 5 + 32.. 37: ################## 4 + 38.. 43: ############# 3 + 44.. 49: ################################ 7 + 50.. 55: ################################ 7 + 56.. 61: ###################### 5 + 62.. 67: #################################### 8 + 68.. 73: ######### 2 + 74.. 79: ###################### 5 + 80.. 85: ######### 2 + 86.. 91: ####################################################### 12 + 92.. 97: ###################### 5 + 98..103: ################## 4 + 104..109: ################## 4 + 110..115: ############# 3 + 116..121: ########################### 6 + +--- Failure -------------------------------------------------------------------- + +Test with shrinking retries failed (0 shrink steps): + +4 + +!!! Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +Warning for test WARN_unlikely_precond: + +WARNING: only 0.5% tests (of 2000) passed precondition for "WARN_unlikely_precond" + +NOTE: it is likely that the precondition is too strong, or that the generator is buggy. + +--- Failure -------------------------------------------------------------------- + +Test FAIL_unlikely_precond failed: + +ERROR: only 0.5% tests (of 2000) passed precondition for "FAIL_unlikely_precond" + +NOTE: it is likely that the precondition is too strong, or that the generator is buggy. + + +--- Failure -------------------------------------------------------------------- + +Test FAIL_bad_gen failed: + +ERROR: uncaught exception in generator for test FAIL_bad_gen after 100 steps: +Exception: Invalid_argument("Gen.int_bound") +Backtrace: + +--- Failure -------------------------------------------------------------------- + +Test int double failed: + +Negative test int double succeeded but was expected to fail + +=== Error ====================================================================== + +Test pos fail with error errored on (1 shrink steps): + +0 + +exception QCheck2_tests.Overall.Error + + +=== Error ====================================================================== + +Test neg fail with error errored on (1 shrink steps): + +0 + +exception QCheck2_tests.Overall.Error + + +--- Failure -------------------------------------------------------------------- + +Test char never produces '\255' failed (0 shrink steps): + +'\255' + +--- Failure -------------------------------------------------------------------- + +Test big bound issue59 failed (0 shrink steps): + +1073741823 + +--- Failure -------------------------------------------------------------------- + +Test long_shrink failed (3038 shrink steps): + +([0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0], [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 1]) + +--- Failure -------------------------------------------------------------------- + +Test ints arent 0 mod 3 failed (1 shrink steps): + +0 + +--- Failure -------------------------------------------------------------------- + +Test ints are 0 failed (29 shrink steps): + +1 + +--- Failure -------------------------------------------------------------------- + +Test ints < 209609 failed (0 shrink steps): + +1073741823 + +--- Failure -------------------------------------------------------------------- + +Test nat < 5001 failed (6 shrink steps): + +5001 + +--- Failure -------------------------------------------------------------------- + +Test char never produces 'abcdef' failed (1 shrink steps): + +'a' + +--- Failure -------------------------------------------------------------------- + +Test printable never produces '!"#$%&' failed (1 shrink steps): + +'!' + +--- Failure -------------------------------------------------------------------- + +Test printable never produces less than '5 failed (0 shrink steps): + +'0' + +--- Failure -------------------------------------------------------------------- + +Test bytes are empty failed (9 shrink steps): + +a + +--- Failure -------------------------------------------------------------------- + +Test bytes never has a \000 char failed (55 shrink steps): + +aaaaaaaaaaaaaaa�aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + +--- Failure -------------------------------------------------------------------- + +Test bytes never has a \255 char failed (75 shrink steps): + +aaaaaaa�aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + +--- Failure -------------------------------------------------------------------- + +Test bytes have unique chars failed (14 shrink steps): + +aaaaaaa + +--- Failure -------------------------------------------------------------------- + +Test strings are empty failed (9 shrink steps): + +"a" + +--- Failure -------------------------------------------------------------------- + +Test string never has a \000 char failed (55 shrink steps): + +"aaaaaaaaaaaaaaa\000aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + +--- Failure -------------------------------------------------------------------- + +Test string never has a \255 char failed (75 shrink steps): + +"aaaaaaa\255aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + +--- Failure -------------------------------------------------------------------- + +Test strings have unique chars failed (14 shrink steps): + +"aaaaaaa" + +--- Failure -------------------------------------------------------------------- + +Test pairs have different components failed (0 shrink steps): + +(6, 6) + +--- Failure -------------------------------------------------------------------- + +Test pairs have same components failed (29 shrink steps): + +(0, 1) + +--- Failure -------------------------------------------------------------------- + +Test pairs have a zero component failed (57 shrink steps): + +(1, 1) + +--- Failure -------------------------------------------------------------------- + +Test pairs are (0,0) failed (29 shrink steps): + +(0, 1) + +--- Failure -------------------------------------------------------------------- + +Test pairs are ordered failed (42 shrink steps): + +(1, 0) + +--- Failure -------------------------------------------------------------------- + +Test pairs are ordered reversely failed (30 shrink steps): + +(0, 1) + +--- Failure -------------------------------------------------------------------- + +Test pairs sum to less than 128 failed (27 shrink steps): + +(0, 128) + +--- Failure -------------------------------------------------------------------- + +Test pairs lists rev concat failed (38 shrink steps): + +([0], [1]) + +--- Failure -------------------------------------------------------------------- + +Test pairs lists no overlap failed (22 shrink steps): + +([0], [0; 0; 0; 0; 0; 0; 0; 0]) + +--- Failure -------------------------------------------------------------------- + +Test triples have pair-wise different components failed (3 shrink steps): + +(0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test triples have same components failed (32 shrink steps): + +(0, 1, 0) + +--- Failure -------------------------------------------------------------------- + +Test triples are ordered failed (4 shrink steps): + +(0, 0, -1) + +--- Failure -------------------------------------------------------------------- + +Test triples are ordered reversely failed (32 shrink steps): + +(0, 0, 1) + +--- Failure -------------------------------------------------------------------- + +Test quadruples have pair-wise different components failed (3 shrink steps): + +(0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test quadruples have same components failed (59 shrink steps): + +(0, 1, 0, 1) + +--- Failure -------------------------------------------------------------------- + +Test quadruples are ordered failed (5 shrink steps): + +(0, 0, 0, -1) + +--- Failure -------------------------------------------------------------------- + +Test quadruples are ordered reversely failed (33 shrink steps): + +(0, 0, 0, 1) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b) in nat: a < b failed (3 shrink steps): + +(0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c) in nat: a < b < c failed (5 shrink steps): + +(0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c, d) in nat: a < b < c < d failed (4 shrink steps): + +(0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c, d, e) in nat: a < b < c < d < e failed (5 shrink steps): + +(0, 0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c, d, e, f) in nat: a < b < c < d < e < f failed (6 shrink steps): + +(0, 0, 0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c, d, e, f, g) in nat: a < b < c < d < e < f < g failed (7 shrink steps): + +(0, 0, 0, 0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c, d, e, f, g, h) in nat: a < b < c < d < e < f < g < h failed (8 shrink steps): + +(0, 0, 0, 0, 0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c, d, e, f, g, h, i) in nat: a < b < c < d < e < f < g < h < i failed (9 shrink steps): + +(0, 0, 0, 0, 0, 0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test bind ordered pairs failed (1 shrink steps): + +(0, 0) + +--- Failure -------------------------------------------------------------------- + +Test bind list_size constant failed (12 shrink steps): + +(4, [0; 0; 0; 0]) + +--- Failure -------------------------------------------------------------------- + +Test lists are empty failed (9 shrink steps): + +[0] + +--- Failure -------------------------------------------------------------------- + +Test lists shorter than 10 failed (15 shrink steps): + +[0; 0; 0; 0; 0; 0; 0; 0; 0; 0] + +--- Failure -------------------------------------------------------------------- + +Test lists shorter than 432 failed (413 shrink steps): + +[...] list length: 432 + +--- Failure -------------------------------------------------------------------- + +Test lists shorter than 4332 failed (4002 shrink steps): + +[...] list length: 4332 + +--- Failure -------------------------------------------------------------------- + +Test lists have unique elems failed (10 shrink steps): + +[0; 0; 0] + +--- Failure -------------------------------------------------------------------- + +Test tree contains only 42 failed (2 shrink steps): + +Leaf 0 + +--- Failure -------------------------------------------------------------------- + +Test sum list = 0 failed (0 shrink steps): + +[46; 2; 22; 4; 4; 2; 6; 5; 88; 24; 7; 9; 9; 2; 5; 1; 55; 8; 45; 1; 96; 0; 1; 2; 7; 4; 1; 5; 95; 6; 8; 6; 4; 0; 5; 5; 22; 87; 2; 1; 1; 0; 2; 2; 9; 5; 9; 3; 7; 59; 7; 96; 6; 5; 1; 3; 9; 9; 65; 6; 7; 7; 2; 5; 0; 0; 70; 5; 5; 2; 1; 57; 9; 7; 8; 10; 9; 7; 9; 75; 73; 80; 7; 9; 4; 3; 16; 5; 79; 1; 8; 6; 2; 3; 4; 9; 2; 8; 4; 6; 50; 2; 1; 5; 9; 5; 4; 3; 56; 6; 5; 9; 4; 1; 47; 1; 2; 5; 2; 0; 7; 31; 55; 6; 7; 4; 7; 8; 8; 2; 4; 40; 4; 6; 9; 3; 59; 5; 1; 0; 2; 6; 90; 1; 6; 81; 0; 1; 3; 7; 2; 4; 5; 4; 7; 3; 62; 0; 1; 6; 7; 5; 97; 83; 41; 7; 2; 6; 3; 0; 4; 8; 99; 8; 6; 0; 7; 9; 7; 1; 55; 30; 25; 3; 4; 7; 1; 6; 80; 8; 0; 4; 21; 3; 5; 9; 27; 10; 60; 47; 54; 6; 5; 8; 1; 5; 9; 65; 9; 5; 7; 7; 6; 48; 9; 5; 6; 4; 9; 7; 1; 2; 71; 6; 9; 2; 7; 8; 14; 59; 71; 30; 7; 3; 5; 4; 6; 7; 3; 6; 9; 8; 2; 38; 6; 6; 7; 1; 5; 2; 43; 5; 2; 9; 3; 0; 3; 2; 7; 71; 26; 3; 9; 11; 5; 1; 5; 2; 53; 46; 4; 6; 7; 67; 1; 0; 34; 0; 48; 5; 5; 0; 7; 49; 92; 8; 3; 0; 67; 1; 5; 2; 9; 5; 9; 3; 1; 4; 8; 0; 3; 6; 46; 58; 1; 54; 77; 0; 96; 1; 6; 2; 8; 22; 3; 9; 2; 6; 25; 49; 9; 6; 3; 8; 5; 9; 54; 1; 7; 5; 6; 5; 1; 7; 8; 23; 4; 6; 4; 2; 5; 8; 4; 7; 4] + +--- Failure -------------------------------------------------------------------- + +Test fail_pred_map_commute failed (69 shrink steps): + +([0; 0; 0], {0 -> 1; 1 -> 0; 3 -> 0; 5 -> 0; 6 -> 0; 54 -> 0; 7 -> 0; 8 -> 0; 9 -> 0; _ -> 0}, {1 -> true; 54 -> false; _ -> false}) + +--- Failure -------------------------------------------------------------------- + +Test fail_pred_strings failed (2 shrink steps): + +{"some random string" -> true; _ -> false} + +--- Failure -------------------------------------------------------------------- + +Test fold_left fold_right failed (32 shrink steps): + +(0, [1], {(5, 5) -> 0; (3, 8) -> 0; (1, 0) -> 1; (3, 0) -> 0; (8, 0) -> 0; (6, 4) -> 0; (9, 2) -> 0; (5, 0) -> 0; (0, 2) -> 0; (2, 0) -> 0; (2, 1) -> 0; (8, 6) -> 0; (0, 3) -> 0; (0, 23) -> 0; (1, 8) -> 0; (0, 4) -> 0; (4, 0) -> 0; (7, 2) -> 0; (2, 5) -> 0; (0, 8) -> 0; (23, 6) -> 0; (0, 0) -> 0; (4, 80) -> 0; _ -> 0}) + ++++ Messages ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Messages for test fold_left fold_right: + +l=[1], fold_left=1, fold_right=0 + + +--- Failure -------------------------------------------------------------------- + +Test fold_left fold_right uncurried failed (434 shrink steps): + +({(5, 2) -> 0; (0, 2) -> 0; (2, 80) -> 0; (8, 6) -> 0; (76, 6) -> 0; (3, 8) -> 0; (75, 57) -> 0; (7, 2) -> 0; (43, 1) -> 0; (2, 7) -> 0; (7, 1) -> 0; (76, 3) -> 0; (4, 50) -> 0; (70, 5) -> 0; (49, 46) -> 0; (71, 31) -> 0; (67, 0) -> 0; (32, 96) -> 0; (9, 1) -> 0; (8, 8) -> 0; (53, 8) -> 0; (76, 5) -> 0; (2, 5) -> 0; (5, 4) -> 0; (9, 3) -> 0; (6, 65) -> 0; (75, 2) -> 0; (35, 96) -> 0; (3, 2) -> 0; (24, 1) -> 0; (75, 4) -> 0; (48, 8) -> 0; (0, 16) -> 0; (26, 73) -> 0; (2, 88) -> 0; (76, 7) -> 0; (6, 9) -> 0; (71, 59) -> 0; (4, 7) -> 0; (1, 1) -> 0; (4, 22) -> 0; (0, 5) -> 0; (1, 5) -> 0; (1, 4) -> 0; (8, 45) -> 0; (2, 47) -> 0; (0, 1) -> 0; (6, 10) -> 0; (73, 0) -> 0; (27, 3) -> 0; (88, 7) -> 0; (5, 1) -> 0; (3, 6) -> 0; (77, 8) -> 0; (2, 1) -> 0; (1, 2) -> 0; (4, 1) -> 0; (47, 6) -> 0; (76, 9) -> 0; (6, 5) -> 0; (7, 3) -> 0; (9, 87) -> 0; (3, 7) -> 0; (17, 0) -> 0; (43, 55) -> 0; (4, 2) -> 0; (12, 7) -> 0; (7, 79) -> 0; (2, 56) -> 0; (52, 0) -> 0; (9, 2) -> 0; (49, 0) -> 0; (7, 9) -> 0; (2, 75) -> 0; (75, 5) -> 0; (2, 2) -> 0; (6, 4) -> 0; (1, 3) -> 0; (19, 6) -> 0; (4, 55) -> 0; (1, 6) -> 0; (6, 7) -> 0; (6, 24) -> 0; (0, 6) -> 0; (86, 6) -> 0; (3, 1) -> 0; (4, 5) -> 0; (82, 4) -> 0; (5, 70) -> 0; (5, 9) -> 0; (37, 2) -> 0; (45, 1) -> 0; (7, 4) -> 0; (0, 4) -> 1; (6, 95) -> 0; (6, 2) -> 0; (1, 0) -> 0; (8, 4) -> 0; (1, 22) -> 0; (67, 7) -> 0; (92, 7) -> 0; (7, 5) -> 0; (4, 4) -> 0; (9, 8) -> 0; (49, 5) -> 0; (1, 9) -> 0; _ -> 0}, 0, [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 4]) + +--- Failure -------------------------------------------------------------------- + +Test fold_left fold_right uncurried fun last failed (37 shrink steps): + +(0, [0; 0; 0; 0], {(9, 5) -> 0; (0, 2) -> 0; (56, 0) -> 0; (4, 1) -> 0; (8, 5) -> 0; (5, 9) -> 0; (8, 6) -> 0; (3, 8) -> 0; (8, 0) -> 0; (84, 8) -> 0; (23, 4) -> 0; (4, 0) -> 0; (0, 7) -> 0; (7, 8) -> 0; (0, 5) -> 0; (0, 4) -> 0; (1, 5) -> 0; (80, 8) -> 0; (5, 7) -> 0; (2, 2) -> 0; (6, 4) -> 0; (0, 0) -> 56; (0, 23) -> 0; (0, 56) -> 1; (1, 3) -> 0; (0, 1) -> 0; (56, 2) -> 0; (89, 8) -> 0; (7, 7) -> 0; (2, 5) -> 0; (4, 3) -> 0; _ -> 0}) + +--- Failure -------------------------------------------------------------------- + +Test fold_left test, fun first failed (925 shrink steps): + +({("\167$\000\199\169\156V\241\027\212\178d3\196\136\249\1941_=#\216\196\226\186\220\153\150Z)\000\255\184\132`\225\239&uS\235]\212\231\021\028\204\020\t,", 9) -> ""; ("\156\031\194\253\204B\188\154 \167\012\253\2322;", 8) -> ""; ("{\182\172t", 5) -> ""; ("\169\240\228A#\212U\193\172\019\150\238\236\133\209\188\240\135\225\191\241\181\179\243\139\\.\"\190m\204&9\209?\001\171\247\160T\2049\153\0028\184\014;X", 13) -> ""; ("\003\212\207\236\178\162\182m\147\190\b>W\141\242\195\206j\201\202\166B\145k\229\211J\015\139(\224\143\149\190\196(_\017\170\138", 4) -> ""; ("\130\229\219\227\133\160\213\236\2221\245\129-\183\141r\146sXj\000\2210\200\1576\209\1396s '\026\172\251\236\166X\220\200\176$Z0\024\190", 2) -> ""; ("a\0171\198^,5\170C\139\157\\h\001\026\199", 8) -> ""; ("\189\221\014\254\188\175\205JF", 5) -> ""; ("", 2) -> "a"; ("\165\233\214\166\195\197", 5) -> ""; ("&\169\2415\201", 2) -> ""; ("S\194irBA", 37) -> ""; ("\224\2280\186", 1) -> ""; ("!\209\194\238\0266s\001!\233\234(7\127\228C\136n$\21162^^\012\014\199\178`\148\141\228\18599\205\136\136\189\213\134\019|\197\005\235\151\003\197D%\172\144\238\173[\228\191\235p\177I\180\237\189y\247\250w\143z~\016\003\142\149\157\142\234\\3P\140\030\000\028\205K\188&\202w\1519`\188\015", 2) -> ""; ("\128]\190\164\164\151)\214", 22) -> ""; ("u\251\19988\194\165\242J", 7) -> ""; ("}\129\237\213\203\137\197(W\172Q\171\188\140\205\014\143k~\163\187\140o\130\146r", 0) -> ""; ("\133+\142\011\209\135", 1) -> ""; ("E\212\169=n", 9) -> ""; ("l\022\133\005\016D\026\230\156", 18) -> ""; ("\031\131g\029\215", 31) -> ""; ("/*j", 6) -> ""; ("h\031\226a\226\148\128", 9) -> ""; ("\151", 1) -> ""; ("\221\184V\247\225\254\209iW;_d\144\t\179>2\252\221pO<\134F\005\252\151\163\138\007\219z\136\215\237]92G\000A\135\139\166\214\186\232\199\236\000\132_\006\241\169Gz\"\155\183\215-\233\249", 1) -> ""; ("z\211oC\210\198\155", 8) -> ""; ("}P8\147\167\142j9u\187\007\128\213Y\181E'\130\r\242ng\2088\198\004\136GJ\179-\197Iw\017\197\223\173\250\229D\160\171\t\222\223>6\219\201@^X\221(s\029\127\005-F+\232\213B\170\150\188\018f+>\215\240k\135\023\214P\157", 9) -> ""; ("~f-L\151\011", 2) -> ""; ("!\178\019\016\134%\026", 2) -> ""; ("\255U\t4f*\254\237\181S\020\181\130\184\230\017C\185\200\187:Q\002\210\028\152G\228O\026\012\003\234\011\148z\177\166&\024\178F\188\213u\128R~\\\171\194\r~v\020\160\221(\157wa!a\bAf\127^\169\241;\246\011B\b+\249\179\193\230\137\232\147\247\251\180ey\166q<\150_\158", 6) -> ""; ("\005\140\184\232$", 78) -> ""; (".NF\153", 6) -> ""; ("\180\130\236\011(\210M9", 9) -> ""; ("I\219\224\171\142\155\209\027\011\237\020;\245\176\141(\202\248\023\174\216\156\173+\028\209\193?\154t\196\146\147\181\252#\229\128jz\199\212\194\2302\185\162\208UXq>\024F&\241i\182\165\214I\249*?\136_\142f\163\230\167\210U`W \150X\157=\235pe\200\019\208\138j", 1) -> ""; ("\196\210\239\158\131\198\1516\208\165\163\011\251B\219\161\001\237\224\194T\t\148\158\197\031\145\025\192\148\210t1\235\159\015\176\197.\248a\028'\222r\200= \208w", 36) -> ""; ("\228x[", 91) -> ""; ("\001\143", 7) -> ""; ("\136u\1473\235\255\232\211\129\129\172\n\012\004\\O2.a\228(\218\205\223\011\"\n<\181$\245v\002\016s]\161\170\000q\205\161wM\230\223\143%\t\232\175\171j\129x\022\159\215\182\019\240\002\014}\0052\234\202\226\157,\148-\147\200\158\181\189\196\143f", 38) -> ""; ("@\192\163\234", 72) -> ""; ("\131\158Y\139\199\014\149d$", 9) -> ""; ("-\152", 9) -> ""; _ -> ""}, "", [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 2], [0]) + +--- Failure -------------------------------------------------------------------- + +Test FAIL_#99_1 failed: + +ERROR: uncaught exception in generator for test FAIL_#99_1 after 100 steps: +Exception: QCheck2.No_example_found("<example>") +Backtrace: + ++++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Collect results for test bool dist: + +true: 250511 cases +false: 249489 cases + ++++ Stats for char code dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats char code: + num: 500000, avg: 127.68, stddev: 73.87, median 128, min 0, max 255 + 0.. 12: ##################################################### 25272 + 13.. 25: ###################################################### 25326 + 26.. 38: ##################################################### 25194 + 39.. 51: ###################################################### 25359 + 52.. 64: ###################################################### 25338 + 65.. 77: ###################################################### 25349 + 78.. 90: ###################################################### 25397 + 91..103: ##################################################### 25243 + 104..116: ###################################################### 25420 + 117..129: ###################################################### 25438 + 130..142: ###################################################### 25346 + 143..155: ##################################################### 25177 + 156..168: ####################################################### 25755 + 169..181: ###################################################### 25408 + 182..194: ###################################################### 25633 + 195..207: ###################################################### 25613 + 208..220: ###################################################### 25459 + 221..233: ###################################################### 25322 + 234..246: ##################################################### 25229 + 247..259: ##################################### 17722 + ++++ Stats for printable char code dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats char code: + num: 500000, avg: 78.23, stddev: 28.13, median 78, min 10, max 126 + 10.. 15: ######### 5167 + 16.. 21: 0 + 22.. 27: 0 + 28.. 33: ################## 10338 + 34.. 39: ###################################################### 31469 + 40.. 45: ###################################################### 30994 + 46.. 51: ###################################################### 31366 + 52.. 57: ###################################################### 31369 + 58.. 63: ####################################################### 31531 + 64.. 69: ###################################################### 31208 + 70.. 75: ###################################################### 31228 + 76.. 81: ###################################################### 31514 + 82.. 87: ###################################################### 31209 + 88.. 93: ###################################################### 31207 + 94.. 99: ###################################################### 31342 + 100..105: ###################################################### 31273 + 106..111: ###################################################### 31116 + 112..117: ###################################################### 31022 + 118..123: ##################################################### 30911 + 124..129: ########################### 15736 + ++++ Stats for numeral char code dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats char code: + num: 500000, avg: 52.50, stddev: 2.87, median 53, min 48, max 57 + 48: ###################################################### 49848 + 49: ###################################################### 50118 + 50: ###################################################### 49837 + 51: ###################################################### 50252 + 52: ###################################################### 49765 + 53: ####################################################### 50369 + 54: ###################################################### 50270 + 55: ###################################################### 49885 + 56: ###################################################### 49821 + 57: ###################################################### 49835 + ++++ Stats for tree's depth ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats depth: + num: 1000, avg: 4.13, stddev: 3.52, median 3, min 1, max 15 + 1: ####################################################### 339 + 2: ################ 104 + 3: ############### 98 + 4: ##################### 133 + 5: ######### 60 + 6: #### 29 + 7: ######## 54 + 8: ####### 48 + 9: ## 16 + 10: ### 21 + 11: ########### 68 + 12: 1 + 13: # 8 + 14: ## 16 + 15: 5 + ++++ Stats for bytes_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 7.51, stddev: 1.69, median 8, min 5, max 10 + 5: ################################################## 817 + 6: ################################################# 797 + 7: ####################################################### 885 + 8: ################################################### 834 + 9: ###################################################### 877 + 10: ################################################# 790 + ++++ Stats for bytes len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 370.05, stddev: 1282.91, median 9, min 0, max 9947 + 0.. 497: ####################################################### 4270 + 498.. 995: ###### 497 + 996..1493: 17 + 1494..1991: 9 + 1992..2489: 13 + 2490..2987: 13 + 2988..3485: 9 + 3486..3983: 14 + 3984..4481: 14 + 4482..4979: 17 + 4980..5477: 9 + 5478..5975: 10 + 5976..6473: 15 + 6474..6971: 16 + 6972..7469: 16 + 7470..7967: 9 + 7968..8465: 12 + 8466..8963: 15 + 8964..9461: 9 + 9462..9959: 16 + ++++ Stats for bytes_of len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 359.22, stddev: 1249.46, median 9, min 0, max 9958 + 0.. 497: ####################################################### 4275 + 498.. 995: ###### 479 + 996..1493: 22 + 1494..1991: 12 + 1992..2489: 21 + 2490..2987: 16 + 2988..3485: 13 + 3486..3983: 17 + 3984..4481: 14 + 4482..4979: 14 + 4980..5477: 8 + 5478..5975: 14 + 5976..6473: 13 + 6474..6971: 9 + 6972..7469: 7 + 7470..7967: 17 + 7968..8465: 13 + 8466..8963: 15 + 8964..9461: 10 + 9462..9959: 11 + ++++ Stats for bytes_printable len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 370.05, stddev: 1282.91, median 9, min 0, max 9947 + 0.. 497: ####################################################### 4270 + 498.. 995: ###### 497 + 996..1493: 17 + 1494..1991: 9 + 1992..2489: 13 + 2490..2987: 13 + 2988..3485: 9 + 3486..3983: 14 + 3984..4481: 14 + 4482..4979: 17 + 4980..5477: 9 + 5478..5975: 10 + 5976..6473: 15 + 6474..6971: 16 + 6972..7469: 16 + 7470..7967: 9 + 7968..8465: 12 + 8466..8963: 15 + 8964..9461: 9 + 9462..9959: 16 + ++++ Stats for bytes_small len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 15.99, stddev: 24.58, median 6, min 0, max 99 + 0.. 4: ###################################################### 1920 + 5.. 9: ####################################################### 1929 + 10.. 14: # 69 + 15.. 19: # 62 + 20.. 24: # 63 + 25.. 29: # 59 + 30.. 34: # 68 + 35.. 39: # 62 + 40.. 44: # 57 + 45.. 49: ## 83 + 50.. 54: # 59 + 55.. 59: ## 80 + 60.. 64: # 48 + 65.. 69: # 53 + 70.. 74: # 61 + 75.. 79: # 66 + 80.. 84: # 61 + 85.. 89: ## 72 + 90.. 94: # 66 + 95.. 99: # 62 + ++++ Stats for string_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 7.51, stddev: 1.69, median 8, min 5, max 10 + 5: ################################################## 817 + 6: ################################################# 797 + 7: ####################################################### 885 + 8: ################################################### 834 + 9: ###################################################### 877 + 10: ################################################# 790 + ++++ Stats for string len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 370.05, stddev: 1282.91, median 9, min 0, max 9947 + 0.. 497: ####################################################### 4270 + 498.. 995: ###### 497 + 996..1493: 17 + 1494..1991: 9 + 1992..2489: 13 + 2490..2987: 13 + 2988..3485: 9 + 3486..3983: 14 + 3984..4481: 14 + 4482..4979: 17 + 4980..5477: 9 + 5478..5975: 10 + 5976..6473: 15 + 6474..6971: 16 + 6972..7469: 16 + 7470..7967: 9 + 7968..8465: 12 + 8466..8963: 15 + 8964..9461: 9 + 9462..9959: 16 + ++++ Stats for string_of len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 359.22, stddev: 1249.46, median 9, min 0, max 9958 + 0.. 497: ####################################################### 4275 + 498.. 995: ###### 479 + 996..1493: 22 + 1494..1991: 12 + 1992..2489: 21 + 2490..2987: 16 + 2988..3485: 13 + 3486..3983: 17 + 3984..4481: 14 + 4482..4979: 14 + 4980..5477: 8 + 5478..5975: 14 + 5976..6473: 13 + 6474..6971: 9 + 6972..7469: 7 + 7470..7967: 17 + 7968..8465: 13 + 8466..8963: 15 + 8964..9461: 10 + 9462..9959: 11 + ++++ Stats for string_printable len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 370.05, stddev: 1282.91, median 9, min 0, max 9947 + 0.. 497: ####################################################### 4270 + 498.. 995: ###### 497 + 996..1493: 17 + 1494..1991: 9 + 1992..2489: 13 + 2490..2987: 13 + 2988..3485: 9 + 3486..3983: 14 + 3984..4481: 14 + 4482..4979: 17 + 4980..5477: 9 + 5478..5975: 10 + 5976..6473: 15 + 6474..6971: 16 + 6972..7469: 16 + 7470..7967: 9 + 7968..8465: 12 + 8466..8963: 15 + 8964..9461: 9 + 9462..9959: 16 + ++++ Stats for small_string len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 15.99, stddev: 24.58, median 6, min 0, max 99 + 0.. 4: ###################################################### 1920 + 5.. 9: ####################################################### 1929 + 10.. 14: # 69 + 15.. 19: # 62 + 20.. 24: # 63 + 25.. 29: # 59 + 30.. 34: # 68 + 35.. 39: # 62 + 40.. 44: # 57 + 45.. 49: ## 83 + 50.. 54: # 59 + 55.. 59: ## 80 + 60.. 64: # 48 + 65.. 69: # 53 + 70.. 74: # 61 + 75.. 79: # 66 + 80.. 84: # 61 + 85.. 89: ## 72 + 90.. 94: # 66 + 95.. 99: # 62 + ++++ Stats for pair dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats pair sum: + num: 500000, avg: 100.05, stddev: 41.29, median 100, min 0, max 200 + 0.. 9: ### 2618 + 10.. 19: ######## 7630 + 20.. 29: ############## 12505 + 30.. 39: #################### 17451 + 40.. 49: ########################## 22280 + 50.. 59: ############################### 27307 + 60.. 69: ##################################### 32151 + 70.. 79: ########################################### 37199 + 80.. 89: ################################################# 41901 + 90.. 99: ###################################################### 46313 + 100..109: ####################################################### 46965 + 110..119: ################################################# 42462 + 120..129: ########################################### 37348 + 130..139: ###################################### 32613 + 140..149: ################################ 27606 + 150..159: ########################### 23221 + 160..169: ##################### 18125 + 170..179: ############### 12890 + 180..189: ######### 8059 + 190..199: ### 3297 + 200..209: 59 + ++++ Stats for triple dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats triple sum: + num: 500000, avg: 150.04, stddev: 50.53, median 150, min 1, max 300 + 1.. 15: 360 + 16.. 30: ## 2261 + 31.. 45: ##### 5712 + 46.. 60: ########## 10854 + 61.. 75: ################# 17760 + 76.. 90: ########################## 26151 + 91..105: ################################### 36079 + 106..120: ############################################# 45498 + 121..135: ################################################### 51977 + 136..150: ####################################################### 55179 + 151..165: ###################################################### 54821 + 166..180: ################################################### 51709 + 181..195: ############################################# 45166 + 196..210: ################################### 35354 + 211..225: ######################### 25436 + 226..240: ################# 17179 + 241..255: ########## 10652 + 256..270: ##### 5447 + 271..285: ## 2065 + 286..300: 340 + ++++ Stats for quad dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats quad sum: + num: 500000, avg: 200.06, stddev: 58.39, median 200, min 2, max 394 + 2.. 21: 61 + 22.. 41: 658 + 42.. 61: ## 2534 + 62.. 81: ##### 6444 + 82..101: ########### 13334 + 102..121: ################### 23279 + 122..141: ############################## 35888 + 142..161: ######################################### 48824 + 162..181: ################################################## 59008 + 182..201: ####################################################### 64896 + 202..221: ###################################################### 64051 + 222..241: ################################################# 57864 + 242..261: ####################################### 46793 + 262..281: ############################ 33955 + 282..301: ################## 21775 + 302..321: ########## 12187 + 322..341: #### 5645 + 342..361: # 2244 + 362..381: 529 + 382..401: 31 + ++++ Stats for bind dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats ordered pair difference: + num: 1000000, avg: 25.01, stddev: 22.38, median 19, min 0, max 100 + 0.. 4: ####################################################### 193610 + 5.. 9: #################################### 130051 + 10.. 14: ############################# 104209 + 15.. 19: ######################## 86993 + 20.. 24: ##################### 74295 + 25.. 29: ################## 64874 + 30.. 34: ################ 56447 + 35.. 39: ############## 49416 + 40.. 44: ############ 43051 + 45.. 49: ########## 37580 + 50.. 54: ######### 32378 + 55.. 59: ######## 28558 + 60.. 64: ###### 23971 + 65.. 69: ##### 20146 + 70.. 74: #### 16446 + 75.. 79: ### 13215 + 80.. 84: ## 10294 + 85.. 89: ## 7639 + 90.. 94: # 4698 + 95.. 99: 2041 + 100..104: 88 + +stats ordered pair sum: + num: 1000000, avg: 74.97, stddev: 46.86, median 72, min 0, max 200 + 0.. 9: ####################################################### 70320 + 10.. 19: ##################################################### 68731 + 20.. 29: ##################################################### 68374 + 30.. 39: ##################################################### 68544 + 40.. 49: ##################################################### 68756 + 50.. 59: ##################################################### 68837 + 60.. 69: ##################################################### 68759 + 70.. 79: ##################################################### 68517 + 80.. 89: ##################################################### 68692 + 90.. 99: ###################################################### 69123 + 100..109: ################################################## 64777 + 110..119: ########################################### 55288 + 120..129: #################################### 47156 + 130..139: ############################### 39635 + 140..149: ######################### 32590 + 150..159: #################### 25685 + 160..169: ############### 19842 + 170..179: ########## 14038 + 180..189: ###### 8631 + 190..199: ## 3580 + 200..209: 125 + ++++ Stats for list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 374.46, stddev: 1320.15, median 9, min 0, max 9984 + 0.. 499: ####################################################### 4269 + 500.. 999: ###### 503 + 1000.. 1499: 13 + 1500.. 1999: 6 + 2000.. 2499: 22 + 2500.. 2999: 13 + 3000.. 3499: 10 + 3500.. 3999: 5 + 4000.. 4499: 15 + 4500.. 4999: 10 + 5000.. 5499: 15 + 5500.. 5999: 12 + 6000.. 6499: 6 + 6500.. 6999: 12 + 7000.. 7499: 11 + 7500.. 7999: 15 + 8000.. 8499: 21 + 8500.. 8999: 11 + 9000.. 9499: 15 + 9500.. 9999: 16 + ++++ Stats for small_list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 15.36, stddev: 23.76, median 6, min 0, max 99 + 0.. 4: ###################################################### 1933 + 5.. 9: ####################################################### 1962 + 10.. 14: # 69 + 15.. 19: # 57 + 20.. 24: # 51 + 25.. 29: # 62 + 30.. 34: # 63 + 35.. 39: # 65 + 40.. 44: ## 77 + 45.. 49: # 71 + 50.. 54: # 56 + 55.. 59: # 60 + 60.. 64: # 66 + 65.. 69: # 65 + 70.. 74: # 69 + 75.. 79: # 48 + 80.. 84: # 53 + 85.. 89: # 58 + 90.. 94: # 64 + 95.. 99: # 51 + ++++ Stats for list_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 7.50, stddev: 1.71, median 8, min 5, max 10 + 5: ###################################################### 853 + 6: #################################################### 819 + 7: #################################################### 820 + 8: #################################################### 825 + 9: ####################################################### 857 + 10: ##################################################### 826 + ++++ Stats for list_repeat len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 42.00, stddev: 0.00, median 42, min 42, max 42 + 42: ####################################################### 5000 + ++++ Stats for array len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 374.46, stddev: 1320.15, median 9, min 0, max 9984 + 0.. 499: ####################################################### 4269 + 500.. 999: ###### 503 + 1000.. 1499: 13 + 1500.. 1999: 6 + 2000.. 2499: 22 + 2500.. 2999: 13 + 3000.. 3499: 10 + 3500.. 3999: 5 + 4000.. 4499: 15 + 4500.. 4999: 10 + 5000.. 5499: 15 + 5500.. 5999: 12 + 6000.. 6499: 6 + 6500.. 6999: 12 + 7000.. 7499: 11 + 7500.. 7999: 15 + 8000.. 8499: 21 + 8500.. 8999: 11 + 9000.. 9499: 15 + 9500.. 9999: 16 + ++++ Stats for small_array len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 15.36, stddev: 23.76, median 6, min 0, max 99 + 0.. 4: ###################################################### 1933 + 5.. 9: ####################################################### 1962 + 10.. 14: # 69 + 15.. 19: # 57 + 20.. 24: # 51 + 25.. 29: # 62 + 30.. 34: # 63 + 35.. 39: # 65 + 40.. 44: ## 77 + 45.. 49: # 71 + 50.. 54: # 56 + 55.. 59: # 60 + 60.. 64: # 66 + 65.. 69: # 65 + 70.. 74: # 69 + 75.. 79: # 48 + 80.. 84: # 53 + 85.. 89: # 58 + 90.. 94: # 64 + 95.. 99: # 51 + ++++ Stats for array_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 7.50, stddev: 1.71, median 8, min 5, max 10 + 5: ###################################################### 853 + 6: #################################################### 819 + 7: #################################################### 820 + 8: #################################################### 825 + 9: ####################################################### 857 + 10: ##################################################### 826 + ++++ Stats for array_repeat len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 42.00, stddev: 0.00, median 42, min 42, max 42 + 42: ####################################################### 5000 + ++++ Stats for int_stats_neg ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 5000, avg: 0.43, stddev: 28.63, median 0, min -99, max 99 + -99..-90: # 45 + -89..-80: # 57 + -79..-70: # 68 + -69..-60: # 58 + -59..-50: # 76 + -49..-40: # 67 + -39..-30: # 52 + -29..-20: # 54 + -19..-10: # 47 + -9.. 0: ####################################################### 2205 + 1.. 10: ########################################## 1697 + 11.. 20: # 57 + 21.. 30: # 70 + 31.. 40: # 60 + 41.. 50: # 66 + 51.. 60: # 75 + 61.. 70: # 68 + 71.. 80: # 63 + 81.. 90: # 66 + 91..100: # 49 + ++++ Stats for small_signed_int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 0.86, stddev: 29.11, median 0, min -97, max 99 + -97..-88: # 12 + -87..-78: # 12 + -77..-68: # 13 + -67..-58: # 12 + -57..-48: # 9 + -47..-38: ## 17 + -37..-28: # 13 + -27..-18: # 8 + -17.. -8: ######### 76 + -7.. 2: ####################################################### 437 + 3.. 12: ################################## 276 + 13.. 22: ## 16 + 23.. 32: # 11 + 33.. 42: ## 16 + 43.. 52: # 9 + 53.. 62: # 12 + 63.. 72: # 14 + 73.. 82: # 12 + 83.. 92: # 13 + 93..102: # 12 + ++++ Stats for small_nat dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 15.86, stddev: 24.57, median 6, min 0, max 99 + 0.. 4: ###################################################### 387 + 5.. 9: ####################################################### 390 + 10.. 14: # 11 + 15.. 19: # 8 + 20.. 24: # 11 + 25.. 29: ## 15 + 30.. 34: # 9 + 35.. 39: # 11 + 40.. 44: # 11 + 45.. 49: ## 19 + 50.. 54: # 10 + 55.. 59: ## 19 + 60.. 64: # 9 + 65.. 69: # 9 + 70.. 74: ## 19 + 75.. 79: # 13 + 80.. 84: # 11 + 85.. 89: ## 16 + 90.. 94: # 9 + 95.. 99: # 13 + ++++ Stats for nat dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 382.03, stddev: 1290.55, median 9, min 0, max 9890 + 0.. 494: ####################################################### 850 + 495.. 989: ###### 93 + 990..1484: 8 + 1485..1979: 3 + 1980..2474: 7 + 2475..2969: 1 + 2970..3464: 3 + 3465..3959: 3 + 3960..4454: 3 + 4455..4949: 4 + 4950..5444: 3 + 5445..5939: 3 + 5940..6434: 3 + 6435..6929: 1 + 6930..7424: 2 + 7425..7919: 1 + 7920..8414: 1 + 8415..8909: 5 + 8910..9404: 3 + 9405..9899: 3 + ++++ Stats for int_range (-43643) 435434 dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 193479.13, stddev: 136696.70, median 189823, min -43164, max 434961 + -43164..-19258: ################################### 42 + -19257.. 4649: ############################################## 56 + 4650.. 28556: ############################################# 55 + 28557.. 52463: ############################################### 57 + 52464.. 76370: ######################################### 50 + 76371..100277: ############################# 35 + 100278..124184: ############################################### 57 + 124185..148091: #################################### 44 + 148092..171998: ############################################## 56 + 171999..195905: ####################################################### 66 + 195906..219812: ########################################### 52 + 219813..243719: ######################################## 49 + 243720..267626: ################################ 39 + 267627..291533: ##################################### 45 + 291534..315440: ##################################### 45 + 315441..339347: ################################################# 59 + 339348..363254: ################################################## 60 + 363255..387161: ################################# 40 + 387162..411068: ########################################## 51 + 411069..434975: ################################### 42 + ++++ Stats for int_range (-40000) 40000 dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: -591.06, stddev: 23026.79, median -911, min -39911, max 39959 + -39911..-35918: ####################################### 45 + -35917..-31924: #################################################### 59 + -31923..-27930: ########################################### 49 + -27929..-23936: ########################################## 48 + -23935..-19942: ####################################################### 62 + -19941..-15948: ############################################# 51 + -15947..-11954: ######################################### 47 + -11953.. -7960: ################################################# 56 + -7959.. -3966: ################################### 40 + -3965.. 28: ################################################### 58 + 29.. 4022: ########################################### 49 + 4023.. 8016: ############################################### 53 + 8017.. 12010: ############################################ 50 + 12011.. 16004: ################################### 40 + 16005.. 19998: ####################################### 44 + 19999.. 23992: ####################################################### 62 + 23993.. 27986: ##################################### 42 + 27987.. 31980: ######################################### 47 + 31981.. 35974: ########################################## 48 + 35975.. 39968: ############################################ 50 + ++++ Stats for int_range (-4) 4 dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: -0.12, stddev: 2.52, median 0, min -4, max 4 + -4: ########################################## 116 + -3: ###################################### 103 + -2: ############################################## 125 + -1: ########################################## 115 + 0: ####################################### 106 + 1: ####################################################### 149 + 2: ################################# 92 + 3: ################################# 92 + 4: ##################################### 102 + ++++ Stats for int_range (-4) 17 dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 6.42, stddev: 6.43, median 6, min -4, max 17 + -4..-3: ########################################### 89 + -2..-1: ################################################# 101 + 0.. 1: ############################################## 95 + 2.. 3: ########################################### 89 + 4.. 5: ############################################## 95 + 6.. 7: ##################################### 78 + 8.. 9: ####################################### 81 + 10..11: ######################################## 84 + 12..13: ####################################################### 113 + 14..15: ######################################## 84 + 16..17: ############################################ 91 + 18..19: 0 + 20..21: 0 + 22..23: 0 + 24..25: 0 + 26..27: 0 + 28..29: 0 + 30..31: 0 + 32..33: 0 + 34..35: 0 + ++++ Stats for int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 100000, avg: -2481754.31, stddev: 618398387.27, median -5669677, min -1073719962, max 1073717275 + -1073719962.. -966348101: ##################################################### 4978 + -966348100.. -858976239: ##################################################### 5008 + -858976238.. -751604377: #################################################### 4907 + -751604376.. -644232515: ###################################################### 5037 + -644232514.. -536860653: ###################################################### 5069 + -536860652.. -429488791: ###################################################### 5052 + -429488790.. -322116929: ###################################################### 5035 + -322116928.. -214745067: ####################################################### 5128 + -214745066.. -107373205: ##################################################### 5017 + -107373204.. -1343: ##################################################### 5021 + -1342.. 107370519: ##################################################### 5010 + 107370520.. 214742381: ##################################################### 4964 + 214742382.. 322114243: ##################################################### 4957 + 322114244.. 429486105: ##################################################### 4994 + 429486106.. 536857967: ##################################################### 5025 + 536857968.. 644229829: ###################################################### 5047 + 644229830.. 751601691: ##################################################### 4988 + 751601692.. 858973553: #################################################### 4924 + 858973554.. 966345415: #################################################### 4852 + 966345416.. 1073717277: ##################################################### 4987 + ++++ Stats for oneof int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 1073741.60, stddev: 673131652.31, median 0, min -1073741824, max 1073741823 + -1073741824.. -966367642: ################# 198 + -966367641.. -858993459: 0 + -858993458.. -751619276: 0 + -751619275.. -644245093: 0 + -644245092.. -536870910: 0 + -536870909.. -429496727: 0 + -429496726.. -322122544: 0 + -322122543.. -214748361: 0 + -214748360.. -107374178: 0 + -107374177.. 5: ####################################################### 607 + 6.. 107374188: 0 + 107374189.. 214748371: 0 + 214748372.. 322122554: 0 + 322122555.. 429496737: 0 + 429496738.. 536870920: 0 + 536870921.. 644245103: 0 + 644245104.. 751619286: 0 + 751619287.. 858993469: 0 + 858993470.. 966367652: 0 + 966367653.. 1073741823: ################# 195 +================================================================================ +1 warning(s) +failure (64 tests failed, 3 tests errored, ran 141 tests) +random seed: 153870556 + ++++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: -20587725.59, stddev: 427231078.01, median 8, min -1072292884, max 1073741823 + -1072292884.. -964991149: ## 26 + -964991148.. -857689413: ### 31 + -857689412.. -750387677: ## 22 + -750387676.. -643085941: ## 22 + -643085940.. -535784205: ## 27 + -535784204.. -428482469: ### 30 + -428482468.. -321180733: ## 29 + -321180732.. -213878997: ## 20 + -213878996.. -106577261: ## 20 + -106577260.. 724475: ####################################################### 543 + 724476.. 108026211: ## 22 + 108026212.. 215327947: ## 22 + 215327948.. 322629683: ### 32 + 322629684.. 429931419: ## 29 + 429931420.. 537233155: ## 20 + 537233156.. 644534891: ## 21 + 644534892.. 751836627: ## 20 + 751836628.. 859138363: ## 22 + 859138364.. 966440099: ## 24 + 966440100.. 1073741823: # 18 +================================================================================ +success (ran 1 tests) diff --git a/test/core/QCheck_expect_test.expected.ocaml5.32 b/test/core/QCheck_expect_test.expected.ocaml5.32 new file mode 100644 index 00000000..c8218b2e --- /dev/null +++ b/test/core/QCheck_expect_test.expected.ocaml5.32 @@ -0,0 +1,1408 @@ +random seed: 1234 +45 4 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 (8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) +(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) +(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) +(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) +(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) +(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) +(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) +(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) +-466273346 +-233136673 +-116568337 +-58284169 +-29142085 +-14571043 +-7285522 +-3642761 +-1821381 +-910691 +-455346 +-227673 +-113837 +-56919 +-28460 +-14230 +-7115 +-3558 +-1779 +-890 +-445 +-223 +-112 +-56 +-28 +-14 +-7 +-4 +-2 +-1 +0 +[46; 2; 22; 4; 4; 2; 6; 5; 88; 24; 7; 9; 9; 2; 5; 1; 55; 8; 45; 1; 96; 0; 1; 2; 7; 4; 1; 5; 95; 6; 8; 6; 4; 0; 5; 5; 22; 87; 2; 1; 1; 0; 2; 2; 9; 5; 9; 3; 7; 59; 7; 96; 6; 5; 1; 3; 9; 9; 65; 6; 7; 7; 2; 5; 0; 0; 70; 5; 5; 2; 1; 57; 9; 7; 8; 10; 9; 7; 9; 75; 73; 80; 7; 9; 4; 3; 16; 5; 79; 1; 8; 6; 2; 3; 4; 9; 2; 8; 4; 6; 50; 2; 1; 5; 9; 5; 4; 3; 56; 6; 5; 9; 4; 1; 47; 1; 2; 5; 2; 0; 7; 31; 55; 6; 7; 4; 7; 8; 8; 2; 4; 40; 4; 6; 9; 3; 59; 5; 1; 0; 2; 6; 90; 1; 6; 81; 0; 1; 3; 7; 2; 4; 5; 4; 7; 3; 62; 0; 1; 6; 7; 5; 97; 83; 41; 7; 2; 6; 3; 0; 4; 8; 99; 8; 6; 0; 7; 9; 7; 1; 55; 30; 25; 3; 4; 7; 1; 6; 80; 8; 0; 4; 21; 3; 5; 9; 27; 10; 60; 47; 54; 6; 5; 8; 1; 5; 9; 65; 9; 5; 7; 7; 6; 48; 9; 5; 6; 4; 9; 7; 1; 2; 71; 6; 9; 2; 7; 8; 14; 59; 71; 30; 7; 3; 5; 4; 6; 7; 3; 6; 9; 8; 2; 38; 6; 6; 7; 1; 5; 2; 43; 5; 2; 9; 3; 0; 3; 2; 7; 71; 26; 3; 9; 11; 5; 1; 5; 2; 53; 46; 4; 6; 7; 67; 1; 0; 34; 0; 48; 5; 5; 0; 7; 49; 92; 8; 3; 0; 67; 1; 5; 2; 9; 5; 9; 3; 1; 4; 8; 0; 3; 6; 46; 58; 1; 54; 77; 0; 96; 1; 6; 2; 8; 22; 3; 9; 2; 6; 25; 49; 9; 6; 3; 8; 5; 9; 54; 1; 7; 5; 6; 5; 1; 7; 8; 23; 4; 6; 4; 2; 5; 8; 4; 7; 4] +[46; 2; 22; 4; 4; 2; 6; 5; 88; 24; 7; 9; 9; 2; 5; 1; 55; 8; 45; 1; 96; 0; 1; 2; 7; 4; 1; 5; 95; 6; 8; 6; 4; 0; 5; 5; 22; 87; 2; 1; 1; 0; 2; 2; 9; 5; 9; 3; 7; 59; 7; 96; 6; 5; 1; 3; 9; 9; 65; 6; 7; 7; 2; 5; 0; 0; 70; 5; 5; 2; 1; 57; 9; 7; 8; 10; 9; 7; 9; 75; 73; 80; 7; 9; 4; 3; 16; 5; 79; 1; 8; 6; 2; 3; 4; 9; 2; 8; 4; 6; 50; 2; 1; 5; 9; 5; 4; 3; 56; 6; 5; 9; 4; 1; 47; 1; 2; 5; 2; 0; 7; 31; 55; 6; 7; 4; 7; 8; 8; 2; 4; 40; 4; 6; 9; 3; 59; 5; 1; 0; 2; 6; 90; 1; 6; 81; 0; 1; 3; 7; 2; 4; 5; 4; 7; 3; 62; 0; 1; 6; 7; 5; 97; 83; 41; 7; 2; 6; 3; 0; 4; 8; 99] +[46; 2; 22; 4; 4; 2; 6; 5; 88; 24; 7; 9; 9; 2; 5; 1; 55; 8; 45; 1; 96; 0; 1; 2; 7; 4; 1; 5; 95; 6; 8; 6; 4; 0; 5; 5; 22; 87; 2; 1; 1; 0; 2; 2; 9; 5; 9; 3; 7; 59; 7; 96; 6; 5; 1; 3; 9; 9; 65; 6; 7; 7; 2; 5; 0; 0; 70; 5; 5; 2; 1; 57; 9; 7; 8; 10; 9; 7; 9; 75; 73; 80; 7; 9; 4; 3; 16] +[46; 2; 22; 4; 4; 2; 6; 5; 88; 24; 7; 9; 9; 2; 5; 1; 55; 8; 45; 1; 96; 0; 1; 2; 7; 4; 1; 5; 95; 6; 8; 6; 4; 0; 5; 5; 22; 87; 2; 1; 1; 0; 2; 2] +[46; 2; 22; 4; 4; 2; 6; 5; 88; 24; 7; 9; 9; 2; 5; 1; 55; 8; 45; 1; 96; 0] +[46; 2; 22; 4; 4; 2; 6; 5; 88; 24; 7] +[46; 2; 22; 4; 4; 2] +[46; 2; 22] +[46; 2] +[] +[46] +[] +[23] +[] +[12] +[] +[6] +[] +[3] +[] +[2] +[] +[1] +[] +[0] +[] +[46; 2; 22; 4; 4; 2; 6; 5; 88; 24; 7; 9; 9; 2; 5; 1; 55; 8; 45; 1; 96; 0; 1; 2; 7; 4; 1; 5; 95; 6; 8; 6; 4; 0; 5; 5; 22; 87; 2; 1; 1; 0; 2; 2; 9; 5; 9; 3; 7; 59; 7; 96; 6; 5; 1; 3; 9; 9; 65; 6; 7; 7; 2; 5; 0; 0; 70; 5; 5; 2; 1; 57; 9; 7; 8; 10; 9; 7; 9; 75; 73; 80; 7; 9; 4; 3; 16; 5; 79; 1; 8; 6; 2; 3; 4; 9; 2; 8; 4; 6; 50; 2; 1; 5; 9; 5; 4; 3; 56; 6; 5; 9; 4; 1; 47; 1; 2; 5; 2; 0; 7; 31; 55; 6; 7; 4; 7; 8; 8; 2; 4; 40; 4; 6; 9; 3; 59; 5; 1; 0; 2; 6; 90; 1; 6; 81; 0; 1; 3; 7; 2; 4; 5; 4; 7; 3; 62; 0; 1; 6; 7; 5; 97; 83; 41; 7; 2; 6; 3; 0; 4; 8; 99; 8; 6; 0; 7; 9; 7; 1; 55; 30; 25; 3; 4; 7; 1; 6; 80; 8; 0; 4; 21; 3; 5; 9; 27; 10; 60; 47; 54; 6; 5; 8; 1; 5; 9; 65; 9; 5; 7; 7; 6; 48; 9; 5; 6; 4; 9; 7; 1; 2; 71; 6; 9; 2; 7; 8; 14; 59; 71; 30; 7; 3; 5; 4; 6; 7; 3; 6; 9; 8; 2; 38; 6; 6; 7; 1; 5; 2; 43; 5; 2; 9; 3; 0; 3; 2; 7; 71; 26; 3; 9; 11; 5; 1; 5; 2; 53; 46; 4; 6; 7; 67; 1; 0; 34; 0; 48; 5; 5; 0; 7; 49; 92; 8; 3; 0; 67; 1; 5; 2; 9; 5; 9; 3; 1; 4; 8; 0; 3; 6; 46; 58; 1; 54; 77; 0; 96; 1; 6; 2; 8; 22; 3; 9; 2; 6; 25; 49; 9; 6; 3; 8; 5; 9; 54; 1; 7; 5; 6; 5; 1; 7; 8; 23; 4; 6; 4; 2; 5; 8; 4; 7; 4] +[46; 2; 22; 4; 4; 2; 6; 5; 88; 24; 7; 9; 9; 2; 5; 1; 55; 8; 45; 1; 96; 0; 1; 2; 7; 4; 1; 5; 95; 6; 8; 6; 4; 0; 5; 5; 22; 87; 2; 1; 1; 0; 2; 2; 9; 5; 9; 3; 7; 59; 7; 96; 6; 5; 1; 3; 9; 9; 65; 6; 7; 7; 2; 5; 0; 0; 70; 5; 5; 2; 1; 57; 9; 7; 8; 10; 9; 7; 9; 75; 73; 80; 7; 9; 4; 3; 16; 5; 79; 1; 8; 6; 2; 3; 4; 9; 2; 8; 4; 6; 50; 2; 1; 5; 9; 5; 4; 3; 56; 6; 5; 9; 4; 1; 47; 1; 2; 5; 2; 0; 7; 31; 55; 6; 7; 4; 7; 8; 8; 2; 4; 40; 4; 6; 9; 3; 59; 5; 1; 0; 2; 6; 90; 1; 6; 81; 0; 1; 3; 7; 2; 4; 5; 4; 7; 3; 62; 0; 1; 6; 7; 5; 97; 83; 41; 7; 2; 6; 3; 0; 4; 8; 99] +[46; 2; 22; 4; 4; 2; 6; 5; 88; 24; 7; 9; 9; 2; 5; 1; 55; 8; 45; 1; 96; 0; 1; 2; 7; 4; 1; 5; 95; 6; 8; 6; 4; 0; 5; 5; 22; 87; 2; 1; 1; 0; 2; 2; 9; 5; 9; 3; 7; 59; 7; 96; 6; 5; 1; 3; 9; 9; 65; 6; 7; 7; 2; 5; 0; 0; 70; 5; 5; 2; 1; 57; 9; 7; 8; 10; 9; 7; 9; 75; 73; 80; 7; 9; 4; 3; 16] +[46; 2; 22; 4; 4; 2; 6; 5; 88; 24; 7; 9; 9; 2; 5; 1; 55; 8; 45; 1; 96; 0; 1; 2; 7; 4; 1; 5; 95; 6; 8; 6; 4; 0; 5; 5; 22; 87; 2; 1; 1; 0; 2; 2] +[46; 2; 22; 4; 4; 2; 6; 5; 88; 24; 7; 9; 9; 2; 5; 1; 55; 8; 45; 1; 96; 0] +[46; 2; 22; 4; 4; 2; 6; 5; 88; 24; 7] +[46; 2; 22; 4; 4; 2] +[46; 2; 22] +[46; 2; 4; 4; 2] +[46; 2; 4] +[46; 2; 4; 2] +[46; 2] +[4; 2] +[46; 4; 2] +[2; 4; 2] +[2; 4] +[2] +[2; 2] +[] +[2] +[1; 2] +[2; 1] + +--- Failure -------------------------------------------------------------------- + +Test should_fail_sort_id failed (10 shrink steps): + +[1; 0] + +=== Error ====================================================================== + +Test should_error_raise_exn errored on (30 shrink steps): + +0 + +exception QCheck_tests.Overall.Error + + ++++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Collect results for test collect_results: + +4: 24 cases +3: 20 cases +2: 18 cases +1: 21 cases +0: 17 cases + ++++ Stats for with_stats ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats mod4: + num: 100, avg: 1.56, stddev: 1.18, median 2, min 0, max 3 + 0: ################################################# 27 + 1: #################################### 20 + 2: ########################################## 23 + 3: ####################################################### 30 + +stats num: + num: 100, avg: 62.24, stddev: 33.15, median 62, min 2, max 120 + 2.. 7: ######### 2 + 8.. 13: ################################ 7 + 14.. 19: ########################### 6 + 20.. 25: ############# 3 + 26.. 31: ###################### 5 + 32.. 37: ################## 4 + 38.. 43: ############# 3 + 44.. 49: ################################ 7 + 50.. 55: ################################ 7 + 56.. 61: ###################### 5 + 62.. 67: #################################### 8 + 68.. 73: ######### 2 + 74.. 79: ###################### 5 + 80.. 85: ######### 2 + 86.. 91: ####################################################### 12 + 92.. 97: ###################### 5 + 98..103: ################## 4 + 104..109: ################## 4 + 110..115: ############# 3 + 116..121: ########################### 6 + +--- Failure -------------------------------------------------------------------- + +Test with shrinking retries failed (0 shrink steps): + +4 + +!!! Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +Warning for test WARN_unlikely_precond: + +WARNING: only 0.5% tests (of 2000) passed precondition for "WARN_unlikely_precond" + +NOTE: it is likely that the precondition is too strong, or that the generator is buggy. + +--- Failure -------------------------------------------------------------------- + +Test FAIL_unlikely_precond failed: + +ERROR: only 0.5% tests (of 2000) passed precondition for "FAIL_unlikely_precond" + +NOTE: it is likely that the precondition is too strong, or that the generator is buggy. + + +--- Failure -------------------------------------------------------------------- + +Test FAIL_bad_gen failed: + +ERROR: uncaught exception in generator for test FAIL_bad_gen after 100 steps: +Exception: Invalid_argument("Gen.int_bound") +Backtrace: + +--- Failure -------------------------------------------------------------------- + +Test int double failed: + +Negative test int double succeeded but was expected to fail + +=== Error ====================================================================== + +Test pos fail with error errored on (7 shrink steps): + +0 + +exception QCheck_tests.Overall.Error + + +=== Error ====================================================================== + +Test neg fail with error errored on (7 shrink steps): + +0 + +exception QCheck_tests.Overall.Error + + +--- Failure -------------------------------------------------------------------- + +Test char never produces '\255' failed (0 shrink steps): + +'\255' + +--- Failure -------------------------------------------------------------------- + +Test big bound issue59 failed (20 shrink steps): + +209609 + +--- Failure -------------------------------------------------------------------- + +Test long_shrink failed (86 shrink steps): + +([0], [-1]) + +--- Failure -------------------------------------------------------------------- + +Test ints arent 0 mod 3 failed (26 shrink steps): + +2061 + +--- Failure -------------------------------------------------------------------- + +Test ints are 0 failed (29 shrink steps): + +-1 + +--- Failure -------------------------------------------------------------------- + +Test ints < 209609 failed (20 shrink steps): + +209609 + +--- Failure -------------------------------------------------------------------- + +Test nat < 5001 failed (4 shrink steps): + +5001 + +--- Failure -------------------------------------------------------------------- + +Test char never produces 'abcdef' failed (2 shrink steps): + +'a' + +--- Failure -------------------------------------------------------------------- + +Test printable never produces '!"#$%&' failed (1 shrink steps): + +'&' + +--- Failure -------------------------------------------------------------------- + +Test printable never produces less than '5 failed (0 shrink steps): + +'0' + +--- Failure -------------------------------------------------------------------- + +Test bytes are empty failed (13 shrink steps): + +a + +--- Failure -------------------------------------------------------------------- + +Test bytes never has a \000 char failed (13 shrink steps): + +� + +--- Failure -------------------------------------------------------------------- + +Test bytes never has a \255 char failed (15 shrink steps): + +� + +--- Failure -------------------------------------------------------------------- + +Test bytes have unique chars failed (14 shrink steps): + +�� + +--- Failure -------------------------------------------------------------------- + +Test strings are empty failed (13 shrink steps): + +"a" + +--- Failure -------------------------------------------------------------------- + +Test string never has a \000 char failed (13 shrink steps): + +"\000" + +--- Failure -------------------------------------------------------------------- + +Test string never has a \255 char failed (15 shrink steps): + +"\255" + +--- Failure -------------------------------------------------------------------- + +Test strings have unique chars failed (14 shrink steps): + +"\232\232" + +--- Failure -------------------------------------------------------------------- + +Test pairs have different components failed (0 shrink steps): + +(6, 6) + +--- Failure -------------------------------------------------------------------- + +Test pairs have same components failed (59 shrink steps): + +(0, -1) + +--- Failure -------------------------------------------------------------------- + +Test pairs have a zero component failed (58 shrink steps): + +(-1, -1) + +--- Failure -------------------------------------------------------------------- + +Test pairs are (0,0) failed (59 shrink steps): + +(0, -1) + +--- Failure -------------------------------------------------------------------- + +Test pairs are ordered failed (169 shrink steps): + +(1, 0) + +--- Failure -------------------------------------------------------------------- + +Test pairs are ordered reversely failed (58 shrink steps): + +(0, 1) + +--- Failure -------------------------------------------------------------------- + +Test pairs sum to less than 128 failed (54 shrink steps): + +(0, 128) + +--- Failure -------------------------------------------------------------------- + +Test pairs lists rev concat failed (77 shrink steps): + +([0], [1]) + +--- Failure -------------------------------------------------------------------- + +Test pairs lists no overlap failed (24 shrink steps): + +([0], [0]) + +--- Failure -------------------------------------------------------------------- + +Test triples have pair-wise different components failed (4 shrink steps): + +(6, 6, 0) + +--- Failure -------------------------------------------------------------------- + +Test triples have same components failed (85 shrink steps): + +(0, -1, -2) + +--- Failure -------------------------------------------------------------------- + +Test triples are ordered failed (87 shrink steps): + +(0, 0, -1) + +--- Failure -------------------------------------------------------------------- + +Test triples are ordered reversely failed (89 shrink steps): + +(0, 0, 1) + +--- Failure -------------------------------------------------------------------- + +Test quadruples have pair-wise different components failed (7 shrink steps): + +(0, 5, 5, 0) + +--- Failure -------------------------------------------------------------------- + +Test quadruples have same components failed (117 shrink steps): + +(0, 1, 0, -1) + +--- Failure -------------------------------------------------------------------- + +Test quadruples are ordered failed (118 shrink steps): + +(0, 0, 0, -1) + +--- Failure -------------------------------------------------------------------- + +Test quadruples are ordered reversely failed (120 shrink steps): + +(0, 0, 0, 1) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b) in nat: a < b failed (5 shrink steps): + +(0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c) in nat: a < b < c failed (14 shrink steps): + +(0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c, d) in nat: a < b < c < d failed (17 shrink steps): + +(0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c, d, e) in nat: a < b < c < d < e failed (21 shrink steps): + +(0, 0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c, d, e, f) in nat: a < b < c < d < e < f failed (25 shrink steps): + +(0, 0, 0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c, d, e, f, g) in nat: a < b < c < d < e < f < g failed (27 shrink steps): + +(0, 0, 0, 0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c, d, e, f, g, h) in nat: a < b < c < d < e < f < g < h failed (30 shrink steps): + +(0, 0, 0, 0, 0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test forall (a, b, c, d, e, f, g, h, i) in nat: a < b < c < d < e < f < g < h < i failed (34 shrink steps): + +(0, 0, 0, 0, 0, 0, 0, 0, 0) + +--- Failure -------------------------------------------------------------------- + +Test bind ordered pairs failed (53 shrink steps): + +(0, 0) + +--- Failure -------------------------------------------------------------------- + +Test bind list_size constant failed (52 shrink steps): + +(4, [0; 0; 0; 0]) + +--- Failure -------------------------------------------------------------------- + +Test lists are empty failed (16 shrink steps): + +[0] + +--- Failure -------------------------------------------------------------------- + +Test lists shorter than 10 failed (49 shrink steps): + +[0; 0; 0; 0; 0; 0; 0; 0; 0; 0] + +--- Failure -------------------------------------------------------------------- + +Test lists shorter than 432 failed (1738 shrink steps): + +[...] list length: 432 + +--- Failure -------------------------------------------------------------------- + +Test lists shorter than 4332 failed (11 shrink steps): + +[...] list length: 4332 + +--- Failure -------------------------------------------------------------------- + +Test lists have unique elems failed (10 shrink steps): + +[2; 2] + +--- Failure -------------------------------------------------------------------- + +Test tree contains only 42 failed (9 shrink steps): + +Leaf 0 + +--- Failure -------------------------------------------------------------------- + +Test sum list = 0 failed (0 shrink steps): + +[46; 2; 22; 4; 4; 2; 6; 5; 88; 24; 7; 9; 9; 2; 5; 1; 55; 8; 45; 1; 96; 0; 1; 2; 7; 4; 1; 5; 95; 6; 8; 6; 4; 0; 5; 5; 22; 87; 2; 1; 1; 0; 2; 2; 9; 5; 9; 3; 7; 59; 7; 96; 6; 5; 1; 3; 9; 9; 65; 6; 7; 7; 2; 5; 0; 0; 70; 5; 5; 2; 1; 57; 9; 7; 8; 10; 9; 7; 9; 75; 73; 80; 7; 9; 4; 3; 16; 5; 79; 1; 8; 6; 2; 3; 4; 9; 2; 8; 4; 6; 50; 2; 1; 5; 9; 5; 4; 3; 56; 6; 5; 9; 4; 1; 47; 1; 2; 5; 2; 0; 7; 31; 55; 6; 7; 4; 7; 8; 8; 2; 4; 40; 4; 6; 9; 3; 59; 5; 1; 0; 2; 6; 90; 1; 6; 81; 0; 1; 3; 7; 2; 4; 5; 4; 7; 3; 62; 0; 1; 6; 7; 5; 97; 83; 41; 7; 2; 6; 3; 0; 4; 8; 99; 8; 6; 0; 7; 9; 7; 1; 55; 30; 25; 3; 4; 7; 1; 6; 80; 8; 0; 4; 21; 3; 5; 9; 27; 10; 60; 47; 54; 6; 5; 8; 1; 5; 9; 65; 9; 5; 7; 7; 6; 48; 9; 5; 6; 4; 9; 7; 1; 2; 71; 6; 9; 2; 7; 8; 14; 59; 71; 30; 7; 3; 5; 4; 6; 7; 3; 6; 9; 8; 2; 38; 6; 6; 7; 1; 5; 2; 43; 5; 2; 9; 3; 0; 3; 2; 7; 71; 26; 3; 9; 11; 5; 1; 5; 2; 53; 46; 4; 6; 7; 67; 1; 0; 34; 0; 48; 5; 5; 0; 7; 49; 92; 8; 3; 0; 67; 1; 5; 2; 9; 5; 9; 3; 1; 4; 8; 0; 3; 6; 46; 58; 1; 54; 77; 0; 96; 1; 6; 2; 8; 22; 3; 9; 2; 6; 25; 49; 9; 6; 3; 8; 5; 9; 54; 1; 7; 5; 6; 5; 1; 7; 8; 23; 4; 6; 4; 2; 5; 8; 4; 7; 4] + +--- Failure -------------------------------------------------------------------- + +Test fail_pred_map_commute failed (47 shrink steps): + +([1], {_ -> 0}, {1 -> true; _ -> false}) + +--- Failure -------------------------------------------------------------------- + +Test fail_pred_strings failed (1 shrink steps): + +{some other string -> false; _ -> true} + +--- Failure -------------------------------------------------------------------- + +Test fold_left fold_right failed (21 shrink steps): + +(0, [1], {(0, 1) -> 1; _ -> 0}) + ++++ Messages ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Messages for test fold_left fold_right: + +l=[1], fold_left=0, fold_right=1 + + +--- Failure -------------------------------------------------------------------- + +Test fold_left fold_right uncurried failed (41 shrink steps): + +({(0, 4) -> 1; _ -> 0}, 0, [4]) + +--- Failure -------------------------------------------------------------------- + +Test fold_left fold_right uncurried fun last failed (25 shrink steps): + +(0, [1], {(0, 1) -> 1; _ -> 0}) + +--- Failure -------------------------------------------------------------------- + +Test fold_left test, fun first failed (66 shrink steps): + +({(, 2) -> "a"; _ -> ""}, "", [], [2]) + +--- Failure -------------------------------------------------------------------- + +Test FAIL_#99_1 failed: + +ERROR: uncaught exception in generator for test FAIL_#99_1 after 100 steps: +Exception: QCheck.No_example_found("<example>") +Backtrace: + ++++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Collect results for test bool dist: + +true: 250511 cases +false: 249489 cases + ++++ Stats for char code dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats char code: + num: 500000, avg: 127.68, stddev: 73.87, median 128, min 0, max 255 + 0.. 12: ##################################################### 25272 + 13.. 25: ###################################################### 25326 + 26.. 38: ##################################################### 25194 + 39.. 51: ###################################################### 25359 + 52.. 64: ###################################################### 25338 + 65.. 77: ###################################################### 25349 + 78.. 90: ###################################################### 25397 + 91..103: ##################################################### 25243 + 104..116: ###################################################### 25420 + 117..129: ###################################################### 25438 + 130..142: ###################################################### 25346 + 143..155: ##################################################### 25177 + 156..168: ####################################################### 25755 + 169..181: ###################################################### 25408 + 182..194: ###################################################### 25633 + 195..207: ###################################################### 25613 + 208..220: ###################################################### 25459 + 221..233: ###################################################### 25322 + 234..246: ##################################################### 25229 + 247..259: ##################################### 17722 + ++++ Stats for printable char code dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats char code: + num: 500000, avg: 77.76, stddev: 27.87, median 78, min 10, max 125 + 10.. 15: ######### 5255 + 16.. 21: 0 + 22.. 27: 0 + 28.. 33: ################# 10417 + 34.. 39: ###################################################### 31730 + 40.. 45: ###################################################### 31499 + 46.. 51: ###################################################### 31657 + 52.. 57: ###################################################### 31704 + 58.. 63: ###################################################### 31502 + 64.. 69: ###################################################### 31643 + 70.. 75: ###################################################### 31630 + 76.. 81: ###################################################### 31481 + 82.. 87: ###################################################### 31594 + 88.. 93: ###################################################### 31817 + 94.. 99: ###################################################### 31536 + 100..105: ###################################################### 31528 + 106..111: ###################################################### 31467 + 112..117: ##################################################### 31246 + 118..123: ####################################################### 31861 + 124..129: ################## 10433 + ++++ Stats for numeral char code dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats char code: + num: 500000, avg: 52.50, stddev: 2.87, median 53, min 48, max 57 + 48: ###################################################### 49848 + 49: ###################################################### 50118 + 50: ###################################################### 49837 + 51: ###################################################### 50252 + 52: ###################################################### 49765 + 53: ####################################################### 50369 + 54: ###################################################### 50270 + 55: ###################################################### 49885 + 56: ###################################################### 49821 + 57: ###################################################### 49835 + ++++ Stats for tree's depth ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats depth: + num: 1000, avg: 4.13, stddev: 3.52, median 3, min 1, max 15 + 1: ####################################################### 339 + 2: ################ 104 + 3: ############### 98 + 4: ##################### 133 + 5: ######### 60 + 6: #### 29 + 7: ######## 54 + 8: ####### 48 + 9: ## 16 + 10: ### 21 + 11: ########### 68 + 12: 1 + 13: # 8 + 14: ## 16 + 15: 5 + ++++ Stats for range_subset_spec ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 5000, avg: 9.99, stddev: 6.01, median 10, min 0, max 20 + 0: ############################################### 231 + 1: ############################################## 223 + 2: ##################################################### 258 + 3: ################################################ 233 + 4: ############################################### 228 + 5: ############################################### 231 + 6: #################################################### 254 + 7: ############################################### 228 + 8: #################################################### 254 + 9: ####################################################### 266 + 10: ############################################## 224 + 11: ################################################## 245 + 12: ############################################### 230 + 13: #################################################### 253 + 14: ############################################## 223 + 15: ################################################# 239 + 16: ################################################## 243 + 17: ################################################## 245 + 18: ############################################# 220 + 19: ################################################## 242 + 20: ############################################### 230 + ++++ Stats for bytes_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 7.51, stddev: 1.69, median 8, min 5, max 10 + 5: ################################################## 817 + 6: ################################################# 797 + 7: ####################################################### 885 + 8: ################################################### 834 + 9: ###################################################### 877 + 10: ################################################# 790 + ++++ Stats for bytes len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 370.05, stddev: 1282.91, median 9, min 0, max 9947 + 0.. 497: ####################################################### 4270 + 498.. 995: ###### 497 + 996..1493: 17 + 1494..1991: 9 + 1992..2489: 13 + 2490..2987: 13 + 2988..3485: 9 + 3486..3983: 14 + 3984..4481: 14 + 4482..4979: 17 + 4980..5477: 9 + 5478..5975: 10 + 5976..6473: 15 + 6474..6971: 16 + 6972..7469: 16 + 7470..7967: 9 + 7968..8465: 12 + 8466..8963: 15 + 8964..9461: 9 + 9462..9959: 16 + ++++ Stats for bytes_of len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 359.22, stddev: 1249.46, median 9, min 0, max 9958 + 0.. 497: ####################################################### 4275 + 498.. 995: ###### 479 + 996..1493: 22 + 1494..1991: 12 + 1992..2489: 21 + 2490..2987: 16 + 2988..3485: 13 + 3486..3983: 17 + 3984..4481: 14 + 4482..4979: 14 + 4980..5477: 8 + 5478..5975: 14 + 5976..6473: 13 + 6474..6971: 9 + 6972..7469: 7 + 7470..7967: 17 + 7968..8465: 13 + 8466..8963: 15 + 8964..9461: 10 + 9462..9959: 11 + ++++ Stats for bytes_small len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 15.99, stddev: 24.58, median 6, min 0, max 99 + 0.. 4: ###################################################### 1920 + 5.. 9: ####################################################### 1929 + 10.. 14: # 69 + 15.. 19: # 62 + 20.. 24: # 63 + 25.. 29: # 59 + 30.. 34: # 68 + 35.. 39: # 62 + 40.. 44: # 57 + 45.. 49: ## 83 + 50.. 54: # 59 + 55.. 59: ## 80 + 60.. 64: # 48 + 65.. 69: # 53 + 70.. 74: # 61 + 75.. 79: # 66 + 80.. 84: # 61 + 85.. 89: ## 72 + 90.. 94: # 66 + 95.. 99: # 62 + ++++ Stats for string_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 7.51, stddev: 1.69, median 8, min 5, max 10 + 5: ################################################## 817 + 6: ################################################# 797 + 7: ####################################################### 885 + 8: ################################################### 834 + 9: ###################################################### 877 + 10: ################################################# 790 + ++++ Stats for string len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 370.05, stddev: 1282.91, median 9, min 0, max 9947 + 0.. 497: ####################################################### 4270 + 498.. 995: ###### 497 + 996..1493: 17 + 1494..1991: 9 + 1992..2489: 13 + 2490..2987: 13 + 2988..3485: 9 + 3486..3983: 14 + 3984..4481: 14 + 4482..4979: 17 + 4980..5477: 9 + 5478..5975: 10 + 5976..6473: 15 + 6474..6971: 16 + 6972..7469: 16 + 7470..7967: 9 + 7968..8465: 12 + 8466..8963: 15 + 8964..9461: 9 + 9462..9959: 16 + ++++ Stats for string_of len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 359.22, stddev: 1249.46, median 9, min 0, max 9958 + 0.. 497: ####################################################### 4275 + 498.. 995: ###### 479 + 996..1493: 22 + 1494..1991: 12 + 1992..2489: 21 + 2490..2987: 16 + 2988..3485: 13 + 3486..3983: 17 + 3984..4481: 14 + 4482..4979: 14 + 4980..5477: 8 + 5478..5975: 14 + 5976..6473: 13 + 6474..6971: 9 + 6972..7469: 7 + 7470..7967: 17 + 7968..8465: 13 + 8466..8963: 15 + 8964..9461: 10 + 9462..9959: 11 + ++++ Stats for printable_string len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 370.05, stddev: 1282.91, median 9, min 0, max 9947 + 0.. 497: ####################################################### 4270 + 498.. 995: ###### 497 + 996..1493: 17 + 1494..1991: 9 + 1992..2489: 13 + 2490..2987: 13 + 2988..3485: 9 + 3486..3983: 14 + 3984..4481: 14 + 4482..4979: 17 + 4980..5477: 9 + 5478..5975: 10 + 5976..6473: 15 + 6474..6971: 16 + 6972..7469: 16 + 7470..7967: 9 + 7968..8465: 12 + 8466..8963: 15 + 8964..9461: 9 + 9462..9959: 16 + ++++ Stats for small_string len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 15.99, stddev: 24.58, median 6, min 0, max 99 + 0.. 4: ###################################################### 1920 + 5.. 9: ####################################################### 1929 + 10.. 14: # 69 + 15.. 19: # 62 + 20.. 24: # 63 + 25.. 29: # 59 + 30.. 34: # 68 + 35.. 39: # 62 + 40.. 44: # 57 + 45.. 49: ## 83 + 50.. 54: # 59 + 55.. 59: ## 80 + 60.. 64: # 48 + 65.. 69: # 53 + 70.. 74: # 61 + 75.. 79: # 66 + 80.. 84: # 61 + 85.. 89: ## 72 + 90.. 94: # 66 + 95.. 99: # 62 + ++++ Stats for pair dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats pair sum: + num: 500000, avg: 100.05, stddev: 41.29, median 100, min 0, max 200 + 0.. 9: ### 2618 + 10.. 19: ######## 7630 + 20.. 29: ############## 12505 + 30.. 39: #################### 17451 + 40.. 49: ########################## 22280 + 50.. 59: ############################### 27307 + 60.. 69: ##################################### 32151 + 70.. 79: ########################################### 37199 + 80.. 89: ################################################# 41901 + 90.. 99: ###################################################### 46313 + 100..109: ####################################################### 46965 + 110..119: ################################################# 42462 + 120..129: ########################################### 37348 + 130..139: ###################################### 32613 + 140..149: ################################ 27606 + 150..159: ########################### 23221 + 160..169: ##################### 18125 + 170..179: ############### 12890 + 180..189: ######### 8059 + 190..199: ### 3297 + 200..209: 59 + ++++ Stats for triple dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats triple sum: + num: 500000, avg: 150.04, stddev: 50.53, median 150, min 1, max 300 + 1.. 15: 360 + 16.. 30: ## 2261 + 31.. 45: ##### 5712 + 46.. 60: ########## 10854 + 61.. 75: ################# 17760 + 76.. 90: ########################## 26151 + 91..105: ################################### 36079 + 106..120: ############################################# 45498 + 121..135: ################################################### 51977 + 136..150: ####################################################### 55179 + 151..165: ###################################################### 54821 + 166..180: ################################################### 51709 + 181..195: ############################################# 45166 + 196..210: ################################### 35354 + 211..225: ######################### 25436 + 226..240: ################# 17179 + 241..255: ########## 10652 + 256..270: ##### 5447 + 271..285: ## 2065 + 286..300: 340 + ++++ Stats for quad dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats quad sum: + num: 500000, avg: 200.06, stddev: 58.39, median 200, min 2, max 394 + 2.. 21: 61 + 22.. 41: 658 + 42.. 61: ## 2534 + 62.. 81: ##### 6444 + 82..101: ########### 13334 + 102..121: ################### 23279 + 122..141: ############################## 35888 + 142..161: ######################################### 48824 + 162..181: ################################################## 59008 + 182..201: ####################################################### 64896 + 202..221: ###################################################### 64051 + 222..241: ################################################# 57864 + 242..261: ####################################### 46793 + 262..281: ############################ 33955 + 282..301: ################## 21775 + 302..321: ########## 12187 + 322..341: #### 5645 + 342..361: # 2244 + 362..381: 529 + 382..401: 31 + ++++ Stats for bind dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats ordered pair difference: + num: 1000000, avg: 25.01, stddev: 22.38, median 19, min 0, max 100 + 0.. 4: ####################################################### 193610 + 5.. 9: #################################### 130051 + 10.. 14: ############################# 104209 + 15.. 19: ######################## 86993 + 20.. 24: ##################### 74295 + 25.. 29: ################## 64874 + 30.. 34: ################ 56447 + 35.. 39: ############## 49416 + 40.. 44: ############ 43051 + 45.. 49: ########## 37580 + 50.. 54: ######### 32378 + 55.. 59: ######## 28558 + 60.. 64: ###### 23971 + 65.. 69: ##### 20146 + 70.. 74: #### 16446 + 75.. 79: ### 13215 + 80.. 84: ## 10294 + 85.. 89: ## 7639 + 90.. 94: # 4698 + 95.. 99: 2041 + 100..104: 88 + +stats ordered pair sum: + num: 1000000, avg: 74.97, stddev: 46.86, median 72, min 0, max 200 + 0.. 9: ####################################################### 70320 + 10.. 19: ##################################################### 68731 + 20.. 29: ##################################################### 68374 + 30.. 39: ##################################################### 68544 + 40.. 49: ##################################################### 68756 + 50.. 59: ##################################################### 68837 + 60.. 69: ##################################################### 68759 + 70.. 79: ##################################################### 68517 + 80.. 89: ##################################################### 68692 + 90.. 99: ###################################################### 69123 + 100..109: ################################################## 64777 + 110..119: ########################################### 55288 + 120..129: #################################### 47156 + 130..139: ############################### 39635 + 140..149: ######################### 32590 + 150..159: #################### 25685 + 160..169: ############### 19842 + 170..179: ########## 14038 + 180..189: ###### 8631 + 190..199: ## 3580 + 200..209: 125 + ++++ Stats for list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 374.46, stddev: 1320.15, median 9, min 0, max 9984 + 0.. 499: ####################################################### 4269 + 500.. 999: ###### 503 + 1000.. 1499: 13 + 1500.. 1999: 6 + 2000.. 2499: 22 + 2500.. 2999: 13 + 3000.. 3499: 10 + 3500.. 3999: 5 + 4000.. 4499: 15 + 4500.. 4999: 10 + 5000.. 5499: 15 + 5500.. 5999: 12 + 6000.. 6499: 6 + 6500.. 6999: 12 + 7000.. 7499: 11 + 7500.. 7999: 15 + 8000.. 8499: 21 + 8500.. 8999: 11 + 9000.. 9499: 15 + 9500.. 9999: 16 + ++++ Stats for small_list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 15.36, stddev: 23.76, median 6, min 0, max 99 + 0.. 4: ###################################################### 1933 + 5.. 9: ####################################################### 1962 + 10.. 14: # 69 + 15.. 19: # 57 + 20.. 24: # 51 + 25.. 29: # 62 + 30.. 34: # 63 + 35.. 39: # 65 + 40.. 44: ## 77 + 45.. 49: # 71 + 50.. 54: # 56 + 55.. 59: # 60 + 60.. 64: # 66 + 65.. 69: # 65 + 70.. 74: # 69 + 75.. 79: # 48 + 80.. 84: # 53 + 85.. 89: # 58 + 90.. 94: # 64 + 95.. 99: # 51 + ++++ Stats for list_of_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 7.50, stddev: 1.71, median 8, min 5, max 10 + 5: ###################################################### 853 + 6: #################################################### 819 + 7: #################################################### 820 + 8: #################################################### 825 + 9: ####################################################### 857 + 10: ##################################################### 826 + ++++ Stats for list_repeat len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 42.00, stddev: 0.00, median 42, min 42, max 42 + 42: ####################################################### 5000 + ++++ Stats for array len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 374.46, stddev: 1320.15, median 9, min 0, max 9984 + 0.. 499: ####################################################### 4269 + 500.. 999: ###### 503 + 1000.. 1499: 13 + 1500.. 1999: 6 + 2000.. 2499: 22 + 2500.. 2999: 13 + 3000.. 3499: 10 + 3500.. 3999: 5 + 4000.. 4499: 15 + 4500.. 4999: 10 + 5000.. 5499: 15 + 5500.. 5999: 12 + 6000.. 6499: 6 + 6500.. 6999: 12 + 7000.. 7499: 11 + 7500.. 7999: 15 + 8000.. 8499: 21 + 8500.. 8999: 11 + 9000.. 9499: 15 + 9500.. 9999: 16 + ++++ Stats for small_array len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 15.36, stddev: 23.76, median 6, min 0, max 99 + 0.. 4: ###################################################### 1933 + 5.. 9: ####################################################### 1962 + 10.. 14: # 69 + 15.. 19: # 57 + 20.. 24: # 51 + 25.. 29: # 62 + 30.. 34: # 63 + 35.. 39: # 65 + 40.. 44: ## 77 + 45.. 49: # 71 + 50.. 54: # 56 + 55.. 59: # 60 + 60.. 64: # 66 + 65.. 69: # 65 + 70.. 74: # 69 + 75.. 79: # 48 + 80.. 84: # 53 + 85.. 89: # 58 + 90.. 94: # 64 + 95.. 99: # 51 + ++++ Stats for array_of_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 7.50, stddev: 1.71, median 8, min 5, max 10 + 5: ###################################################### 853 + 6: #################################################### 819 + 7: #################################################### 820 + 8: #################################################### 825 + 9: ####################################################### 857 + 10: ##################################################### 826 + ++++ Stats for array_repeat len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats len: + num: 5000, avg: 42.00, stddev: 0.00, median 42, min 42, max 42 + 42: ####################################################### 5000 + ++++ Stats for int_stats_neg ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 5000, avg: 0.43, stddev: 28.63, median 0, min -99, max 99 + -99..-90: # 45 + -89..-80: # 57 + -79..-70: # 68 + -69..-60: # 58 + -59..-50: # 76 + -49..-40: # 67 + -39..-30: # 52 + -29..-20: # 54 + -19..-10: # 47 + -9.. 0: ####################################################### 2205 + 1.. 10: ########################################## 1697 + 11.. 20: # 57 + 21.. 30: # 70 + 31.. 40: # 60 + 41.. 50: # 66 + 51.. 60: # 75 + 61.. 70: # 68 + 71.. 80: # 63 + 81.. 90: # 66 + 91..100: # 49 + ++++ Stats for small_signed_int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 0.86, stddev: 29.11, median 0, min -97, max 99 + -97..-88: # 12 + -87..-78: # 12 + -77..-68: # 13 + -67..-58: # 12 + -57..-48: # 9 + -47..-38: ## 17 + -37..-28: # 13 + -27..-18: # 8 + -17.. -8: ######### 76 + -7.. 2: ####################################################### 437 + 3.. 12: ################################## 276 + 13.. 22: ## 16 + 23.. 32: # 11 + 33.. 42: ## 16 + 43.. 52: # 9 + 53.. 62: # 12 + 63.. 72: # 14 + 73.. 82: # 12 + 83.. 92: # 13 + 93..102: # 12 + ++++ Stats for small_nat dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 15.86, stddev: 24.57, median 6, min 0, max 99 + 0.. 4: ###################################################### 387 + 5.. 9: ####################################################### 390 + 10.. 14: # 11 + 15.. 19: # 8 + 20.. 24: # 11 + 25.. 29: ## 15 + 30.. 34: # 9 + 35.. 39: # 11 + 40.. 44: # 11 + 45.. 49: ## 19 + 50.. 54: # 10 + 55.. 59: ## 19 + 60.. 64: # 9 + 65.. 69: # 9 + 70.. 74: ## 19 + 75.. 79: # 13 + 80.. 84: # 11 + 85.. 89: ## 16 + 90.. 94: # 9 + 95.. 99: # 13 + ++++ Stats for nat dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 382.03, stddev: 1290.55, median 9, min 0, max 9890 + 0.. 494: ####################################################### 850 + 495.. 989: ###### 93 + 990..1484: 8 + 1485..1979: 3 + 1980..2474: 7 + 2475..2969: 1 + 2970..3464: 3 + 3465..3959: 3 + 3960..4454: 3 + 4455..4949: 4 + 4950..5444: 3 + 5445..5939: 3 + 5940..6434: 3 + 6435..6929: 1 + 6930..7424: 2 + 7425..7919: 1 + 7920..8414: 1 + 8415..8909: 5 + 8910..9404: 3 + 9405..9899: 3 + ++++ Stats for int_range (-43643) 435434 dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 193479.13, stddev: 136696.70, median 189823, min -43164, max 434961 + -43164..-19258: ################################### 42 + -19257.. 4649: ############################################## 56 + 4650.. 28556: ############################################# 55 + 28557.. 52463: ############################################### 57 + 52464.. 76370: ######################################### 50 + 76371..100277: ############################# 35 + 100278..124184: ############################################### 57 + 124185..148091: #################################### 44 + 148092..171998: ############################################## 56 + 171999..195905: ####################################################### 66 + 195906..219812: ########################################### 52 + 219813..243719: ######################################## 49 + 243720..267626: ################################ 39 + 267627..291533: ##################################### 45 + 291534..315440: ##################################### 45 + 315441..339347: ################################################# 59 + 339348..363254: ################################################## 60 + 363255..387161: ################################# 40 + 387162..411068: ########################################## 51 + 411069..434975: ################################### 42 + ++++ Stats for int_range (-40000) 40000 dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: -591.06, stddev: 23026.79, median -911, min -39911, max 39959 + -39911..-35918: ####################################### 45 + -35917..-31924: #################################################### 59 + -31923..-27930: ########################################### 49 + -27929..-23936: ########################################## 48 + -23935..-19942: ####################################################### 62 + -19941..-15948: ############################################# 51 + -15947..-11954: ######################################### 47 + -11953.. -7960: ################################################# 56 + -7959.. -3966: ################################### 40 + -3965.. 28: ################################################### 58 + 29.. 4022: ########################################### 49 + 4023.. 8016: ############################################### 53 + 8017.. 12010: ############################################ 50 + 12011.. 16004: ################################### 40 + 16005.. 19998: ####################################### 44 + 19999.. 23992: ####################################################### 62 + 23993.. 27986: ##################################### 42 + 27987.. 31980: ######################################### 47 + 31981.. 35974: ########################################## 48 + 35975.. 39968: ############################################ 50 + ++++ Stats for int_range (-4) 4 dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: -0.12, stddev: 2.52, median 0, min -4, max 4 + -4: ########################################## 116 + -3: ###################################### 103 + -2: ############################################## 125 + -1: ########################################## 115 + 0: ####################################### 106 + 1: ####################################################### 149 + 2: ################################# 92 + 3: ################################# 92 + 4: ##################################### 102 + ++++ Stats for int_range (-4) 17 dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 6.42, stddev: 6.43, median 6, min -4, max 17 + -4..-3: ########################################### 89 + -2..-1: ################################################# 101 + 0.. 1: ############################################## 95 + 2.. 3: ########################################### 89 + 4.. 5: ############################################## 95 + 6.. 7: ##################################### 78 + 8.. 9: ####################################### 81 + 10..11: ######################################## 84 + 12..13: ####################################################### 113 + 14..15: ######################################## 84 + 16..17: ############################################ 91 + 18..19: 0 + 20..21: 0 + 22..23: 0 + 24..25: 0 + 26..27: 0 + 28..29: 0 + 30..31: 0 + 32..33: 0 + 34..35: 0 + ++++ Stats for int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 100000, avg: -2481754.31, stddev: 618398387.27, median -5669677, min -1073719962, max 1073717275 + -1073719962.. -966348101: ##################################################### 4978 + -966348100.. -858976239: ##################################################### 5008 + -858976238.. -751604377: #################################################### 4907 + -751604376.. -644232515: ###################################################### 5037 + -644232514.. -536860653: ###################################################### 5069 + -536860652.. -429488791: ###################################################### 5052 + -429488790.. -322116929: ###################################################### 5035 + -322116928.. -214745067: ####################################################### 5128 + -214745066.. -107373205: ##################################################### 5017 + -107373204.. -1343: ##################################################### 5021 + -1342.. 107370519: ##################################################### 5010 + 107370520.. 214742381: ##################################################### 4964 + 214742382.. 322114243: ##################################################### 4957 + 322114244.. 429486105: ##################################################### 4994 + 429486106.. 536857967: ##################################################### 5025 + 536857968.. 644229829: ###################################################### 5047 + 644229830.. 751601691: ##################################################### 4988 + 751601692.. 858973553: #################################################### 4924 + 858973554.. 966345415: #################################################### 4852 + 966345416.. 1073717277: ##################################################### 4987 + ++++ Stats for oneof int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: 1073741.60, stddev: 673131652.31, median 0, min -1073741824, max 1073741823 + -1073741824.. -966367642: ################# 198 + -966367641.. -858993459: 0 + -858993458.. -751619276: 0 + -751619275.. -644245093: 0 + -644245092.. -536870910: 0 + -536870909.. -429496727: 0 + -429496726.. -322122544: 0 + -322122543.. -214748361: 0 + -214748360.. -107374178: 0 + -107374177.. 5: ####################################################### 607 + 6.. 107374188: 0 + 107374189.. 214748371: 0 + 214748372.. 322122554: 0 + 322122555.. 429496737: 0 + 429496738.. 536870920: 0 + 536870921.. 644245103: 0 + 644245104.. 751619286: 0 + 751619287.. 858993469: 0 + 858993470.. 966367652: 0 + 966367653.. 1073741823: ################# 195 +================================================================================ +1 warning(s) +failure (64 tests failed, 3 tests errored, ran 149 tests) +random seed: 153870556 + ++++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 1000, avg: -20587725.59, stddev: 427231078.01, median 8, min -1072292884, max 1073741823 + -1072292884.. -964991149: ## 26 + -964991148.. -857689413: ### 31 + -857689412.. -750387677: ## 22 + -750387676.. -643085941: ## 22 + -643085940.. -535784205: ## 27 + -535784204.. -428482469: ### 30 + -428482468.. -321180733: ## 29 + -321180732.. -213878997: ## 20 + -213878996.. -106577261: ## 20 + -106577260.. 724475: ####################################################### 543 + 724476.. 108026211: ## 22 + 108026212.. 215327947: ## 22 + 215327948.. 322629683: ### 32 + 322629684.. 429931419: ## 29 + 429931420.. 537233155: ## 20 + 537233156.. 644534891: ## 21 + 644534892.. 751836627: ## 20 + 751836628.. 859138363: ## 22 + 859138364.. 966440099: ## 24 + 966440100.. 1073741823: # 18 +================================================================================ +success (ran 1 tests) From b29ca7bc3c42290f93cc0122945afd7dd5731b3e Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 3 May 2023 10:07:34 +0100 Subject: [PATCH 145/391] Rework test/core/dune and rename expect files --- ...=> QCheck2_expect_test.expected.ocaml4.32} | 0 ...=> QCheck2_expect_test.expected.ocaml4.64} | 0 ...=> QCheck2_expect_test.expected.ocaml5.64} | 0 ... => QCheck_expect_test.expected.ocaml4.32} | 0 ... => QCheck_expect_test.expected.ocaml4.64} | 0 ... => QCheck_expect_test.expected.ocaml5.64} | 0 test/core/dune | 53 +++++++++++++------ 7 files changed, 36 insertions(+), 17 deletions(-) rename test/core/{QCheck2_expect_test.expected.32 => QCheck2_expect_test.expected.ocaml4.32} (100%) rename test/core/{QCheck2_expect_test.expected.64 => QCheck2_expect_test.expected.ocaml4.64} (100%) rename test/core/{QCheck2_expect_test.expected.ocaml5 => QCheck2_expect_test.expected.ocaml5.64} (100%) rename test/core/{QCheck_expect_test.expected.32 => QCheck_expect_test.expected.ocaml4.32} (100%) rename test/core/{QCheck_expect_test.expected.64 => QCheck_expect_test.expected.ocaml4.64} (100%) rename test/core/{QCheck_expect_test.expected.ocaml5 => QCheck_expect_test.expected.ocaml5.64} (100%) diff --git a/test/core/QCheck2_expect_test.expected.32 b/test/core/QCheck2_expect_test.expected.ocaml4.32 similarity index 100% rename from test/core/QCheck2_expect_test.expected.32 rename to test/core/QCheck2_expect_test.expected.ocaml4.32 diff --git a/test/core/QCheck2_expect_test.expected.64 b/test/core/QCheck2_expect_test.expected.ocaml4.64 similarity index 100% rename from test/core/QCheck2_expect_test.expected.64 rename to test/core/QCheck2_expect_test.expected.ocaml4.64 diff --git a/test/core/QCheck2_expect_test.expected.ocaml5 b/test/core/QCheck2_expect_test.expected.ocaml5.64 similarity index 100% rename from test/core/QCheck2_expect_test.expected.ocaml5 rename to test/core/QCheck2_expect_test.expected.ocaml5.64 diff --git a/test/core/QCheck_expect_test.expected.32 b/test/core/QCheck_expect_test.expected.ocaml4.32 similarity index 100% rename from test/core/QCheck_expect_test.expected.32 rename to test/core/QCheck_expect_test.expected.ocaml4.32 diff --git a/test/core/QCheck_expect_test.expected.64 b/test/core/QCheck_expect_test.expected.ocaml4.64 similarity index 100% rename from test/core/QCheck_expect_test.expected.64 rename to test/core/QCheck_expect_test.expected.ocaml4.64 diff --git a/test/core/QCheck_expect_test.expected.ocaml5 b/test/core/QCheck_expect_test.expected.ocaml5.64 similarity index 100% rename from test/core/QCheck_expect_test.expected.ocaml5 rename to test/core/QCheck_expect_test.expected.ocaml5.64 diff --git a/test/core/dune b/test/core/dune index e38f2ed7..3e854fd3 100644 --- a/test/core/dune +++ b/test/core/dune @@ -1,12 +1,3 @@ -(* -*- tuareg -*- *) - -let suffix = - try - let major_version = List.hd (String.split_on_char '.' Sys.ocaml_version) in - if int_of_string major_version < 5 then string_of_int Sys.word_size else "ocaml5" - with _ -> failwith ("Unknown OCaml version format: " ^ Sys.ocaml_version) - -let dune = Printf.sprintf {| (library (name QCheck_tests) (modules QCheck_tests) @@ -25,13 +16,29 @@ let dune = Printf.sprintf {| (rule (targets QCheck_expect_test.out) (action - (with-stdout-to %%{targets} + (with-stdout-to %{targets} (run ./QCheck_expect_test.exe --no-colors -s 1234)))) +(rule + (enabled_if (and (= %{arch_sixtyfour} true) (>= %{ocaml_version} 5))) + (action (copy QCheck_expect_test.expected.ocaml5.64 QCheck_expect_test.expected))) + +(rule + (enabled_if (and (= %{arch_sixtyfour} false) (>= %{ocaml_version} 5))) + (action (copy QCheck_expect_test.expected.ocaml5.32 QCheck_expect_test.expected))) + +(rule + (enabled_if (and (= %{arch_sixtyfour} true) (< %{ocaml_version} 5))) + (action (copy QCheck_expect_test.expected.ocaml4.64 QCheck_expect_test.expected))) + +(rule + (enabled_if (and (= %{arch_sixtyfour} false) (< %{ocaml_version} 5))) + (action (copy QCheck_expect_test.expected.ocaml4.32 QCheck_expect_test.expected))) + (rule (alias runtest) (package qcheck-core) - (action (diff QCheck_expect_test.expected.%s QCheck_expect_test.out))) + (action (diff QCheck_expect_test.expected QCheck_expect_test.out))) (executable (name QCheck2_expect_test) @@ -41,13 +48,29 @@ let dune = Printf.sprintf {| (rule (targets QCheck2_expect_test.out) (action - (with-stdout-to %%{targets} + (with-stdout-to %{targets} (run ./QCheck2_expect_test.exe --no-colors -s 1234)))) +(rule + (enabled_if (and (= %{arch_sixtyfour} true) (>= %{ocaml_version} 5))) + (action (copy QCheck2_expect_test.expected.ocaml5.64 QCheck2_expect_test.expected))) + +(rule + (enabled_if (and (= %{arch_sixtyfour} false) (>= %{ocaml_version} 5))) + (action (copy QCheck2_expect_test.expected.ocaml5.32 QCheck2_expect_test.expected))) + +(rule + (enabled_if (and (= %{arch_sixtyfour} true) (< %{ocaml_version} 5))) + (action (copy QCheck2_expect_test.expected.ocaml4.64 QCheck2_expect_test.expected))) + +(rule + (enabled_if (and (= %{arch_sixtyfour} false) (< %{ocaml_version} 5))) + (action (copy QCheck2_expect_test.expected.ocaml4.32 QCheck2_expect_test.expected))) + (rule (alias runtest) (package qcheck-core) - (action (diff QCheck2_expect_test.expected.%s QCheck2_expect_test.out))) + (action (diff QCheck2_expect_test.expected QCheck2_expect_test.out))) (tests (names QCheck_unit_tests QCheck2_unit_tests) @@ -59,7 +82,3 @@ let dune = Printf.sprintf {| (name shrink_benchmark) (modules shrink_benchmark) (libraries qcheck-core qcheck-core.runner QCheck_tests QCheck2_tests)) - -|} suffix suffix - -let () = Jbuild_plugin.V1.send dune From 9ab7b27b219e3811c70d681b0d5bbba850727144 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 3 May 2023 11:24:13 +0200 Subject: [PATCH 146/391] Clean-up expect-rules --- test/core/dune | 44 ++++++++++++++------------------------------ 1 file changed, 14 insertions(+), 30 deletions(-) diff --git a/test/core/dune b/test/core/dune index 3e854fd3..2f6b364b 100644 --- a/test/core/dune +++ b/test/core/dune @@ -8,17 +8,6 @@ (modules QCheck2_tests) (libraries qcheck-core)) -(executable - (name QCheck_expect_test) - (modules QCheck_expect_test) - (libraries qcheck-core qcheck-core.runner QCheck_tests)) - -(rule - (targets QCheck_expect_test.out) - (action - (with-stdout-to %{targets} - (run ./QCheck_expect_test.exe --no-colors -s 1234)))) - (rule (enabled_if (and (= %{arch_sixtyfour} true) (>= %{ocaml_version} 5))) (action (copy QCheck_expect_test.expected.ocaml5.64 QCheck_expect_test.expected))) @@ -35,21 +24,13 @@ (enabled_if (and (= %{arch_sixtyfour} false) (< %{ocaml_version} 5))) (action (copy QCheck_expect_test.expected.ocaml4.32 QCheck_expect_test.expected))) -(rule - (alias runtest) - (package qcheck-core) - (action (diff QCheck_expect_test.expected QCheck_expect_test.out))) - -(executable - (name QCheck2_expect_test) - (modules QCheck2_expect_test) - (libraries qcheck-core qcheck-core.runner QCheck2_tests)) - -(rule - (targets QCheck2_expect_test.out) - (action - (with-stdout-to %{targets} - (run ./QCheck2_expect_test.exe --no-colors -s 1234)))) +;; implicitly compared against QCheck_expect_test.expected +(test + (name QCheck_expect_test) + (modules QCheck_expect_test) + (package qcheck-core) + (libraries qcheck-core qcheck-core.runner QCheck_tests) + (action (run ./%{test} --no-colors -s 1234))) (rule (enabled_if (and (= %{arch_sixtyfour} true) (>= %{ocaml_version} 5))) @@ -67,10 +48,13 @@ (enabled_if (and (= %{arch_sixtyfour} false) (< %{ocaml_version} 5))) (action (copy QCheck2_expect_test.expected.ocaml4.32 QCheck2_expect_test.expected))) -(rule - (alias runtest) - (package qcheck-core) - (action (diff QCheck2_expect_test.expected QCheck2_expect_test.out))) +;; implicitly compared against QCheck2_expect_test.expected +(test + (name QCheck2_expect_test) + (modules QCheck2_expect_test) + (package qcheck-core) + (libraries qcheck-core qcheck-core.runner QCheck2_tests) + (action (run ./%{test} --no-colors -s 1234))) (tests (names QCheck_unit_tests QCheck2_unit_tests) From e250bb378cfa5de89ba72de6fa22b30ecb8cc688 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 3 May 2023 11:39:06 +0200 Subject: [PATCH 147/391] Rework example/dune and rename expect files --- ... => QCheck_runner_test.expected.ocaml4.32} | 0 ... => QCheck_runner_test.expected.ocaml4.64} | 0 ... => QCheck_runner_test.expected.ocaml5.32} | 0 ... => QCheck_runner_test.expected.ocaml5.64} | 0 example/dune | 46 ++++++++----------- 5 files changed, 18 insertions(+), 28 deletions(-) rename example/{output.txt.expected.32 => QCheck_runner_test.expected.ocaml4.32} (100%) rename example/{output.txt.expected.64 => QCheck_runner_test.expected.ocaml4.64} (100%) rename example/{output.txt.expected.ocaml5.32 => QCheck_runner_test.expected.ocaml5.32} (100%) rename example/{output.txt.expected.ocaml5 => QCheck_runner_test.expected.ocaml5.64} (100%) diff --git a/example/output.txt.expected.32 b/example/QCheck_runner_test.expected.ocaml4.32 similarity index 100% rename from example/output.txt.expected.32 rename to example/QCheck_runner_test.expected.ocaml4.32 diff --git a/example/output.txt.expected.64 b/example/QCheck_runner_test.expected.ocaml4.64 similarity index 100% rename from example/output.txt.expected.64 rename to example/QCheck_runner_test.expected.ocaml4.64 diff --git a/example/output.txt.expected.ocaml5.32 b/example/QCheck_runner_test.expected.ocaml5.32 similarity index 100% rename from example/output.txt.expected.ocaml5.32 rename to example/QCheck_runner_test.expected.ocaml5.32 diff --git a/example/output.txt.expected.ocaml5 b/example/QCheck_runner_test.expected.ocaml5.64 similarity index 100% rename from example/output.txt.expected.ocaml5 rename to example/QCheck_runner_test.expected.ocaml5.64 diff --git a/example/dune b/example/dune index cb411f49..2c05f777 100644 --- a/example/dune +++ b/example/dune @@ -1,34 +1,24 @@ -(* -*- tuareg -*- *) - -let suffix = - try - let major_version = List.hd (String.split_on_char '.' Sys.ocaml_version) in - if int_of_string major_version < 5 then string_of_int Sys.word_size else "ocaml5" - with _ -> failwith ("Unknown OCaml version format: " ^ Sys.ocaml_version) - -let dune = Printf.sprintf {| - -(executables - (names QCheck_runner_test) - (libraries qcheck)) +(rule + (enabled_if (and (= %{arch_sixtyfour} true) (>= %{ocaml_version} 5))) + (action (copy QCheck_runner_test.expected.ocaml5.64 QCheck_runner_test.expected))) (rule - (targets output.txt) - (deps ./QCheck_runner_test.exe) - (enabled_if (= %%{os_type} "Unix")) - (action - (with-accepted-exit-codes - 1 - (with-stdout-to - %%{targets} - (run ./QCheck_runner_test.exe --no-colors -s 1234))))) + (enabled_if (and (= %{arch_sixtyfour} false) (>= %{ocaml_version} 5))) + (action (copy QCheck_runner_test.expected.ocaml5.32 QCheck_runner_test.expected))) (rule - (alias runtest) - (enabled_if (= %%{os_type} "Unix")) - (package qcheck) - (action (diff output.txt.expected.%s output.txt))) + (enabled_if (and (= %{arch_sixtyfour} true) (< %{ocaml_version} 5))) + (action (copy QCheck_runner_test.expected.ocaml4.64 QCheck_runner_test.expected))) -|} suffix +(rule + (enabled_if (and (= %{arch_sixtyfour} false) (< %{ocaml_version} 5))) + (action (copy QCheck_runner_test.expected.ocaml4.32 QCheck_runner_test.expected))) -let () = Jbuild_plugin.V1.send dune +;; implicitly compared against QCheck_runner_test.expected +(test + (enabled_if (= %{os_type} "Unix")) + (name QCheck_runner_test) + (modules QCheck_runner_test) + (package qcheck) + (libraries qcheck) + (action (with-accepted-exit-codes 1 (run ./%{test} --no-colors -s 1234)))) From dff2c79e52702453c6a53c8e4f2c0a729cfd4e8a Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 3 May 2023 11:53:19 +0200 Subject: [PATCH 148/391] Rework example/alcotest/dune and rename expect files --- ...> QCheck_alcotest_test.expected.ocaml4.32} | 0 ...> QCheck_alcotest_test.expected.ocaml4.64} | 0 ...> QCheck_alcotest_test.expected.ocaml5.32} | 0 ...> QCheck_alcotest_test.expected.ocaml5.64} | 0 example/alcotest/dune | 61 ++++++++----------- 5 files changed, 24 insertions(+), 37 deletions(-) rename example/alcotest/{output.txt.expected.32 => QCheck_alcotest_test.expected.ocaml4.32} (100%) rename example/alcotest/{output.txt.expected.64 => QCheck_alcotest_test.expected.ocaml4.64} (100%) rename example/alcotest/{output.txt.expected.ocaml5.32 => QCheck_alcotest_test.expected.ocaml5.32} (100%) rename example/alcotest/{output.txt.expected.ocaml5 => QCheck_alcotest_test.expected.ocaml5.64} (100%) diff --git a/example/alcotest/output.txt.expected.32 b/example/alcotest/QCheck_alcotest_test.expected.ocaml4.32 similarity index 100% rename from example/alcotest/output.txt.expected.32 rename to example/alcotest/QCheck_alcotest_test.expected.ocaml4.32 diff --git a/example/alcotest/output.txt.expected.64 b/example/alcotest/QCheck_alcotest_test.expected.ocaml4.64 similarity index 100% rename from example/alcotest/output.txt.expected.64 rename to example/alcotest/QCheck_alcotest_test.expected.ocaml4.64 diff --git a/example/alcotest/output.txt.expected.ocaml5.32 b/example/alcotest/QCheck_alcotest_test.expected.ocaml5.32 similarity index 100% rename from example/alcotest/output.txt.expected.ocaml5.32 rename to example/alcotest/QCheck_alcotest_test.expected.ocaml5.32 diff --git a/example/alcotest/output.txt.expected.ocaml5 b/example/alcotest/QCheck_alcotest_test.expected.ocaml5.64 similarity index 100% rename from example/alcotest/output.txt.expected.ocaml5 rename to example/alcotest/QCheck_alcotest_test.expected.ocaml5.64 diff --git a/example/alcotest/dune b/example/alcotest/dune index 93b58d19..55ff553e 100644 --- a/example/alcotest/dune +++ b/example/alcotest/dune @@ -1,42 +1,29 @@ -(* -*- tuareg -*- *) - -let suffix = - try - let major_version = List.hd (String.split_on_char '.' Sys.ocaml_version) in - if int_of_string major_version < 5 then string_of_int Sys.word_size else "ocaml5" - with _ -> failwith ("Unknown OCaml version format: " ^ Sys.ocaml_version) - -let dune = Printf.sprintf {| - -(env - (_ - (env-vars - ; Don't run tests as if Alcotest was run in CI - (CI false)))) - -(executable - (name QCheck_alcotest_test) - (libraries qcheck-core qcheck-alcotest alcotest)) - (rule - (targets output.txt) - (deps ./QCheck_alcotest_test.exe) - (enabled_if (= %%{os_type} "Unix")) - (action - (with-accepted-exit-codes - 1 - (setenv - QCHECK_SEED 1234 - (with-stdout-to - %%{targets} - (run ./run_alcotest.sh --color=never)))))) + (enabled_if (and (= %{arch_sixtyfour} true) (>= %{ocaml_version} 5))) + (action (copy QCheck_alcotest_test.expected.ocaml5.64 QCheck_alcotest_test.expected))) (rule - (alias runtest) - (package qcheck-alcotest) - (enabled_if (= %%{os_type} "Unix")) - (action (diff output.txt.expected.%s output.txt))) + (enabled_if (and (= %{arch_sixtyfour} false) (>= %{ocaml_version} 5))) + (action (copy QCheck_alcotest_test.expected.ocaml5.32 QCheck_alcotest_test.expected))) -|} suffix +(rule + (enabled_if (and (= %{arch_sixtyfour} true) (< %{ocaml_version} 5))) + (action (copy QCheck_alcotest_test.expected.ocaml4.64 QCheck_alcotest_test.expected))) -let () = Jbuild_plugin.V1.send dune +(rule + (enabled_if (and (= %{arch_sixtyfour} false) (< %{ocaml_version} 5))) + (action (copy QCheck_alcotest_test.expected.ocaml4.32 QCheck_alcotest_test.expected))) + +;; implicitly compared against QCheck_runner_test.expected +(test + (enabled_if (= %{os_type} "Unix")) + (name QCheck_alcotest_test) + (modules QCheck_alcotest_test) + (deps ./QCheck_alcotest_test.exe) + (package qcheck-alcotest) + (libraries qcheck-core qcheck-alcotest alcotest) + (action + (with-accepted-exit-codes 1 + (setenv CI false ; Don't run tests as if Alcotest was run in CI + (setenv QCHECK_SEED 1234 + (run ./run_alcotest.sh --color=never)))))) From 5a0867c9176b2d8520eff2e6f1eb7496e8922f85 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 3 May 2023 16:33:13 +0200 Subject: [PATCH 149/391] Rework example/ounit/dune and rename expect files --- ...2 => QCheck_ounit_test.expected.ocaml4.32} | 0 ...4 => QCheck_ounit_test.expected.ocaml4.64} | 0 ...2 => QCheck_ounit_test.expected.ocaml5.32} | 0 ...5 => QCheck_ounit_test.expected.ocaml5.64} | 0 example/ounit/dune | 52 +++++++++---------- 5 files changed, 25 insertions(+), 27 deletions(-) rename example/ounit/{output.txt.expected.32 => QCheck_ounit_test.expected.ocaml4.32} (100%) rename example/ounit/{output.txt.expected.64 => QCheck_ounit_test.expected.ocaml4.64} (100%) rename example/ounit/{output.txt.expected.ocaml5.32 => QCheck_ounit_test.expected.ocaml5.32} (100%) rename example/ounit/{output.txt.expected.ocaml5 => QCheck_ounit_test.expected.ocaml5.64} (100%) diff --git a/example/ounit/output.txt.expected.32 b/example/ounit/QCheck_ounit_test.expected.ocaml4.32 similarity index 100% rename from example/ounit/output.txt.expected.32 rename to example/ounit/QCheck_ounit_test.expected.ocaml4.32 diff --git a/example/ounit/output.txt.expected.64 b/example/ounit/QCheck_ounit_test.expected.ocaml4.64 similarity index 100% rename from example/ounit/output.txt.expected.64 rename to example/ounit/QCheck_ounit_test.expected.ocaml4.64 diff --git a/example/ounit/output.txt.expected.ocaml5.32 b/example/ounit/QCheck_ounit_test.expected.ocaml5.32 similarity index 100% rename from example/ounit/output.txt.expected.ocaml5.32 rename to example/ounit/QCheck_ounit_test.expected.ocaml5.32 diff --git a/example/ounit/output.txt.expected.ocaml5 b/example/ounit/QCheck_ounit_test.expected.ocaml5.64 similarity index 100% rename from example/ounit/output.txt.expected.ocaml5 rename to example/ounit/QCheck_ounit_test.expected.ocaml5.64 diff --git a/example/ounit/dune b/example/ounit/dune index fae1b11a..4e9db825 100644 --- a/example/ounit/dune +++ b/example/ounit/dune @@ -1,34 +1,32 @@ -(* -*- tuareg -*- *) +(executable + (name QCheck_test) + (modules QCheck_test) + (libraries ounit2 qcheck-ounit)) -let suffix = - try - let major_version = List.hd (String.split_on_char '.' Sys.ocaml_version) in - if int_of_string major_version < 5 then string_of_int Sys.word_size else "ocaml5" - with _ -> failwith ("Unknown OCaml version format: " ^ Sys.ocaml_version) - -let dune = Printf.sprintf {| - -(executables - (names QCheck_ounit_test QCheck_test) - (libraries ounit2 qcheck-ounit)) +(rule + (enabled_if (and (= %{arch_sixtyfour} true) (>= %{ocaml_version} 5))) + (action (copy QCheck_ounit_test.expected.ocaml5.64 QCheck_ounit_test.expected))) (rule - (targets output.txt) - (deps ./QCheck_ounit_test.exe) - (enabled_if (= %%{os_type} "Unix")) - (action - (with-accepted-exit-codes - 1 - (with-stdout-to - %%{targets} - (run ./run_ounit.sh -runner=sequential -seed 1234))))) + (enabled_if (and (= %{arch_sixtyfour} false) (>= %{ocaml_version} 5))) + (action (copy QCheck_ounit_test.expected.ocaml5.32 QCheck_ounit_test.expected))) (rule - (alias runtest) - (package qcheck-ounit) - (enabled_if (= %%{os_type} "Unix")) - (action (diff output.txt.expected.%s output.txt))) + (enabled_if (and (= %{arch_sixtyfour} true) (< %{ocaml_version} 5))) + (action (copy QCheck_ounit_test.expected.ocaml4.64 QCheck_ounit_test.expected))) -|} suffix +(rule + (enabled_if (and (= %{arch_sixtyfour} false) (< %{ocaml_version} 5))) + (action (copy QCheck_ounit_test.expected.ocaml4.32 QCheck_ounit_test.expected))) -let () = Jbuild_plugin.V1.send dune +;; implicitly compared against QCheck_runner_test.expected +(test + (enabled_if (= %{os_type} "Unix")) + (name QCheck_ounit_test) + (modules QCheck_ounit_test) + (deps ./QCheck_ounit_test.exe) + (package qcheck-ounit) + (libraries ounit2 qcheck-ounit) + (action + (with-accepted-exit-codes 1 + (run ./run_ounit.sh -runner=sequential -seed 1234)))) From 9b3745fdf8763d5c2830ec280aeb3b2a7eca7dec Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 3 May 2023 18:39:22 +0200 Subject: [PATCH 150/391] Fall back on expanded rules when running test in a wrapper script --- example/alcotest/dune | 21 ++++++++++++++------- example/ounit/dune | 24 +++++++++++++----------- 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/example/alcotest/dune b/example/alcotest/dune index 55ff553e..449789ff 100644 --- a/example/alcotest/dune +++ b/example/alcotest/dune @@ -14,16 +14,23 @@ (enabled_if (and (= %{arch_sixtyfour} false) (< %{ocaml_version} 5))) (action (copy QCheck_alcotest_test.expected.ocaml4.32 QCheck_alcotest_test.expected))) -;; implicitly compared against QCheck_runner_test.expected -(test - (enabled_if (= %{os_type} "Unix")) +(executable (name QCheck_alcotest_test) - (modules QCheck_alcotest_test) + (libraries qcheck-core qcheck-alcotest alcotest)) + +(rule + (targets QCheck_alcotest_test.output) (deps ./QCheck_alcotest_test.exe) - (package qcheck-alcotest) - (libraries qcheck-core qcheck-alcotest alcotest) + (enabled_if (= %{os_type} "Unix")) (action (with-accepted-exit-codes 1 (setenv CI false ; Don't run tests as if Alcotest was run in CI (setenv QCHECK_SEED 1234 - (run ./run_alcotest.sh --color=never)))))) + (with-stdout-to %{targets} + (run ./run_alcotest.sh --color=never))))))) + +(rule + (alias runtest) + (package qcheck-alcotest) + (enabled_if (= %{os_type} "Unix")) + (action (diff QCheck_alcotest_test.expected QCheck_alcotest_test.output))) diff --git a/example/ounit/dune b/example/ounit/dune index 4e9db825..6fdbdef5 100644 --- a/example/ounit/dune +++ b/example/ounit/dune @@ -1,6 +1,5 @@ -(executable - (name QCheck_test) - (modules QCheck_test) +(executables + (names QCheck_ounit_test QCheck_test) (libraries ounit2 qcheck-ounit)) (rule @@ -19,14 +18,17 @@ (enabled_if (and (= %{arch_sixtyfour} false) (< %{ocaml_version} 5))) (action (copy QCheck_ounit_test.expected.ocaml4.32 QCheck_ounit_test.expected))) -;; implicitly compared against QCheck_runner_test.expected -(test - (enabled_if (= %{os_type} "Unix")) - (name QCheck_ounit_test) - (modules QCheck_ounit_test) +(rule + (targets QCheck_ounit_test.output) (deps ./QCheck_ounit_test.exe) - (package qcheck-ounit) - (libraries ounit2 qcheck-ounit) + (enabled_if (= %{os_type} "Unix")) (action (with-accepted-exit-codes 1 - (run ./run_ounit.sh -runner=sequential -seed 1234)))) + (with-stdout-to %{targets} + (run ./run_ounit.sh -runner=sequential -seed 1234))))) + +(rule + (alias runtest) + (package qcheck-ounit) + (enabled_if (= %{os_type} "Unix")) + (action (diff QCheck_ounit_test.expected QCheck_ounit_test.output))) From d547fccfca7d1ebc24974473cf24a0ac297f3483 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 8 May 2023 18:42:52 +0200 Subject: [PATCH 151/391] Normalize ounit output on bytecode-only ppc64 and s390x --- example/ounit/QCheck_ounit_test.expected.ocaml4.32 | 3 --- example/ounit/QCheck_ounit_test.expected.ocaml4.64 | 3 --- example/ounit/QCheck_ounit_test.expected.ocaml5.64 | 3 --- example/ounit/run_ounit.sh | 1 + 4 files changed, 1 insertion(+), 9 deletions(-) diff --git a/example/ounit/QCheck_ounit_test.expected.ocaml4.32 b/example/ounit/QCheck_ounit_test.expected.ocaml4.32 index 0ead3a2a..815be7c5 100644 --- a/example/ounit/QCheck_ounit_test.expected.ocaml4.32 +++ b/example/ounit/QCheck_ounit_test.expected.ocaml4.32 @@ -25,7 +25,6 @@ Error: tests:6:fail_check_err_message. Error: tests:6:fail_check_err_message (in the log). -Error: tests:6:fail_check_err_message (in the code). test `fail_check_err_message` failed on ≥ 1 cases: @@ -43,7 +42,6 @@ Error: tests:4:neg test unexpected success. Error: tests:4:neg test unexpected success (in the log). -Error: tests:4:neg test unexpected success (in the code). negative test 'neg test unexpected success' succeeded unexpectedly @@ -54,7 +52,6 @@ Error: tests:1:fail_sort_id. Error: tests:1:fail_sort_id (in the log). -Error: tests:1:fail_sort_id (in the code). test `fail_sort_id` failed on ≥ 1 cases: [1; 0] (after 11 shrink steps) diff --git a/example/ounit/QCheck_ounit_test.expected.ocaml4.64 b/example/ounit/QCheck_ounit_test.expected.ocaml4.64 index 874cd527..a038e261 100644 --- a/example/ounit/QCheck_ounit_test.expected.ocaml4.64 +++ b/example/ounit/QCheck_ounit_test.expected.ocaml4.64 @@ -25,7 +25,6 @@ Error: tests:6:fail_check_err_message. Error: tests:6:fail_check_err_message (in the log). -Error: tests:6:fail_check_err_message (in the code). test `fail_check_err_message` failed on ≥ 1 cases: @@ -43,7 +42,6 @@ Error: tests:4:neg test unexpected success. Error: tests:4:neg test unexpected success (in the log). -Error: tests:4:neg test unexpected success (in the code). negative test 'neg test unexpected success' succeeded unexpectedly @@ -54,7 +52,6 @@ Error: tests:1:fail_sort_id. Error: tests:1:fail_sort_id (in the log). -Error: tests:1:fail_sort_id (in the code). test `fail_sort_id` failed on ≥ 1 cases: [1; 0] (after 11 shrink steps) diff --git a/example/ounit/QCheck_ounit_test.expected.ocaml5.64 b/example/ounit/QCheck_ounit_test.expected.ocaml5.64 index 2294b902..a95398ea 100644 --- a/example/ounit/QCheck_ounit_test.expected.ocaml5.64 +++ b/example/ounit/QCheck_ounit_test.expected.ocaml5.64 @@ -25,7 +25,6 @@ Error: tests:6:fail_check_err_message. Error: tests:6:fail_check_err_message (in the log). -Error: tests:6:fail_check_err_message (in the code). test `fail_check_err_message` failed on ≥ 1 cases: @@ -43,7 +42,6 @@ Error: tests:4:neg test unexpected success. Error: tests:4:neg test unexpected success (in the log). -Error: tests:4:neg test unexpected success (in the code). negative test 'neg test unexpected success' succeeded unexpectedly @@ -54,7 +52,6 @@ Error: tests:1:fail_sort_id. Error: tests:1:fail_sort_id (in the log). -Error: tests:1:fail_sort_id (in the code). test `fail_sort_id` failed on ≥ 1 cases: [1; 0] (after 16 shrink steps) diff --git a/example/ounit/run_ounit.sh b/example/ounit/run_ounit.sh index 40edc9aa..1e99ff9d 100755 --- a/example/ounit/run_ounit.sh +++ b/example/ounit/run_ounit.sh @@ -10,5 +10,6 @@ echo "$OUT" \ | grep -v 'File .*, line .*' \ | grep -v 'Called from ' \ | grep -v 'Raised at ' \ + | grep -v '(in the code)' \ | sed 's/in: .*seconds/in: <nondet> seconds/' exit $CODE From 0a6954862e4988a79989f52a975a6f17550add26 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 8 May 2023 18:50:31 +0200 Subject: [PATCH 152/391] Prepare for v0.21 --- CHANGELOG.md | 3 +-- ppx_deriving_qcheck.opam | 2 +- qcheck-alcotest.opam | 2 +- qcheck-core.opam | 2 +- qcheck-ounit.opam | 2 +- qcheck.opam | 2 +- 6 files changed, 6 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 67964879..f7ab8e65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changes -## NEXT RELEASE +## 0.21 - make `Test.check_result`, `Test.check_cell_exn`, and `Test.check_exn` honor test polarity by raising @@ -11,7 +11,6 @@ and a related issue when deriving a generator for a record type - fix #241 causing `QCheck.Shrink.int*` to emit duplicates, also affecting `QCheck.Shrink.{char,string}` - fix a cornercase where `Shrink.list_spine` would emit duplicates -- ... ## 0.20 diff --git a/ppx_deriving_qcheck.opam b/ppx_deriving_qcheck.opam index 699597ea..c03d4e7b 100644 --- a/ppx_deriving_qcheck.opam +++ b/ppx_deriving_qcheck.opam @@ -1,6 +1,6 @@ opam-version: "2.0" name: "ppx_deriving_qcheck" -version: "0.3.0" +version: "0.4.0" license: "BSD-2-Clause" synopsis: "PPX Deriver for QCheck" diff --git a/qcheck-alcotest.opam b/qcheck-alcotest.opam index ad1a06b5..5a52bf3c 100644 --- a/qcheck-alcotest.opam +++ b/qcheck-alcotest.opam @@ -5,7 +5,7 @@ homepage: "https://github.com/c-cube/qcheck/" license: "BSD-2-Clause" synopsis: "Alcotest backend for qcheck" doc: ["http://c-cube.github.io/qcheck/"] -version: "0.20" +version: "0.21" tags: [ "test" "quickcheck" diff --git a/qcheck-core.opam b/qcheck-core.opam index 0bb42124..c71779c3 100644 --- a/qcheck-core.opam +++ b/qcheck-core.opam @@ -5,7 +5,7 @@ homepage: "https://github.com/c-cube/qcheck/" license: "BSD-2-Clause" synopsis: "Core qcheck library" doc: ["http://c-cube.github.io/qcheck/"] -version: "0.20" +version: "0.21" tags: [ "test" "property" diff --git a/qcheck-ounit.opam b/qcheck-ounit.opam index 4b9242d2..8efab580 100644 --- a/qcheck-ounit.opam +++ b/qcheck-ounit.opam @@ -5,7 +5,7 @@ license: "BSD-2-Clause" homepage: "https://github.com/c-cube/qcheck/" doc: ["http://c-cube.github.io/qcheck/"] synopsis: "OUnit backend for qcheck" -version: "0.20" +version: "0.21" tags: [ "qcheck" "quickcheck" diff --git a/qcheck.opam b/qcheck.opam index 3c72f47e..6699b954 100644 --- a/qcheck.opam +++ b/qcheck.opam @@ -5,7 +5,7 @@ synopsis: "Compatibility package for qcheck" homepage: "https://github.com/c-cube/qcheck/" license: "BSD-2-Clause" doc: ["http://c-cube.github.io/qcheck/"] -version: "0.20" +version: "0.21" tags: [ "test" "property" From 61243efc20cb460e9a41eef9b73a7776ee86ad7a Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 8 May 2023 19:31:52 +0200 Subject: [PATCH 153/391] Bump dune lower-bound to 2.8.0 for qcheck* opam packages --- qcheck-alcotest.opam | 2 +- qcheck-core.opam | 2 +- qcheck-ounit.opam | 2 +- qcheck.opam | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/qcheck-alcotest.opam b/qcheck-alcotest.opam index 5a52bf3c..804cca9a 100644 --- a/qcheck-alcotest.opam +++ b/qcheck-alcotest.opam @@ -18,7 +18,7 @@ build: [ ["dune" "runtest" "-p" name "-j" jobs] {with-test} ] depends: [ - "dune" { >= "2.2" } + "dune" { >= "2.8.0" } "base-bytes" "base-unix" "qcheck-core" { = version } diff --git a/qcheck-core.opam b/qcheck-core.opam index c71779c3..ac304c09 100644 --- a/qcheck-core.opam +++ b/qcheck-core.opam @@ -17,7 +17,7 @@ build: [ ["dune" "runtest" "-p" name "-j" jobs] {with-test} ] depends: [ - "dune" { >= "2.2" } + "dune" { >= "2.8.0" } "base-bytes" "base-unix" "alcotest" {with-test} diff --git a/qcheck-ounit.opam b/qcheck-ounit.opam index 8efab580..fab9dc4f 100644 --- a/qcheck-ounit.opam +++ b/qcheck-ounit.opam @@ -17,7 +17,7 @@ build: [ ["dune" "runtest" "-p" name "-j" jobs] {with-test} ] depends: [ - "dune" { >= "2.2" } + "dune" { >= "2.8.0" } "base-bytes" "base-unix" "qcheck-core" { = version } diff --git a/qcheck.opam b/qcheck.opam index 6699b954..ebe42db5 100644 --- a/qcheck.opam +++ b/qcheck.opam @@ -17,7 +17,7 @@ build: [ ["dune" "runtest" "-p" name "-j" jobs] {with-test} ] depends: [ - "dune" { >= "2.2" } + "dune" { >= "2.8.0" } "base-bytes" "base-unix" "qcheck-core" { = version } From a138b2b9a865081c711a3fe4173aeba047bc6d24 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 16 May 2023 13:53:43 +0200 Subject: [PATCH 154/391] Prepare CHANGELOG for coming changes --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f7ab8e65..035f8a04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes +## NEXT RELEASE + +- ... + ## 0.21 - make `Test.check_result`, `Test.check_cell_exn`, and From 360039eb501963e3255cbc788053b4d818c59551 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 17 May 2023 14:43:12 +0200 Subject: [PATCH 155/391] revert-shrinker-fix --- src/core/QCheck.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index f64de762..2809e6ed 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -760,7 +760,7 @@ module Shrink = struct match l with | [] -> () | [_] -> yield [] - | [x;y] -> yield []; yield [x]; if x <> y then yield [y] + | [x;y] -> yield []; yield [x]; yield [y] | _::_ -> let len = List.length l in let xs,ys = split l ((1 + len) / 2) [] in From 4fc1283c6e5c448177a65e6e0f86aa56b02fa7e6 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 17 May 2023 18:14:18 +0200 Subject: [PATCH 156/391] Update expected outputs --- test/core/QCheck_expect_test.expected.ocaml4.32 | 1 + test/core/QCheck_expect_test.expected.ocaml4.64 | 1 + test/core/QCheck_expect_test.expected.ocaml5.32 | 1 + test/core/QCheck_expect_test.expected.ocaml5.64 | 1 + test/core/QCheck_unit_tests.ml | 6 +++--- 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/test/core/QCheck_expect_test.expected.ocaml4.32 b/test/core/QCheck_expect_test.expected.ocaml4.32 index 865566a8..e5de618b 100644 --- a/test/core/QCheck_expect_test.expected.ocaml4.32 +++ b/test/core/QCheck_expect_test.expected.ocaml4.32 @@ -74,6 +74,7 @@ random seed: 1234 [1; 1] [] [1] +[1] [0; 1] [1; 0] diff --git a/test/core/QCheck_expect_test.expected.ocaml4.64 b/test/core/QCheck_expect_test.expected.ocaml4.64 index 4b32e050..7accc9a8 100644 --- a/test/core/QCheck_expect_test.expected.ocaml4.64 +++ b/test/core/QCheck_expect_test.expected.ocaml4.64 @@ -106,6 +106,7 @@ random seed: 1234 [1; 1] [] [1] +[1] [0; 1] [1; 0] diff --git a/test/core/QCheck_expect_test.expected.ocaml5.32 b/test/core/QCheck_expect_test.expected.ocaml5.32 index c8218b2e..f5ec356f 100644 --- a/test/core/QCheck_expect_test.expected.ocaml5.32 +++ b/test/core/QCheck_expect_test.expected.ocaml5.32 @@ -84,6 +84,7 @@ random seed: 1234 [2; 2] [] [2] +[2] [1; 2] [2; 1] diff --git a/test/core/QCheck_expect_test.expected.ocaml5.64 b/test/core/QCheck_expect_test.expected.ocaml5.64 index ed35317c..1572ed29 100644 --- a/test/core/QCheck_expect_test.expected.ocaml5.64 +++ b/test/core/QCheck_expect_test.expected.ocaml5.64 @@ -116,6 +116,7 @@ random seed: 1234 [2; 2] [] [2] +[2] [1; 2] [2; 1] diff --git a/test/core/QCheck_unit_tests.ml b/test/core/QCheck_unit_tests.ml index f8e3f432..349896b7 100644 --- a/test/core/QCheck_unit_tests.ml +++ b/test/core/QCheck_unit_tests.ml @@ -85,8 +85,8 @@ module Shrink = struct List.iter (alco_check Alcotest.string (trace_false Shrink.string) "on repeated failure") [ ("string \"\"", "", []); ("string \"a\"", "a", [""]); - ("string \"aa\"", "aa", [""; "a"]); - ("string \"aaaa\"", "aaaa", ["aa"; "aa"; "aaa"]); + ("string \"aa\"", "aa", [""; "a"; "a"]); + ("string \"aaaa\"", "aaaa", ["aa"; "aa"; "aaa"; "aaa"]); ("string \"abcd\"", "abcd", ["ab"; "cd"; "acd"; "bcd"; "aacd"; "abbd"; "abcc"]); ("string \"E'*\"", "E'*", ["E'"; "*"; "E*"; "'*"; "S'*"; "L'*"; "H'*"; "F'*"; "ED*"; "E5*"; "E.*"; "E**"; "E(*"; "E'E"; "E'7"; "E'0"; "E'-"; "E'+"]); @@ -101,7 +101,7 @@ module Shrink = struct "vi5x92mgG"; "vi5x92sgG"; "vi5x92vgG"; "vi5x92wgG"; "vi5x92xdG"; "vi5x92xfG"; "vi5x92xgT"; "vi5x92xgM"; "vi5x92xgJ"; "vi5x92xgH"]); - ("string \"~~~~\"", "~~~~", ["~~"; "~~"; "~~~"; "p~~~"; "w~~~"; "{~~~"; "}~~~"; "~p~~"; + ("string \"~~~~\"", "~~~~", ["~~"; "~~"; "~~~"; "~~~"; "p~~~"; "w~~~"; "{~~~"; "}~~~"; "~p~~"; "~w~~"; "~{~~"; "~}~~"; "~~p~"; "~~w~"; "~~{~"; "~~}~"; "~~~p"; "~~~w"; "~~~{"; "~~~}"]); ]; List.iter (alco_check Alcotest.string (trace_true Shrink.string) "on repeated success") From aaf575e0e67811b5af51c644d207b978fee4b51f Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 17 May 2023 18:14:39 +0200 Subject: [PATCH 157/391] Add regression test case --- test/core/QCheck_unit_tests.ml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/core/QCheck_unit_tests.ml b/test/core/QCheck_unit_tests.ml index 349896b7..5360376f 100644 --- a/test/core/QCheck_unit_tests.ml +++ b/test/core/QCheck_unit_tests.ml @@ -113,6 +113,10 @@ module Shrink = struct ("string \"E'*\"", "E'*", ["E'"; ""]); ("string \"vi5x92xgG\"", "vi5x92xgG", ["vi5x9"; "vi5"; "vi"; ""]); ] + let test_list_spine_compare () = + let run_test () = QCheck.Shrink.list_spine [pred;succ] ignore in + Alcotest.(check unit) "doesn't compare elements" () @@ run_test () + let tests = ("Shrink", Alcotest.[ test_case "int" `Quick test_int; test_case "int32" `Quick test_int32; @@ -121,6 +125,7 @@ module Shrink = struct test_case "char_numeral" `Quick test_char_numeral; test_case "char_printable" `Quick test_char_printable; test_case "string" `Quick test_string; + test_case "list_spine" `Quick test_list_spine_compare; ]) end From 0133ea2d480a6d94c0659eca6b3752b09cb4e082 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 17 May 2023 18:46:40 +0200 Subject: [PATCH 158/391] Add CHANGELOG entry --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 035f8a04..570f5a94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,8 @@ ## NEXT RELEASE -- ... +- Roll back the `Shrink.list_spine` fix, as it was utilizing polymorphic + equality that can raise an exception on function comparison. ## 0.21 From a306ee8b29ad6e2fc90b5c566b75e02669a9c0b3 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 19 May 2023 17:48:21 +0200 Subject: [PATCH 159/391] Prepare for v0.21.1 --- CHANGELOG.md | 2 +- qcheck-alcotest.opam | 2 +- qcheck-core.opam | 2 +- qcheck-ounit.opam | 2 +- qcheck.opam | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 570f5a94..2649579f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changes -## NEXT RELEASE +## 0.21.1 - Roll back the `Shrink.list_spine` fix, as it was utilizing polymorphic equality that can raise an exception on function comparison. diff --git a/qcheck-alcotest.opam b/qcheck-alcotest.opam index 804cca9a..b388e269 100644 --- a/qcheck-alcotest.opam +++ b/qcheck-alcotest.opam @@ -5,7 +5,7 @@ homepage: "https://github.com/c-cube/qcheck/" license: "BSD-2-Clause" synopsis: "Alcotest backend for qcheck" doc: ["http://c-cube.github.io/qcheck/"] -version: "0.21" +version: "0.21.1" tags: [ "test" "quickcheck" diff --git a/qcheck-core.opam b/qcheck-core.opam index ac304c09..1b103caf 100644 --- a/qcheck-core.opam +++ b/qcheck-core.opam @@ -5,7 +5,7 @@ homepage: "https://github.com/c-cube/qcheck/" license: "BSD-2-Clause" synopsis: "Core qcheck library" doc: ["http://c-cube.github.io/qcheck/"] -version: "0.21" +version: "0.21.1" tags: [ "test" "property" diff --git a/qcheck-ounit.opam b/qcheck-ounit.opam index fab9dc4f..b8131bf0 100644 --- a/qcheck-ounit.opam +++ b/qcheck-ounit.opam @@ -5,7 +5,7 @@ license: "BSD-2-Clause" homepage: "https://github.com/c-cube/qcheck/" doc: ["http://c-cube.github.io/qcheck/"] synopsis: "OUnit backend for qcheck" -version: "0.21" +version: "0.21.1" tags: [ "qcheck" "quickcheck" diff --git a/qcheck.opam b/qcheck.opam index ebe42db5..0367563e 100644 --- a/qcheck.opam +++ b/qcheck.opam @@ -5,7 +5,7 @@ synopsis: "Compatibility package for qcheck" homepage: "https://github.com/c-cube/qcheck/" license: "BSD-2-Clause" doc: ["http://c-cube.github.io/qcheck/"] -version: "0.21" +version: "0.21.1" tags: [ "test" "property" From 9424d94c8fa682ef90ad8bf2d487c852d8c4f38d Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 23 May 2023 12:12:36 +0200 Subject: [PATCH 160/391] Prepare CHANGELOG for coming changes --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2649579f..4deb62a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes +## NEXT RELEASE + +- ... + ## 0.21.1 - Roll back the `Shrink.list_spine` fix, as it was utilizing polymorphic From 34542f836014eea3296f8e80f271dd74ec803691 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 17 Aug 2023 17:17:12 +0200 Subject: [PATCH 161/391] Only require qcheck-core in ppx_deriving_qcheck --- ppx_deriving_qcheck.opam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ppx_deriving_qcheck.opam b/ppx_deriving_qcheck.opam index c03d4e7b..bdf54fc2 100644 --- a/ppx_deriving_qcheck.opam +++ b/ppx_deriving_qcheck.opam @@ -10,7 +10,7 @@ author: [ "the qcheck contributors" ] depends: [ "dune" {>= "2.8.0"} "ocaml" {>= "4.08.0"} - "qcheck" {>= "0.19"} + "qcheck-core" {>= "0.19"} "ppxlib" {>= "0.22.0"} "ppx_deriving" {>= "5.2.1"} "odoc" {with-doc} From 695c892be7089453b99d257074d1694ba9a93c8a Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 17 Aug 2023 17:23:42 +0200 Subject: [PATCH 162/391] Reduce library requirement in test from qcheck to qcheck-core --- test/ppx_deriving_qcheck/deriver/qcheck2/dune | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/ppx_deriving_qcheck/deriver/qcheck2/dune b/test/ppx_deriving_qcheck/deriver/qcheck2/dune index ce1de538..091a1bfd 100644 --- a/test/ppx_deriving_qcheck/deriver/qcheck2/dune +++ b/test/ppx_deriving_qcheck/deriver/qcheck2/dune @@ -8,5 +8,5 @@ test_tuple test_variants test_record) - (libraries qcheck-alcotest ppxlib ppx_deriving_qcheck qcheck) + (libraries qcheck-alcotest ppxlib ppx_deriving_qcheck qcheck-core) (preprocess (pps ppxlib.metaquot ppx_deriving_qcheck))) From f6947c34cbbc23edff1632568becb1f713ecefb5 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 17 Aug 2023 17:25:27 +0200 Subject: [PATCH 163/391] Add CHANGELOG entry --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4deb62a0..6319a2c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## NEXT RELEASE -- ... +- fix #273 by lowering `ppx_deriving_qcheck`'s `qcheck` dependency to `qcheck-core` ## 0.21.1 From c6e72099a50fe24c1f954f2eb27e45720ef0bc7d Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 17 Aug 2023 17:34:22 +0200 Subject: [PATCH 164/391] Reintroduce list shrinker optimization using an address comparison instead --- src/core/QCheck.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index 2809e6ed..20f5fcdc 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -760,7 +760,7 @@ module Shrink = struct match l with | [] -> () | [_] -> yield [] - | [x;y] -> yield []; yield [x]; yield [y] + | [x;y] -> yield []; yield [x]; if x != y then yield [y] | _::_ -> let len = List.length l in let xs,ys = split l ((1 + len) / 2) [] in From 18e63a1d2b43180e7f6cbb97c634c2b8b5fce637 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 17 Aug 2023 17:42:34 +0200 Subject: [PATCH 165/391] Update expect test outputs --- test/core/QCheck_expect_test.expected.ocaml4.32 | 1 - test/core/QCheck_expect_test.expected.ocaml4.64 | 1 - test/core/QCheck_expect_test.expected.ocaml5.32 | 1 - test/core/QCheck_expect_test.expected.ocaml5.64 | 1 - 4 files changed, 4 deletions(-) diff --git a/test/core/QCheck_expect_test.expected.ocaml4.32 b/test/core/QCheck_expect_test.expected.ocaml4.32 index e5de618b..865566a8 100644 --- a/test/core/QCheck_expect_test.expected.ocaml4.32 +++ b/test/core/QCheck_expect_test.expected.ocaml4.32 @@ -74,7 +74,6 @@ random seed: 1234 [1; 1] [] [1] -[1] [0; 1] [1; 0] diff --git a/test/core/QCheck_expect_test.expected.ocaml4.64 b/test/core/QCheck_expect_test.expected.ocaml4.64 index 7accc9a8..4b32e050 100644 --- a/test/core/QCheck_expect_test.expected.ocaml4.64 +++ b/test/core/QCheck_expect_test.expected.ocaml4.64 @@ -106,7 +106,6 @@ random seed: 1234 [1; 1] [] [1] -[1] [0; 1] [1; 0] diff --git a/test/core/QCheck_expect_test.expected.ocaml5.32 b/test/core/QCheck_expect_test.expected.ocaml5.32 index f5ec356f..c8218b2e 100644 --- a/test/core/QCheck_expect_test.expected.ocaml5.32 +++ b/test/core/QCheck_expect_test.expected.ocaml5.32 @@ -84,7 +84,6 @@ random seed: 1234 [2; 2] [] [2] -[2] [1; 2] [2; 1] diff --git a/test/core/QCheck_expect_test.expected.ocaml5.64 b/test/core/QCheck_expect_test.expected.ocaml5.64 index 1572ed29..ed35317c 100644 --- a/test/core/QCheck_expect_test.expected.ocaml5.64 +++ b/test/core/QCheck_expect_test.expected.ocaml5.64 @@ -116,7 +116,6 @@ random seed: 1234 [2; 2] [] [2] -[2] [1; 2] [2; 1] From 36e15374ceb2bfe2dc4c5073df9408f4feaf9825 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 17 Aug 2023 17:42:51 +0200 Subject: [PATCH 166/391] Update unit test output --- test/core/QCheck_unit_tests.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/core/QCheck_unit_tests.ml b/test/core/QCheck_unit_tests.ml index 5360376f..19d31421 100644 --- a/test/core/QCheck_unit_tests.ml +++ b/test/core/QCheck_unit_tests.ml @@ -85,8 +85,8 @@ module Shrink = struct List.iter (alco_check Alcotest.string (trace_false Shrink.string) "on repeated failure") [ ("string \"\"", "", []); ("string \"a\"", "a", [""]); - ("string \"aa\"", "aa", [""; "a"; "a"]); - ("string \"aaaa\"", "aaaa", ["aa"; "aa"; "aaa"; "aaa"]); + ("string \"aa\"", "aa", [""; "a"]); + ("string \"aaaa\"", "aaaa", ["aa"; "aa"; "aaa"]); ("string \"abcd\"", "abcd", ["ab"; "cd"; "acd"; "bcd"; "aacd"; "abbd"; "abcc"]); ("string \"E'*\"", "E'*", ["E'"; "*"; "E*"; "'*"; "S'*"; "L'*"; "H'*"; "F'*"; "ED*"; "E5*"; "E.*"; "E**"; "E(*"; "E'E"; "E'7"; "E'0"; "E'-"; "E'+"]); @@ -101,7 +101,7 @@ module Shrink = struct "vi5x92mgG"; "vi5x92sgG"; "vi5x92vgG"; "vi5x92wgG"; "vi5x92xdG"; "vi5x92xfG"; "vi5x92xgT"; "vi5x92xgM"; "vi5x92xgJ"; "vi5x92xgH"]); - ("string \"~~~~\"", "~~~~", ["~~"; "~~"; "~~~"; "~~~"; "p~~~"; "w~~~"; "{~~~"; "}~~~"; "~p~~"; + ("string \"~~~~\"", "~~~~", ["~~"; "~~"; "~~~"; "p~~~"; "w~~~"; "{~~~"; "}~~~"; "~p~~"; "~w~~"; "~{~~"; "~}~~"; "~~p~"; "~~w~"; "~~{~"; "~~}~"; "~~~p"; "~~~w"; "~~~{"; "~~~}"]); ]; List.iter (alco_check Alcotest.string (trace_true Shrink.string) "on repeated success") From 1b3e1a0119cee716a0edcdb459d7c3fbbc62b360 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 17 Aug 2023 17:47:06 +0200 Subject: [PATCH 167/391] Add a CHANGELOG entry --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6319a2c8..1fa5698b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,8 @@ ## NEXT RELEASE -- fix #273 by lowering `ppx_deriving_qcheck`'s `qcheck` dependency to `qcheck-core` +- Reintroduce the `Shrink.list_spine` fix using an address comparison instead. +- Fix #273 by lowering `ppx_deriving_qcheck`'s `qcheck` dependency to `qcheck-core` ## 0.21.1 From 0fc57342d68ecaec33cb77dd3591f5320a86470c Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 22 Aug 2023 14:20:34 +0200 Subject: [PATCH 168/391] Add unit tests of Shrink.list_spine --- test/core/QCheck_unit_tests.ml | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/test/core/QCheck_unit_tests.ml b/test/core/QCheck_unit_tests.ml index 19d31421..8b433a33 100644 --- a/test/core/QCheck_unit_tests.ml +++ b/test/core/QCheck_unit_tests.ml @@ -113,6 +113,42 @@ module Shrink = struct ("string \"E'*\"", "E'*", ["E'"; ""]); ("string \"vi5x92xgG\"", "vi5x92xgG", ["vi5x9"; "vi5"; "vi"; ""]); ] + let test_int_list () = + List.iter (alco_check Alcotest.(list int) (trace_false (Shrink.list_spine)) "on repeated failure") + [ ("list int [0]", [0], [[]]); + ("list int [0;1]", [0;1], [[]; [0]; [1]]); + ("list int [0;1;2]", [0;1;2], [[0; 1]; [2]; [0; 2]; [1; 2]]); + ("list int [0;1;2;3]", [0;1;2;3], [[0; 1]; [2; 3]; [0; 2; 3]; [1; 2; 3]]); + ("list int [0;0]", [0;0], [[]; [0]]); + ("list int [0;0;0]", [0;0;0], [[0; 0]; [0]; [0; 0]]); + ("list int [0;0;0;0]", [0;0;0;0], [[0; 0]; [0; 0]; [0; 0; 0]]); ]; + List.iter (alco_check Alcotest.(list int) (trace_true (Shrink.list_spine)) "on repeated success") + [ ("list int [0]", [0], [[]]); + ("list int [0;1]", [0;1], [[]]); + ("list int [0;1;2]", [0;1;2], [[0; 1]; []]); + ("list int [0;1;2;3]", [0;1;2;3], [[0; 1]; []]); + ("list int [0;0]", [0;0], [[]]); + ("list int [0;0;0]", [0;0;0], [[0; 0]; []]); + ("list int [0;0;0;0]", [0;0;0;0], [[0; 0]; []]); ] + + let test_int32_list () = (* use int32 as a boxed type and List.map to force run-time allocations *) + List.iter (alco_check Alcotest.(list int32) (trace_false (Shrink.list_spine)) "on repeated failure") + [ ("list int32 [0l]", List.map Int32.of_int [0], [[]]); + ("list int32 [0l;1l]", List.map Int32.of_int [0;1], [[]; [0l]; [1l]]); + ("list int32 [0l;1l;2l]", List.map Int32.of_int [0;1;2], [[0l; 1l]; [2l]; [0l; 2l]; [1l; 2l]]); + ("list int32 [0l;1l;2l;3l]", List.map Int32.of_int [0;1;2;3], [[0l; 1l]; [2l; 3l]; [0l; 2l; 3l]; [1l; 2l; 3l]]); + ("list int32 [0l;0l]", List.map Int32.of_int [0;0], [[]; [0l]; [0l]]); + ("list int32 [0l;0l;0l]", List.map Int32.of_int [0;0;0], [[0l; 0l]; [0l]; [0l; 0l]; [0l; 0l]]); + ("list int32 [0l;0l;0l;0l]", List.map Int32.of_int [0;0;0;0], [[0l; 0l]; [0l; 0l]; [0l; 0l; 0l]; [0l; 0l; 0l]]); ]; + List.iter (alco_check Alcotest.(list int32) (trace_true (Shrink.list_spine)) "on repeated success") + [ ("list int [0l]", List.map Int32.of_int [0], [[]]); + ("list int [0l;1l]", List.map Int32.of_int [0;1], [[]]); + ("list int [0l;1l;2l]", List.map Int32.of_int [0;1;2], [[0l; 1l]; []]); + ("list int [0l;1l;2l;3l]", List.map Int32.of_int [0;1;2;3], [[0l; 1l]; []]); + ("list int [0l;0l]", List.map Int32.of_int [0;0], [[]]); + ("list int [0l;0l;0l]", List.map Int32.of_int [0;0;0], [[0l; 0l]; []]); + ("list int [0l;0l;0l;0l]", List.map Int32.of_int [0;0;0;0], [[0l; 0l]; []]); ] + let test_list_spine_compare () = let run_test () = QCheck.Shrink.list_spine [pred;succ] ignore in Alcotest.(check unit) "doesn't compare elements" () @@ run_test () @@ -125,6 +161,8 @@ module Shrink = struct test_case "char_numeral" `Quick test_char_numeral; test_case "char_printable" `Quick test_char_printable; test_case "string" `Quick test_string; + test_case "int list" `Quick test_int_list; + test_case "int32 list" `Quick test_int32_list; test_case "list_spine" `Quick test_list_spine_compare; ]) end From 6f3762e59ac8a12c28fd60a1125acc130375e512 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 22 Aug 2023 14:22:33 +0200 Subject: [PATCH 169/391] Use @shym's suggestion --- src/core/QCheck.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index 20f5fcdc..b67a4ca1 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -760,7 +760,7 @@ module Shrink = struct match l with | [] -> () | [_] -> yield [] - | [x;y] -> yield []; yield [x]; if x != y then yield [y] + | [x;y] -> yield []; yield [x]; if (try x <> y with Invalid_argument _ -> x != y) then yield [y] | _::_ -> let len = List.length l in let xs,ys = split l ((1 + len) / 2) [] in From 917ebae2f2e869777f14cdc21b6814d28f7465a9 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 22 Aug 2023 14:24:11 +0200 Subject: [PATCH 170/391] Update unit test outputs --- test/core/QCheck_unit_tests.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/core/QCheck_unit_tests.ml b/test/core/QCheck_unit_tests.ml index 8b433a33..01375af3 100644 --- a/test/core/QCheck_unit_tests.ml +++ b/test/core/QCheck_unit_tests.ml @@ -137,9 +137,9 @@ module Shrink = struct ("list int32 [0l;1l]", List.map Int32.of_int [0;1], [[]; [0l]; [1l]]); ("list int32 [0l;1l;2l]", List.map Int32.of_int [0;1;2], [[0l; 1l]; [2l]; [0l; 2l]; [1l; 2l]]); ("list int32 [0l;1l;2l;3l]", List.map Int32.of_int [0;1;2;3], [[0l; 1l]; [2l; 3l]; [0l; 2l; 3l]; [1l; 2l; 3l]]); - ("list int32 [0l;0l]", List.map Int32.of_int [0;0], [[]; [0l]; [0l]]); - ("list int32 [0l;0l;0l]", List.map Int32.of_int [0;0;0], [[0l; 0l]; [0l]; [0l; 0l]; [0l; 0l]]); - ("list int32 [0l;0l;0l;0l]", List.map Int32.of_int [0;0;0;0], [[0l; 0l]; [0l; 0l]; [0l; 0l; 0l]; [0l; 0l; 0l]]); ]; + ("list int32 [0l;0l]", List.map Int32.of_int [0;0], [[]; [0l]]); + ("list int32 [0l;0l;0l]", List.map Int32.of_int [0;0;0], [[0l; 0l]; [0l]; [0l; 0l]]); + ("list int32 [0l;0l;0l;0l]", List.map Int32.of_int [0;0;0;0], [[0l; 0l]; [0l; 0l]; [0l; 0l; 0l]]); ]; List.iter (alco_check Alcotest.(list int32) (trace_true (Shrink.list_spine)) "on repeated success") [ ("list int [0l]", List.map Int32.of_int [0], [[]]); ("list int [0l;1l]", List.map Int32.of_int [0;1], [[]]); From ca2c049982d6b649ce5d931f2886d5967b5145c4 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 22 Aug 2023 14:30:32 +0200 Subject: [PATCH 171/391] Update CHANGELOG entry --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fa5698b..0d6a2904 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,8 @@ ## NEXT RELEASE -- Reintroduce the `Shrink.list_spine` fix using an address comparison instead. +- Reintroduce the `Shrink.list_spine` fix by catching `Invalid_argument` and + falling back on an address comparison. - Fix #273 by lowering `ppx_deriving_qcheck`'s `qcheck` dependency to `qcheck-core` ## 0.21.1 From 7fc7d0afe076fa869babc9eda9d49f65693a4a2e Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 25 Aug 2023 09:33:18 +0200 Subject: [PATCH 172/391] Prepare for v0.21.2 --- CHANGELOG.md | 2 +- qcheck-alcotest.opam | 2 +- qcheck-core.opam | 2 +- qcheck-ounit.opam | 2 +- qcheck.opam | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d6a2904..807e368d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changes -## NEXT RELEASE +## 0.21.2 - Reintroduce the `Shrink.list_spine` fix by catching `Invalid_argument` and falling back on an address comparison. diff --git a/qcheck-alcotest.opam b/qcheck-alcotest.opam index b388e269..b9630a61 100644 --- a/qcheck-alcotest.opam +++ b/qcheck-alcotest.opam @@ -5,7 +5,7 @@ homepage: "https://github.com/c-cube/qcheck/" license: "BSD-2-Clause" synopsis: "Alcotest backend for qcheck" doc: ["http://c-cube.github.io/qcheck/"] -version: "0.21.1" +version: "0.21.2" tags: [ "test" "quickcheck" diff --git a/qcheck-core.opam b/qcheck-core.opam index 1b103caf..d0d6fb0c 100644 --- a/qcheck-core.opam +++ b/qcheck-core.opam @@ -5,7 +5,7 @@ homepage: "https://github.com/c-cube/qcheck/" license: "BSD-2-Clause" synopsis: "Core qcheck library" doc: ["http://c-cube.github.io/qcheck/"] -version: "0.21.1" +version: "0.21.2" tags: [ "test" "property" diff --git a/qcheck-ounit.opam b/qcheck-ounit.opam index b8131bf0..cc93c55c 100644 --- a/qcheck-ounit.opam +++ b/qcheck-ounit.opam @@ -5,7 +5,7 @@ license: "BSD-2-Clause" homepage: "https://github.com/c-cube/qcheck/" doc: ["http://c-cube.github.io/qcheck/"] synopsis: "OUnit backend for qcheck" -version: "0.21.1" +version: "0.21.2" tags: [ "qcheck" "quickcheck" diff --git a/qcheck.opam b/qcheck.opam index 0367563e..0dab57dc 100644 --- a/qcheck.opam +++ b/qcheck.opam @@ -5,7 +5,7 @@ synopsis: "Compatibility package for qcheck" homepage: "https://github.com/c-cube/qcheck/" license: "BSD-2-Clause" doc: ["http://c-cube.github.io/qcheck/"] -version: "0.21.1" +version: "0.21.2" tags: [ "test" "property" From 20bc3bc827da813945fee787d2fe2d391d54ef6a Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 25 Aug 2023 10:26:23 +0200 Subject: [PATCH 173/391] Include ppx_deriving_qcheck.0.4.1 in release --- ppx_deriving_qcheck.opam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ppx_deriving_qcheck.opam b/ppx_deriving_qcheck.opam index bdf54fc2..0c6434e4 100644 --- a/ppx_deriving_qcheck.opam +++ b/ppx_deriving_qcheck.opam @@ -1,6 +1,6 @@ opam-version: "2.0" name: "ppx_deriving_qcheck" -version: "0.4.0" +version: "0.4.1" license: "BSD-2-Clause" synopsis: "PPX Deriver for QCheck" From 321628b10b5f84cee45d4c15e2939927562b1b98 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 25 Aug 2023 10:56:42 +0200 Subject: [PATCH 174/391] Also update test/ppx_deriving_qcheck/deriver/qcheck/dune with reduced requirement --- test/ppx_deriving_qcheck/deriver/qcheck/dune | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/ppx_deriving_qcheck/deriver/qcheck/dune b/test/ppx_deriving_qcheck/deriver/qcheck/dune index ce1de538..091a1bfd 100644 --- a/test/ppx_deriving_qcheck/deriver/qcheck/dune +++ b/test/ppx_deriving_qcheck/deriver/qcheck/dune @@ -8,5 +8,5 @@ test_tuple test_variants test_record) - (libraries qcheck-alcotest ppxlib ppx_deriving_qcheck qcheck) + (libraries qcheck-alcotest ppxlib ppx_deriving_qcheck qcheck-core) (preprocess (pps ppxlib.metaquot ppx_deriving_qcheck))) From c199aa5f31c420ae72611c97e857d76508c2dee2 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 29 Aug 2023 10:37:32 +0200 Subject: [PATCH 175/391] Prepare CHANGELOG for next release --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 807e368d..f7ac5803 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes +## NEXT RELEASE + +- ... + ## 0.21.2 - Reintroduce the `Shrink.list_spine` fix by catching `Invalid_argument` and From 08c3e470fb3da3a48c7c2b60157143c447ee809b Mon Sep 17 00:00:00 2001 From: Jerry James <loganjerry@gmail.com> Date: Fri, 1 Sep 2023 11:17:08 -0600 Subject: [PATCH 176/391] Fix asciidoc error --- README.adoc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.adoc b/README.adoc index 970b96b3..35bddef4 100644 --- a/README.adoc +++ b/README.adoc @@ -406,10 +406,11 @@ describe("qcheck-rely", ({test}) => { A ppx_deriver is provided to derive QCheck generators from a type declaration. -```ocaml +[source,OCaml] +---- type tree = Leaf of int | Node of tree * tree [@@deriving qcheck] -``` +---- See the according https://github.com/c-cube/qcheck/tree/master/src/ppx_deriving_qcheck/[README] for more information and examples. From 31d98b888a7fa0e2c0b56a902c664e89a8327471 Mon Sep 17 00:00:00 2001 From: Samuel Hym <samuel.hym@rustyne.lautre.net> Date: Thu, 28 Sep 2023 10:38:59 +0200 Subject: [PATCH 177/391] Remove the dependency on `bytes` `bytes` is provided by all the required OCaml versions, so drop it from the dependencies This makes it easy to compile QCheck (at least core) without a fully-working Opam environment --- CHANGELOG.md | 3 ++- qcheck-alcotest.opam | 1 - qcheck-core.opam | 1 - qcheck-ounit.opam | 1 - qcheck.opam | 1 - src/alcotest/dune | 2 +- src/core/dune | 2 +- src/ounit/dune | 2 +- 8 files changed, 5 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f7ac5803..512b2a0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,8 @@ ## NEXT RELEASE -- ... +- Drop the dependency on `base-bytes` as it is provided in all supported + versions of the OCaml compiler ## 0.21.2 diff --git a/qcheck-alcotest.opam b/qcheck-alcotest.opam index b9630a61..b7ff6efa 100644 --- a/qcheck-alcotest.opam +++ b/qcheck-alcotest.opam @@ -19,7 +19,6 @@ build: [ ] depends: [ "dune" { >= "2.8.0" } - "base-bytes" "base-unix" "qcheck-core" { = version } "alcotest" {>= "0.8.1"} diff --git a/qcheck-core.opam b/qcheck-core.opam index d0d6fb0c..c0df01a4 100644 --- a/qcheck-core.opam +++ b/qcheck-core.opam @@ -18,7 +18,6 @@ build: [ ] depends: [ "dune" { >= "2.8.0" } - "base-bytes" "base-unix" "alcotest" {with-test} "odoc" {with-doc} diff --git a/qcheck-ounit.opam b/qcheck-ounit.opam index cc93c55c..ee8fe1d4 100644 --- a/qcheck-ounit.opam +++ b/qcheck-ounit.opam @@ -18,7 +18,6 @@ build: [ ] depends: [ "dune" { >= "2.8.0" } - "base-bytes" "base-unix" "qcheck-core" { = version } "ounit2" diff --git a/qcheck.opam b/qcheck.opam index 0dab57dc..2aadb8d6 100644 --- a/qcheck.opam +++ b/qcheck.opam @@ -18,7 +18,6 @@ build: [ ] depends: [ "dune" { >= "2.8.0" } - "base-bytes" "base-unix" "qcheck-core" { = version } "qcheck-ounit" { = version } diff --git a/src/alcotest/dune b/src/alcotest/dune index 220a8b37..df1ffe08 100644 --- a/src/alcotest/dune +++ b/src/alcotest/dune @@ -3,6 +3,6 @@ (name qcheck_alcotest) (public_name qcheck-alcotest) (wrapped false) - (libraries unix bytes qcheck-core qcheck-core.runner alcotest) + (libraries unix qcheck-core qcheck-core.runner alcotest) (flags :standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string) ) diff --git a/src/core/dune b/src/core/dune index ad0939f5..42dc8ac9 100644 --- a/src/core/dune +++ b/src/core/dune @@ -3,6 +3,6 @@ (name qcheck_core) (public_name qcheck-core) (wrapped false) - (libraries unix bytes) + (libraries unix) (flags :standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string) ) diff --git a/src/ounit/dune b/src/ounit/dune index 2fadb7a4..41f8d4bb 100644 --- a/src/ounit/dune +++ b/src/ounit/dune @@ -3,6 +3,6 @@ (name qcheck_ounit) (public_name qcheck-ounit) (wrapped false) - (libraries unix bytes qcheck-core qcheck-core.runner ounit2) + (libraries unix qcheck-core qcheck-core.runner ounit2) (flags :standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string) ) From e43c6756af3516a19bd626e43f21b3c6514e7b1c Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 30 Nov 2023 15:00:24 +0100 Subject: [PATCH 178/391] Prepare for v0.21.3 --- CHANGELOG.md | 2 +- qcheck-alcotest.opam | 2 +- qcheck-core.opam | 2 +- qcheck-ounit.opam | 2 +- qcheck.opam | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 512b2a0f..4525cd6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changes -## NEXT RELEASE +## 0.21.3 - Drop the dependency on `base-bytes` as it is provided in all supported versions of the OCaml compiler diff --git a/qcheck-alcotest.opam b/qcheck-alcotest.opam index b7ff6efa..7c452845 100644 --- a/qcheck-alcotest.opam +++ b/qcheck-alcotest.opam @@ -5,7 +5,7 @@ homepage: "https://github.com/c-cube/qcheck/" license: "BSD-2-Clause" synopsis: "Alcotest backend for qcheck" doc: ["http://c-cube.github.io/qcheck/"] -version: "0.21.2" +version: "0.21.3" tags: [ "test" "quickcheck" diff --git a/qcheck-core.opam b/qcheck-core.opam index c0df01a4..aa04bc19 100644 --- a/qcheck-core.opam +++ b/qcheck-core.opam @@ -5,7 +5,7 @@ homepage: "https://github.com/c-cube/qcheck/" license: "BSD-2-Clause" synopsis: "Core qcheck library" doc: ["http://c-cube.github.io/qcheck/"] -version: "0.21.2" +version: "0.21.3" tags: [ "test" "property" diff --git a/qcheck-ounit.opam b/qcheck-ounit.opam index ee8fe1d4..5dc884e6 100644 --- a/qcheck-ounit.opam +++ b/qcheck-ounit.opam @@ -5,7 +5,7 @@ license: "BSD-2-Clause" homepage: "https://github.com/c-cube/qcheck/" doc: ["http://c-cube.github.io/qcheck/"] synopsis: "OUnit backend for qcheck" -version: "0.21.2" +version: "0.21.3" tags: [ "qcheck" "quickcheck" diff --git a/qcheck.opam b/qcheck.opam index 2aadb8d6..c71940c4 100644 --- a/qcheck.opam +++ b/qcheck.opam @@ -5,7 +5,7 @@ synopsis: "Compatibility package for qcheck" homepage: "https://github.com/c-cube/qcheck/" license: "BSD-2-Clause" doc: ["http://c-cube.github.io/qcheck/"] -version: "0.21.2" +version: "0.21.3" tags: [ "test" "property" From a6a80e842469a822e1b5a3fd47603a23ec6aa999 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 7 Dec 2023 09:56:30 +0100 Subject: [PATCH 179/391] Prepare CHANGELOG for next release --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4525cd6b..cbb35752 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes +## NEXT RELEASE + +- ... + ## 0.21.3 - Drop the dependency on `base-bytes` as it is provided in all supported From 15a247771e97d0ed4d0474c5c25a15f6814eab4d Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 7 Dec 2023 19:14:23 +0100 Subject: [PATCH 180/391] Update checkout action to v4 to silence CI warnings --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dea1dee2..a8a29293 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,7 +25,7 @@ jobs: ocaml-compiler: ocaml-base-compiler.5.0.0 runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: ocaml/setup-ocaml@v2 with: ocaml-compiler: ${{ matrix.ocaml-compiler }} From 7b4f48d49b4d38713d6ba3e22979c3bad6a746a4 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 28 Jun 2024 12:57:43 +0200 Subject: [PATCH 181/391] Run macOS runners Intel hardware as 4.08.1 does not have M1/ARM64 support --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a8a29293..a14de033 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: os: - - macos-latest + - macos-13 - ubuntu-latest - windows-latest ocaml-compiler: From b29c19ca657c41208bf76706773c7cbc59ef38f8 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 28 Jun 2024 11:55:41 +0200 Subject: [PATCH 182/391] Remove {,get_}instances as it is causing a memory leak #287 --- src/core/QCheck2.ml | 8 +------- src/core/QCheck2.mli | 4 ---- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index a0cc4e7b..1bf96d2b 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -1354,9 +1354,6 @@ module TestResult = struct collect_tbl: (string, int) Hashtbl.t lazy_t; stats_tbl: ('a stat * (int, int) Hashtbl.t) list; mutable warnings: string list; - mutable instances: 'a list; - (** List of instances used for this test, in no particular order. - @since 0.9 *) } let get_state {state; _} = state @@ -1391,8 +1388,6 @@ module TestResult = struct let warnings = get_warnings - let get_instances r = r.instances - let is_success r = match r.state with | Success -> true | Failed _ | Error _ | Failed_other _ -> false @@ -1763,7 +1758,6 @@ module Test = struct and check_state_input state input_tree = let Tree.Tree (input, _) = input_tree in state.handler state.test.name state.test (Collecting input); - state.res.R.instances <- input :: state.res.R.instances; collect state input; update_stats state input; let res = @@ -1835,7 +1829,7 @@ module Test = struct res = {R. state=R.Success; count=0; count_gen=0; collect_tbl=lazy (Hashtbl.create 10); - instances=[]; warnings=[]; + warnings=[]; stats_tbl= List.map (fun stat -> stat, Hashtbl.create 10) cell.stats; }; } in diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index 75f68ce8..ceed40e5 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -1610,10 +1610,6 @@ module TestResult : sig (** [get_warnings t] returns the list of warnings emitted during the test. @since 0.18 *) - val get_instances : 'a t -> 'a list - (** [get_instances t] returns the generated instances, with no guarantee on the order. - @since 0.18 *) - val is_success : _ t -> bool (** Returns true iff the state is [Success] @since 0.9 *) From 55b3f859878b94c08a4a96ff84c1c662ede728cf Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 28 Jun 2024 12:03:49 +0200 Subject: [PATCH 183/391] Add a CHANGELOG entry --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cbb35752..eb767a0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,8 @@ ## NEXT RELEASE -- ... +- Remove `QCheck2.TestResult.get_instances` as retaining previous test inputs + cause memory leaks ## 0.21.3 From e6a01b5d427876dc4e94a69e113620eb16a6962b Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 1 Jul 2024 17:25:33 +0200 Subject: [PATCH 184/391] Add alcotest lower bound for test-dependency --- qcheck-core.opam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qcheck-core.opam b/qcheck-core.opam index aa04bc19..8f8babda 100644 --- a/qcheck-core.opam +++ b/qcheck-core.opam @@ -19,7 +19,7 @@ build: [ depends: [ "dune" { >= "2.8.0" } "base-unix" - "alcotest" {with-test} + "alcotest" {with-test & >= "1.2.0"} "odoc" {with-doc} "ocaml" {>= "4.08.0"} ] From 9508ca94b19353f07f018797acbf88e03ce16983 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 1 Jul 2024 18:19:11 +0200 Subject: [PATCH 185/391] Make QCheck2.state.res immutable --- src/core/QCheck2.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index 1bf96d2b..c9a5dd50 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -1562,7 +1562,7 @@ module Test = struct step: 'a step; handler : 'a handler; rand: RS.t; - mutable res: 'a TestResult.t; + res: 'a TestResult.t; mutable cur_count: int; (** number of iterations remaining to do *) mutable cur_max_gen: int; (** maximum number of generations allowed *) mutable cur_max_fail: int; (** maximum number of counter-examples allowed *) From d6102ecccdd906122355beed56242760dc457da5 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 4 Jul 2024 15:45:51 +0200 Subject: [PATCH 186/391] Add a CHANGELOG entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb767a0d..0890f65d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Remove `QCheck2.TestResult.get_instances` as retaining previous test inputs cause memory leaks +- Make `QCheck2.state.res` immutable, silencing a compilation warning ## 0.21.3 From 7725523177bffff848bfdb4767c358923c03747d Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 4 Jul 2024 15:57:20 +0200 Subject: [PATCH 187/391] Update to setup-ocaml v3 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a14de033..85218357 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,7 +26,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - uses: ocaml/setup-ocaml@v2 + - uses: ocaml/setup-ocaml@v3 with: ocaml-compiler: ${{ matrix.ocaml-compiler }} - run: opam pin -n . From d119249e0efcb36f58726f72a9595520405115cd Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 4 Jul 2024 16:03:19 +0200 Subject: [PATCH 188/391] Test on 5.0.0 and 5.2.0, without excluding 5.0-windows combination --- .github/workflows/main.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 85218357..62c0b821 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,10 +19,8 @@ jobs: - 4.08.x - 4.12.x - 4.14.x - - ocaml-base-compiler.5.0.0 - exclude: - - os: windows-latest - ocaml-compiler: ocaml-base-compiler.5.0.0 + - 5.0.0 + - 5.2.0 runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 From 0f4a2a3fcc393e8ae4b4b44a5d69f6c85d9da95e Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 4 Jul 2024 16:18:42 +0200 Subject: [PATCH 189/391] mimic https://github.com/avsm/hello-world-action-ocaml more closely --- .github/workflows/main.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 62c0b821..483a2e96 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,17 +10,18 @@ jobs: run: name: Build strategy: + fail-fast: false matrix: os: - macos-13 - ubuntu-latest - windows-latest ocaml-compiler: - - 4.08.x - - 4.12.x - - 4.14.x - - 5.0.0 - - 5.2.0 + - "4.08" + - "4.12" + - "4.14" + - "5.0" + - "5.2" runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 From e13741d5a801fc722188575adb7f51743bffc9b1 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 4 Jul 2024 16:39:03 +0200 Subject: [PATCH 190/391] Exclude Windows 4.08 and 4.12 combinations --- .github/workflows/main.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 483a2e96..f7c49a1f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,6 +22,11 @@ jobs: - "4.14" - "5.0" - "5.2" + exclude: + - os: windows-latest + ocaml-compiler: "4.08" + - os: windows-latest + ocaml-compiler: "4.12" runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 From 03573d7afa0bee260916d9c6adaf04324b5472e3 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 4 Jul 2024 16:42:39 +0200 Subject: [PATCH 191/391] Remove opam depext dependency --- .github/workflows/main.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f7c49a1f..a455c1ba 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,9 +33,7 @@ jobs: - uses: ocaml/setup-ocaml@v3 with: ocaml-compiler: ${{ matrix.ocaml-compiler }} - - run: opam pin -n . - - run: opam depext -yt qcheck qcheck-core qcheck-ounit qcheck-alcotest - - run: opam install -t . --deps-only + - run: opam install . --deps-only --with-test - run: opam exec -- dune build - run: opam exec -- dune runtest if: ${{ matrix.os != 'windows-latest'}} From f97eba5762eecd70b7b62a37460c5e6513f30d7f Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 4 Jul 2024 17:41:01 +0200 Subject: [PATCH 192/391] prepare for 0.22 release --- CHANGELOG.md | 2 +- qcheck-alcotest.opam | 2 +- qcheck-core.opam | 2 +- qcheck-ounit.opam | 2 +- qcheck.opam | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0890f65d..1b2b544e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changes -## NEXT RELEASE +## 0.22 - Remove `QCheck2.TestResult.get_instances` as retaining previous test inputs cause memory leaks diff --git a/qcheck-alcotest.opam b/qcheck-alcotest.opam index 7c452845..6ecfa476 100644 --- a/qcheck-alcotest.opam +++ b/qcheck-alcotest.opam @@ -5,7 +5,7 @@ homepage: "https://github.com/c-cube/qcheck/" license: "BSD-2-Clause" synopsis: "Alcotest backend for qcheck" doc: ["http://c-cube.github.io/qcheck/"] -version: "0.21.3" +version: "0.22" tags: [ "test" "quickcheck" diff --git a/qcheck-core.opam b/qcheck-core.opam index 8f8babda..1894b0ee 100644 --- a/qcheck-core.opam +++ b/qcheck-core.opam @@ -5,7 +5,7 @@ homepage: "https://github.com/c-cube/qcheck/" license: "BSD-2-Clause" synopsis: "Core qcheck library" doc: ["http://c-cube.github.io/qcheck/"] -version: "0.21.3" +version: "0.22" tags: [ "test" "property" diff --git a/qcheck-ounit.opam b/qcheck-ounit.opam index 5dc884e6..df909c93 100644 --- a/qcheck-ounit.opam +++ b/qcheck-ounit.opam @@ -5,7 +5,7 @@ license: "BSD-2-Clause" homepage: "https://github.com/c-cube/qcheck/" doc: ["http://c-cube.github.io/qcheck/"] synopsis: "OUnit backend for qcheck" -version: "0.21.3" +version: "0.22" tags: [ "qcheck" "quickcheck" diff --git a/qcheck.opam b/qcheck.opam index c71940c4..189a609d 100644 --- a/qcheck.opam +++ b/qcheck.opam @@ -5,7 +5,7 @@ synopsis: "Compatibility package for qcheck" homepage: "https://github.com/c-cube/qcheck/" license: "BSD-2-Clause" doc: ["http://c-cube.github.io/qcheck/"] -version: "0.21.3" +version: "0.22" tags: [ "test" "property" From d3211ddda1cea84c562abd9425d2b0a5dde0f55b Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 5 Jul 2024 16:59:23 +0200 Subject: [PATCH 193/391] Uniformly require at least alcotest.1.2.0 --- qcheck-alcotest.opam | 2 +- qcheck.opam | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qcheck-alcotest.opam b/qcheck-alcotest.opam index 6ecfa476..a40f5479 100644 --- a/qcheck-alcotest.opam +++ b/qcheck-alcotest.opam @@ -21,7 +21,7 @@ depends: [ "dune" { >= "2.8.0" } "base-unix" "qcheck-core" { = version } - "alcotest" {>= "0.8.1"} + "alcotest" {>= "1.2.0"} "odoc" {with-doc} "ocaml" {>= "4.08.0"} ] diff --git a/qcheck.opam b/qcheck.opam index 189a609d..cd3ab30e 100644 --- a/qcheck.opam +++ b/qcheck.opam @@ -21,7 +21,7 @@ depends: [ "base-unix" "qcheck-core" { = version } "qcheck-ounit" { = version } - "alcotest" {with-test} + "alcotest" {with-test & >= "1.2.0"} "odoc" {with-doc} "ocaml" {>= "4.08.0"} ] From 31541c6b280f0815c4d17ca1083125a0722d959a Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 8 Jul 2024 15:28:52 +0200 Subject: [PATCH 194/391] Prepare CHANGELOG for next release --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b2b544e..e68b80be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes +## NEXT RELEASE + +- ... + ## 0.22 - Remove `QCheck2.TestResult.get_instances` as retaining previous test inputs From efb36f488594dc482f743b302e2c6ea5e6d588b1 Mon Sep 17 00:00:00 2001 From: Kakadu <Kakadu@pm.me> Date: Thu, 21 Nov 2024 22:44:08 +0300 Subject: [PATCH 195/391] PPX: Fix codegen for mutually recursive records Previously it gave an error: n is unbound It looks like if we have mutually recursive types (algebraic + record) It doesn't generate 'n' argument for record, because it thinks that a record is not recursive by itself. It was fixed by treating all mutually recurusive types as recursive ones. Signed-off-by: Kakadu <Kakadu@pm.me> --- src/ppx_deriving_qcheck/ppx_deriving_qcheck.ml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/ppx_deriving_qcheck/ppx_deriving_qcheck.ml b/src/ppx_deriving_qcheck/ppx_deriving_qcheck.ml index e501e540..ac9392e3 100644 --- a/src/ppx_deriving_qcheck/ppx_deriving_qcheck.ml +++ b/src/ppx_deriving_qcheck/ppx_deriving_qcheck.ml @@ -252,7 +252,7 @@ let gen_sized ~loc ~env (is_rec : 'a -> bool) (to_gen : 'a -> expression) (xs : G.frequency ~loc (A.elist nodes) else let nodes = List.map to_gen nodes in - let leaves = A.elist leaves |> G.frequency ~loc + let leaves = A.elist leaves |> G.frequency ~loc and nodes = A.elist (leaves @ nodes) |> G.frequency ~loc in [%expr match n with @@ -541,12 +541,7 @@ let derive_gens ~version ~loc (xs : rec_flag * type_declaration list) : structur | `Normal gen -> [gen]) | _, xs -> let typ_names = List.map (fun x -> x.ptype_name.txt) xs in - let env = Env.{ curr_type = ""; rec_types = []; curr_types = typ_names; version } in - let env = - List.fold_left - (fun env x -> add_if_rec env x x.ptype_name.txt) - env xs - in + let env = Env.{ curr_type = ""; rec_types = typ_names; curr_types = typ_names; version } in let gens = List.map (fun x -> let env = { env with curr_type = x.ptype_name.txt }in From 0af542e59fe4fc3d8ce397fce3851d135eee5cb3 Mon Sep 17 00:00:00 2001 From: Kakadu <Kakadu@pm.me> Date: Thu, 21 Nov 2024 22:44:14 +0300 Subject: [PATCH 196/391] Add a test for mutual recursion with records Signed-off-by: Kakadu <Kakadu@pm.me> --- .../deriver/qcheck/test_textual.ml | 32 +++++------ test/ppx_deriving_qcheck/deriver/qcheck2/dune | 1 + .../deriver/qcheck2/test_mutual.ml | 54 +++++++++++++++++++ 3 files changed, 71 insertions(+), 16 deletions(-) create mode 100644 test/ppx_deriving_qcheck/deriver/qcheck2/test_mutual.ml diff --git a/test/ppx_deriving_qcheck/deriver/qcheck/test_textual.ml b/test/ppx_deriving_qcheck/deriver/qcheck/test_textual.ml index 4ba46d1f..063968ad 100644 --- a/test/ppx_deriving_qcheck/deriver/qcheck/test_textual.ml +++ b/test/ppx_deriving_qcheck/deriver/qcheck/test_textual.ml @@ -118,7 +118,7 @@ let test_int64' () = * ] * in * let actual = f @@ extract [%stri type t = Bytes.t ] in - * + * * check_eq ~expected ~actual "deriving int64" *) let test_tuple () = @@ -820,28 +820,28 @@ let test_unused_variable () = | _ -> QCheck.Gen.frequency [(1, (QCheck.Gen.pure A)); - (1, (QCheck.Gen.map (fun gen0 -> B gen0) gen_myint))] - and gen_myint = QCheck.Gen.nat - ]; - [%stri - let gen_c = QCheck.Gen.sized gen_c_sized + (1, (QCheck.Gen.map (fun gen0 -> B gen0) (gen_myint_sized (n / 2))))] + and gen_myint_sized _n = QCheck.Gen.nat ]; + [%stri let gen_c = QCheck.Gen.sized gen_c_sized]; + [%stri let gen_myint = QCheck.Gen.sized gen_myint_sized]; [%stri let arb_c_sized n = QCheck.make @@ (gen_c_sized n)]; - [%stri let arb_myint = QCheck.make @@ gen_myint]; + [%stri let arb_myint_sized _n = QCheck.make @@ (gen_myint_sized _n)]; [%stri let arb_c = QCheck.make @@ gen_c]; + [%stri let arb_myint = QCheck.make @@ gen_myint]; [%stri - let rec gen_c_sized _n = + let rec gen_c_sized n = QCheck.Gen.frequency - [(1, (QCheck.Gen.map (fun gen0 -> A gen0) gen_myint)); - (1, (QCheck.Gen.map (fun gen0 -> B gen0) gen_myint))] - and gen_myint = QCheck.Gen.nat + [(1, (QCheck.Gen.map (fun gen0 -> A gen0) (gen_myint_sized (n / 2)))); + (1, (QCheck.Gen.map (fun gen0 -> B gen0) (gen_myint_sized (n / 2))))] + and gen_myint_sized _n = QCheck.Gen.nat ]; - [%stri - let gen_c = QCheck.Gen.sized gen_c_sized - ]; - [%stri let arb_c_sized _n = QCheck.make @@ (gen_c_sized _n)]; - [%stri let arb_myint = QCheck.make @@ gen_myint]; + [%stri let gen_c = QCheck.Gen.sized gen_c_sized]; + [%stri let gen_myint = QCheck.Gen.sized gen_myint_sized]; + [%stri let arb_c_sized n = QCheck.make @@ (gen_c_sized n)]; + [%stri let arb_myint_sized _n = QCheck.make @@ (gen_myint_sized _n)]; [%stri let arb_c = QCheck.make @@ gen_c]; + [%stri let arb_myint = QCheck.make @@ gen_myint]; ] in let actual = diff --git a/test/ppx_deriving_qcheck/deriver/qcheck2/dune b/test/ppx_deriving_qcheck/deriver/qcheck2/dune index 091a1bfd..bfd4b6e0 100644 --- a/test/ppx_deriving_qcheck/deriver/qcheck2/dune +++ b/test/ppx_deriving_qcheck/deriver/qcheck2/dune @@ -7,6 +7,7 @@ test_recursive test_tuple test_variants + test_mutual test_record) (libraries qcheck-alcotest ppxlib ppx_deriving_qcheck qcheck-core) (preprocess (pps ppxlib.metaquot ppx_deriving_qcheck))) diff --git a/test/ppx_deriving_qcheck/deriver/qcheck2/test_mutual.ml b/test/ppx_deriving_qcheck/deriver/qcheck2/test_mutual.ml new file mode 100644 index 00000000..8bf35478 --- /dev/null +++ b/test/ppx_deriving_qcheck/deriver/qcheck2/test_mutual.ml @@ -0,0 +1,54 @@ +open QCheck2 +open Helpers + +type tree = Leaf | Node of tree * tree +and name = { a: tree } +[@@deriving qcheck2] + +let rec pp_tree fmt x = + let open Format in + match x with + | Leaf -> + fprintf fmt "Leaf" + | Node (l, r) -> + fprintf fmt "Node (%a, %a)" + (pp_tree ) l + (pp_tree ) r + +let eq_tree = Alcotest.of_pp (pp_tree ) + +let gen_tree_ref = + let open Gen in + sized @@ fix (fun self -> + function + | 0 -> pure Leaf + | n -> + oneof [ + pure Leaf; + map2 (fun l r -> Node (l,r)) (self (n/2)) (self (n/2)); + ]) + +let test_tree_ref () = + + test_compare ~msg:"gen tree <=> derivation tree" + ~eq:(eq_tree ) + (gen_tree_ref) (gen_tree ) + +let test_leaf = + Test.make + ~name:"gen_tree_sized 0 = Node (_, Leaf, Leaf)" + (gen_tree_sized 0) + (function + | Leaf -> true + | Node (Leaf, Leaf) -> true + | _ -> false) + |> + QCheck_alcotest.to_alcotest + + +let () = Alcotest.run "Test_Recursive" + [("Recursive", + Alcotest.[ + test_case "test_tree_ref" `Quick test_tree_ref; + + ])] From e7ef1d5d1e018e707907139b22723f34fd0a5e84 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Sat, 7 Dec 2024 00:18:54 +0100 Subject: [PATCH 197/391] Remove unread fun_gen field from QCheck2's fun_repr_tbl type --- src/core/QCheck2.ml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index c9a5dd50..ea315bf7 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -1169,7 +1169,6 @@ end (** Internal representation of functions, used for shrinking and printing (in case of error). *) type ('a, 'b) fun_repr_tbl = { fun_tbl: ('a, 'b) Poly_tbl.t; (** Input-output bindings *) - fun_gen: 'b Gen.t; (** How to generate output values *) fun_print: 'b Print.t option; (** How to print output values *) fun_default: 'b; (** Default value for all inputs not explicitly mapped in {!fun_tbl} *) } @@ -1203,8 +1202,8 @@ module Fn = struct let make_ (r : 'a fun_repr) : 'a fun_ = Fun (r, function_of_repr r) - let mk_repr tbl gen ?print def = - Fun_tbl { fun_tbl=tbl; fun_gen=gen; fun_print=print; fun_default=def; } + let mk_repr tbl ?print def = + Fun_tbl { fun_tbl=tbl; fun_print=print; fun_default=def; } let map_repr f repr = Fun_map (f, repr) @@ -1233,7 +1232,7 @@ module Fn = struct (** [gen_rep obs gen] creates a function generator. Input values are observed with [obs] and output values are generated with [gen]. *) let gen_rep (obs : 'a Observable.t) ?(print : 'b Print.t option) (gen : 'b Gen.t) : ('a -> 'b) fun_repr Gen.t = - Gen.liftA2 (fun default_value poly_tbl -> mk_repr poly_tbl gen ?print default_value) gen (Poly_tbl.create ?v_print:print obs gen 8) + Gen.liftA2 (fun default_value poly_tbl -> mk_repr poly_tbl ?print default_value) gen (Poly_tbl.create ?v_print:print obs gen 8) let gen (obs : 'a Observable.t) ?(print : 'b Print.t option) (gen : 'b Gen.t) : ('a -> 'b) fun_ Gen.t = Gen.map make_ (gen_rep obs gen ?print) From e9eec0930e0ce35a23a94ae906dc9c9426baedfa Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Sat, 7 Dec 2024 00:20:31 +0100 Subject: [PATCH 198/391] Add a CHANGELOG entry --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e68b80be..afd95b15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,8 @@ ## NEXT RELEASE -- ... +- Remove unread `fun_gen` field from `QCheck2`'s `fun_repr_tbl` type + thereby silencing a compiler warning ## 0.22 From e9fded1b27996a4ad6c65e18df4ab8a09ee16ae1 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 6 Dec 2024 23:17:18 +0100 Subject: [PATCH 199/391] Add Shrink.bool --- src/core/QCheck.ml | 9 ++++++--- src/core/QCheck.mli | 6 +++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index b67a4ca1..07840844 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -672,6 +672,9 @@ module Shrink = struct let unit = nil + let bool b = + if b then Iter.return false else Iter.empty + (* balanced shrinker for integers (non-exhaustive) *) let int x yield = let y = ref x in @@ -1085,9 +1088,9 @@ let choose l = match l with arb.gen st) let unit : unit arbitrary = - make ~small:small1 ~shrink:Shrink.nil ~print:(fun _ -> "()") Gen.unit - -let bool = make_scalar ~print:string_of_bool Gen.bool + make ~small:small1 ~shrink:Shrink.nil ~print:Print.unit Gen.unit +let bool = + make ~small:small1 ~shrink:Shrink.bool ~print:Print.bool Gen.bool let float = make_scalar ~print:string_of_float Gen.float let pos_float = make_scalar ~print:string_of_float Gen.pfloat let neg_float = make_scalar ~print:string_of_float Gen.nfloat diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 92d31a3f..ea3fcd28 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -723,7 +723,11 @@ module Shrink : sig val nil : 'a t (** No shrink *) - val unit : unit t (** @since 0.6 *) + val unit : unit t + (** @since 0.6 *) + + val bool : bool t + (** @since NEXT_RELEASE *) val char : char t (** Shrinks towards ['a']. From 746563a2451e214b2d5f57fc3352edb524ce4774 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 6 Dec 2024 23:17:59 +0100 Subject: [PATCH 200/391] Add unit test for Shrink.bool --- test/core/QCheck_unit_tests.ml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/core/QCheck_unit_tests.ml b/test/core/QCheck_unit_tests.ml index 01375af3..f07af0d1 100644 --- a/test/core/QCheck_unit_tests.ml +++ b/test/core/QCheck_unit_tests.ml @@ -17,6 +17,14 @@ module Shrink = struct let alco_check typ func msg_suffix (msg,input,expected) = Alcotest.(check (list typ)) (msg ^ " - " ^ msg_suffix) expected (func input) + let test_bool () = + List.iter (alco_check Alcotest.bool (trace_false Shrink.bool) "on repeated failure") + [ ("bool true", true, [false]); + ("bool false", false, []) ]; + List.iter (alco_check Alcotest.bool (trace_true Shrink.bool) "on repeated success") + [ ("bool true", true, [false]); + ("bool false", false, []) ] + let test_int () = List.iter (alco_check Alcotest.int (trace_false Shrink.int) "on repeated failure") [ ("int 100", 100, [50; 75; 88; 94; 97; 99]); @@ -154,6 +162,7 @@ module Shrink = struct Alcotest.(check unit) "doesn't compare elements" () @@ run_test () let tests = ("Shrink", Alcotest.[ + test_case "bool" `Quick test_bool; test_case "int" `Quick test_int; test_case "int32" `Quick test_int32; test_case "int64" `Quick test_int64; From 832f94ed027e2a57cc9842599ccc57780d33030e Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 6 Dec 2024 23:20:39 +0100 Subject: [PATCH 201/391] Update 64-bit outputs for example/QCheck_runner_test.ml --- example/QCheck_runner_test.expected.ocaml4.64 | 4 ++-- example/QCheck_runner_test.expected.ocaml5.64 | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/example/QCheck_runner_test.expected.ocaml4.64 b/example/QCheck_runner_test.expected.ocaml4.64 index f54f8f4f..6a0526f2 100644 --- a/example/QCheck_runner_test.expected.ocaml4.64 +++ b/example/QCheck_runner_test.expected.ocaml4.64 @@ -80,9 +80,9 @@ Test FAIL_pred_map_commute failed (77 shrink steps): --- Failure -------------------------------------------------------------------- -Test FAIL_fun2_pred_strings failed (1 shrink steps): +Test FAIL_fun2_pred_strings failed (2 shrink steps): -{some other string -> false; _ -> true} +{some random string -> true; _ -> false} --- Failure -------------------------------------------------------------------- diff --git a/example/QCheck_runner_test.expected.ocaml5.64 b/example/QCheck_runner_test.expected.ocaml5.64 index 6e700e68..18e321d3 100644 --- a/example/QCheck_runner_test.expected.ocaml5.64 +++ b/example/QCheck_runner_test.expected.ocaml5.64 @@ -74,15 +74,15 @@ exception Dune__exe__QCheck_runner_test.Error --- Failure -------------------------------------------------------------------- -Test FAIL_pred_map_commute failed (79 shrink steps): +Test FAIL_pred_map_commute failed (89 shrink steps): -([11], {_ -> 0}, {11 -> false; _ -> true}) +([1], {_ -> 0}, {0 -> true; _ -> false}) --- Failure -------------------------------------------------------------------- -Test FAIL_fun2_pred_strings failed (1 shrink steps): +Test FAIL_fun2_pred_strings failed (2 shrink steps): -{some other string -> false; _ -> true} +{some random string -> true; _ -> false} --- Failure -------------------------------------------------------------------- From 450dab90fd14d101b604cefc5570efd773fa2ec7 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 6 Dec 2024 23:22:04 +0100 Subject: [PATCH 202/391] Update 64-bit outputs for test/core/QCheck_expect_test.ml --- test/core/QCheck_expect_test.expected.ocaml4.64 | 4 ++-- test/core/QCheck_expect_test.expected.ocaml5.64 | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/core/QCheck_expect_test.expected.ocaml4.64 b/test/core/QCheck_expect_test.expected.ocaml4.64 index 4b32e050..001496d7 100644 --- a/test/core/QCheck_expect_test.expected.ocaml4.64 +++ b/test/core/QCheck_expect_test.expected.ocaml4.64 @@ -541,9 +541,9 @@ Test fail_pred_map_commute failed (77 shrink steps): --- Failure -------------------------------------------------------------------- -Test fail_pred_strings failed (1 shrink steps): +Test fail_pred_strings failed (2 shrink steps): -{some other string -> false; _ -> true} +{some random string -> true; _ -> false} --- Failure -------------------------------------------------------------------- diff --git a/test/core/QCheck_expect_test.expected.ocaml5.64 b/test/core/QCheck_expect_test.expected.ocaml5.64 index ed35317c..8105c9ee 100644 --- a/test/core/QCheck_expect_test.expected.ocaml5.64 +++ b/test/core/QCheck_expect_test.expected.ocaml5.64 @@ -545,15 +545,15 @@ Test sum list = 0 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute failed (79 shrink steps): +Test fail_pred_map_commute failed (89 shrink steps): -([11], {_ -> 0}, {11 -> false; _ -> true}) +([1], {_ -> 0}, {0 -> true; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_strings failed (1 shrink steps): +Test fail_pred_strings failed (2 shrink steps): -{some other string -> false; _ -> true} +{some random string -> true; _ -> false} --- Failure -------------------------------------------------------------------- From 49180a5165c79ce5e1015560508bc7a02fc5b470 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 6 Dec 2024 23:44:45 +0100 Subject: [PATCH 203/391] Update 32-bit outputs for example/QCheck_runner_test.ml --- example/QCheck_runner_test.expected.ocaml4.32 | 8 ++++---- example/QCheck_runner_test.expected.ocaml5.32 | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/example/QCheck_runner_test.expected.ocaml4.32 b/example/QCheck_runner_test.expected.ocaml4.32 index 5eb9e10c..6f2af91b 100644 --- a/example/QCheck_runner_test.expected.ocaml4.32 +++ b/example/QCheck_runner_test.expected.ocaml4.32 @@ -74,15 +74,15 @@ exception Dune__exe__QCheck_runner_test.Error --- Failure -------------------------------------------------------------------- -Test FAIL_pred_map_commute failed (47 shrink steps): +Test FAIL_pred_map_commute failed (48 shrink steps): -([1], {_ -> 0}, {0 -> false; _ -> true}) +([1], {_ -> 0}, {1 -> true; _ -> false}) --- Failure -------------------------------------------------------------------- -Test FAIL_fun2_pred_strings failed (1 shrink steps): +Test FAIL_fun2_pred_strings failed (2 shrink steps): -{some other string -> false; _ -> true} +{some random string -> true; _ -> false} --- Failure -------------------------------------------------------------------- diff --git a/example/QCheck_runner_test.expected.ocaml5.32 b/example/QCheck_runner_test.expected.ocaml5.32 index 4a96b674..96d62981 100644 --- a/example/QCheck_runner_test.expected.ocaml5.32 +++ b/example/QCheck_runner_test.expected.ocaml5.32 @@ -80,9 +80,9 @@ Test FAIL_pred_map_commute failed (47 shrink steps): --- Failure -------------------------------------------------------------------- -Test FAIL_fun2_pred_strings failed (1 shrink steps): +Test FAIL_fun2_pred_strings failed (2 shrink steps): -{some other string -> false; _ -> true} +{some random string -> true; _ -> false} --- Failure -------------------------------------------------------------------- From 82086b77ca646cce5778fd989fc5b9a662ccaaa8 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 6 Dec 2024 23:45:49 +0100 Subject: [PATCH 204/391] Update 32-bit outputs for test/core/QCheck_expect_test.ml --- test/core/QCheck_expect_test.expected.ocaml4.32 | 8 ++++---- test/core/QCheck_expect_test.expected.ocaml5.32 | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/core/QCheck_expect_test.expected.ocaml4.32 b/test/core/QCheck_expect_test.expected.ocaml4.32 index 865566a8..bdbd94cb 100644 --- a/test/core/QCheck_expect_test.expected.ocaml4.32 +++ b/test/core/QCheck_expect_test.expected.ocaml4.32 @@ -503,15 +503,15 @@ Test sum list = 0 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute failed (47 shrink steps): +Test fail_pred_map_commute failed (48 shrink steps): -([1], {_ -> 0}, {0 -> false; _ -> true}) +([1], {_ -> 0}, {1 -> true; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_strings failed (1 shrink steps): +Test fail_pred_strings failed (2 shrink steps): -{some other string -> false; _ -> true} +{some random string -> true; _ -> false} --- Failure -------------------------------------------------------------------- diff --git a/test/core/QCheck_expect_test.expected.ocaml5.32 b/test/core/QCheck_expect_test.expected.ocaml5.32 index c8218b2e..0c273efd 100644 --- a/test/core/QCheck_expect_test.expected.ocaml5.32 +++ b/test/core/QCheck_expect_test.expected.ocaml5.32 @@ -519,9 +519,9 @@ Test fail_pred_map_commute failed (47 shrink steps): --- Failure -------------------------------------------------------------------- -Test fail_pred_strings failed (1 shrink steps): +Test fail_pred_strings failed (2 shrink steps): -{some other string -> false; _ -> true} +{some random string -> true; _ -> false} --- Failure -------------------------------------------------------------------- From d1c7c8125c1b578062fafa006959e2e3d9843c8e Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Sat, 7 Dec 2024 00:01:35 +0100 Subject: [PATCH 205/391] Add CHANGELOG entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index afd95b15..39f955ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## NEXT RELEASE +- Add `Shrink.bool` and use it in `QCheck.bool` - Remove unread `fun_gen` field from `QCheck2`'s `fun_repr_tbl` type thereby silencing a compiler warning From d80102ddc344c8b4e2b1520e4427973854bc0aaa Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 6 Dec 2024 16:50:16 +0100 Subject: [PATCH 206/391] Add an exponential Gen and arbitrary combinator --- src/core/QCheck.ml | 8 ++++++++ src/core/QCheck.mli | 12 ++++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index 07840844..bf5b6277 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -181,6 +181,12 @@ module Gen = struct let (--.) = float_range + let exponential mean = + if Float.is_nan mean then invalid_arg "Gen.exponential"; + let unit_gen = float_bound_inclusive 1.0 in + map (fun p -> -. mean *. (log p)) unit_gen + (* See https://en.wikipedia.org/wiki/Relationships_among_probability_distributions *) + let neg_int st = -(nat st) let option ?(ratio = 0.85) f st = @@ -1103,6 +1109,8 @@ let float_bound_exclusive bound = let float_range low high = make_scalar ~print:string_of_float (Gen.float_range low high) +let exponential mean = make_scalar ~print:Print.float (Gen.exponential mean) + let int = make_int Gen.int let int_bound n = make_int (Gen.int_bound n) let int_range a b = make_int (Gen.int_range a b) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index ea3fcd28..7d123d31 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -267,6 +267,12 @@ module Gen : sig (** Synonym for [float_range] @since 0.11 *) + val exponential : float -> float t + (** [exponential m] generates floating-point numbers following an exponential + distribution with a mean of [m]. + @raise Invalid_argument if [m] is NaN. + @since NEXT_VERSION *) + val nat : int t (** Generates small natural numbers. *) val big_nat : int t @@ -1233,6 +1239,12 @@ val float_range : float -> float -> float arbitrary @raise Invalid_argument if [low > high] or if the range is larger than [max_float]. @since 0.11 *) +val exponential : float -> float arbitrary +(** [exponential m] generates floating-point numbers following an exponential + distribution with a mean of [m]. + @raise Invalid_argument if [m] is NaN. + @since NEXT_VERSION *) + val int : int arbitrary (** Int generator. Uniformly distributed. *) From 425a8e510f1cdef811fdb8a8792b9a2846864fd6 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 6 Dec 2024 16:51:01 +0100 Subject: [PATCH 207/391] Add a QCheck2.Gen.exponential combinator --- src/core/QCheck2.ml | 6 ++++++ src/core/QCheck2.mli | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index ea315bf7..b4e8560b 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -369,6 +369,12 @@ module Gen = struct let (--.) low high = float_range ?origin:None low high + let exponential (mean : float) = + if Float.is_nan mean then invalid_arg "Gen.exponential"; + let unit_gen = float_bound_inclusive 1.0 in + map (fun p -> -. mean *. (log p)) unit_gen + (* See https://en.wikipedia.org/wiki/Relationships_among_probability_distributions *) + let neg_int : int t = nat >|= Int.neg (** [option gen] shrinks towards [None] then towards shrinks of [gen]. *) diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index ceed40e5..c6cae163 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -516,6 +516,14 @@ module Gen : sig @since 0.11 *) + val exponential : float -> float t + (** [exponential m] generates floating-point numbers following an exponential + distribution with a mean of [m]. + + @raise Invalid_argument if [m] is NaN. + + @since NEXT_VERSION *) + val char_range : ?origin:char -> char -> char -> char t (** [char_range ?origin low high] generates chars between [low] and [high], inclusive. Example: [char_range 'a' 'z'] for all lower case ASCII letters. From 1624c881b2509cabeb7624f7819c9f1cc1132811 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 6 Dec 2024 16:52:00 +0100 Subject: [PATCH 208/391] Add expect tests of exponential --- test/core/QCheck2_tests.ml | 7 +++++++ test/core/QCheck_tests.ml | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/test/core/QCheck2_tests.ml b/test/core/QCheck2_tests.ml index 1da328ae..3f2add05 100644 --- a/test/core/QCheck2_tests.ml +++ b/test/core/QCheck2_tests.ml @@ -883,6 +883,12 @@ module Stats = struct Test.make ~name:"oneof int dist" ~count:1000 ~stats:[dist] (Gen.oneofl[min_int;-1;0;1;max_int]) (fun _ -> true); ] + let exponential_tests = + let float_dist = ("dist",int_of_float) in + [ Test.make ~name:"exponential 10. dist" ~count:5_000 ~stats:[float_dist] (Gen.exponential 10.) (fun _ -> true); + Test.make ~name:"exponential -10. dist" ~count:5_000 ~stats:[float_dist] (Gen.exponential (-10.)) (fun _ -> true); + ] + let tree_depth_test = let depth = ("depth", IntTree.depth) in Test.make ~name:"tree's depth" ~count:1000 ~stats:[depth] IntTree.gen_tree (fun _ -> true) @@ -904,4 +910,5 @@ module Stats = struct @ list_len_tests @ array_len_tests @ int_dist_tests + @ exponential_tests end diff --git a/test/core/QCheck_tests.ml b/test/core/QCheck_tests.ml index 1d1779ab..dd5b7ec4 100644 --- a/test/core/QCheck_tests.ml +++ b/test/core/QCheck_tests.ml @@ -955,6 +955,12 @@ module Stats = struct Test.make ~name:"oneof int dist" ~count:1000 (add_stat dist (oneofl[min_int;-1;0;1;max_int])) (fun _ -> true); ] + let exponential_tests = + let float_dist = ("dist",int_of_float) in + [ Test.make ~name:"exponential 10. dist" ~count:5_000 (add_stat float_dist (exponential 10.)) (fun _ -> true); + Test.make ~name:"exponential -10. dist" ~count:5_000 (add_stat float_dist (exponential (-10.))) (fun _ -> true); + ] + let tree_depth_test = let depth = ("depth", IntTree.depth) in Test.make ~name:"tree's depth" ~count:1000 (add_stat depth (make IntTree.gen_tree)) (fun _ -> true) @@ -982,4 +988,5 @@ module Stats = struct @ list_len_tests @ array_len_tests @ int_dist_tests + @ exponential_tests end From 3f094d1b9d008ca8d88136e988a151a2e926e058 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 6 Dec 2024 16:52:49 +0100 Subject: [PATCH 209/391] Update 64-bit expect test output --- .../QCheck2_expect_test.expected.ocaml4.64 | 52 ++++++++++++++++++- .../QCheck2_expect_test.expected.ocaml5.64 | 52 ++++++++++++++++++- .../QCheck_expect_test.expected.ocaml4.64 | 52 ++++++++++++++++++- .../QCheck_expect_test.expected.ocaml5.64 | 52 ++++++++++++++++++- 4 files changed, 204 insertions(+), 4 deletions(-) diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.64 b/test/core/QCheck2_expect_test.expected.ocaml4.64 index b1d73a60..9f2b7dfe 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.64 @@ -1459,9 +1459,59 @@ stats dist: 3228180212899171968.. 3689348814741910783: 0 3689348814741910784.. 4150517416584649599: 0 4150517416584649600.. 4611686018427387903: ################# 189 + ++++ Stats for exponential 10. dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 5000, avg: 9.56, stddev: 9.91, median 7, min 0, max 89 + 0.. 4: ####################################################### 1934 + 5.. 9: ################################## 1202 + 10.. 14: #################### 727 + 15.. 19: ############ 452 + 20.. 24: ######## 284 + 25.. 29: #### 164 + 30.. 34: ## 103 + 35.. 39: # 51 + 40.. 44: 26 + 45.. 49: 24 + 50.. 54: 15 + 55.. 59: 7 + 60.. 64: 3 + 65.. 69: 2 + 70.. 74: 2 + 75.. 79: 1 + 80.. 84: 1 + 85.. 89: 2 + 90.. 94: 0 + 95.. 99: 0 + ++++ Stats for exponential -10. dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 5000, avg: -9.56, stddev: 9.91, median -7, min -89, max 0 + -89..-85: 2 + -84..-80: 1 + -79..-75: 1 + -74..-70: 2 + -69..-65: 2 + -64..-60: 3 + -59..-55: 7 + -54..-50: 15 + -49..-45: 24 + -44..-40: 26 + -39..-35: # 51 + -34..-30: ## 103 + -29..-25: #### 164 + -24..-20: ######## 284 + -19..-15: ############ 452 + -14..-10: #################### 727 + -9.. -5: ################################## 1202 + -4.. 0: ####################################################### 1934 + 1.. 5: 0 + 6.. 10: 0 ================================================================================ 1 warning(s) -failure (64 tests failed, 3 tests errored, ran 141 tests) +failure (64 tests failed, 3 tests errored, ran 143 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.64 b/test/core/QCheck2_expect_test.expected.ocaml5.64 index bce5b4b9..7b24307d 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.64 @@ -1451,9 +1451,59 @@ stats dist: 3228180212899171968.. 3689348814741910783: 0 3689348814741910784.. 4150517416584649599: 0 4150517416584649600.. 4611686018427387903: ################# 195 + ++++ Stats for exponential 10. dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 5000, avg: 9.45, stddev: 9.82, median 6, min 0, max 79 + 0.. 3: ####################################################### 1631 + 4.. 7: ##################################### 1109 + 8..11: ######################### 747 + 12..15: ################# 512 + 16..19: ########## 308 + 20..23: ######## 251 + 24..27: ##### 165 + 28..31: ## 85 + 32..35: ## 64 + 36..39: # 43 + 40..43: 25 + 44..47: 20 + 48..51: 20 + 52..55: 3 + 56..59: 8 + 60..63: 3 + 64..67: 1 + 68..71: 2 + 72..75: 2 + 76..79: 1 + ++++ Stats for exponential -10. dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 5000, avg: -9.45, stddev: 9.82, median -6, min -79, max 0 + -79..-76: 1 + -75..-72: 2 + -71..-68: 2 + -67..-64: 1 + -63..-60: 3 + -59..-56: 8 + -55..-52: 3 + -51..-48: 20 + -47..-44: 20 + -43..-40: 25 + -39..-36: # 43 + -35..-32: ## 64 + -31..-28: ## 85 + -27..-24: ##### 165 + -23..-20: ######## 251 + -19..-16: ########## 308 + -15..-12: ################# 512 + -11.. -8: ######################### 747 + -7.. -4: ##################################### 1109 + -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (64 tests failed, 3 tests errored, ran 141 tests) +failure (64 tests failed, 3 tests errored, ran 143 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_expect_test.expected.ocaml4.64 b/test/core/QCheck_expect_test.expected.ocaml4.64 index 001496d7..3cd4711e 100644 --- a/test/core/QCheck_expect_test.expected.ocaml4.64 +++ b/test/core/QCheck_expect_test.expected.ocaml4.64 @@ -1397,9 +1397,59 @@ stats dist: 3228180212899171968.. 3689348814741910783: 0 3689348814741910784.. 4150517416584649599: 0 4150517416584649600.. 4611686018427387903: ################# 189 + ++++ Stats for exponential 10. dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 5000, avg: 9.56, stddev: 9.91, median 7, min 0, max 89 + 0.. 4: ####################################################### 1934 + 5.. 9: ################################## 1202 + 10.. 14: #################### 727 + 15.. 19: ############ 452 + 20.. 24: ######## 284 + 25.. 29: #### 164 + 30.. 34: ## 103 + 35.. 39: # 51 + 40.. 44: 26 + 45.. 49: 24 + 50.. 54: 15 + 55.. 59: 7 + 60.. 64: 3 + 65.. 69: 2 + 70.. 74: 2 + 75.. 79: 1 + 80.. 84: 1 + 85.. 89: 2 + 90.. 94: 0 + 95.. 99: 0 + ++++ Stats for exponential -10. dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 5000, avg: -9.56, stddev: 9.91, median -7, min -89, max 0 + -89..-85: 2 + -84..-80: 1 + -79..-75: 1 + -74..-70: 2 + -69..-65: 2 + -64..-60: 3 + -59..-55: 7 + -54..-50: 15 + -49..-45: 24 + -44..-40: 26 + -39..-35: # 51 + -34..-30: ## 103 + -29..-25: #### 164 + -24..-20: ######## 284 + -19..-15: ############ 452 + -14..-10: #################### 727 + -9.. -5: ################################## 1202 + -4.. 0: ####################################################### 1934 + 1.. 5: 0 + 6.. 10: 0 ================================================================================ 1 warning(s) -failure (64 tests failed, 3 tests errored, ran 149 tests) +failure (64 tests failed, 3 tests errored, ran 151 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_expect_test.expected.ocaml5.64 b/test/core/QCheck_expect_test.expected.ocaml5.64 index 8105c9ee..9c26971c 100644 --- a/test/core/QCheck_expect_test.expected.ocaml5.64 +++ b/test/core/QCheck_expect_test.expected.ocaml5.64 @@ -1407,9 +1407,59 @@ stats dist: 3228180212899171968.. 3689348814741910783: 0 3689348814741910784.. 4150517416584649599: 0 4150517416584649600.. 4611686018427387903: ################# 195 + ++++ Stats for exponential 10. dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 5000, avg: 9.45, stddev: 9.82, median 6, min 0, max 79 + 0.. 3: ####################################################### 1631 + 4.. 7: ##################################### 1109 + 8..11: ######################### 747 + 12..15: ################# 512 + 16..19: ########## 308 + 20..23: ######## 251 + 24..27: ##### 165 + 28..31: ## 85 + 32..35: ## 64 + 36..39: # 43 + 40..43: 25 + 44..47: 20 + 48..51: 20 + 52..55: 3 + 56..59: 8 + 60..63: 3 + 64..67: 1 + 68..71: 2 + 72..75: 2 + 76..79: 1 + ++++ Stats for exponential -10. dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 5000, avg: -9.45, stddev: 9.82, median -6, min -79, max 0 + -79..-76: 1 + -75..-72: 2 + -71..-68: 2 + -67..-64: 1 + -63..-60: 3 + -59..-56: 8 + -55..-52: 3 + -51..-48: 20 + -47..-44: 20 + -43..-40: 25 + -39..-36: # 43 + -35..-32: ## 64 + -31..-28: ## 85 + -27..-24: ##### 165 + -23..-20: ######## 251 + -19..-16: ########## 308 + -15..-12: ################# 512 + -11.. -8: ######################### 747 + -7.. -4: ##################################### 1109 + -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (64 tests failed, 3 tests errored, ran 149 tests) +failure (64 tests failed, 3 tests errored, ran 151 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ From 2d2bb48cd15741b9b7ce2b7ab7eb721cd785971a Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 6 Dec 2024 17:30:21 +0100 Subject: [PATCH 210/391] Update 32-bit expect test output --- .../QCheck2_expect_test.expected.ocaml4.32 | 52 ++++++++++++++++++- .../QCheck2_expect_test.expected.ocaml5.32 | 52 ++++++++++++++++++- .../QCheck_expect_test.expected.ocaml4.32 | 52 ++++++++++++++++++- .../QCheck_expect_test.expected.ocaml5.32 | 52 ++++++++++++++++++- 4 files changed, 204 insertions(+), 4 deletions(-) diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.32 b/test/core/QCheck2_expect_test.expected.ocaml4.32 index 126bcd4b..e25a26ec 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.32 @@ -1395,9 +1395,59 @@ stats dist: 751619287.. 858993469: 0 858993470.. 966367652: 0 966367653.. 1073741823: ################# 189 + ++++ Stats for exponential 10. dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 5000, avg: 9.56, stddev: 9.91, median 7, min 0, max 89 + 0.. 4: ####################################################### 1934 + 5.. 9: ################################## 1202 + 10.. 14: #################### 727 + 15.. 19: ############ 452 + 20.. 24: ######## 284 + 25.. 29: #### 164 + 30.. 34: ## 103 + 35.. 39: # 51 + 40.. 44: 26 + 45.. 49: 24 + 50.. 54: 15 + 55.. 59: 7 + 60.. 64: 3 + 65.. 69: 2 + 70.. 74: 2 + 75.. 79: 1 + 80.. 84: 1 + 85.. 89: 2 + 90.. 94: 0 + 95.. 99: 0 + ++++ Stats for exponential -10. dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 5000, avg: -9.56, stddev: 9.91, median -7, min -89, max 0 + -89..-85: 2 + -84..-80: 1 + -79..-75: 1 + -74..-70: 2 + -69..-65: 2 + -64..-60: 3 + -59..-55: 7 + -54..-50: 15 + -49..-45: 24 + -44..-40: 26 + -39..-35: # 51 + -34..-30: ## 103 + -29..-25: #### 164 + -24..-20: ######## 284 + -19..-15: ############ 452 + -14..-10: #################### 727 + -9.. -5: ################################## 1202 + -4.. 0: ####################################################### 1934 + 1.. 5: 0 + 6.. 10: 0 ================================================================================ 1 warning(s) -failure (64 tests failed, 3 tests errored, ran 141 tests) +failure (64 tests failed, 3 tests errored, ran 143 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.32 b/test/core/QCheck2_expect_test.expected.ocaml5.32 index 4526d5f9..b560f542 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.32 @@ -1395,9 +1395,59 @@ stats dist: 751619287.. 858993469: 0 858993470.. 966367652: 0 966367653.. 1073741823: ################# 195 + ++++ Stats for exponential 10. dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 5000, avg: 9.45, stddev: 9.82, median 6, min 0, max 79 + 0.. 3: ####################################################### 1631 + 4.. 7: ##################################### 1109 + 8..11: ######################### 747 + 12..15: ################# 512 + 16..19: ########## 308 + 20..23: ######## 251 + 24..27: ##### 165 + 28..31: ## 85 + 32..35: ## 64 + 36..39: # 43 + 40..43: 25 + 44..47: 20 + 48..51: 20 + 52..55: 3 + 56..59: 8 + 60..63: 3 + 64..67: 1 + 68..71: 2 + 72..75: 2 + 76..79: 1 + ++++ Stats for exponential -10. dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 5000, avg: -9.45, stddev: 9.82, median -6, min -79, max 0 + -79..-76: 1 + -75..-72: 2 + -71..-68: 2 + -67..-64: 1 + -63..-60: 3 + -59..-56: 8 + -55..-52: 3 + -51..-48: 20 + -47..-44: 20 + -43..-40: 25 + -39..-36: # 43 + -35..-32: ## 64 + -31..-28: ## 85 + -27..-24: ##### 165 + -23..-20: ######## 251 + -19..-16: ########## 308 + -15..-12: ################# 512 + -11.. -8: ######################### 747 + -7.. -4: ##################################### 1109 + -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (64 tests failed, 3 tests errored, ran 141 tests) +failure (64 tests failed, 3 tests errored, ran 143 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_expect_test.expected.ocaml4.32 b/test/core/QCheck_expect_test.expected.ocaml4.32 index bdbd94cb..7aa93ab2 100644 --- a/test/core/QCheck_expect_test.expected.ocaml4.32 +++ b/test/core/QCheck_expect_test.expected.ocaml4.32 @@ -1365,9 +1365,59 @@ stats dist: 751619287.. 858993469: 0 858993470.. 966367652: 0 966367653.. 1073741823: ################# 189 + ++++ Stats for exponential 10. dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 5000, avg: 9.56, stddev: 9.91, median 7, min 0, max 89 + 0.. 4: ####################################################### 1934 + 5.. 9: ################################## 1202 + 10.. 14: #################### 727 + 15.. 19: ############ 452 + 20.. 24: ######## 284 + 25.. 29: #### 164 + 30.. 34: ## 103 + 35.. 39: # 51 + 40.. 44: 26 + 45.. 49: 24 + 50.. 54: 15 + 55.. 59: 7 + 60.. 64: 3 + 65.. 69: 2 + 70.. 74: 2 + 75.. 79: 1 + 80.. 84: 1 + 85.. 89: 2 + 90.. 94: 0 + 95.. 99: 0 + ++++ Stats for exponential -10. dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 5000, avg: -9.56, stddev: 9.91, median -7, min -89, max 0 + -89..-85: 2 + -84..-80: 1 + -79..-75: 1 + -74..-70: 2 + -69..-65: 2 + -64..-60: 3 + -59..-55: 7 + -54..-50: 15 + -49..-45: 24 + -44..-40: 26 + -39..-35: # 51 + -34..-30: ## 103 + -29..-25: #### 164 + -24..-20: ######## 284 + -19..-15: ############ 452 + -14..-10: #################### 727 + -9.. -5: ################################## 1202 + -4.. 0: ####################################################### 1934 + 1.. 5: 0 + 6.. 10: 0 ================================================================================ 1 warning(s) -failure (64 tests failed, 3 tests errored, ran 149 tests) +failure (64 tests failed, 3 tests errored, ran 151 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_expect_test.expected.ocaml5.32 b/test/core/QCheck_expect_test.expected.ocaml5.32 index 0c273efd..915f39c7 100644 --- a/test/core/QCheck_expect_test.expected.ocaml5.32 +++ b/test/core/QCheck_expect_test.expected.ocaml5.32 @@ -1375,9 +1375,59 @@ stats dist: 751619287.. 858993469: 0 858993470.. 966367652: 0 966367653.. 1073741823: ################# 195 + ++++ Stats for exponential 10. dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 5000, avg: 9.45, stddev: 9.82, median 6, min 0, max 79 + 0.. 3: ####################################################### 1631 + 4.. 7: ##################################### 1109 + 8..11: ######################### 747 + 12..15: ################# 512 + 16..19: ########## 308 + 20..23: ######## 251 + 24..27: ##### 165 + 28..31: ## 85 + 32..35: ## 64 + 36..39: # 43 + 40..43: 25 + 44..47: 20 + 48..51: 20 + 52..55: 3 + 56..59: 8 + 60..63: 3 + 64..67: 1 + 68..71: 2 + 72..75: 2 + 76..79: 1 + ++++ Stats for exponential -10. dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 5000, avg: -9.45, stddev: 9.82, median -6, min -79, max 0 + -79..-76: 1 + -75..-72: 2 + -71..-68: 2 + -67..-64: 1 + -63..-60: 3 + -59..-56: 8 + -55..-52: 3 + -51..-48: 20 + -47..-44: 20 + -43..-40: 25 + -39..-36: # 43 + -35..-32: ## 64 + -31..-28: ## 85 + -27..-24: ##### 165 + -23..-20: ######## 251 + -19..-16: ########## 308 + -15..-12: ################# 512 + -11.. -8: ######################### 747 + -7.. -4: ##################################### 1109 + -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (64 tests failed, 3 tests errored, ran 149 tests) +failure (64 tests failed, 3 tests errored, ran 151 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ From c30deb10138b48bb9123d773a3ac1c3b28102774 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 6 Dec 2024 18:02:38 +0100 Subject: [PATCH 211/391] Add CHANGELOG entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 39f955ff..bb23e9cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## NEXT RELEASE +- Add `exponential` generator to `QCheck`, `QCheck.Gen`, and `QCheck2.Gen` - Add `Shrink.bool` and use it in `QCheck.bool` - Remove unread `fun_gen` field from `QCheck2`'s `fun_repr_tbl` type thereby silencing a compiler warning From c5c73c3c1533da82d36f6458c88d2d211f25c2a7 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 9 Dec 2024 12:39:17 +0100 Subject: [PATCH 212/391] Rework QCheck introduction a bit, fixing a broken arbitrary link --- src/core/QCheck.mli | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 7d123d31..cf77c853 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -10,15 +10,17 @@ all rights reserved. (** The library takes inspiration from Haskell's QuickCheck library. The rough idea is that the programmer describes invariants that values of a certain type need to satisfy ("properties"), as functions from this type - to bool. She also needs to describe how to generate random values of the type, + to [bool]. The programmer also needs to describe how to generate random values of the type, so that the property is tried and checked on a number of random instances. This explains the organization of this module: - - {! 'a arbitrary} is used to describe how to generate random values, - shrink them (make counter-examples as small as possible), print - them, etc. Auxiliary modules such as {!Gen}, {!Print}, and {!Shrink} - can be used along with {!make} to build one's own arbitrary instances. + - {{!section:arbitrary}The ['a arbitrary] record type} describes how to generate random values, + shrink them (reduce counter-examples to a minimum), print them, etc. + It is the generator type expected by {!Test.make}. + + - Auxiliary modules such as {!Gen}, {!Print}, and {!Shrink} can be used along with {!make} + to build custom generators. - {!Test} is used to describe a single test, that is, a property of type ['a -> bool] combined with an ['a arbitrary] that is used to generate From c59f40bb86445e7263e9de536ce6ceba7ce16d90 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 9 Dec 2024 12:44:40 +0100 Subject: [PATCH 213/391] Use Print.t type in arbitrary type --- src/core/QCheck.ml | 2 +- src/core/QCheck.mli | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index bf5b6277..6bb11647 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -1042,7 +1042,7 @@ type 'a stat = string * ('a -> int) type 'a arbitrary = { gen: 'a Gen.t; - print: ('a -> string) option; (** print values *) + print: ('a Print.t) option; (** print values *) small: ('a -> int) option; (** size of example *) shrink: ('a -> 'a Iter.t) option; (** shrink to smaller examples *) collect: ('a -> string) option; (** map value to tag, and group by tag *) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index cf77c853..e43f76ac 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -897,7 +897,7 @@ type 'a stat = string * ('a -> int) type 'a arbitrary = private { gen: 'a Gen.t; - print: ('a -> string) option; (** print values *) + print: ('a Print.t) option; (** print values *) small: ('a -> int) option; (** size of example *) shrink: ('a Shrink.t) option; (** shrink to smaller examples *) collect: ('a -> string) option; (** map value to tag, and group by tag *) From 7981bd832dd83753be41ac72068757350762ff14 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 9 Dec 2024 12:45:57 +0100 Subject: [PATCH 214/391] Use Shrink.t type in arbitrary type --- src/core/QCheck.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index 6bb11647..cd29f021 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -1044,7 +1044,7 @@ type 'a arbitrary = { gen: 'a Gen.t; print: ('a Print.t) option; (** print values *) small: ('a -> int) option; (** size of example *) - shrink: ('a -> 'a Iter.t) option; (** shrink to smaller examples *) + shrink: ('a Shrink.t) option; (** shrink to smaller examples *) collect: ('a -> string) option; (** map value to tag, and group by tag *) stats: 'a stat list; (** statistics to collect and print *) } From 78d0ff149d46e304e5128a5bcc3fea8ab829bfcd Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 9 Dec 2024 12:56:36 +0100 Subject: [PATCH 215/391] Replace erroneous mention of shrinking in tuple Gens by a more descriptive text --- src/core/QCheck.mli | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index e43f76ac..34ab0652 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -369,9 +369,11 @@ module Gen : sig (** Generates quadruples. @since 0.5.1 *) - (** {3 Tuple of generators} *) + (** {3 Tuple generators} *) - (** {4 Shrinks on [gen1], then [gen2], then ... } *) + (** {4 Create tuple generators by composing individual element generators. For example, + [Gen.(tup3 int char bool)] creates a [(int * char * bool)] triple generator + by composing the [int], [char], and [bool] generators. *) val tup2 : 'a t -> 'b t -> ('a * 'b) t From ec276ad1c28e39d57759d37e90450507d8df989a Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 9 Dec 2024 12:57:12 +0100 Subject: [PATCH 216/391] Adjust QCheck2 introduction accordingly --- src/core/QCheck2.mli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index c6cae163..e686823e 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -15,7 +15,7 @@ content will appear. *) This library takes inspiration from Haskell's QuickCheck library. The rough idea is that the programmer describes invariants that values of a certain type need to satisfy ("properties"), as functions from this type - to bool. They also need to describe how to generate random values of the type, + to [bool]. The programmer also needs to describe how to generate random values of the type, so that the property is tried and checked on a number of random instances. This explains the organization of this module: From 46a6a489fa35bab31adbd0181ea075456f87e14e Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 9 Dec 2024 13:10:18 +0100 Subject: [PATCH 217/391] Fix broken links --- src/core/QCheck.mli | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 34ab0652..d56cc5a4 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -847,8 +847,8 @@ end The random function will observe its arguments in a way that is determined from the observable instance. - Inspired from https://blogs.janestreet.com/quickcheck-for-core/ - and Koen Claessen's "Shrinking and Showing functions". + Inspired from {:https://blogs.janestreet.com/quickcheck-for-core/} + and {{:https://dl.acm.org/doi/abs/10.1145/2364506.2364516}Koen Claessen's "Shrinking and Showing Functions"}. @since 0.6 *) @@ -1169,7 +1169,7 @@ end also be used to find data satisfying a predicate, {i within a property being tested}. - See https://github.com/c-cube/qcheck/issues/31 + See {:https://github.com/c-cube/qcheck/issues/31} *) exception No_example_found of string From 05b042a9d4cb40216ebc48965ac082f64ff0fbd4 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 9 Dec 2024 13:18:37 +0100 Subject: [PATCH 218/391] Don't use a sub-section in tuple generators --- src/core/QCheck.mli | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index d56cc5a4..4719ed01 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -369,11 +369,12 @@ module Gen : sig (** Generates quadruples. @since 0.5.1 *) - (** {3 Tuple generators} *) + (** {3 Tuple generators} - (** {4 Create tuple generators by composing individual element generators. For example, + Create tuple generators by composing individual element generators. For example, [Gen.(tup3 int char bool)] creates a [(int * char * bool)] triple generator - by composing the [int], [char], and [bool] generators. *) + by composing the [int], [char], and [bool] generators. + *) val tup2 : 'a t -> 'b t -> ('a * 'b) t From 30212bdd92947c81a69659e03a49478ddf7026f1 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 9 Dec 2024 13:19:44 +0100 Subject: [PATCH 219/391] Put Gen.generate* combinators in sub-section --- src/core/QCheck.mli | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 4719ed01..97ab8e85 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -591,12 +591,6 @@ module Gen : sig in a generator. @since 0.17 *) - val generate : ?rand:Random.State.t -> n:int -> 'a t -> 'a list - (** [generate ~n g] generates [n] instances of [g]. *) - - val generate1 : ?rand:Random.State.t -> 'a t -> 'a - (** [generate1 g] generates one instance of [g]. *) - val ( let+ ) : 'a t -> ('a -> 'b) -> 'b t val ( and+ ) : 'a t -> 'b t -> ('a * 'b) t @@ -604,6 +598,18 @@ module Gen : sig val ( let* ) : 'a t -> ('a -> 'b t) -> 'b t val ( and* ) : 'a t -> 'b t -> ('a * 'b) t + + (** {3 Debug generators} + + These functions should not be used in tests: they are provided + for convenience to debug/investigate what values a generator produces. + *) + + val generate : ?rand:Random.State.t -> n:int -> 'a t -> 'a list + (** [generate ~n g] generates [n] instances of [g]. *) + + val generate1 : ?rand:Random.State.t -> 'a t -> 'a + (** [generate1 g] generates one instance of [g]. *) end (** {2 Pretty printing} *) From c845fe4232a84992cf1bc18220459553d448baed Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 9 Dec 2024 13:23:00 +0100 Subject: [PATCH 220/391] Add primitive generator sub-section, moving tuple generator sub-section --- src/core/QCheck.mli | 72 +++++++++++++++++++++++---------------------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 97ab8e85..32fb54be 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -238,6 +238,8 @@ module Gen : sig @since 0.18 *) + (** {3 Primitive generators} *) + val unit : unit t (** The unit generator. *) val bool : bool t (** The boolean generator. *) @@ -361,41 +363,6 @@ module Gen : sig @since 0.18 ([?ratio] parameter) *) - val pair : 'a t -> 'b t -> ('a * 'b) t (** Generates pairs. *) - - val triple : 'a t -> 'b t -> 'c t -> ('a * 'b * 'c) t (** Generates triples. *) - - val quad : 'a t -> 'b t -> 'c t -> 'd t -> ('a * 'b * 'c * 'd) t - (** Generates quadruples. - @since 0.5.1 *) - - (** {3 Tuple generators} - - Create tuple generators by composing individual element generators. For example, - [Gen.(tup3 int char bool)] creates a [(int * char * bool)] triple generator - by composing the [int], [char], and [bool] generators. - *) - - val tup2 : 'a t -> 'b t -> ('a * 'b) t - - val tup3 : 'a t -> 'b t -> 'c t -> ('a * 'b * 'c) t - - val tup4 : 'a t -> 'b t -> 'c t -> 'd t -> ('a * 'b * 'c * 'd) t - - val tup5 : 'a t -> 'b t -> 'c t -> 'd t -> 'e t -> ('a * 'b * 'c * 'd * 'e) t - - val tup6 : 'a t -> 'b t -> 'c t -> 'd t -> 'e t -> 'f t -> - ('a * 'b * 'c * 'd * 'e * 'f) t - - val tup7 : 'a t -> 'b t -> 'c t -> 'd t -> 'e t -> 'f t -> 'g t -> - ('a * 'b * 'c * 'd * 'e * 'f * 'g) t - - val tup8 : 'a t -> 'b t -> 'c t -> 'd t -> 'e t -> 'f t -> 'g t -> 'h t -> - ('a * 'b * 'c * 'd * 'e * 'f * 'g * 'h) t - - val tup9 : 'a t -> 'b t -> 'c t -> 'd t -> 'e t -> 'f t -> 'g t -> 'h t -> 'i t -> - ('a * 'b * 'c * 'd * 'e * 'f * 'g * 'h * 'i) t - val char : char t (** Generates characters upto character code 255. *) @@ -496,6 +463,41 @@ module Gen : sig (** Generates arrays of small size (see {!small_nat}). @since 0.10 *) + (** {3 Tuple generators} + + Create tuple generators by composing individual element generators. For example, + [Gen.(tup3 int char bool)] creates a [(int * char * bool)] triple generator + by composing the [int], [char], and [bool] generators. + *) + + val pair : 'a t -> 'b t -> ('a * 'b) t (** Generates pairs. *) + + val triple : 'a t -> 'b t -> 'c t -> ('a * 'b * 'c) t (** Generates triples. *) + + val quad : 'a t -> 'b t -> 'c t -> 'd t -> ('a * 'b * 'c * 'd) t + (** Generates quadruples. + @since 0.5.1 *) + + val tup2 : 'a t -> 'b t -> ('a * 'b) t + + val tup3 : 'a t -> 'b t -> 'c t -> ('a * 'b * 'c) t + + val tup4 : 'a t -> 'b t -> 'c t -> 'd t -> ('a * 'b * 'c * 'd) t + + val tup5 : 'a t -> 'b t -> 'c t -> 'd t -> 'e t -> ('a * 'b * 'c * 'd * 'e) t + + val tup6 : 'a t -> 'b t -> 'c t -> 'd t -> 'e t -> 'f t -> + ('a * 'b * 'c * 'd * 'e * 'f) t + + val tup7 : 'a t -> 'b t -> 'c t -> 'd t -> 'e t -> 'f t -> 'g t -> + ('a * 'b * 'c * 'd * 'e * 'f * 'g) t + + val tup8 : 'a t -> 'b t -> 'c t -> 'd t -> 'e t -> 'f t -> 'g t -> 'h t -> + ('a * 'b * 'c * 'd * 'e * 'f * 'g * 'h) t + + val tup9 : 'a t -> 'b t -> 'c t -> 'd t -> 'e t -> 'f t -> 'g t -> 'h t -> 'i t -> + ('a * 'b * 'c * 'd * 'e * 'f * 'g * 'h * 'i) t + val join : 'a t t -> 'a t (** Collapses a generator of generators to simply a generator. @since 0.5 *) From c93dd6a1c33c3f6fd38e8e25e28d1d6e7d4fccb8 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 10 Dec 2024 11:01:45 +0100 Subject: [PATCH 221/391] Rework order of src/core/QCheck.mli for nicer documentation --- src/core/QCheck.mli | 1060 +++++++++++++++++++++++-------------------- 1 file changed, 563 insertions(+), 497 deletions(-) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 32fb54be..fc3d8b25 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -7,7 +7,9 @@ all rights reserved. (** {1 Quickcheck inspired property-based testing} *) -(** The library takes inspiration from Haskell's QuickCheck library. The +(** {1 Introduction} + + The library takes inspiration from Haskell's QuickCheck library. The rough idea is that the programmer describes invariants that values of a certain type need to satisfy ("properties"), as functions from this type to [bool]. The programmer also needs to describe how to generate random values of the type, @@ -29,7 +31,7 @@ all rights reserved. and test, etc. - Examples: + {1 Examples} - List.rev is involutive: @@ -80,6 +82,8 @@ all rights reserved. {{:http://gasche.github.io/random-generator/doc/Generator.html } here}. *) +(** {1 Assumptions} *) + val (==>) : bool -> bool -> bool (** [b1 ==> b2] is the logical implication [b1 => b2] ie [not b1 || b2] (except that it is strict and will interact @@ -125,8 +129,14 @@ val assume_fail : unit -> 'a @since 0.5.1 *) -(** {2 Generate Random Values} *) +(** {1 Generate Random Values} *) + module Gen : sig + (** The [Gen] module offers combinators to build custom generators. + Unlike the {{!section:arbitrary}the ['a arbitrary] record type}, + which comes with printers, shrinkers, etc. {!Gen.t} represents + a type for generation only. *) + type 'a t = Random.State.t -> 'a (** A random generator for values of type 'a. *) @@ -614,10 +624,12 @@ module Gen : sig (** [generate1 g] generates one instance of [g]. *) end -(** {2 Pretty printing} *) +(** {1 Printing Values} *) -(** {2 Show Values} *) module Print : sig + + (** The [Print] module offers combinators for printing generated values. *) + type 'a t = 'a -> string (** Printer for values of type ['a]. *) @@ -686,12 +698,24 @@ module Print : sig (** 9-tuple printer. Expects printers for each component. *) end -(** {2 Iterators} +(** {1 Shrinking Values} + + Shrinking is used to reduce the size of a counter-example. It tries + to make the counter-example smaller, e.g., by decreasing an integer, + or removing elements of a list, until the property to test holds again; + it then returns the smallest value that still made the test fail. + + Shrinking is defined as a type {!Shrink.t} that takes an argument to shrink + and produces an iterator of type {!Iter.t} of shrinking candidates. +*) + +(** {2 Iterators} *) - Compatible with the library "sequence". An iterator [i] is simply - a function that accepts another function [f] (of type ['a -> unit]) - and calls [f] on a sequence of elements [f x1; f x2; ...; f xn]. *) module Iter : sig + (** [Iter] is compatible with the library "sequence". An iterator [i] is simply + a function that accepts another function [f] (of type ['a -> unit]) + and calls [f] on a sequence of elements [f x1; f x2; ...; f xn]. *) + type 'a t = ('a -> unit) -> unit val empty : 'a t @@ -728,13 +752,12 @@ module Iter : sig val ( and* ) : 'a t -> 'b t -> ('a * 'b) t end -(** {2 Shrink Values} +(** {2 Shrinkers} *) - Shrinking is used to reduce the size of a counter-example. It tries - to make the counter-example smaller by decreasing it, or removing - elements, until the property to test holds again; then it returns the - smallest value that still made the test fail. *) module Shrink : sig + (** The [Shrink] module contains combinators to build up composite shrinkers + for user-defined types *) + type 'a t = 'a -> 'a Iter.t (** Given a counter-example, return an iterator on smaller versions of the counter-example. *) @@ -850,52 +873,8 @@ module Shrink : sig (** Similar to {!tup2} *) end -(** {2 Observe Values} *) - -(** Observables are usable as arguments for random functions. - The random function will observe its arguments in a way - that is determined from the observable instance. - - Inspired from {:https://blogs.janestreet.com/quickcheck-for-core/} - and {{:https://dl.acm.org/doi/abs/10.1145/2364506.2364516}Koen Claessen's "Shrinking and Showing Functions"}. - - @since 0.6 -*) - -module Observable : sig - (** An observable for ['a], packing a printer and other things. *) - type -'a t - - val equal : 'a t -> 'a -> 'a -> bool - val hash : 'a t -> 'a -> int - val print : 'a t -> 'a Print.t - - val unit : unit t - val bool : bool t - val int : int t - val float : float t - val string : string t - val bytes : bytes t (** @since 0.20 *) - val char : char t - - val make : - ?eq:('a -> 'a -> bool) -> - ?hash:('a -> int) -> - 'a Print.t -> - 'a t - - val map : ('a -> 'b) -> 'b t -> 'a t - - val option : 'a t -> 'a option t - val list : 'a t -> 'a list t - val array : 'a t -> 'a array t - - val pair : 'a t -> 'b t -> ('a * 'b) t - val triple : 'a t -> 'b t -> 'c t -> ('a * 'b * 'c) t - val quad : 'a t -> 'b t -> 'c t -> 'd t -> ('a * 'b * 'c * 'd) t -end -(** {2 Arbitrary} +(** {1 Arbitrary} A value of type ['a arbitrary] glues together a random generator, and optional functions for shrinking, printing, computing the size, @@ -938,6 +917,11 @@ val make : @param shrink to shrink counter-examples *) +(** {2 Adjusting arbitrary generators } + + There is a range to [get] and [set] fields on an arbitrary record type. +*) + val set_print : 'a Print.t -> 'a arbitrary -> 'a arbitrary val set_small : ('a -> int) -> 'a arbitrary -> 'a arbitrary val set_shrink : 'a Shrink.t -> 'a arbitrary -> 'a arbitrary @@ -967,357 +951,107 @@ val get_gen : 'a arbitrary -> 'a Gen.t val get_print : 'a arbitrary -> 'a Print.t option -(** {2 Tests} - A test is a universal property of type [foo -> bool] for some type [foo], - with an object of type [foo arbitrary] used to generate, print, etc. values - of type [foo]. +(** {2 Primitive combinators for arbitrary} *) - The main features of this module are: - - {!Test.make} to build a test, - - {!Test.make_neg} to build a negative test that is expected not to satisfy the tested property, - - {!Test.check_exn} to run a single test with a simple runner. +val unit : unit arbitrary +(** Always generates [()], obviously. *) - A test fails if the property does not hold for a given input. The {{!Test.fail_report} simple} form or the {{!Test.fail_reportf} rich} form) offer more elaborate forms to fail a test. +val bool : bool arbitrary +(** Uniform boolean generator. *) - For more serious testing, it is recommended to create a testsuite and use a full-fledged runner: - - {!QCheck_base_runner} is a QCheck-only runner (useful if you don't have or don't need another test framework) - - {!QCheck_alcotest} interfaces to the Alcotest framework - - {!QCheck_ounit} interfaces to the to OUnit framework -*) +val float : float arbitrary +(** Generates regular floats (no nan and no infinities). *) +(* FIXME: does not generate nan nor infinity I think. *) -(** Result of running a test *) -module TestResult : sig - type 'a counter_ex = 'a QCheck2.TestResult.counter_ex = { - instance: 'a; (** The counter-example(s) *) +val pos_float : float arbitrary +(** Positive float generator (no nan and no infinities). *) - shrink_steps: int; (** How many shrinking steps for this counterex *) +val neg_float : float arbitrary +(** Negative float generator (no nan and no infinities). *) - msg_l: string list; - (** messages. - @since 0.7 *) - } +val float_bound_inclusive : float -> float arbitrary +(** [float_bound_inclusive n] is uniform between [0] and [n] included. If [bound] is + negative, the result is negative or zero. If [bound] is 0, the result is 0. + @since 0.11 *) - type 'a failed_state = 'a counter_ex list +val float_bound_exclusive : float -> float arbitrary +(** [float_bound_exclusive n] is uniform between [0] included and [n] excluded. + If [bound] is negative, the result is negative or zero. + @raise Invalid_argument if [bound] is zero. + @since 0.11 *) - (** Result state. - changed in 0.10 (move to inline records, add Fail_other) *) - type 'a state = 'a QCheck2.TestResult.state = - | Success - | Failed of { - instances: 'a failed_state; (** Failed instance(s) *) - } - | Failed_other of {msg: string} - | Error of { - instance: 'a counter_ex; - exn: exn; - backtrace: string; - } (** Error, backtrace, and instance that triggered it *) +val float_range : float -> float -> float arbitrary +(** [float_range low high] is uniform between [low] included and [high] included. + @raise Invalid_argument if [low > high] or if the range is larger than [max_float]. + @since 0.11 *) - (* result returned by running a test *) - type 'a t = 'a QCheck2.TestResult.t +val exponential : float -> float arbitrary +(** [exponential m] generates floating-point numbers following an exponential + distribution with a mean of [m]. + @raise Invalid_argument if [m] is NaN. + @since NEXT_VERSION *) - val get_count : _ t -> int - (** Get the count of a cell. - @since 0.5.3 *) +val int : int arbitrary +(** Int generator. Uniformly distributed. *) - val get_count_gen : _ t -> int +val int_bound : int -> int arbitrary +(** [int_bound n] is uniform between [0] and [n] included. *) - val get_state : 'a t -> 'a state +val int_range : int -> int -> int arbitrary +(** [int_range a b] is uniform between [a] and [b] included. [b] must be + larger than [a]. *) - val collect : _ t -> (string,int) Hashtbl.t option - (** Obtain statistics - @since 0.6 *) +val small_nat : int arbitrary +(** Small unsigned integers. + @since 0.5.1 *) - val stats : 'a t -> ('a stat * (int,int) Hashtbl.t) list - (** Obtain statistics - @since 0.6 *) +val small_int : int arbitrary +(** Small unsigned integers. See {!Gen.small_int}. + @deprecated use {!small_signed_int}. *) - val warnings : _ t -> string list - (** Obtain list of warnings - @since 0.10 *) +val small_signed_int : int arbitrary +(** Small signed integers. + @since 0.5.2 *) - val is_success : _ t -> bool - (** Returns true iff the state if [Success] - @since 0.9 *) -end +val (--) : int -> int -> int arbitrary +(** Synonym for {!int_range}. *) -(** Module related to individual tests. - @since 0.18 most of it moved to {!QCheck2}, - and the type ['a cell] was made a private implementation detail. -*) -module Test : sig - type res = QCheck2.Test.res = - | Success - | Failure - | FalseAssumption - | Error of exn * string - type 'a event = 'a QCheck2.Test.event = - | Generating - | Collecting of 'a - | Testing of 'a - | Shrunk of int * 'a - | Shrinking of int * int * 'a +val int32 : int32 arbitrary +(** Int32 generator. Uniformly distributed. *) - type 'a cell = 'a QCheck2.Test.cell - type 'a handler = 'a QCheck2.Test.handler - type 'a step = 'a QCheck2.Test.step - type 'a callback = 'a QCheck2.Test.callback +val int64 : int64 arbitrary +(** Int64 generator. Uniformly distributed. *) - type t = QCheck2.Test.t +val pos_int : int arbitrary +(** Positive int generator (0 included). Uniformly distributed. + See {!Gen.pint} *) - val fail_report : string -> 'a - (** Fail the test with some additional message that will - be reported. - @since 0.7 *) +val small_int_corners : unit -> int arbitrary +(** As [small_int], but each newly created generator starts with + a list of corner cases before falling back on random generation. *) - val fail_reportf : ('a, Format.formatter, unit, 'b) format4 -> 'a - (** Format version of {!fail_report} - @since 0.7 *) +val neg_int : int arbitrary +(** Negative int generator (0 included, see {!Gen.neg_int}). + The distribution is similar to that of + [small_int], not of [pos_int]. +*) - val make_cell : - ?if_assumptions_fail:([`Fatal | `Warning] * float) -> - ?count:int -> ?long_factor:int -> ?negative:bool -> ?max_gen:int -> ?max_fail:int -> - ?small:('a -> int) -> ?retries:int -> ?name:string -> - 'a arbitrary -> ('a -> bool) -> 'a cell - (** [make_cell arb prop] builds a test that checks property [prop] on instances - of the generator [arb]. - @param name the name of the test. - @param count number of test cases to run, counting only - the test cases which satisfy preconditions. - @param retries number of times to retry the tested property while shrinking. - @param long_factor the factor by which to multiply count, max_gen and - max_fail when running a long test (default: 1). - @param negative whether the test is expected not to satisfy the tested property. - @param max_gen maximum number of times the generation function - is called in total to replace inputs that do not satisfy - preconditions (should be >= count). - @param max_fail maximum number of failures before we stop generating - inputs. This is useful if shrinking takes too much time. - @param small kept for compatibility reasons; if provided, replaces - the field [arbitrary.small]. - If there is no shrinking function but there is a [small] - function, only the smallest failures will be printed. - @param if_assumptions_fail the minimum - fraction of tests that must satisfy the precondition for a success - to be considered valid. - The fraction should be between 0. and 1. - A warning will be emitted otherwise if - the flag is [`Warning], the test will be a failure if the flag is [`Fatal]. - (since 0.10) +val char : char arbitrary +(** Uniformly distributed on all the chars (not just ascii or + valid latin-1). *) + +val printable_char : char arbitrary +(** Uniformly distributed over a subset of printable ascii chars. + Ascii character codes 32 to 126, inclusive - or ['\n'] with code 10. *) - val get_law : 'a cell -> ('a -> bool) - (** @deprecated use {!QCheck2.Test.get_law} instead *) - val get_name : _ cell -> string - (** @deprecated use {!QCheck2.Test.get_name} instead *) - val set_name : _ cell -> string -> unit - (** @deprecated use {!QCheck2.Test.set_name} instead *) +val numeral_char : char arbitrary +(** Uniformly distributed over ['0'..'9']. *) - val get_count : _ cell -> int - (** Get the count of a cell. - @deprecated use {!QCheck2.Test.get_count} instead - @since 0.5.3 *) - - val get_long_factor : _ cell -> int - (** Get the long factor of a cell. - @deprecated use {!QCheck2.Test.get_long_factor} instead - @since 0.5.3 *) - - val make : - ?if_assumptions_fail:([`Fatal | `Warning] * float) -> - ?count:int -> ?long_factor:int -> ?max_gen:int -> ?max_fail:int -> - ?small:('a -> int) -> ?retries:int -> ?name:string -> 'a arbitrary -> - ('a -> bool) -> t - (** [make arb prop] builds a test that checks property [prop] on instances - of the generator [arb]. - See {!make_cell} for a description of the parameters. - *) - - val make_neg : - ?if_assumptions_fail:([`Fatal | `Warning] * float) -> - ?count:int -> ?long_factor:int -> ?max_gen:int -> ?max_fail:int -> - ?small:('a -> int) -> ?retries:int -> ?name:string -> 'a arbitrary -> - ('a -> bool) -> t - (** [make_neg arb prop] builds a test that checks property [prop] on instances - of the generator [arb]. - The test is considered negative, meaning that it is expected not to satisfy the tested property. - This information is recorded in an underlying test [cell] entry and interpreted suitably by test runners. - See {!make_cell} for a description of the parameters. - *) - - include module type of QCheck2.Test_exceptions - - val print_instance : 'a cell -> 'a -> string - val print_c_ex : 'a cell -> 'a TestResult.counter_ex -> string - val print_fail : 'a cell -> string -> 'a TestResult.counter_ex list -> string - val print_fail_other : string -> msg:string -> string - val print_error : ?st:string -> 'a cell -> string -> 'a TestResult.counter_ex * exn -> string - val print_test_fail : string -> string list -> string - val print_test_error : string -> string -> exn -> string -> string - - val check_cell : - ?long:bool -> ?call:'a callback -> - ?step:'a step -> ?handler:'a handler -> - ?rand:Random.State.t -> 'a cell -> 'a TestResult.t - (** See {!QCheck2.Test.check_cell}. *) - - val check_cell_exn : - ?long:bool -> ?call:'a callback -> - ?step:'a step -> ?handler:'a handler -> - ?rand:Random.State.t -> 'a cell -> unit - (** See {!QCheck2.Test.check_cell_exn}. *) - - val check_exn : ?long:bool -> ?rand:Random.State.t -> t -> unit - (** See {!QCheck2.Test.check_exn}. *) -end - -(** {2 Sub-tests} *) - -(** The infrastructure used to find counter-examples to properties can - also be used to find data satisfying a predicate, - {i within a property being tested}. - - See {:https://github.com/c-cube/qcheck/issues/31} -*) - -exception No_example_found of string - -val find_example : - ?name:string -> - ?count:int -> - f:('a -> bool) -> - 'a Gen.t -> - 'a Gen.t -(** [find_example ~f gen] uses [gen] to generate some values of type ['a], - and checks them against [f]. If such a value is found, it is returned. - Otherwise an exception is raised. - {b NOTE} this should only be used from within a property in {!Test.make}. - @param count number of attempts. - @param name description of the example to find (used in the exception). - @param f the property that the example must satisfy. - @raise No_example_found if no example is found within [count] tries. - @since 0.6 -*) - -val find_example_gen : - ?rand:Random.State.t -> - ?name:string -> - ?count:int -> - f:('a -> bool) -> - 'a Gen.t -> - 'a -(** Toplevel version of {!find_example}. - [find_example_gen ~f arb ~n] is roughly the same as - [Gen.generate1 (find_example ~f arb |> gen)]. - @param rand the random state to use to generate inputs. - @raise No_example_found if no example was found within [count] tries. - @since 0.6 *) - -(** {2 Combinators for arbitrary} *) - -val choose : 'a arbitrary list -> 'a arbitrary -(** Choose among the given list of generators. The list must not - be empty; if it is Invalid_argument is raised. *) - -val unit : unit arbitrary -(** Always generates [()], obviously. *) - -val bool : bool arbitrary -(** Uniform boolean generator. *) - -val float : float arbitrary -(** Generates regular floats (no nan and no infinities). *) -(* FIXME: does not generate nan nor infinity I think. *) - -val pos_float : float arbitrary -(** Positive float generator (no nan and no infinities). *) - -val neg_float : float arbitrary -(** Negative float generator (no nan and no infinities). *) - -val float_bound_inclusive : float -> float arbitrary -(** [float_bound_inclusive n] is uniform between [0] and [n] included. If [bound] is - negative, the result is negative or zero. If [bound] is 0, the result is 0. - @since 0.11 *) - -val float_bound_exclusive : float -> float arbitrary -(** [float_bound_exclusive n] is uniform between [0] included and [n] excluded. - If [bound] is negative, the result is negative or zero. - @raise Invalid_argument if [bound] is zero. - @since 0.11 *) - -val float_range : float -> float -> float arbitrary -(** [float_range low high] is uniform between [low] included and [high] included. - @raise Invalid_argument if [low > high] or if the range is larger than [max_float]. - @since 0.11 *) - -val exponential : float -> float arbitrary -(** [exponential m] generates floating-point numbers following an exponential - distribution with a mean of [m]. - @raise Invalid_argument if [m] is NaN. - @since NEXT_VERSION *) - -val int : int arbitrary -(** Int generator. Uniformly distributed. *) - -val int_bound : int -> int arbitrary -(** [int_bound n] is uniform between [0] and [n] included. *) - -val int_range : int -> int -> int arbitrary -(** [int_range a b] is uniform between [a] and [b] included. [b] must be - larger than [a]. *) - -val small_nat : int arbitrary -(** Small unsigned integers. - @since 0.5.1 *) - -val small_int : int arbitrary -(** Small unsigned integers. See {!Gen.small_int}. - @deprecated use {!small_signed_int}. *) - -val small_signed_int : int arbitrary -(** Small signed integers. - @since 0.5.2 *) - -val (--) : int -> int -> int arbitrary -(** Synonym for {!int_range}. *) - -val int32 : int32 arbitrary -(** Int32 generator. Uniformly distributed. *) - -val int64 : int64 arbitrary -(** Int64 generator. Uniformly distributed. *) - -val pos_int : int arbitrary -(** Positive int generator (0 included). Uniformly distributed. - See {!Gen.pint} *) - -val small_int_corners : unit -> int arbitrary -(** As [small_int], but each newly created generator starts with - a list of corner cases before falling back on random generation. *) - -val neg_int : int arbitrary -(** Negative int generator (0 included, see {!Gen.neg_int}). - The distribution is similar to that of - [small_int], not of [pos_int]. -*) - -val char : char arbitrary -(** Uniformly distributed on all the chars (not just ascii or - valid latin-1). *) - -val printable_char : char arbitrary -(** Uniformly distributed over a subset of printable ascii chars. - Ascii character codes 32 to 126, inclusive - or ['\n'] with code 10. - *) - -val numeral_char : char arbitrary -(** Uniformly distributed over ['0'..'9']. *) - -val bytes_gen_of_size : int Gen.t -> char Gen.t -> bytes arbitrary -(** Builds a bytes generator from a (non-negative) size generator and a character generator. - @since 0.20 *) +val bytes_gen_of_size : int Gen.t -> char Gen.t -> bytes arbitrary +(** Builds a bytes generator from a (non-negative) size generator and a character generator. + @since 0.20 *) val bytes_of : char Gen.t -> bytes arbitrary (** Generates bytes with a distribution of length of {!Gen.nat}. @@ -1427,6 +1161,14 @@ val array : 'a arbitrary -> 'a array arbitrary val array_of_size : int Gen.t -> 'a arbitrary -> 'a array arbitrary (** Generates arrays with length from the given distribution. *) +val option : ?ratio:float -> 'a arbitrary -> 'a option arbitrary +(** Choose between returning Some random value with optional ratio, or None. *) + + +(** {2 Tuples of arbitrary generators} + + These shrink on [gen1], then [gen2], then ... *) + val pair : 'a arbitrary -> 'b arbitrary -> ('a * 'b) arbitrary (** Combines two generators into a generator of pairs. Order of elements can matter (w.r.t shrinking, see {!Shrink.pair}) *) @@ -1439,10 +1181,6 @@ val quad : 'a arbitrary -> 'b arbitrary -> 'c arbitrary -> 'd arbitrary -> ('a * (** Combines four generators into a generator of 4-tuples. Order matters for shrinking, see {!Shrink.pair} and the likes *) -(** {3 Tuple of generators} *) - -(** {4 Shrinks on [gen1], then [gen2], then ... } *) - val tup2 : 'a arbitrary -> 'b arbitrary -> @@ -1534,53 +1272,425 @@ val tup9 : Order of elements can matter (w.r.t shrinking, see {!Shrink.tup2}) Prints as many elements as available printers *) -val option : ?ratio:float -> 'a arbitrary -> 'a option arbitrary -(** Choose between returning Some random value with optional ratio, or None. *) -val fun1_unsafe : 'a arbitrary -> 'b arbitrary -> ('a -> 'b) arbitrary -(** Generator of functions of arity 1. - The functions are always pure and total functions: - - when given the same argument (as decided by Stdlib.(=)), it returns the same value - - it never does side effects, like printing or never raise exceptions etc. - The functions generated are really printable. +(** {2 Combinatoric arbitrary combinators } *) - renamed from {!fun1} since 0.6 +val choose : 'a arbitrary list -> 'a arbitrary +(** Choose among the given list of generators. The list must not + be empty; if it is Invalid_argument is raised. *) - @deprecated use {!fun_} instead. +val oneofl : ?print:'a Print.t -> ?collect:('a -> string) -> + 'a list -> 'a arbitrary +(** Pick an element randomly in the list. *) - @since 0.6 -*) +val oneofa : ?print:'a Print.t -> ?collect:('a -> string) -> + 'a array -> 'a arbitrary +(** Pick an element randomly in the array. *) -val fun2_unsafe : 'a arbitrary -> 'b arbitrary -> 'c arbitrary -> ('a -> 'b -> 'c) arbitrary -(** Generator of functions of arity 2. The remark about [fun1] also apply - here. - renamed from {!fun2} since 0.6 - @deprecated use {!fun_} instead since 0.6 +val oneof : 'a arbitrary list -> 'a arbitrary +(** Pick a generator among the list, randomly. + @deprecated this function is badly specified and will not use shrinkers + appropriately. Consider using {!Gen.oneof} and then {!make} to build + a well behaved arbitrary instance. *) -type _ fun_repr -(** Internal data for functions. A ['f fun_] is a function - of type ['f], fundamentally. *) +val always : ?print:'a Print.t -> 'a -> 'a arbitrary +(** Always return the same element. *) -(** A function packed with the data required to print/shrink it. See {!Fn} - to see how to apply, print, etc. such a function. +val frequency : ?print:'a Print.t -> ?small:('a -> int) -> + ?shrink:'a Shrink.t -> ?collect:('a -> string) -> + (int * 'a arbitrary) list -> 'a arbitrary +(** Similar to {!oneof} but with frequencies. *) - One can also directly pattern match on it to obtain - the executable function. +val frequencyl : ?print:'a Print.t -> ?small:('a -> int) -> + (int * 'a) list -> 'a arbitrary +(** Same as {!oneofl}, but each element is paired with its frequency in + the probability distribution (the higher, the more likely). *) - For example: - {[ - QCheck.Test.make - QCheck.(pair (fun1 Observable.int bool) (small_list int)) +val frequencya : ?print:'a Print.t -> ?small:('a -> int) -> + (int * 'a) array -> 'a arbitrary +(** Same as {!frequencyl}, but with an array. *) + +val map : ?rev:('b -> 'a) -> ('a -> 'b) -> 'a arbitrary -> 'b arbitrary +(** [map f a] returns a new arbitrary instance that generates values using + [a#gen] and then transforms them through [f]. + @param rev if provided, maps values back to type ['a] so that the printer, + shrinker, etc. of [a] can be used. We assume [f] is monotonic in + this case (that is, smaller inputs are transformed into smaller outputs). +*) + +val map_same_type : ('a -> 'a) -> 'a arbitrary -> 'a arbitrary +(** Specialization of [map] when the transformation preserves the type, which + makes shrinker, printer, etc. still relevant. *) + +val map_keep_input : + ?print:'b Print.t -> ?small:('b -> int) -> + ('a -> 'b) -> 'a arbitrary -> ('a * 'b) arbitrary +(** [map_keep_input f a] generates random values from [a], and maps them into + values of type ['b] using the function [f], but it also keeps the + original value. + For shrinking, it is assumed that [f] is monotonic and that smaller input + values will map into smaller values. + @param print optional printer for the [f]'s output. +*) + + +(** {1 Tests} + + A test is a universal property of type [foo -> bool] for some type [foo], + with an object of type [foo arbitrary] used to generate, print, etc. values + of type [foo]. + + The main features of this module are: + - {!Test.make} to build a test, + - {!Test.make_neg} to build a negative test that is expected not to satisfy the tested property, + - {!Test.check_exn} to run a single test with a simple runner. + + A test fails if the property does not hold for a given input. The {{!Test.fail_report} simple} form or the {{!Test.fail_reportf} rich} form) offer more elaborate forms to fail a test. + + For more serious testing, it is recommended to create a testsuite and use a full-fledged runner: + - {!QCheck_base_runner} is a QCheck-only runner (useful if you don't have or don't need another test framework) + - {!QCheck_alcotest} interfaces to the Alcotest framework + - {!QCheck_ounit} interfaces to the to OUnit framework +*) + + +(** {2 Test Results } *) + +module TestResult : sig + (** Module to represent the result of running a test *) + + type 'a counter_ex = 'a QCheck2.TestResult.counter_ex = { + instance: 'a; (** The counter-example(s) *) + + shrink_steps: int; (** How many shrinking steps for this counterex *) + + msg_l: string list; + (** messages. + @since 0.7 *) + } + + type 'a failed_state = 'a counter_ex list + + (** Result state. + changed in 0.10 (move to inline records, add Fail_other) *) + type 'a state = 'a QCheck2.TestResult.state = + | Success + | Failed of { + instances: 'a failed_state; (** Failed instance(s) *) + } + | Failed_other of {msg: string} + | Error of { + instance: 'a counter_ex; + exn: exn; + backtrace: string; + } (** Error, backtrace, and instance that triggered it *) + + (* result returned by running a test *) + type 'a t = 'a QCheck2.TestResult.t + + val get_count : _ t -> int + (** Get the count of a cell. + @since 0.5.3 *) + + val get_count_gen : _ t -> int + + val get_state : 'a t -> 'a state + + val collect : _ t -> (string,int) Hashtbl.t option + (** Obtain statistics + @since 0.6 *) + + val stats : 'a t -> ('a stat * (int,int) Hashtbl.t) list + (** Obtain statistics + @since 0.6 *) + + val warnings : _ t -> string list + (** Obtain list of warnings + @since 0.10 *) + + val is_success : _ t -> bool + (** Returns true iff the state if [Success] + @since 0.9 *) +end + +(** {2 Defining Tests } *) + +(** Module related to individual tests. + @since 0.18 most of it moved to {!QCheck2}, + and the type ['a cell] was made a private implementation detail. +*) +module Test : sig + type res = QCheck2.Test.res = + | Success + | Failure + | FalseAssumption + | Error of exn * string + type 'a event = 'a QCheck2.Test.event = + | Generating + | Collecting of 'a + | Testing of 'a + | Shrunk of int * 'a + | Shrinking of int * int * 'a + + type 'a cell = 'a QCheck2.Test.cell + type 'a handler = 'a QCheck2.Test.handler + type 'a step = 'a QCheck2.Test.step + type 'a callback = 'a QCheck2.Test.callback + + type t = QCheck2.Test.t + + val fail_report : string -> 'a + (** Fail the test with some additional message that will + be reported. + @since 0.7 *) + + val fail_reportf : ('a, Format.formatter, unit, 'b) format4 -> 'a + (** Format version of {!fail_report} + @since 0.7 *) + + val make_cell : + ?if_assumptions_fail:([`Fatal | `Warning] * float) -> + ?count:int -> ?long_factor:int -> ?negative:bool -> ?max_gen:int -> ?max_fail:int -> + ?small:('a -> int) -> ?retries:int -> ?name:string -> + 'a arbitrary -> ('a -> bool) -> 'a cell + (** [make_cell arb prop] builds a test that checks property [prop] on instances + of the generator [arb]. + @param name the name of the test. + @param count number of test cases to run, counting only + the test cases which satisfy preconditions. + @param retries number of times to retry the tested property while shrinking. + @param long_factor the factor by which to multiply count, max_gen and + max_fail when running a long test (default: 1). + @param negative whether the test is expected not to satisfy the tested property. + @param max_gen maximum number of times the generation function + is called in total to replace inputs that do not satisfy + preconditions (should be >= count). + @param max_fail maximum number of failures before we stop generating + inputs. This is useful if shrinking takes too much time. + @param small kept for compatibility reasons; if provided, replaces + the field [arbitrary.small]. + If there is no shrinking function but there is a [small] + function, only the smallest failures will be printed. + @param if_assumptions_fail the minimum + fraction of tests that must satisfy the precondition for a success + to be considered valid. + The fraction should be between 0. and 1. + A warning will be emitted otherwise if + the flag is [`Warning], the test will be a failure if the flag is [`Fatal]. + (since 0.10) + *) + + val get_law : 'a cell -> ('a -> bool) + (** @deprecated use {!QCheck2.Test.get_law} instead *) + val get_name : _ cell -> string + (** @deprecated use {!QCheck2.Test.get_name} instead *) + val set_name : _ cell -> string -> unit + (** @deprecated use {!QCheck2.Test.set_name} instead *) + + val get_count : _ cell -> int + (** Get the count of a cell. + @deprecated use {!QCheck2.Test.get_count} instead + @since 0.5.3 *) + + val get_long_factor : _ cell -> int + (** Get the long factor of a cell. + @deprecated use {!QCheck2.Test.get_long_factor} instead + @since 0.5.3 *) + + val make : + ?if_assumptions_fail:([`Fatal | `Warning] * float) -> + ?count:int -> ?long_factor:int -> ?max_gen:int -> ?max_fail:int -> + ?small:('a -> int) -> ?retries:int -> ?name:string -> 'a arbitrary -> + ('a -> bool) -> t + (** [make arb prop] builds a test that checks property [prop] on instances + of the generator [arb]. + See {!make_cell} for a description of the parameters. + *) + + val make_neg : + ?if_assumptions_fail:([`Fatal | `Warning] * float) -> + ?count:int -> ?long_factor:int -> ?max_gen:int -> ?max_fail:int -> + ?small:('a -> int) -> ?retries:int -> ?name:string -> 'a arbitrary -> + ('a -> bool) -> t + (** [make_neg arb prop] builds a test that checks property [prop] on instances + of the generator [arb]. + The test is considered negative, meaning that it is expected not to satisfy the tested property. + This information is recorded in an underlying test [cell] entry and interpreted suitably by test runners. + See {!make_cell} for a description of the parameters. + *) + + include module type of QCheck2.Test_exceptions + + val print_instance : 'a cell -> 'a -> string + val print_c_ex : 'a cell -> 'a TestResult.counter_ex -> string + val print_fail : 'a cell -> string -> 'a TestResult.counter_ex list -> string + val print_fail_other : string -> msg:string -> string + val print_error : ?st:string -> 'a cell -> string -> 'a TestResult.counter_ex * exn -> string + val print_test_fail : string -> string list -> string + val print_test_error : string -> string -> exn -> string -> string + + val check_cell : + ?long:bool -> ?call:'a callback -> + ?step:'a step -> ?handler:'a handler -> + ?rand:Random.State.t -> 'a cell -> 'a TestResult.t + (** See {!QCheck2.Test.check_cell}. *) + + val check_cell_exn : + ?long:bool -> ?call:'a callback -> + ?step:'a step -> ?handler:'a handler -> + ?rand:Random.State.t -> 'a cell -> unit + (** See {!QCheck2.Test.check_cell_exn}. *) + + val check_exn : ?long:bool -> ?rand:Random.State.t -> t -> unit + (** See {!QCheck2.Test.check_exn}. *) +end + +(** {2 Sub-tests} *) + +(** The infrastructure used to find counter-examples to properties can + also be used to find data satisfying a predicate, + {i within a property being tested}. + + See {:https://github.com/c-cube/qcheck/issues/31} +*) + +exception No_example_found of string + +val find_example : + ?name:string -> + ?count:int -> + f:('a -> bool) -> + 'a Gen.t -> + 'a Gen.t +(** [find_example ~f gen] uses [gen] to generate some values of type ['a], + and checks them against [f]. If such a value is found, it is returned. + Otherwise an exception is raised. + {b NOTE} this should only be used from within a property in {!Test.make}. + @param count number of attempts. + @param name description of the example to find (used in the exception). + @param f the property that the example must satisfy. + @raise No_example_found if no example is found within [count] tries. + @since 0.6 +*) + +val find_example_gen : + ?rand:Random.State.t -> + ?name:string -> + ?count:int -> + f:('a -> bool) -> + 'a Gen.t -> + 'a +(** Toplevel version of {!find_example}. + [find_example_gen ~f arb ~n] is roughly the same as + [Gen.generate1 (find_example ~f arb |> gen)]. + @param rand the random state to use to generate inputs. + @raise No_example_found if no example was found within [count] tries. + @since 0.6 *) + + +(** {1 Generating Functions} + + The [QCheck] module supports generation of pure function values. + The implementation is inspired from {:https://blogs.janestreet.com/quickcheck-for-core/} + and {{:https://dl.acm.org/doi/abs/10.1145/2364506.2364516}Koen Claessen's "Shrinking and Showing Functions"}. + + Generated function arguments are of type {!Observable.t} and function results are of type + {{!section:arbitrary}[arbitrary]}. + + Underneath the hood, generated function values have a table-based representation. + They therefore need to be applied in a special way, e.g., with {!Fn.apply}. +*) + +(** {2 Observing arguments} *) + +module Observable : sig + (** Observables are usable as arguments for random functions. + The random function will observe its arguments in a way + that is determined from the observable instance. + + @since 0.6 + *) + + (** An observable for ['a], packing a printer and other things. *) + type -'a t + + val equal : 'a t -> 'a -> 'a -> bool + val hash : 'a t -> 'a -> int + val print : 'a t -> 'a Print.t + + val unit : unit t + val bool : bool t + val int : int t + val float : float t + val string : string t + val bytes : bytes t (** @since 0.20 *) + val char : char t + + val make : + ?eq:('a -> 'a -> bool) -> + ?hash:('a -> int) -> + 'a Print.t -> + 'a t + + val map : ('a -> 'b) -> 'b t -> 'a t + + val option : 'a t -> 'a option t + val list : 'a t -> 'a list t + val array : 'a t -> 'a array t + + val pair : 'a t -> 'b t -> ('a * 'b) t + val triple : 'a t -> 'b t -> 'c t -> ('a * 'b * 'c) t + val quad : 'a t -> 'b t -> 'c t -> 'd t -> ('a * 'b * 'c * 'd) t +end + +(** {2 Deprecated function generator combinators } *) + +val fun1_unsafe : 'a arbitrary -> 'b arbitrary -> ('a -> 'b) arbitrary +(** Generator of functions of arity 1. + The functions are always pure and total functions: + - when given the same argument (as decided by Stdlib.(=)), it returns the same value + - it never does side effects, like printing or never raise exceptions etc. + The functions generated are really printable. + + renamed from {!fun1} since 0.6 + + @deprecated use {!fun_} instead. + + @since 0.6 +*) + +val fun2_unsafe : 'a arbitrary -> 'b arbitrary -> 'c arbitrary -> ('a -> 'b -> 'c) arbitrary +(** Generator of functions of arity 2. The remark about [fun1] also apply + here. + renamed from {!fun2} since 0.6 + @deprecated use {!fun_} instead since 0.6 +*) + +type _ fun_repr +(** Internal data for functions. A ['f fun_] is a function + of type ['f], fundamentally. *) + +(** A function packed with the data required to print/shrink it. See {!Fn} + to see how to apply, print, etc. such a function. + + One can also directly pattern match on it to obtain + the executable function. + + For example: + {[ + QCheck.Test.make + QCheck.(pair (fun1 Observable.int bool) (small_list int)) (fun (Fun (_,f), l) -> l=(List.rev_map f l |> List.rev l)) ]} *) type _ fun_ = | Fun : 'f fun_repr * 'f -> 'f fun_ -(** Utils on functions - @since 0.6 *) module Fn : sig + (** A utility module of helpers for printing, shrinking, and applying generated function values. + @since 0.6 *) + type 'a t = 'a fun_ val print : _ t Print.t @@ -1589,6 +1699,9 @@ module Fn : sig val apply : 'f t -> 'f end + +(** {2 Defining function generators } *) + val fun1 : 'a Observable.t -> 'b arbitrary -> ('a -> 'b) fun_ arbitrary (** [fun1 o ret] makes random functions that take an argument observable via [o] and map to random values generated from [ret]. @@ -1597,6 +1710,38 @@ val fun1 : 'a Observable.t -> 'b arbitrary -> ('a -> 'b) fun_ arbitrary (shrinking will be faster). @since 0.6 *) +val fun2 : + 'a Observable.t -> + 'b Observable.t -> + 'c arbitrary -> + ('a -> 'b -> 'c) fun_ arbitrary +(** @since 0.6 *) + +val fun3 : + 'a Observable.t -> + 'b Observable.t -> + 'c Observable.t -> + 'd arbitrary -> + ('a -> 'b -> 'c -> 'd) fun_ arbitrary +(** @since 0.6 *) + +val fun4 : + 'a Observable.t -> + 'b Observable.t -> + 'c Observable.t -> + 'd Observable.t -> + 'e arbitrary -> + ('a -> 'b -> 'c -> 'd -> 'e) fun_ arbitrary +(** @since 0.6 *) + + +(** {2 Tuples of observables } + + To circumvent the arity boundaries of {!fun1}, ..., {!fun4}, one can instead + define uncurried functions, instead accepting a tuple argument. A resulting + function then needs to be applied with {!fun_nary}. +*) + module Tuple : sig (** Heterogeneous tuple, used to pass any number of arguments to a function. *) @@ -1634,82 +1779,3 @@ val fun_nary : 'a Tuple.obs -> 'b arbitrary -> ('a Tuple.t -> 'b) fun_ arbitrary fun_nary Tuple.(O.int @-> O.float @-> O.string @-> o_nil) bool) ]} @since 0.6 *) - -val fun2 : - 'a Observable.t -> - 'b Observable.t -> - 'c arbitrary -> - ('a -> 'b -> 'c) fun_ arbitrary -(** @since 0.6 *) - -val fun3 : - 'a Observable.t -> - 'b Observable.t -> - 'c Observable.t -> - 'd arbitrary -> - ('a -> 'b -> 'c -> 'd) fun_ arbitrary -(** @since 0.6 *) - -val fun4 : - 'a Observable.t -> - 'b Observable.t -> - 'c Observable.t -> - 'd Observable.t -> - 'e arbitrary -> - ('a -> 'b -> 'c -> 'd -> 'e) fun_ arbitrary -(** @since 0.6 *) - -val oneofl : ?print:'a Print.t -> ?collect:('a -> string) -> - 'a list -> 'a arbitrary -(** Pick an element randomly in the list. *) - -val oneofa : ?print:'a Print.t -> ?collect:('a -> string) -> - 'a array -> 'a arbitrary -(** Pick an element randomly in the array. *) - -val oneof : 'a arbitrary list -> 'a arbitrary -(** Pick a generator among the list, randomly. - @deprecated this function is badly specified and will not use shrinkers - appropriately. Consider using {!Gen.oneof} and then {!make} to build - a well behaved arbitrary instance. -*) - -val always : ?print:'a Print.t -> 'a -> 'a arbitrary -(** Always return the same element. *) - -val frequency : ?print:'a Print.t -> ?small:('a -> int) -> - ?shrink:'a Shrink.t -> ?collect:('a -> string) -> - (int * 'a arbitrary) list -> 'a arbitrary -(** Similar to {!oneof} but with frequencies. *) - -val frequencyl : ?print:'a Print.t -> ?small:('a -> int) -> - (int * 'a) list -> 'a arbitrary -(** Same as {!oneofl}, but each element is paired with its frequency in - the probability distribution (the higher, the more likely). *) - -val frequencya : ?print:'a Print.t -> ?small:('a -> int) -> - (int * 'a) array -> 'a arbitrary -(** Same as {!frequencyl}, but with an array. *) - -val map : ?rev:('b -> 'a) -> ('a -> 'b) -> 'a arbitrary -> 'b arbitrary -(** [map f a] returns a new arbitrary instance that generates values using - [a#gen] and then transforms them through [f]. - @param rev if provided, maps values back to type ['a] so that the printer, - shrinker, etc. of [a] can be used. We assume [f] is monotonic in - this case (that is, smaller inputs are transformed into smaller outputs). -*) - -val map_same_type : ('a -> 'a) -> 'a arbitrary -> 'a arbitrary -(** Specialization of [map] when the transformation preserves the type, which - makes shrinker, printer, etc. still relevant. *) - -val map_keep_input : - ?print:'b Print.t -> ?small:('b -> int) -> - ('a -> 'b) -> 'a arbitrary -> ('a * 'b) arbitrary -(** [map_keep_input f a] generates random values from [a], and maps them into - values of type ['b] using the function [f], but it also keeps the - original value. - For shrinking, it is assumed that [f] is monotonic and that smaller input - values will map into smaller values. - @param print optional printer for the [f]'s output. -*) From 051a8dde6c6944e6eef81042bd51f8ddd3bc6ba8 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 10 Dec 2024 11:02:35 +0100 Subject: [PATCH 222/391] Remove unmatched paren in Tuple example --- src/core/QCheck.mli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index fc3d8b25..79e8cf29 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -1776,6 +1776,6 @@ val fun_nary : 'a Tuple.obs -> 'b arbitrary -> ('a Tuple.t -> 'b) fun_ arbitrary Example: {[ let module O = Observable in - fun_nary Tuple.(O.int @-> O.float @-> O.string @-> o_nil) bool) + fun_nary Tuple.(O.int @-> O.float @-> O.string @-> o_nil) bool ]} @since 0.6 *) From 2f5e605b2846977bf5e122950f490c90ded900d3 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 10 Dec 2024 11:07:36 +0100 Subject: [PATCH 223/391] Address warnings in QCheck.mli --- src/core/QCheck.mli | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 79e8cf29..7942b8b0 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -634,7 +634,8 @@ module Print : sig (** Printer for values of type ['a]. *) - val unit : unit t (** @since 0.6 *) + val unit : unit t + (** @since 0.6 *) val int : int t (** Integer printer. *) @@ -644,7 +645,9 @@ module Print : sig val char : char t (** Character printer. *) - val bytes : bytes t (** Bytes printer. @since 0.20 *) + val bytes : bytes t + (** Bytes printer. + @since 0.20 *) val string : string t (** String printer. *) @@ -1417,8 +1420,8 @@ end (** {2 Defining Tests } *) (** Module related to individual tests. - @since 0.18 most of it moved to {!QCheck2}, - and the type ['a cell] was made a private implementation detail. + Since 0.18 most of it moved to {!QCheck2}, + and the type ['a cell] was made a private implementation detail. *) module Test : sig type res = QCheck2.Test.res = From 4b952125b929642137539beade6b18a3004d2110 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 10 Dec 2024 12:03:03 +0100 Subject: [PATCH 224/391] Documentation pass over QCheck2.mli --- src/core/QCheck2.mli | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index e686823e..095a8e4b 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -93,6 +93,21 @@ content will appear. *) @since 0.18 *) +(** {1 Generators, printers, and shrinkers in QCheck2 } + +The {!Gen} module offers combinators to build compositive generators for complex +data types. + +To print counter-examples, {!Test.make} accepts a [print] function, turning a +test-case into a [string] for printing on the console. The {!Print} module +offers combinators to build such printers. + +The {!Tree} module defines the lazy tree type underlying integrated shrinking. + +The {!Shrink} module contains utility functions for defining shrinkers. +*) + + (** A tree represents a generated value and its successive shrunk values. *) module Tree : sig (** Conceptually a pseudo-randomly generated value is packaged with its shrunk values. @@ -1256,6 +1271,19 @@ module Shrink : sig end +(** {1 Generating Functions} + + The [QCheck2] module supports generation of pure function values. + The implementation is inspired from {:https://blogs.janestreet.com/quickcheck-for-core/} + and {{:https://dl.acm.org/doi/abs/10.1145/2364506.2364516}Koen Claessen's "Shrinking and Showing Functions"}. + + Generated function arguments are of type {!Observable.t} and function results are of type + {!Gen.t}. + + Underneath the hood, generated function values have a table-based representation. + They therefore need to be applied in a special way, e.g., with {!Fn.apply}. +*) + (** An observable is a random function {i argument}. *) module Observable : sig (** @@ -1481,9 +1509,10 @@ val fun_nary : 'a Tuple.obs -> ?print:('b Print.t) -> 'b Gen.t -> ('a Tuple.t -> @since 0.6 *) -(** Utils on generated functions. - @since 0.6 *) module Fn : sig + (** A utility module of helpers for printing, shrinking, and applying generated function values. + @since 0.6 *) + val print : 'f fun_ Print.t (** [print f] prints the implementation of generated function [f]. @@ -1498,7 +1527,7 @@ module Fn : sig end -(** {2 Assumptions} *) +(** {1 Assumptions} *) val assume : bool -> unit (** [assume cond] checks the precondition [cond], and does nothing From 908173db6956e051a29ebd74b54a5c9c22beb428 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 10 Dec 2024 12:07:02 +0100 Subject: [PATCH 225/391] Add a documentation frontpage, briefly describing QCheck and QCheck2 --- Makefile | 2 +- doc/dune | 3 +++ doc/index.mld | 31 +++++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 doc/dune create mode 100644 doc/index.mld diff --git a/Makefile b/Makefile index aed037c1..a80c1aed 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ clean: @dune clean doc: - @dune build @doc + @dune build @doc doc/ example-test: @dune exec example/ounit/QCheck_test.exe diff --git a/doc/dune b/doc/dune new file mode 100644 index 00000000..d43522ad --- /dev/null +++ b/doc/dune @@ -0,0 +1,3 @@ +(documentation + (package qcheck-core) + (mld_files index)) diff --git a/doc/index.mld b/doc/index.mld new file mode 100644 index 00000000..5d9eea71 --- /dev/null +++ b/doc/index.mld @@ -0,0 +1,31 @@ +{0 qcheck-core} + +The [qcheck-core] opam package contains two libraries: + +- The [qcheck-core] library for defining property-based tests +- The [qcheck-core.runner] library for running property-based tests + +{1: The [qcheck-core] library} + +The [qcheck-core] library exposes two toplevel modules: + +- {!QCheck} is the initial property-based-testing module and +- {!QCheck2} is a newer property-based-testing module supporting integrated shrinking + +Of the two, {!QCheck} is the most battle-tested module. +{!QCheck2} on the other hand offers integrated shrinking, thus +removing the need for having to hand-write shrinkers. + +{!QCheck} tests can be ported to {!QCheck2} by following the +{{!QCheck2.migration_qcheck2}migration guide}. Please +file an issue if you encounter problems using either of the two +modules. + +{1: The [qcheck-core.runner] library} + +The entry point of the [qcheck-core.runner] library is the {!QCheck_base_runner} module. + +One can run a list of property-based tests by calling either + +- {!QCheck_base_runner.run_tests}, which accepts a number of optional arguments, or +- {!QCheck_base_runner.run_tests_main}, which can be controlled via command-line arguments From da09a2a02c9f9748510c9b6c46b3fae8d506625e Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 10 Dec 2024 12:21:16 +0100 Subject: [PATCH 226/391] Add a CHANGELOG entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb23e9cb..8d4d2e08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## NEXT RELEASE +- Clean-up `QCheck` and `QCheck2` documentation pages - Add `exponential` generator to `QCheck`, `QCheck.Gen`, and `QCheck2.Gen` - Add `Shrink.bool` and use it in `QCheck.bool` - Remove unread `fun_gen` field from `QCheck2`'s `fun_repr_tbl` type From ed38cbc88a7243fce985228290bb63360ffe3c03 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 6 Dec 2024 12:11:04 +0100 Subject: [PATCH 227/391] Quote and escape strings and chars in QCheck.Print module --- src/core/QCheck.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index cd29f021..d67de147 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -481,8 +481,8 @@ module Print = struct let bool = string_of_bool let float = string_of_float let bytes = Bytes.to_string - let string s = s - let char c = String.make 1 c + let string s = Printf.sprintf "%S" s + let char c = Printf.sprintf "%C" c let option f = function | None -> "None" From 41dea263b212ffeb2c29582f019166750e709cef Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 6 Dec 2024 12:19:21 +0100 Subject: [PATCH 228/391] Switch to using Print-module combinators --- src/core/QCheck.ml | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index d67de147..bc12418c 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -7,7 +7,6 @@ all rights reserved. (** {1 Quickcheck inspired property-based testing} *) let poly_compare=compare -open Printf module RS = struct (* Poor man's splitter for version < 5.0 *) @@ -1097,17 +1096,17 @@ let unit : unit arbitrary = make ~small:small1 ~shrink:Shrink.nil ~print:Print.unit Gen.unit let bool = make ~small:small1 ~shrink:Shrink.bool ~print:Print.bool Gen.bool -let float = make_scalar ~print:string_of_float Gen.float -let pos_float = make_scalar ~print:string_of_float Gen.pfloat -let neg_float = make_scalar ~print:string_of_float Gen.nfloat +let float = make_scalar ~print:Print.float Gen.float +let pos_float = make_scalar ~print:Print.float Gen.pfloat +let neg_float = make_scalar ~print:Print.float Gen.nfloat let float_bound_inclusive bound = - make_scalar ~print:string_of_float (Gen.float_bound_inclusive bound) + make_scalar ~print:Print.float (Gen.float_bound_inclusive bound) let float_bound_exclusive bound = - make_scalar ~print:string_of_float (Gen.float_bound_exclusive bound) + make_scalar ~print:Print.float (Gen.float_bound_exclusive bound) -let float_range low high = make_scalar ~print:string_of_float (Gen.float_range low high) +let float_range low high = make_scalar ~print:Print.float (Gen.float_range low high) let exponential mean = make_scalar ~print:Print.float (Gen.exponential mean) @@ -1132,18 +1131,18 @@ let int64 = let small_char target c = abs ((Char.code c) - (Char.code target)) let char = - make ~print:(sprintf "%C") ~small:(small_char 'a') ~shrink:Shrink.char Gen.char + make ~print:Print.char ~small:(small_char 'a') ~shrink:Shrink.char Gen.char let printable_char = - make ~print:(sprintf "%C") ~small:(small_char 'a') ~shrink:Shrink.char_printable Gen.printable + make ~print:Print.char ~small:(small_char 'a') ~shrink:Shrink.char_printable Gen.printable let numeral_char = - make ~print:(sprintf "%C") ~small:(small_char '0') ~shrink:Shrink.char_numeral Gen.numeral + make ~print:Print.char ~small:(small_char '0') ~shrink:Shrink.char_numeral Gen.numeral let bytes_gen_of_size size gen = make ~shrink:Shrink.bytes ~small:Bytes.length - ~print:(Print.bytes) (Gen.bytes_size ~gen size) + ~print:Print.bytes (Gen.bytes_size ~gen size) let bytes_of gen = make ~shrink:Shrink.bytes ~small:Bytes.length - ~print:(Print.bytes) (Gen.bytes ~gen) + ~print:Print.bytes (Gen.bytes ~gen) let bytes = bytes_of Gen.char let bytes_of_size size = bytes_gen_of_size size Gen.char @@ -1151,14 +1150,14 @@ let bytes_small = bytes_gen_of_size Gen.small_nat Gen.char let bytes_small_of gen = bytes_gen_of_size Gen.small_nat gen let bytes_printable = make ~shrink:(Shrink.bytes ~shrink:Shrink.char_printable) ~small:Bytes.length - ~print:(Print.bytes) (Gen.bytes ~gen:Gen.printable) + ~print:Print.bytes (Gen.bytes ~gen:Gen.printable) let string_gen_of_size size gen = make ~shrink:Shrink.string ~small:String.length - ~print:(sprintf "%S") (Gen.string_size ~gen size) + ~print:Print.string (Gen.string_size ~gen size) let string_of gen = make ~shrink:Shrink.string ~small:String.length - ~print:(sprintf "%S") (Gen.string ~gen) + ~print:Print.string (Gen.string ~gen) let string = string_of Gen.char let string_of_size size = string_gen_of_size size Gen.char @@ -1169,23 +1168,23 @@ let string_gen = string_of let printable_string = make ~shrink:(Shrink.string ~shrink:Shrink.char_printable) ~small:String.length - ~print:(sprintf "%S") (Gen.string ~gen:Gen.printable) + ~print:Print.string (Gen.string ~gen:Gen.printable) let printable_string_of_size size = make ~shrink:(Shrink.string ~shrink:Shrink.char_printable) ~small:String.length - ~print:(sprintf "%S") (Gen.string_size ~gen:Gen.printable size) + ~print:Print.string (Gen.string_size ~gen:Gen.printable size) let small_printable_string = make ~shrink:(Shrink.string ~shrink:Shrink.char_printable) ~small:String.length - ~print:(sprintf "%S") (Gen.string_size ~gen:Gen.printable Gen.small_nat) + ~print:Print.string (Gen.string_size ~gen:Gen.printable Gen.small_nat) let numeral_string = make ~shrink:(Shrink.string ~shrink:Shrink.char_numeral) ~small:String.length - ~print:(sprintf "%S") (Gen.string ~gen:Gen.numeral) + ~print:Print.string (Gen.string ~gen:Gen.numeral) let numeral_string_of_size size = make ~shrink:(Shrink.string ~shrink:Shrink.char_numeral) ~small:String.length - ~print:(sprintf "%S") (Gen.string_size ~gen:Gen.numeral size) + ~print:Print.string (Gen.string_size ~gen:Gen.numeral size) let string_printable = printable_string let string_printable_of_size = printable_string_of_size From 1e22eb617ec3c90e02fcd1d9580c609160b4f15e Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 6 Dec 2024 12:23:21 +0100 Subject: [PATCH 229/391] Update expect test outputs for example/QCheck_runner_test.ml --- example/QCheck_runner_test.expected.ocaml4.32 | 2 +- example/QCheck_runner_test.expected.ocaml4.64 | 2 +- example/QCheck_runner_test.expected.ocaml5.32 | 2 +- example/QCheck_runner_test.expected.ocaml5.64 | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/example/QCheck_runner_test.expected.ocaml4.32 b/example/QCheck_runner_test.expected.ocaml4.32 index 6f2af91b..0430ef85 100644 --- a/example/QCheck_runner_test.expected.ocaml4.32 +++ b/example/QCheck_runner_test.expected.ocaml4.32 @@ -82,7 +82,7 @@ Test FAIL_pred_map_commute failed (48 shrink steps): Test FAIL_fun2_pred_strings failed (2 shrink steps): -{some random string -> true; _ -> false} +{"some random string" -> true; _ -> false} --- Failure -------------------------------------------------------------------- diff --git a/example/QCheck_runner_test.expected.ocaml4.64 b/example/QCheck_runner_test.expected.ocaml4.64 index 6a0526f2..e3a1573d 100644 --- a/example/QCheck_runner_test.expected.ocaml4.64 +++ b/example/QCheck_runner_test.expected.ocaml4.64 @@ -82,7 +82,7 @@ Test FAIL_pred_map_commute failed (77 shrink steps): Test FAIL_fun2_pred_strings failed (2 shrink steps): -{some random string -> true; _ -> false} +{"some random string" -> true; _ -> false} --- Failure -------------------------------------------------------------------- diff --git a/example/QCheck_runner_test.expected.ocaml5.32 b/example/QCheck_runner_test.expected.ocaml5.32 index 96d62981..4b1b17c4 100644 --- a/example/QCheck_runner_test.expected.ocaml5.32 +++ b/example/QCheck_runner_test.expected.ocaml5.32 @@ -82,7 +82,7 @@ Test FAIL_pred_map_commute failed (47 shrink steps): Test FAIL_fun2_pred_strings failed (2 shrink steps): -{some random string -> true; _ -> false} +{"some random string" -> true; _ -> false} --- Failure -------------------------------------------------------------------- diff --git a/example/QCheck_runner_test.expected.ocaml5.64 b/example/QCheck_runner_test.expected.ocaml5.64 index 18e321d3..1810c2bd 100644 --- a/example/QCheck_runner_test.expected.ocaml5.64 +++ b/example/QCheck_runner_test.expected.ocaml5.64 @@ -82,7 +82,7 @@ Test FAIL_pred_map_commute failed (89 shrink steps): Test FAIL_fun2_pred_strings failed (2 shrink steps): -{some random string -> true; _ -> false} +{"some random string" -> true; _ -> false} --- Failure -------------------------------------------------------------------- From 892c173878d4e731b47cf8bcf77fb8017611c17b Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 6 Dec 2024 13:08:36 +0100 Subject: [PATCH 230/391] Update expect test outputs for test/core/QCheck_expect_test.ml --- test/core/QCheck_expect_test.expected.ocaml4.32 | 2 +- test/core/QCheck_expect_test.expected.ocaml4.64 | 2 +- test/core/QCheck_expect_test.expected.ocaml5.32 | 4 ++-- test/core/QCheck_expect_test.expected.ocaml5.64 | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/core/QCheck_expect_test.expected.ocaml4.32 b/test/core/QCheck_expect_test.expected.ocaml4.32 index 7aa93ab2..73d69535 100644 --- a/test/core/QCheck_expect_test.expected.ocaml4.32 +++ b/test/core/QCheck_expect_test.expected.ocaml4.32 @@ -511,7 +511,7 @@ Test fail_pred_map_commute failed (48 shrink steps): Test fail_pred_strings failed (2 shrink steps): -{some random string -> true; _ -> false} +{"some random string" -> true; _ -> false} --- Failure -------------------------------------------------------------------- diff --git a/test/core/QCheck_expect_test.expected.ocaml4.64 b/test/core/QCheck_expect_test.expected.ocaml4.64 index 3cd4711e..a6425348 100644 --- a/test/core/QCheck_expect_test.expected.ocaml4.64 +++ b/test/core/QCheck_expect_test.expected.ocaml4.64 @@ -543,7 +543,7 @@ Test fail_pred_map_commute failed (77 shrink steps): Test fail_pred_strings failed (2 shrink steps): -{some random string -> true; _ -> false} +{"some random string" -> true; _ -> false} --- Failure -------------------------------------------------------------------- diff --git a/test/core/QCheck_expect_test.expected.ocaml5.32 b/test/core/QCheck_expect_test.expected.ocaml5.32 index 915f39c7..3f3bf3b9 100644 --- a/test/core/QCheck_expect_test.expected.ocaml5.32 +++ b/test/core/QCheck_expect_test.expected.ocaml5.32 @@ -521,7 +521,7 @@ Test fail_pred_map_commute failed (47 shrink steps): Test fail_pred_strings failed (2 shrink steps): -{some random string -> true; _ -> false} +{"some random string" -> true; _ -> false} --- Failure -------------------------------------------------------------------- @@ -552,7 +552,7 @@ Test fold_left fold_right uncurried fun last failed (25 shrink steps): Test fold_left test, fun first failed (66 shrink steps): -({(, 2) -> "a"; _ -> ""}, "", [], [2]) +({("", 2) -> "a"; _ -> ""}, "", [], [2]) --- Failure -------------------------------------------------------------------- diff --git a/test/core/QCheck_expect_test.expected.ocaml5.64 b/test/core/QCheck_expect_test.expected.ocaml5.64 index 9c26971c..4e290c65 100644 --- a/test/core/QCheck_expect_test.expected.ocaml5.64 +++ b/test/core/QCheck_expect_test.expected.ocaml5.64 @@ -553,7 +553,7 @@ Test fail_pred_map_commute failed (89 shrink steps): Test fail_pred_strings failed (2 shrink steps): -{some random string -> true; _ -> false} +{"some random string" -> true; _ -> false} --- Failure -------------------------------------------------------------------- @@ -584,7 +584,7 @@ Test fold_left fold_right uncurried fun last failed (25 shrink steps): Test fold_left test, fun first failed (66 shrink steps): -({(, 2) -> "a"; _ -> ""}, "", [], [2]) +({("", 2) -> "a"; _ -> ""}, "", [], [2]) --- Failure -------------------------------------------------------------------- From 00dcb1f4c24e49925a2b6aacfacefb7ce07d50a4 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 6 Dec 2024 12:26:34 +0100 Subject: [PATCH 231/391] Add a CHANGELOG entry --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d4d2e08..734aae97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## NEXT RELEASE +- Quote and escape in `Print.string` and `Print.char` in the `QCheck` module, + mirroring the `QCheck2.Print` module's behaviour - Clean-up `QCheck` and `QCheck2` documentation pages - Add `exponential` generator to `QCheck`, `QCheck.Gen`, and `QCheck2.Gen` - Add `Shrink.bool` and use it in `QCheck.bool` From 7ca06f5ed8bf279d953a4a5991ec05935a1a3d13 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Sat, 7 Dec 2024 14:35:10 +0100 Subject: [PATCH 232/391] Quote and escape bytes in QCheck{,2}.Print too --- src/core/QCheck.ml | 2 +- src/core/QCheck2.ml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index bc12418c..2b0e11d2 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -479,8 +479,8 @@ module Print = struct let int = string_of_int let bool = string_of_bool let float = string_of_float - let bytes = Bytes.to_string let string s = Printf.sprintf "%S" s + let bytes b = string (Bytes.to_string b) let char c = Printf.sprintf "%C" c let option f = function diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index b4e8560b..0c821a00 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -797,10 +797,10 @@ module Print = struct let float = string_of_float - let bytes = Bytes.to_string - let string s = Printf.sprintf "%S" s + let bytes b = string (Bytes.to_string b) + let char c = Printf.sprintf "%C" c let option f = function From 6decca762436bb04aceacc31253e551f478f29c8 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Sat, 7 Dec 2024 14:48:38 +0100 Subject: [PATCH 233/391] Update expected bytes output for test/core/QCheck_expect_test.ml --- test/core/QCheck_expect_test.expected.ocaml4.32 | 8 ++++---- test/core/QCheck_expect_test.expected.ocaml4.64 | 8 ++++---- test/core/QCheck_expect_test.expected.ocaml5.32 | 8 ++++---- test/core/QCheck_expect_test.expected.ocaml5.64 | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/test/core/QCheck_expect_test.expected.ocaml4.32 b/test/core/QCheck_expect_test.expected.ocaml4.32 index 73d69535..e5217c99 100644 --- a/test/core/QCheck_expect_test.expected.ocaml4.32 +++ b/test/core/QCheck_expect_test.expected.ocaml4.32 @@ -253,25 +253,25 @@ Test printable never produces less than '5 failed (3 shrink steps): Test bytes are empty failed (15 shrink steps): -a +"a" --- Failure -------------------------------------------------------------------- Test bytes never has a \000 char failed (8 shrink steps): -� +"\000" --- Failure -------------------------------------------------------------------- Test bytes never has a \255 char failed (14 shrink steps): -� +"\255" --- Failure -------------------------------------------------------------------- Test bytes have unique chars failed (13 shrink steps): -�� +"\129\129" --- Failure -------------------------------------------------------------------- diff --git a/test/core/QCheck_expect_test.expected.ocaml4.64 b/test/core/QCheck_expect_test.expected.ocaml4.64 index a6425348..c026b98a 100644 --- a/test/core/QCheck_expect_test.expected.ocaml4.64 +++ b/test/core/QCheck_expect_test.expected.ocaml4.64 @@ -285,25 +285,25 @@ Test printable never produces less than '5 failed (3 shrink steps): Test bytes are empty failed (15 shrink steps): -a +"a" --- Failure -------------------------------------------------------------------- Test bytes never has a \000 char failed (8 shrink steps): -� +"\000" --- Failure -------------------------------------------------------------------- Test bytes never has a \255 char failed (14 shrink steps): -� +"\255" --- Failure -------------------------------------------------------------------- Test bytes have unique chars failed (13 shrink steps): -�� +"\129\129" --- Failure -------------------------------------------------------------------- diff --git a/test/core/QCheck_expect_test.expected.ocaml5.32 b/test/core/QCheck_expect_test.expected.ocaml5.32 index 3f3bf3b9..19929927 100644 --- a/test/core/QCheck_expect_test.expected.ocaml5.32 +++ b/test/core/QCheck_expect_test.expected.ocaml5.32 @@ -263,25 +263,25 @@ Test printable never produces less than '5 failed (0 shrink steps): Test bytes are empty failed (13 shrink steps): -a +"a" --- Failure -------------------------------------------------------------------- Test bytes never has a \000 char failed (13 shrink steps): -� +"\000" --- Failure -------------------------------------------------------------------- Test bytes never has a \255 char failed (15 shrink steps): -� +"\255" --- Failure -------------------------------------------------------------------- Test bytes have unique chars failed (14 shrink steps): -�� +"\232\232" --- Failure -------------------------------------------------------------------- diff --git a/test/core/QCheck_expect_test.expected.ocaml5.64 b/test/core/QCheck_expect_test.expected.ocaml5.64 index 4e290c65..c7636b1d 100644 --- a/test/core/QCheck_expect_test.expected.ocaml5.64 +++ b/test/core/QCheck_expect_test.expected.ocaml5.64 @@ -295,25 +295,25 @@ Test printable never produces less than '5 failed (0 shrink steps): Test bytes are empty failed (13 shrink steps): -a +"a" --- Failure -------------------------------------------------------------------- Test bytes never has a \000 char failed (13 shrink steps): -� +"\000" --- Failure -------------------------------------------------------------------- Test bytes never has a \255 char failed (15 shrink steps): -� +"\255" --- Failure -------------------------------------------------------------------- Test bytes have unique chars failed (14 shrink steps): -�� +"\232\232" --- Failure -------------------------------------------------------------------- From 48ac3ed4fe3ff18b7a553932ff72b5f493c0ae38 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Sat, 7 Dec 2024 14:49:59 +0100 Subject: [PATCH 234/391] Update expected bytes output for test/core/QCheck2_expect_test.ml --- test/core/QCheck2_expect_test.expected.ocaml4.32 | 8 ++++---- test/core/QCheck2_expect_test.expected.ocaml4.64 | 8 ++++---- test/core/QCheck2_expect_test.expected.ocaml5.32 | 8 ++++---- test/core/QCheck2_expect_test.expected.ocaml5.64 | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.32 b/test/core/QCheck2_expect_test.expected.ocaml4.32 index e25a26ec..5054a74c 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.32 @@ -284,25 +284,25 @@ Test printable never produces less than '5 failed (1 shrink steps): Test bytes are empty failed (8 shrink steps): -a +"a" --- Failure -------------------------------------------------------------------- Test bytes never has a \000 char failed (22 shrink steps): -aaaaaa�aaaaaaaaaaaaaaaa +"aaaaaa\000aaaaaaaaaaaaaaaa" --- Failure -------------------------------------------------------------------- Test bytes never has a \255 char failed (59 shrink steps): -aaaaaaaaaaaaaaaaaaaaaaaaaa�aaaaaaaaaaaaaaaaaaaaaaaa +"aaaaaaaaaaaaaaaaaaaaaaaaaa\255aaaaaaaaaaaaaaaaaaaaaaaa" --- Failure -------------------------------------------------------------------- Test bytes have unique chars failed (18 shrink steps): -aaaaaaaaaaaaa +"aaaaaaaaaaaaa" --- Failure -------------------------------------------------------------------- diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.64 b/test/core/QCheck2_expect_test.expected.ocaml4.64 index 9f2b7dfe..c04aa400 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.64 @@ -348,25 +348,25 @@ Test printable never produces less than '5 failed (1 shrink steps): Test bytes are empty failed (8 shrink steps): -a +"a" --- Failure -------------------------------------------------------------------- Test bytes never has a \000 char failed (22 shrink steps): -aaaaaa�aaaaaaaaaaaaaaaa +"aaaaaa\000aaaaaaaaaaaaaaaa" --- Failure -------------------------------------------------------------------- Test bytes never has a \255 char failed (59 shrink steps): -aaaaaaaaaaaaaaaaaaaaaaaaaa�aaaaaaaaaaaaaaaaaaaaaaaa +"aaaaaaaaaaaaaaaaaaaaaaaaaa\255aaaaaaaaaaaaaaaaaaaaaaaa" --- Failure -------------------------------------------------------------------- Test bytes have unique chars failed (18 shrink steps): -aaaaaaaaaaaaa +"aaaaaaaaaaaaa" --- Failure -------------------------------------------------------------------- diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.32 b/test/core/QCheck2_expect_test.expected.ocaml5.32 index b560f542..81879c1a 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.32 @@ -284,25 +284,25 @@ Test printable never produces less than '5 failed (0 shrink steps): Test bytes are empty failed (9 shrink steps): -a +"a" --- Failure -------------------------------------------------------------------- Test bytes never has a \000 char failed (55 shrink steps): -aaaaaaaaaaaaaaa�aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +"aaaaaaaaaaaaaaa\000aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" --- Failure -------------------------------------------------------------------- Test bytes never has a \255 char failed (75 shrink steps): -aaaaaaa�aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +"aaaaaaa\255aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" --- Failure -------------------------------------------------------------------- Test bytes have unique chars failed (14 shrink steps): -aaaaaaa +"aaaaaaa" --- Failure -------------------------------------------------------------------- diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.64 b/test/core/QCheck2_expect_test.expected.ocaml5.64 index 7b24307d..7126ca47 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.64 @@ -340,25 +340,25 @@ Test printable never produces less than '5 failed (0 shrink steps): Test bytes are empty failed (9 shrink steps): -a +"a" --- Failure -------------------------------------------------------------------- Test bytes never has a \000 char failed (55 shrink steps): -aaaaaaaaaaaaaaa�aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +"aaaaaaaaaaaaaaa\000aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" --- Failure -------------------------------------------------------------------- Test bytes never has a \255 char failed (75 shrink steps): -aaaaaaa�aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +"aaaaaaa\255aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" --- Failure -------------------------------------------------------------------- Test bytes have unique chars failed (14 shrink steps): -aaaaaaa +"aaaaaaa" --- Failure -------------------------------------------------------------------- From 75f1061ce34578952e9a760c675c7b66d279ebfa Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Sat, 7 Dec 2024 15:16:25 +0100 Subject: [PATCH 235/391] Update CHANGELOG entry --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 734aae97..7c6243db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,8 @@ ## NEXT RELEASE - Quote and escape in `Print.string` and `Print.char` in the `QCheck` module, - mirroring the `QCheck2.Print` module's behaviour + mirroring the `QCheck2.Print` module's behaviour. Also quote and + escape `Print.bytes` in both `QCheck` and `QCheck2`. - Clean-up `QCheck` and `QCheck2` documentation pages - Add `exponential` generator to `QCheck`, `QCheck.Gen`, and `QCheck2.Gen` - Add `Shrink.bool` and use it in `QCheck.bool` From 52889c3ba2269076af11e04bca0e93fba5a162b5 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 12 Dec 2024 18:01:10 +0100 Subject: [PATCH 236/391] Revert Makefile change --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a80c1aed..aed037c1 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ clean: @dune clean doc: - @dune build @doc doc/ + @dune build @doc example-test: @dune exec example/ounit/QCheck_test.exe From b330336aaae9ecffeab8d46112fc2d48604ed0d0 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 12 Dec 2024 18:03:46 +0100 Subject: [PATCH 237/391] Prepare for 0.23 release --- ppx_deriving_qcheck.opam | 2 +- qcheck-alcotest.opam | 2 +- qcheck-core.opam | 2 +- qcheck-ounit.opam | 2 +- qcheck.opam | 2 +- src/core/QCheck.mli | 6 +++--- src/core/QCheck2.mli | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ppx_deriving_qcheck.opam b/ppx_deriving_qcheck.opam index 0c6434e4..6379d864 100644 --- a/ppx_deriving_qcheck.opam +++ b/ppx_deriving_qcheck.opam @@ -1,6 +1,6 @@ opam-version: "2.0" name: "ppx_deriving_qcheck" -version: "0.4.1" +version: "0.5" license: "BSD-2-Clause" synopsis: "PPX Deriver for QCheck" diff --git a/qcheck-alcotest.opam b/qcheck-alcotest.opam index a40f5479..e1510a6b 100644 --- a/qcheck-alcotest.opam +++ b/qcheck-alcotest.opam @@ -5,7 +5,7 @@ homepage: "https://github.com/c-cube/qcheck/" license: "BSD-2-Clause" synopsis: "Alcotest backend for qcheck" doc: ["http://c-cube.github.io/qcheck/"] -version: "0.22" +version: "0.23" tags: [ "test" "quickcheck" diff --git a/qcheck-core.opam b/qcheck-core.opam index 1894b0ee..1cbdd88b 100644 --- a/qcheck-core.opam +++ b/qcheck-core.opam @@ -5,7 +5,7 @@ homepage: "https://github.com/c-cube/qcheck/" license: "BSD-2-Clause" synopsis: "Core qcheck library" doc: ["http://c-cube.github.io/qcheck/"] -version: "0.22" +version: "0.23" tags: [ "test" "property" diff --git a/qcheck-ounit.opam b/qcheck-ounit.opam index df909c93..1b635efc 100644 --- a/qcheck-ounit.opam +++ b/qcheck-ounit.opam @@ -5,7 +5,7 @@ license: "BSD-2-Clause" homepage: "https://github.com/c-cube/qcheck/" doc: ["http://c-cube.github.io/qcheck/"] synopsis: "OUnit backend for qcheck" -version: "0.22" +version: "0.23" tags: [ "qcheck" "quickcheck" diff --git a/qcheck.opam b/qcheck.opam index cd3ab30e..0fa67c8a 100644 --- a/qcheck.opam +++ b/qcheck.opam @@ -5,7 +5,7 @@ synopsis: "Compatibility package for qcheck" homepage: "https://github.com/c-cube/qcheck/" license: "BSD-2-Clause" doc: ["http://c-cube.github.io/qcheck/"] -version: "0.22" +version: "0.23" tags: [ "test" "property" diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 7942b8b0..f52feba9 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -285,7 +285,7 @@ module Gen : sig (** [exponential m] generates floating-point numbers following an exponential distribution with a mean of [m]. @raise Invalid_argument if [m] is NaN. - @since NEXT_VERSION *) + @since 0.23 *) val nat : int t (** Generates small natural numbers. *) @@ -772,7 +772,7 @@ module Shrink : sig (** @since 0.6 *) val bool : bool t - (** @since NEXT_RELEASE *) + (** @since 0.23 *) val char : char t (** Shrinks towards ['a']. @@ -993,7 +993,7 @@ val exponential : float -> float arbitrary (** [exponential m] generates floating-point numbers following an exponential distribution with a mean of [m]. @raise Invalid_argument if [m] is NaN. - @since NEXT_VERSION *) + @since 0.23 *) val int : int arbitrary (** Int generator. Uniformly distributed. *) diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index 095a8e4b..4328933a 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -537,7 +537,7 @@ module Gen : sig @raise Invalid_argument if [m] is NaN. - @since NEXT_VERSION *) + @since 0.23 *) val char_range : ?origin:char -> char -> char -> char t (** [char_range ?origin low high] generates chars between [low] and [high], inclusive. From 14236c2e95dea9670d638c4ac45415717523fb1b Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 13 Dec 2024 15:22:28 +0100 Subject: [PATCH 238/391] Prepare CHANGELOG for next release --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c6243db..ea8f31e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## NEXT RELEASE +- ... + +## 0.23 + - Quote and escape in `Print.string` and `Print.char` in the `QCheck` module, mirroring the `QCheck2.Print` module's behaviour. Also quote and escape `Print.bytes` in both `QCheck` and `QCheck2`. From afe1c3f579143d68fa959f958dd315d61c5b64dd Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 27 Dec 2024 12:33:53 +0100 Subject: [PATCH 239/391] Clean up installation instructions --- README.adoc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/README.adoc b/README.adoc index 35bddef4..bff44817 100644 --- a/README.adoc +++ b/README.adoc @@ -34,14 +34,22 @@ changed in lots of small ways (in the right direction, I hope) so the code will not work any more. <<examples>> is an updated version of the blog post's examples. -== Build +== Build and Install - $ make - -You can use opam: +You can install qcheck via opam: $ opam install qcheck +The `qcheck` package is offered for compatibility. +For a bare-bones installation you can use the `qcheck-core` package: + + $ opam install qcheck-core + +To build the library from source + + $ make + + == License The code is now released under the BSD license. From 2caa1a2b533fe9bfcfaab7945d818fe289dc4b52 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 27 Dec 2024 12:57:33 +0100 Subject: [PATCH 240/391] Add dune usage examples --- README.adoc | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/README.adoc b/README.adoc index bff44817..30ffbba2 100644 --- a/README.adoc +++ b/README.adoc @@ -438,3 +438,59 @@ Starting with 0.9, the library is split into several components: Normally, for contributors, `opam pin https://github.com/c-cube/qcheck` will pin all these packages. + + +=== Usage from dune + +We can use the buggy test from above using the `qcheck` opam package: + +[source,OCaml] +---- +(* test.ml *) +let test = + QCheck.Test.make ~count:1000 ~name:"my_buggy_test" + QCheck.(list small_nat) + (fun l -> List.rev l = l) + +let _ = QCheck_runner.run_tests_main [test] +---- + +with the following `dune` file: + +[source] +---- +(test + (name test) + (modules test) + (libraries qcheck) +) +---- + +and run it with `dune exec ./test.exe` or `dune runtest`. + + +Using the `qcheck-core` package instead, we have to adapt the last line of the +example to use `QCheck_base_runner`: + +[source,OCaml] +---- +(* test.ml *) +let test = + QCheck.Test.make ~count:1000 ~name:"my_buggy_test" + QCheck.(list small_nat) + (fun l -> List.rev l = l) + +let _ = QCheck_base_runner.run_tests_main [test] +---- + +and adjust the `dune` file accordingly to use `qcheck-core` and its +`qcheck-core.runner` sub-package: + +[source] +---- +(test + (name test) + (modules test) + (libraries qcheck-core qcheck-core.runner) +) +---- From 411b904fe7cdbdf7730cfaa9e73e96c4bd89382f Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 27 Dec 2024 13:06:52 +0100 Subject: [PATCH 241/391] Add implicit_transitive_deps mention --- README.adoc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.adoc b/README.adoc index 30ffbba2..f21d7438 100644 --- a/README.adoc +++ b/README.adoc @@ -469,8 +469,9 @@ with the following `dune` file: and run it with `dune exec ./test.exe` or `dune runtest`. -Using the `qcheck-core` package instead, we have to adapt the last line of the -example to use `QCheck_base_runner`: +To keep things minimal or if you are using `(implicit_transitive_deps false)` +in dune, you may want to use the `qcheck-core` package instead. To do so, +we have to adapt the last line of the example to use `QCheck_base_runner`: [source,OCaml] ---- From 98611cd8b821fa7e51fc17f315abab10ff09de67 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 27 Dec 2024 13:07:32 +0100 Subject: [PATCH 242/391] Add CHANGELOG entry --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea8f31e2..6eb8eeaf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## NEXT RELEASE -- ... +- Document `dune` usage in README ## 0.23 From 3c8633cebf78534f3a50829815809fd7fc1601d8 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 27 Dec 2024 16:20:19 +0100 Subject: [PATCH 243/391] Add QCheck.Print.int{32,64} --- src/core/QCheck.ml | 8 ++++---- src/core/QCheck.mli | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index 2b0e11d2..a0ca8b42 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -477,6 +477,8 @@ module Print = struct let unit _ = "()" let int = string_of_int + let int32 i = Int32.to_string i ^ "l" + let int64 i = Int64.to_string i ^ "L" let bool = string_of_bool let float = string_of_float let string s = Printf.sprintf "%S" s @@ -1122,11 +1124,9 @@ let small_int_corners () = make_int (Gen.nng_corners ()) let neg_int = make_int Gen.neg_int let int32 = - make ~print:(fun i -> Int32.to_string i ^ "l") ~small:small1 - ~shrink:Shrink.int32 Gen.ui32 + make ~print:Print.int32 ~small:small1 ~shrink:Shrink.int32 Gen.ui32 let int64 = - make ~print:(fun i -> Int64.to_string i ^ "L") ~small:small1 - ~shrink:Shrink.int64 Gen.ui64 + make ~print:Print.int64 ~small:small1 ~shrink:Shrink.int64 Gen.ui64 let small_char target c = abs ((Char.code c) - (Char.code target)) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index f52feba9..3a0a1e07 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -639,6 +639,12 @@ module Print : sig val int : int t (** Integer printer. *) + val int32 : int32 t (** 32-bit integer printer. *) + (** @since NEXT_RELEASE *) + + val int64 : int64 t (** 64-bit integer printer. *) + (** @since NEXT_RELEASE *) + val bool : bool t (** Boolean printer. *) val float : float t (** Floating point number printer. *) From 60e9fe9329b258bf682ab183b3d4090b56b7a6b0 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 27 Dec 2024 16:26:21 +0100 Subject: [PATCH 244/391] Add QCheck2.Print.int{32,64} --- src/core/QCheck2.ml | 2 ++ src/core/QCheck2.mli | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index 0c821a00..c8dadc15 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -792,6 +792,8 @@ module Print = struct let unit _ = "()" let int = string_of_int + let int32 i = Int32.to_string i ^ "l" + let int64 i = Int64.to_string i ^ "L" let bool = string_of_bool diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index 4328933a..0a0e36bb 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -1111,7 +1111,15 @@ module Print : sig *) val int : int t - (** [int] is a printer of integer. *) + (** [int] is a printer of integers. *) + + val int32 : int32 t + (** [int32] is a printer of 32-bit integers. + @since NEXT_RELEASE *) + + val int64 : int64 t + (** [int64] is a printer of 64-bit integers. + @since NEXT_RELEASE *) val bool : bool t (** [bool] is a printer of boolean. *) From bb8a9dfeae5e17c0b30346c4ed7f197a9502f8b3 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 27 Dec 2024 16:33:24 +0100 Subject: [PATCH 245/391] Add QCheck.Gen.{int32,int64} --- src/core/QCheck.ml | 11 +++++++---- src/core/QCheck.mli | 8 ++++++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index a0ca8b42..0b696fdc 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -256,8 +256,11 @@ module Gen = struct done; Bytes.unsafe_to_string s - let ui32 st = Int32.of_string (random_binary_string st 32) - let ui64 st = Int64.of_string (random_binary_string st 64) + let int32 st = Int32.of_string (random_binary_string st 32) + let int64 st = Int64.of_string (random_binary_string st 64) + + let ui32 = int32 (* FIXME #90 *) + let ui64 = int64 (* FIXME #90 *) let list_size size gen st = foldn ~f:(fun acc _ -> (gen st)::acc) ~init:[] (size st) @@ -1124,9 +1127,9 @@ let small_int_corners () = make_int (Gen.nng_corners ()) let neg_int = make_int Gen.neg_int let int32 = - make ~print:Print.int32 ~small:small1 ~shrink:Shrink.int32 Gen.ui32 + make ~print:Print.int32 ~small:small1 ~shrink:Shrink.int32 Gen.int32 let int64 = - make ~print:Print.int64 ~small:small1 ~shrink:Shrink.int64 Gen.ui64 + make ~print:Print.int64 ~small:small1 ~shrink:Shrink.int64 Gen.int64 let small_char target c = abs ((Char.code c) - (Char.code target)) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 3a0a1e07..ff5a12d2 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -337,6 +337,14 @@ module Gen : sig val (--) : int -> int -> int t (** Synonym for {!int_range}. *) + val int32 : int32 t + (** Generates [int32] values uniformly. + @since NEXT_RELEASE *) + + val int64 : int64 t + (** Generates [int64] values uniformly. + @since NEXT_RELEASE *) + val ui32 : int32 t (** Generates (unsigned) [int32] values. *) val ui64 : int64 t (** Generates (unsigned) [int64] values. *) From 3a3cc6a73338a7cd65b8d0a505d67e5916dedbd7 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 27 Dec 2024 16:38:29 +0100 Subject: [PATCH 246/391] Mark QCheck.Gen.{ui32,ui64} as deprecated, like in QCheck2.Gen --- src/core/QCheck.ml | 4 ++-- src/core/QCheck.mli | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index 0b696fdc..bcfb913d 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -259,8 +259,8 @@ module Gen = struct let int32 st = Int32.of_string (random_binary_string st 32) let int64 st = Int64.of_string (random_binary_string st 64) - let ui32 = int32 (* FIXME #90 *) - let ui64 = int64 (* FIXME #90 *) + let ui32 = int32 + let ui64 = int64 let list_size size gen st = foldn ~f:(fun acc _ -> (gen st)::acc) ~init:[] (size st) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index ff5a12d2..e5d42ffa 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -345,9 +345,15 @@ module Gen : sig (** Generates [int64] values uniformly. @since NEXT_RELEASE *) - val ui32 : int32 t (** Generates (unsigned) [int32] values. *) + val ui32 : int32 t + (** Generates [int32] values. + @deprecated use {!val:int32} instead, the name is wrong, values {i are} signed. + *) - val ui64 : int64 t (** Generates (unsigned) [int64] values. *) + val ui64 : int64 t + (** Generates [int64] values. + @deprecated use {!val:int64} instead, the name is wrong, values {i are} signed. + *) val list : 'a t -> 'a list t (** Builds a list generator from an element generator. List size is generated by {!nat}. *) From 8cb570820a232c2466cf3a8c28d540b0c49fec39 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 27 Dec 2024 16:48:29 +0100 Subject: [PATCH 247/391] Add QCheck.Observable.{int32,int64} --- src/core/QCheck.ml | 6 ++++++ src/core/QCheck.mli | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index bcfb913d..625bb31d 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -966,6 +966,8 @@ module Observable = struct let combine a b = Hashtbl.seeded_hash a b let combine_f f s x = Hashtbl.seeded_hash s (f x) let int i = i land max_int + let int32 (i:int32) = Hashtbl.hash i + let int64 (i:int64) = Hashtbl.hash i let bool b = if b then 1 else 2 let char x = Char.code x let bytes (x:bytes) = Hashtbl.hash x @@ -982,6 +984,8 @@ module Observable = struct type 'a t = 'a -> 'a -> bool let int : int t = (=) + let int32 : int32 t = (=) + let int64 : int64 t = (=) let bytes : bytes t = (=) let string : string t = (=) let bool : bool t = (=) @@ -1015,6 +1019,8 @@ module Observable = struct let unit : unit t = make ~hash:(fun _ -> 1) ~eq:Eq.unit Print.unit let bool : bool t = make ~hash:H.bool ~eq:Eq.bool Print.bool let int : int t = make ~hash:H.int ~eq:Eq.int Print.int + let int32 : int32 t = make ~hash:H.int32 ~eq:Eq.int32 Print.int32 + let int64 : int64 t = make ~hash:H.int64 ~eq:Eq.int64 Print.int64 let float : float t = make ~eq:Eq.float Print.float let bytes = make ~hash:H.bytes ~eq:Eq.bytes Print.bytes let string = make ~hash:H.string ~eq:Eq.string Print.string diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index e5d42ffa..cb4b438e 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -1645,6 +1645,8 @@ module Observable : sig val unit : unit t val bool : bool t val int : int t + val int32 : int32 t (** @since NEXT_RELEASE *) + val int64 : int64 t (** @since NEXT_RELEASE *) val float : float t val string : string t val bytes : bytes t (** @since 0.20 *) From 71e65e18d80c787582d5f271ec62b447e1e269c8 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 27 Dec 2024 16:54:12 +0100 Subject: [PATCH 248/391] Add QCheck2.Observable.{int32,int64} --- src/core/QCheck2.ml | 6 ++++++ src/core/QCheck2.mli | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index c8dadc15..699724be 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -981,6 +981,8 @@ module Observable = struct let combine_f f s x = Hashtbl.seeded_hash s (f x) let int i = i land max_int + let int32 (i:int32) = Hashtbl.hash i + let int64 (i:int64) = Hashtbl.hash i let bool b = if b then 1 else 2 @@ -1004,6 +1006,8 @@ module Observable = struct type 'a t = 'a -> 'a -> bool let int : int t = (=) + let int32 : int32 t = (=) + let int64 : int64 t = (=) let bytes : bytes t = (=) @@ -1045,6 +1049,8 @@ module Observable = struct let bool : bool t = make ~hash:H.bool ~eq:Eq.bool Print.bool let int : int t = make ~hash:H.int ~eq:Eq.int Print.int + let int32 : int32 t = make ~hash:H.int32 ~eq:Eq.int32 Print.int32 + let int64 : int64 t = make ~hash:H.int64 ~eq:Eq.int64 Print.int64 let float : float t = make ~eq:Eq.float Print.float diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index 0a0e36bb..5723585f 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -1342,6 +1342,14 @@ module Observable : sig val int : int t (** [int] is an observable of [int]. *) + val int32 : int32 t + (** [int32] is an observable of [int32]. + @since NEXT_RELEASE *) + + val int64 : int64 t + (** [int64] is an observable of [int64]. + @since NEXT_RELEASE *) + val float : float t (** [float] is an observable of [float]. *) From d26209d26e522c190ba903ce37e3dc88266fd451 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 27 Dec 2024 16:58:06 +0100 Subject: [PATCH 249/391] Add CHANGELOG entry --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6eb8eeaf..c6417b68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## NEXT RELEASE +- Add missing combinators `QCheck{,2}.Print.int{32,64}`, `QCheck.Gen.int{32,64}`, + `QCheck{,2}.Observable.int{32,64}`, and deprecate `QCheck.Gen.{ui32,ui64}` - Document `dune` usage in README ## 0.23 From 6144efd8ec7890f1fde5c48e25fd111ef924cb29 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 2 Jan 2025 22:19:40 +0100 Subject: [PATCH 250/391] Only one comment block for QCheck.Print.int32 --- src/core/QCheck.mli | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index cb4b438e..41c9d89c 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -653,8 +653,9 @@ module Print : sig val int : int t (** Integer printer. *) - val int32 : int32 t (** 32-bit integer printer. *) - (** @since NEXT_RELEASE *) + val int32 : int32 t + (** 32-bit integer printer. + @since NEXT_RELEASE *) val int64 : int64 t (** 64-bit integer printer. *) (** @since NEXT_RELEASE *) From 903bc9e0ed109ae6be1a96468ae968aebb4ca433 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 2 Jan 2025 22:20:06 +0100 Subject: [PATCH 251/391] Only one comment block for QCheck.Print.int64 --- src/core/QCheck.mli | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 41c9d89c..39603a24 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -657,8 +657,9 @@ module Print : sig (** 32-bit integer printer. @since NEXT_RELEASE *) - val int64 : int64 t (** 64-bit integer printer. *) - (** @since NEXT_RELEASE *) + val int64 : int64 t + (** 64-bit integer printer. + @since NEXT_RELEASE *) val bool : bool t (** Boolean printer. *) From d0b7ebd3350d2fdb14abc5fd6be8e8bc23237f45 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 2 Jan 2025 23:00:58 +0100 Subject: [PATCH 252/391] Add QCheck.Gen.result --- src/core/QCheck.ml | 6 ++++++ src/core/QCheck.mli | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index 625bb31d..7ddf9e05 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -195,6 +195,12 @@ module Gen = struct let opt = option + let result ?(ratio = 0.75) vg eg st = + let p = RS.float st 1. in + if p < (1.0 -. ratio) + then Error (eg st) + else Ok (vg st) + (* Uniform random int generator *) let pint = if Sys.word_size = 32 then diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 39603a24..4878e5c5 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -387,6 +387,14 @@ module Gen : sig @since 0.18 ([?ratio] parameter) *) + val result : ?ratio:float -> 'a t -> 'e t -> ('a, 'e) result t + (** A result generator, with optional ratio. + @param ratio a float between [0.] and [1.] indicating the probability of a sample to be [Ok _] + rather than [Error _]. + + @since NEXT_RELEASE + *) + val char : char t (** Generates characters upto character code 255. *) From ffe0ca5b746a6392ddbf935b757ffe41349759cd Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 2 Jan 2025 23:21:37 +0100 Subject: [PATCH 253/391] Add QCheck.Print.result --- src/core/QCheck.ml | 4 ++++ src/core/QCheck.mli | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index 7ddf9e05..b77ae478 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -498,6 +498,10 @@ module Print = struct | None -> "None" | Some x -> "Some (" ^ f x ^ ")" + let result vp ep = function + | Error e -> "Error (" ^ ep e ^ ")" + | Ok v -> "Ok (" ^ vp v ^ ")" + let pair a b (x,y) = Printf.sprintf "(%s, %s)" (a x) (b y) let triple a b c (x,y,z) = Printf.sprintf "(%s, %s, %s)" (a x) (b y) (c z) let quad a b c d (x,y,z,w) = diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 4878e5c5..75b425cf 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -683,6 +683,10 @@ module Print : sig val option : 'a t -> 'a option t (** Option printer. *) + val result : 'a t -> 'e t -> ('a, 'e) result t + (** Result printer. + @since NEXT_RELEASE *) + val pair : 'a t -> 'b t -> ('a*'b) t (** Pair printer. Expects printers for each component. *) From 5298873a06947cb7560e06232adefd3164b19eca Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 2 Jan 2025 23:23:07 +0100 Subject: [PATCH 254/391] Add QCheck.Shrink.result --- src/core/QCheck.ml | 4 ++++ src/core/QCheck.mli | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index b77ae478..5a8661b1 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -750,6 +750,10 @@ module Shrink = struct | None -> Iter.empty | Some x -> Iter.(return None <+> map (fun y->Some y) (s x)) + let result vs es x = match x with + | Error e -> Iter.map (fun e -> Error e) (es e) + | Ok v -> Iter.map (fun v -> Ok v) (vs v) + let array ?shrink a yield = let n = Array.length a in let chunk_size = ref n in diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 75b425cf..82762992 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -830,6 +830,9 @@ module Shrink : sig val option : 'a t -> 'a option t + val result : 'a t -> 'e t -> ('a, 'e) result t + (** @since NEXT_RELEASE *) + val bytes : ?shrink:(char t) -> bytes t (** @since 0.20 *) From 034fb78249bb34691a542dbbbe2b742aef5eedcd Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 2 Jan 2025 23:34:26 +0100 Subject: [PATCH 255/391] Add QCheck.Observable.result --- src/core/QCheck.ml | 9 +++++++++ src/core/QCheck.mli | 1 + 2 files changed, 10 insertions(+) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index 5a8661b1..217f9a6f 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -989,6 +989,9 @@ module Observable = struct let opt f = function | None -> 42 | Some x -> combine 43 (f x) + let result vh eh = function + | Error e -> combine 17 (eh e) + | Ok v -> combine 19 (vh v) let list f l = List.fold_left (combine_f f) 0x42 l let array f l = Array.fold_left (combine_f f) 0x42 l let pair f g (x,y) = combine (f x) (g y) @@ -1027,6 +1030,8 @@ module Observable = struct | None, Some _ -> false | Some x, Some y -> f x y + let result ok error r1 r2 = Result.equal ~ok ~error r1 r2 + let pair f g (x1,y1)(x2,y2) = f x1 x2 && g y1 y2 end @@ -1044,6 +1049,10 @@ module Observable = struct make ~hash:(H.opt p.hash) ~eq:(Eq.option p.eq) (Print.option p.print) + let result op rp = + make ~hash:(H.result op.hash rp.hash) ~eq:(Eq.result op.eq rp.eq) + (Print.result op.print rp.print) + let array p = make ~hash:(H.array p.hash) ~eq:(Eq.array p.eq) (Print.array p.print) let list p = diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 82762992..9e3b2721 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -1678,6 +1678,7 @@ module Observable : sig val map : ('a -> 'b) -> 'b t -> 'a t val option : 'a t -> 'a option t + val result : 'a t -> 'e t -> ('a, 'e) result t (** @since NEXT_RELEASE *) val list : 'a t -> 'a list t val array : 'a t -> 'a array t From ec73a37f3e04d1a18fb9bd3d16184adfd04b6d59 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 3 Jan 2025 00:27:24 +0100 Subject: [PATCH 256/391] Add QCheck.result arbitrary --- src/core/QCheck.ml | 15 +++++++++++++++ src/core/QCheck.mli | 8 ++++++++ 2 files changed, 23 insertions(+) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index 217f9a6f..fee38d13 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -1365,6 +1365,21 @@ let option ?ratio a = ?print:(_opt_map ~f:Print.option a.print) g +let result ?ratio ok err = + let g = Gen.result ?ratio ok.gen err.gen + and shrink = _opt_map_2 ok.shrink err.shrink ~f:Shrink.result + and small = match ok.small, err.small with + | None, None -> (function Ok _ -> 0 | Error _ -> 1) + | None, Some es -> (function Ok _ -> 0 | Error e -> es e) + | Some os, None -> (function Ok o -> os o | Error _ -> 1) + | Some os, Some es -> (function Ok o -> os o | Error e -> es e) + in + make + ~small + ?shrink:shrink + ?print:(_opt_map_2 ~f:Print.result ok.print err.print) + g + let map ?rev f a = make ?print:(_opt_map_2 rev a.print ~f:(fun r p x -> p (r x))) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 9e3b2721..3e3d9f9c 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -1204,6 +1204,14 @@ val array_of_size : int Gen.t -> 'a arbitrary -> 'a array arbitrary val option : ?ratio:float -> 'a arbitrary -> 'a option arbitrary (** Choose between returning Some random value with optional ratio, or None. *) +val result : ?ratio:float -> 'a arbitrary -> 'e arbitrary -> ('a, 'e) result arbitrary +(** [result ~ratio okgen errgen] generates [Ok v] with [v] coming from [okgen] + or [Error e] with [e] coming from [errgen], depending on [ratio]. The latter + is a float between [0.] and [1.] indicating the probability of a sample to + be [Ok _] rather than [Error _]. + + @since NEXT_RELEASE *) + (** {2 Tuples of arbitrary generators} From e00222f0987010082f83667e6af48df067249d4d Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 3 Jan 2025 00:41:15 +0100 Subject: [PATCH 257/391] Add QCheck2.Gen.result --- src/core/QCheck2.ml | 6 ++++++ src/core/QCheck2.mli | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index 699724be..0bef9482 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -387,6 +387,12 @@ module Gen = struct (** [opt] is an alias of {!val:option} for backward compatibility. *) let opt = option + let result ?(ratio : float = 0.75) (ok_gen : 'a t) (err_gen : 'e t) : ('a, 'e) result t = fun st -> + let p = RS.float st 1. in + if p < (1. -. ratio) + then Tree.map (fun e -> Error e) (err_gen st) + else Tree.map (fun o -> Ok o) (ok_gen st) + (* Uniform positive random int generator. We can't use {!RS.int} because the upper bound must be positive and is excluded, diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index 5723585f..88e23b71 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -702,6 +702,16 @@ module Gen : sig val opt : ?ratio:float -> 'a t -> 'a option t (** [opt] is an alias of {!val:option} for backward compatibility. *) + val result : ?ratio:float -> 'a t -> 'e t -> ('a, 'e) result t + (** [result ~ratio okgen errgen] generates [Ok v] with [v] coming from [okgen] + or [Error e] with [e] coming from [errgen], depending on [ratio]. + + @param ratio a float between [0.] and [1.] indicating the probability of a sample to + be [Ok _] rather than [Error _]. + + @since NEXT_RELEASE *) + + (** {3 Combining generators} *) val pair : 'a t -> 'b t -> ('a * 'b) t From a2c0afe39cc8d63fc1b6855d1a2fe5a2cfdf86a0 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 3 Jan 2025 00:46:33 +0100 Subject: [PATCH 258/391] Add QCheck2.Print.result --- src/core/QCheck2.ml | 4 ++++ src/core/QCheck2.mli | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index 0bef9482..2d58af9e 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -815,6 +815,10 @@ module Print = struct | None -> "None" | Some x -> "Some (" ^ f x ^ ")" + let result vp ep = function + | Error e -> "Error (" ^ ep e ^ ")" + | Ok v -> "Ok (" ^ vp v ^ ")" + let pair a b (x,y) = Printf.sprintf "(%s, %s)" (a x) (b y) let triple a b c (x,y,z) = Printf.sprintf "(%s, %s, %s)" (a x) (b y) (c z) diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index 88e23b71..7e70d63e 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -1150,6 +1150,12 @@ module Print : sig val option : 'a t -> 'a option t (** [option p] is a printer of ['a option], using [p] if it is a [Some]. *) + val result : 'a t -> 'e t -> ('a, 'e) result t + (** [result okp errp] is a printer of [('a,'e) result], using [okp] for printing [Ok _] + and [errp] for printing [Error _]. + + @since NEXT_RELEASE *) + val pair : 'a t -> 'b t -> ('a*'b) t (** [pair p1 p2] is a printer of pair. *) From 2cda13cd66b44dc43dc571b51a8fbf8f41138fa6 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 3 Jan 2025 00:54:39 +0100 Subject: [PATCH 259/391] Add QCheck2.Observable.result --- src/core/QCheck2.ml | 11 +++++++++++ src/core/QCheck2.mli | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index 2d58af9e..43c53cee 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -1005,6 +1005,11 @@ module Observable = struct let option f = function | None -> 42 | Some x -> combine 43 (f x) + + let result vh eh = function + | Error e -> combine 17 (eh e) + | Ok v -> combine 19 (vh v) + let list f l = List.fold_left (combine_f f) 0x42 l let array f l = Array.fold_left (combine_f f) 0x42 l @@ -1051,6 +1056,8 @@ module Observable = struct | None, Some _ -> false | Some x, Some y -> f x y + let result ok error r1 r2 = Result.equal ~ok ~error r1 r2 + let pair f g (x1,y1)(x2,y2) = f x1 x2 && g y1 y2 end @@ -1074,6 +1081,10 @@ module Observable = struct make ~hash:(H.option p.hash) ~eq:(Eq.option p.eq) (Print.option p.print) + let result op rp = + make ~hash:(H.result op.hash rp.hash) ~eq:(Eq.result op.eq rp.eq) + (Print.result op.print rp.print) + let array p = make ~hash:(H.array p.hash) ~eq:(Eq.array p.eq) (Print.array p.print) diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index 7e70d63e..bd305045 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -1395,6 +1395,11 @@ module Observable : sig (** [option o] wraps the observable [o] of ['a] into an observable of ['a option]. *) + val result : 'a t -> 'e t -> ('a, 'e) result t + (** [result ok_o err_o] creates an [('a, 'e) result] observable out of + two observables [ok_o] and [err_o]. + @since NEXT_RELEASE *) + val list : 'a t -> 'a list t (** [list o] wraps the observable [o] of ['a] into an observable of ['a list]. *) From 3e393d1e19bb36bc6a18c8c8c755b4e5ab122ad9 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 3 Jan 2025 00:57:47 +0100 Subject: [PATCH 260/391] Add CHANGELOG entry --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c6417b68..12ffa33f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## NEXT RELEASE +- Add `result` combinators to `QCheck`, `QCheck.{Gen,Print,Shrink,Observable}`, + and `QCheck2.{Gen,Print,Observable}`. - Add missing combinators `QCheck{,2}.Print.int{32,64}`, `QCheck.Gen.int{32,64}`, `QCheck{,2}.Observable.int{32,64}`, and deprecate `QCheck.Gen.{ui32,ui64}` - Document `dune` usage in README From 7377a1d1db243130d43f756bbed2ec6d00c59850 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Sun, 5 Jan 2025 13:32:09 +0100 Subject: [PATCH 261/391] Mv qcheck-core index page to doc/qcheck-core --- doc/{ => qcheck-core}/dune | 0 doc/{ => qcheck-core}/index.mld | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename doc/{ => qcheck-core}/dune (100%) rename doc/{ => qcheck-core}/index.mld (100%) diff --git a/doc/dune b/doc/qcheck-core/dune similarity index 100% rename from doc/dune rename to doc/qcheck-core/dune diff --git a/doc/index.mld b/doc/qcheck-core/index.mld similarity index 100% rename from doc/index.mld rename to doc/qcheck-core/index.mld From 3a13fa4137a3fc71cf5613ef4818afdf9a2d5db0 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Sun, 5 Jan 2025 13:36:04 +0100 Subject: [PATCH 262/391] Mv qcheck index page to doc/qcheck --- doc/qcheck/dune | 3 +++ {src => doc/qcheck}/index.mld | 0 src/dune | 5 ----- 3 files changed, 3 insertions(+), 5 deletions(-) create mode 100644 doc/qcheck/dune rename {src => doc/qcheck}/index.mld (100%) diff --git a/doc/qcheck/dune b/doc/qcheck/dune new file mode 100644 index 00000000..39d1e86f --- /dev/null +++ b/doc/qcheck/dune @@ -0,0 +1,3 @@ +(documentation + (package qcheck) + (mld_files index)) diff --git a/src/index.mld b/doc/qcheck/index.mld similarity index 100% rename from src/index.mld rename to doc/qcheck/index.mld diff --git a/src/dune b/src/dune index 7f18afde..6f1369e1 100644 --- a/src/dune +++ b/src/dune @@ -1,4 +1,3 @@ - (library (name qcheck) (public_name qcheck) @@ -6,7 +5,3 @@ (modules QCheck_runner) (synopsis "compatibility library for qcheck") (libraries qcheck-core qcheck-core.runner qcheck-ounit)) - -(documentation - (package qcheck) - (mld_files index)) From ddd2e11defc78207355bdfc6e3878eed12d05be9 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Sun, 5 Jan 2025 13:49:14 +0100 Subject: [PATCH 263/391] Add documentation strings for QCheck.Gen.tup* --- src/core/QCheck.mli | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 3e3d9f9c..21123a7d 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -511,24 +511,32 @@ module Gen : sig @since 0.5.1 *) val tup2 : 'a t -> 'b t -> ('a * 'b) t + (** Combines two generators into a 2-tuple generator. *) val tup3 : 'a t -> 'b t -> 'c t -> ('a * 'b * 'c) t + (** Combines three generators into a 3-tuple generator. *) val tup4 : 'a t -> 'b t -> 'c t -> 'd t -> ('a * 'b * 'c * 'd) t + (** Combines four generators into a 4-tuple generator. *) val tup5 : 'a t -> 'b t -> 'c t -> 'd t -> 'e t -> ('a * 'b * 'c * 'd * 'e) t + (** Combines five generators into a 5-tuple generator. *) val tup6 : 'a t -> 'b t -> 'c t -> 'd t -> 'e t -> 'f t -> ('a * 'b * 'c * 'd * 'e * 'f) t + (** Combines six generators into a 6-tuple generator. *) val tup7 : 'a t -> 'b t -> 'c t -> 'd t -> 'e t -> 'f t -> 'g t -> ('a * 'b * 'c * 'd * 'e * 'f * 'g) t + (** Combines seven generators into a 7-tuple generator. *) val tup8 : 'a t -> 'b t -> 'c t -> 'd t -> 'e t -> 'f t -> 'g t -> 'h t -> ('a * 'b * 'c * 'd * 'e * 'f * 'g * 'h) t + (** Combines eight generators into an 8-tuple generator. *) val tup9 : 'a t -> 'b t -> 'c t -> 'd t -> 'e t -> 'f t -> 'g t -> 'h t -> 'i t -> ('a * 'b * 'c * 'd * 'e * 'f * 'g * 'h * 'i) t + (** Combines nine generators into a 9-tuple generator. *) val join : 'a t t -> 'a t (** Collapses a generator of generators to simply a generator. From 6d825008b8f05e35d231b3ed53378c7fdacd7415 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Sun, 5 Jan 2025 13:49:47 +0100 Subject: [PATCH 264/391] Add documentation strings for QCheck2.Gen.tup* --- src/core/QCheck2.mli | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index bd305045..463470ac 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -739,20 +739,29 @@ module Gen : sig (** {4 Shrinks on [gen1], then [gen2], then ... } *) val tup2 : 'a t -> 'b t -> ('a * 'b) t + (** Combines two generators into a 2-tuple generator. *) val tup3 : 'a t -> 'b t -> 'c t -> ('a * 'b * 'c) t + (** Combines three generators into a 3-tuple generator. *) val tup4 : 'a t -> 'b t -> 'c t -> 'd t -> ('a * 'b * 'c * 'd) t + (** Combines four generators into a 4-tuple generator. *) val tup5 : 'a t -> 'b t -> 'c t -> 'd t -> 'e t -> ('a * 'b * 'c * 'd * 'e) t + (** Combines five generators into a 5-tuple generator. *) val tup6 : 'a t -> 'b t -> 'c t -> 'd t -> 'e t -> 'f t -> ('a * 'b * 'c * 'd * 'e * 'f) t + (** Combines six generators into a 6-tuple generator. *) val tup7 : 'a t -> 'b t -> 'c t -> 'd t -> 'e t -> 'f t -> 'g t -> ('a * 'b * 'c * 'd * 'e * 'f * 'g) t + (** Combines seven generators into a 7-tuple generator. *) val tup8 : 'a t -> 'b t -> 'c t -> 'd t -> 'e t -> 'f t -> 'g t -> 'h t -> ('a * 'b * 'c * 'd * 'e * 'f * 'g * 'h) t + (** Combines eight generators into an 8-tuple generator. *) val tup9 : 'a t -> 'b t -> 'c t -> 'd t -> 'e t -> 'f t -> 'g t -> 'h t -> 'i t -> ('a * 'b * 'c * 'd * 'e * 'f * 'g * 'h * 'i) t + (** Combines nine generators into a 9-tuple generator. *) + (** {3 Convert a structure of generator to a generator of structure} *) From 7e1b724feb5c065d21372274496360383c5f4675 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Sun, 5 Jan 2025 13:59:31 +0100 Subject: [PATCH 265/391] Add documentation strings for QCheck.Gen binding operators --- src/core/QCheck.mli | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 21123a7d..f811a0c0 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -634,12 +634,17 @@ module Gen : sig @since 0.17 *) val ( let+ ) : 'a t -> ('a -> 'b) -> 'b t + (** {{: https://ocaml.org/manual/bindingops.html} Binding operator} alias for {!map}. *) val ( and+ ) : 'a t -> 'b t -> ('a * 'b) t + (** {{: https://ocaml.org/manual/bindingops.html} Binding operator} alias for {!pair}. *) val ( let* ) : 'a t -> ('a -> 'b t) -> 'b t + (** {{: https://ocaml.org/manual/bindingops.html} Binding operator} alias for {!bind}. *) val ( and* ) : 'a t -> 'b t -> ('a * 'b) t + (** {{: https://ocaml.org/manual/bindingops.html} Binding operator} alias for {!pair}. *) + (** {3 Debug generators} From ca0ecd6226c6acee05f6602d7b2e58b9bfc2c065 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Sun, 5 Jan 2025 14:03:59 +0100 Subject: [PATCH 266/391] Add documentation string for QCheck.Print.unit --- src/core/QCheck.mli | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index f811a0c0..a44c6b5f 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -670,7 +670,8 @@ module Print : sig val unit : unit t - (** @since 0.6 *) + (** [unit] is a printer of unit. + @since 0.6 *) val int : int t (** Integer printer. *) From eadf4d8c42ad8d56bd1981e2821e77949b84eea6 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Sun, 5 Jan 2025 14:22:30 +0100 Subject: [PATCH 267/391] Elaborate on scarse QCheck.Shrink documentation --- src/core/QCheck.mli | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index a44c6b5f..92501d24 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -817,40 +817,53 @@ module Shrink : sig (** No shrink *) val unit : unit t - (** @since 0.6 *) + (** unit shrinker. Does not produce any shrinking candidates. + @since 0.6 *) val bool : bool t - (** @since 0.23 *) + (** bool shrinker. Shrinks towards [false]. + @since 0.23 *) val char : char t - (** Shrinks towards ['a']. + (** char shrinker. Shrinks towards ['a']. @since 0.6 *) val char_numeral : char t - (** Shrinks towards ['0']. + (** char digit shrinker. Shrinks towards ['0']. @since 0.19 *) val char_printable : char t - (** Shrinks towards ['a'] like [!char]. The output is also a printable character. + (** Printable char shrinker. Shrinks towards ['a'] like [!char]. The output is also a printable character. @since 0.19 *) val int : int t + (** int shrinker. Shrinks towards [0]. *) val int32 : int32 t - (** @since 0.14 *) + (** int32 shrinker. Shrinks towards [0l]. + @since 0.14 *) val int64 : int64 t - (** @since 0.14 *) + (** int64 shrinker. Shrinks towards [0L]. + @since 0.14 *) val option : 'a t -> 'a option t + (** option shrinker. Shrinks towards [None]. + [option shk] reduces [Some v] values using [shk] to reduce [v]. *) val result : 'a t -> 'e t -> ('a, 'e) result t - (** @since NEXT_RELEASE *) + (** result shrinker. + [result ashk eshk] reduces [Ok a] values using [ashk] and [Error e] values using [eshk]. + @since NEXT_RELEASE *) val bytes : ?shrink:(char t) -> bytes t - (** @since 0.20 *) + (** bytes shrinker. Shrinks towards shorter byte strings. + @param shrink an optional [char] shrinker. + @since 0.20 *) val string : ?shrink:(char t) -> string t + (** string shrinker. Shrinks towards [""]. + @param shrink an optional [char] shrinker. *) val filter : ('a -> bool) -> 'a t -> 'a t (** [filter f shrink] shrinks values the same as [shrink], but From f445fd5ffcd497cb5a61c6fd5528a1e160866466 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Sun, 5 Jan 2025 14:29:56 +0100 Subject: [PATCH 268/391] Add QCheck.Shrink infinite loop warning --- src/core/QCheck.mli | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 92501d24..3f674436 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -807,7 +807,10 @@ end module Shrink : sig (** The [Shrink] module contains combinators to build up composite shrinkers - for user-defined types *) + for user-defined types + + Warning: A hand-written shrinker returning its own argument, will cause + QCheck's shrinking phase to loop infinitely. *) type 'a t = 'a -> 'a Iter.t (** Given a counter-example, return an iterator on smaller versions From 64f03d3ed34ae8eab0a68273552dd651848dec99 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Sun, 5 Jan 2025 15:06:30 +0100 Subject: [PATCH 269/391] Add documentation strings for QCheck.Iter --- src/core/QCheck.mli | 51 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 3 deletions(-) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 3f674436..d2dd5213 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -768,39 +768,84 @@ module Iter : sig and calls [f] on a sequence of elements [f x1; f x2; ...; f xn]. *) type 'a t = ('a -> unit) -> unit + (** The type of iterators, underlying {!Shrink.t}. *) val empty : 'a t + (** The empty iterator *) + val return : 'a -> 'a t + (** The constant iterator *) + val (<*>) : ('a -> 'b) t -> 'a t -> 'b t + (** Applicative operator for iterators, combining a function iterator and + an argument iterator into a result generator. *) + val (>>=) : 'a t -> ('a -> 'b t) -> 'b t + (** Monadic bind operator for iterators. + [i >>= f] passes each element of [i] to [f], iterating over each element + of [f]'s resulting iterators. *) + val map : ('a -> 'b) -> 'a t -> 'b t + (** [map f i] returns an iterator of elements from [i], each of which have + been applied to [f]. *) + val map2 : ('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t + (** [map f i j] returns an iterator of elements from [i] and [j], which have + been applied to [f]. *) + val (>|=) : 'a t -> ('a -> 'b) -> 'b t + (** An infix synonym for {!map}. *) + val append : 'a t -> 'a t -> 'a t - val (<+>) : 'a t -> 'a t -> 'a t (** Synonym for {!append}. *) + (** [append a b] first iterates over [a]'s elements and then over [b]'s. *) + + val (<+>) : 'a t -> 'a t -> 'a t + (** Synonym for {!append}. *) val of_list : 'a list -> 'a t + (** [of_list xs] builds an iterator over the list elements of [xs]. *) + val of_array : 'a array -> 'a t + (** [of_array xs] builds an iterator over the array elements of [xs]. *) + val pair : 'a t -> 'b t -> ('a * 'b) t + (** [pair a b] iterates over pairs [(x,y)] with [x] coming from [a] and + [y] coming from [b]. *) + val triple : 'a t -> 'b t -> 'c t -> ('a * 'b * 'c) t + (** [triple a b c] iterates over triples [(x,y,z)] with [x] coming from [a], + [y] coming from [b], and [z] coming from [c]. *) + val quad : 'a t -> 'b t -> 'c t -> 'd t -> ('a * 'b * 'c * 'd) t + (** [quad a b c d] iterates over quadruples [(x,y,z,w)] with [x] coming from [a], + [y] coming from [b], [z] coming from [c], and [w] coming from [d]. *) + val find : ('a -> bool) -> 'a t -> 'a option + (** [find p i] maps over the iterator [i], returning [Some _] when the + predicate [p] is [true] and [None] otherwise. *) val filter : ('a -> bool) -> 'a t -> 'a t + (** [filter p i] returns an iterator of elements from [i] satisfying [p]. *) val append_l : 'a t list -> 'a t - (** @since 0.8 *) + (** Appends a list of iterators into a single iterator. + @since 0.8 *) val flatten : 'a t t -> 'a t - (** @since 0.8 *) + (** Flattens an iterator of iterators into a single iterator. + @since 0.8 *) val ( let+ ) : 'a t -> ('a -> 'b) -> 'b t + (** {{: https://ocaml.org/manual/bindingops.html} Binding operator} alias for {!map}. *) val ( and+ ) : 'a t -> 'b t -> ('a * 'b) t + (** {{: https://ocaml.org/manual/bindingops.html} Binding operator} alias for {!pair}. *) val ( let* ) : 'a t -> ('a -> 'b t) -> 'b t + (** {{: https://ocaml.org/manual/bindingops.html} Binding operator} alias for {!(>>=)}. *) val ( and* ) : 'a t -> 'b t -> ('a * 'b) t + (** {{: https://ocaml.org/manual/bindingops.html} Binding operator} alias for {!pair}. *) end (** {2 Shrinkers} *) From c4f1981bbc934117e7086f348b8af46f116003d2 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Sun, 5 Jan 2025 15:09:42 +0100 Subject: [PATCH 270/391] Add CHANGELOG entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12ffa33f..fcbeee6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## NEXT RELEASE +- Add missing documentation strings for `QCheck.{Print,Iter,Shrink,Gen}` and `QCheck2.Gen`. - Add `result` combinators to `QCheck`, `QCheck.{Gen,Print,Shrink,Observable}`, and `QCheck2.{Gen,Print,Observable}`. - Add missing combinators `QCheck{,2}.Print.int{32,64}`, `QCheck.Gen.int{32,64}`, From 01d9b2453b5398bb9eda86f45ee770117a1b99cf Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 17 Jan 2025 14:05:31 +0100 Subject: [PATCH 271/391] Add x-maintenance-intent field to opam files --- ppx_deriving_qcheck.opam | 1 + qcheck-alcotest.opam | 1 + qcheck-core.opam | 1 + qcheck-ounit.opam | 1 + qcheck.opam | 1 + 5 files changed, 5 insertions(+) diff --git a/ppx_deriving_qcheck.opam b/ppx_deriving_qcheck.opam index 6379d864..1020a9dc 100644 --- a/ppx_deriving_qcheck.opam +++ b/ppx_deriving_qcheck.opam @@ -27,3 +27,4 @@ build: [ homepage: "https://github.com/c-cube/qcheck/" bug-reports: "https://github.com/c-cube/qcheck/-/issues" dev-repo: "git+https://github.com/vch9/ppx_deriving_qcheck.git" +x-maintenance-intent: ["(latest)"] diff --git a/qcheck-alcotest.opam b/qcheck-alcotest.opam index e1510a6b..7e13ec71 100644 --- a/qcheck-alcotest.opam +++ b/qcheck-alcotest.opam @@ -27,3 +27,4 @@ depends: [ ] dev-repo: "git+https://github.com/c-cube/qcheck.git" bug-reports: "https://github.com/c-cube/qcheck/issues" +x-maintenance-intent: ["(latest)"] diff --git a/qcheck-core.opam b/qcheck-core.opam index 1cbdd88b..4b7dd673 100644 --- a/qcheck-core.opam +++ b/qcheck-core.opam @@ -24,6 +24,7 @@ depends: [ "ocaml" {>= "4.08.0"} ] dev-repo: "git+https://github.com/c-cube/qcheck.git" +x-maintenance-intent: ["(latest)"] bug-reports: "https://github.com/c-cube/qcheck/issues" conflicts: [ "ounit" { < "2.0" } diff --git a/qcheck-ounit.opam b/qcheck-ounit.opam index 1b635efc..f6b7235e 100644 --- a/qcheck-ounit.opam +++ b/qcheck-ounit.opam @@ -25,4 +25,5 @@ depends: [ "ocaml" {>= "4.08.0"} ] dev-repo: "git+https://github.com/c-cube/qcheck.git" +x-maintenance-intent: ["(latest)"] bug-reports: "https://github.com/c-cube/qcheck/issues" diff --git a/qcheck.opam b/qcheck.opam index 0fa67c8a..c828bb39 100644 --- a/qcheck.opam +++ b/qcheck.opam @@ -26,6 +26,7 @@ depends: [ "ocaml" {>= "4.08.0"} ] dev-repo: "git+https://github.com/c-cube/qcheck.git" +x-maintenance-intent: ["(latest)"] bug-reports: "https://github.com/c-cube/qcheck/issues" conflicts: [ "ounit" { < "2.0" } From 0166091d64f36c52aa200a674b4064ed74e943ee Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 20 Jan 2025 11:50:18 +0100 Subject: [PATCH 272/391] Add positive tests of int{,32,64} for QCheck and QCheck2 --- test/core/QCheck2_expect_test.expected.ocaml4.32 | 2 +- test/core/QCheck2_expect_test.expected.ocaml4.64 | 2 +- test/core/QCheck2_expect_test.expected.ocaml5.32 | 2 +- test/core/QCheck2_expect_test.expected.ocaml5.64 | 2 +- test/core/QCheck2_tests.ml | 15 +++++++++++++++ test/core/QCheck_expect_test.expected.ocaml4.32 | 2 +- test/core/QCheck_expect_test.expected.ocaml4.64 | 2 +- test/core/QCheck_expect_test.expected.ocaml5.32 | 2 +- test/core/QCheck_expect_test.expected.ocaml5.64 | 2 +- test/core/QCheck_tests.ml | 15 +++++++++++++++ 10 files changed, 38 insertions(+), 8 deletions(-) diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.32 b/test/core/QCheck2_expect_test.expected.ocaml4.32 index 5054a74c..75ee1809 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.32 @@ -1447,7 +1447,7 @@ stats dist: 6.. 10: 0 ================================================================================ 1 warning(s) -failure (64 tests failed, 3 tests errored, ran 143 tests) +failure (64 tests failed, 3 tests errored, ran 146 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.64 b/test/core/QCheck2_expect_test.expected.ocaml4.64 index c04aa400..f1c2ceba 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.64 @@ -1511,7 +1511,7 @@ stats dist: 6.. 10: 0 ================================================================================ 1 warning(s) -failure (64 tests failed, 3 tests errored, ran 143 tests) +failure (64 tests failed, 3 tests errored, ran 146 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.32 b/test/core/QCheck2_expect_test.expected.ocaml5.32 index 81879c1a..c96f716e 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.32 @@ -1447,7 +1447,7 @@ stats dist: -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (64 tests failed, 3 tests errored, ran 143 tests) +failure (64 tests failed, 3 tests errored, ran 146 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.64 b/test/core/QCheck2_expect_test.expected.ocaml5.64 index 7126ca47..01738235 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.64 @@ -1503,7 +1503,7 @@ stats dist: -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (64 tests failed, 3 tests errored, ran 143 tests) +failure (64 tests failed, 3 tests errored, ran 146 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_tests.ml b/test/core/QCheck2_tests.ml index 3f2add05..3990dd01 100644 --- a/test/core/QCheck2_tests.ml +++ b/test/core/QCheck2_tests.ml @@ -193,6 +193,18 @@ module Generator = struct Test.make ~name:"nat has right range" ~count:1000 ~print:Print.int Gen.nat (fun n -> 0 <= n && n < 10000) + let int_test = + Test.make ~name:"int doubling" ~count:1000 ~print:Print.int + Gen.int (fun i -> i+i = 2*i) + + let int32_test = + Test.make ~name:"int32 doubling" ~count:1000 ~print:Print.int32 + Gen.int32 (fun i -> Int32.add i i = Int32.mul 2l i) + + let int64_test = + Test.make ~name:"int64 doubling" ~count:1000 ~print:Print.int64 + Gen.int64 (fun i -> Int64.add i i = Int64.mul 2L i) + let bytes_test = Test.make ~name:"bytes has right length and content" ~count:1000 ~print:Print.bytes Gen.bytes @@ -317,6 +329,9 @@ module Generator = struct char_dist_issue_23; char_test; nat_test; + int_test; + int32_test; + int64_test; bytes_test; string_test; pair_test; diff --git a/test/core/QCheck_expect_test.expected.ocaml4.32 b/test/core/QCheck_expect_test.expected.ocaml4.32 index e5217c99..950e4721 100644 --- a/test/core/QCheck_expect_test.expected.ocaml4.32 +++ b/test/core/QCheck_expect_test.expected.ocaml4.32 @@ -1417,7 +1417,7 @@ stats dist: 6.. 10: 0 ================================================================================ 1 warning(s) -failure (64 tests failed, 3 tests errored, ran 151 tests) +failure (64 tests failed, 3 tests errored, ran 154 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_expect_test.expected.ocaml4.64 b/test/core/QCheck_expect_test.expected.ocaml4.64 index c026b98a..573c9c46 100644 --- a/test/core/QCheck_expect_test.expected.ocaml4.64 +++ b/test/core/QCheck_expect_test.expected.ocaml4.64 @@ -1449,7 +1449,7 @@ stats dist: 6.. 10: 0 ================================================================================ 1 warning(s) -failure (64 tests failed, 3 tests errored, ran 151 tests) +failure (64 tests failed, 3 tests errored, ran 154 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_expect_test.expected.ocaml5.32 b/test/core/QCheck_expect_test.expected.ocaml5.32 index 19929927..5689abcc 100644 --- a/test/core/QCheck_expect_test.expected.ocaml5.32 +++ b/test/core/QCheck_expect_test.expected.ocaml5.32 @@ -1427,7 +1427,7 @@ stats dist: -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (64 tests failed, 3 tests errored, ran 151 tests) +failure (64 tests failed, 3 tests errored, ran 154 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_expect_test.expected.ocaml5.64 b/test/core/QCheck_expect_test.expected.ocaml5.64 index c7636b1d..c9a06d29 100644 --- a/test/core/QCheck_expect_test.expected.ocaml5.64 +++ b/test/core/QCheck_expect_test.expected.ocaml5.64 @@ -1459,7 +1459,7 @@ stats dist: -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (64 tests failed, 3 tests errored, ran 151 tests) +failure (64 tests failed, 3 tests errored, ran 154 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_tests.ml b/test/core/QCheck_tests.ml index dd5b7ec4..c6ad9078 100644 --- a/test/core/QCheck_tests.ml +++ b/test/core/QCheck_tests.ml @@ -201,6 +201,18 @@ module Generator = struct Test.make ~name:"nat has right range" ~count:1000 (make ~print:Print.int Gen.nat) (fun n -> 0 <= n && n < 10000) + let int_test = + Test.make ~name:"int doubling" ~count:1000 + int (fun i -> i+i = 2*i) + + let int32_test = + Test.make ~name:"int32 doubling" ~count:1000 + int32 (fun i -> Int32.add i i = Int32.mul 2l i) + + let int64_test = + Test.make ~name:"int64 doubling" ~count:1000 + int64 (fun i -> Int64.add i i = Int64.mul 2L i) + let bytes_test = Test.make ~name:"bytes has right length and content" ~count:1000 bytes @@ -398,6 +410,9 @@ module Generator = struct printable_test; numeral_test; nat_test; + int_test; + int32_test; + int64_test; bytes_test; string_test; pair_test; From afc44f69034f7538e01c0aeb6179f88ba550e6ae Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 20 Jan 2025 12:13:06 +0100 Subject: [PATCH 273/391] Add negative tests of int{,32,64} for QCheck and QCheck2, and update expected output --- .../QCheck2_expect_test.expected.ocaml4.32 | 26 ++++++++++++++++++- .../QCheck2_expect_test.expected.ocaml4.64 | 26 ++++++++++++++++++- .../QCheck2_expect_test.expected.ocaml5.32 | 26 ++++++++++++++++++- .../QCheck2_expect_test.expected.ocaml5.64 | 26 ++++++++++++++++++- test/core/QCheck2_tests.ml | 20 ++++++++++++++ .../QCheck_expect_test.expected.ocaml4.32 | 26 ++++++++++++++++++- .../QCheck_expect_test.expected.ocaml4.64 | 26 ++++++++++++++++++- .../QCheck_expect_test.expected.ocaml5.32 | 26 ++++++++++++++++++- .../QCheck_expect_test.expected.ocaml5.64 | 26 ++++++++++++++++++- test/core/QCheck_tests.ml | 20 ++++++++++++++ 10 files changed, 240 insertions(+), 8 deletions(-) diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.32 b/test/core/QCheck2_expect_test.expected.ocaml4.32 index 75ee1809..33e05068 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.32 @@ -252,6 +252,30 @@ Test ints are 0 failed (29 shrink steps): --- Failure -------------------------------------------------------------------- +Test int32s arent 0l rem 3l failed (1 shrink steps): + +0l + +--- Failure -------------------------------------------------------------------- + +Test int32s are 0l failed (30 shrink steps): + +-1l + +--- Failure -------------------------------------------------------------------- + +Test int64s arent 0L rem 3L failed (1 shrink steps): + +0L + +--- Failure -------------------------------------------------------------------- + +Test int64s are 0L failed (62 shrink steps): + +-1L + +--- Failure -------------------------------------------------------------------- + Test ints < 209609 failed (0 shrink steps): 1073741823 @@ -1447,7 +1471,7 @@ stats dist: 6.. 10: 0 ================================================================================ 1 warning(s) -failure (64 tests failed, 3 tests errored, ran 146 tests) +failure (68 tests failed, 3 tests errored, ran 150 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.64 b/test/core/QCheck2_expect_test.expected.ocaml4.64 index f1c2ceba..e9309343 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.64 @@ -316,6 +316,30 @@ Test ints are 0 failed (61 shrink steps): --- Failure -------------------------------------------------------------------- +Test int32s arent 0l rem 3l failed (1 shrink steps): + +0l + +--- Failure -------------------------------------------------------------------- + +Test int32s are 0l failed (30 shrink steps): + +-1l + +--- Failure -------------------------------------------------------------------- + +Test int64s arent 0L rem 3L failed (1 shrink steps): + +0L + +--- Failure -------------------------------------------------------------------- + +Test int64s are 0L failed (62 shrink steps): + +-1L + +--- Failure -------------------------------------------------------------------- + Test ints < 209609 failed (0 shrink steps): 4611686018427387903 @@ -1511,7 +1535,7 @@ stats dist: 6.. 10: 0 ================================================================================ 1 warning(s) -failure (64 tests failed, 3 tests errored, ran 146 tests) +failure (68 tests failed, 3 tests errored, ran 150 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.32 b/test/core/QCheck2_expect_test.expected.ocaml5.32 index c96f716e..fdbe8e5e 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.32 @@ -252,6 +252,30 @@ Test ints are 0 failed (29 shrink steps): --- Failure -------------------------------------------------------------------- +Test int32s arent 0l rem 3l failed (1 shrink steps): + +0l + +--- Failure -------------------------------------------------------------------- + +Test int32s are 0l failed (30 shrink steps): + +1l + +--- Failure -------------------------------------------------------------------- + +Test int64s arent 0L rem 3L failed (1 shrink steps): + +0L + +--- Failure -------------------------------------------------------------------- + +Test int64s are 0L failed (62 shrink steps): + +1L + +--- Failure -------------------------------------------------------------------- + Test ints < 209609 failed (0 shrink steps): 1073741823 @@ -1447,7 +1471,7 @@ stats dist: -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (64 tests failed, 3 tests errored, ran 146 tests) +failure (68 tests failed, 3 tests errored, ran 150 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.64 b/test/core/QCheck2_expect_test.expected.ocaml5.64 index 01738235..5c70207e 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.64 @@ -308,6 +308,30 @@ Test ints are 0 failed (57 shrink steps): --- Failure -------------------------------------------------------------------- +Test int32s arent 0l rem 3l failed (1 shrink steps): + +0l + +--- Failure -------------------------------------------------------------------- + +Test int32s are 0l failed (30 shrink steps): + +1l + +--- Failure -------------------------------------------------------------------- + +Test int64s arent 0L rem 3L failed (1 shrink steps): + +0L + +--- Failure -------------------------------------------------------------------- + +Test int64s are 0L failed (62 shrink steps): + +1L + +--- Failure -------------------------------------------------------------------- + Test ints < 209609 failed (0 shrink steps): 4611686018427387903 @@ -1503,7 +1527,7 @@ stats dist: -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (64 tests failed, 3 tests errored, ran 146 tests) +failure (68 tests failed, 3 tests errored, ran 150 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_tests.ml b/test/core/QCheck2_tests.ml index 3990dd01..57d914e4 100644 --- a/test/core/QCheck2_tests.ml +++ b/test/core/QCheck2_tests.ml @@ -390,6 +390,22 @@ module Shrink = struct Test.make ~name:"ints are 0" ~count:1000 ~print:Print.int Gen.int (fun i -> Printf.printf "%i\n" i; i = 0) + let int32s_arent_0l_rem_3l = + Test.make ~name:"int32s arent 0l rem 3l" ~count:1000 ~print:Print.int32 + Gen.int32 (fun i -> Int32.rem i 3l <> 0l) + + let int32s_are_0l = + Test.make ~name:"int32s are 0l" ~count:1000 ~print:Print.int32 + Gen.int32 (fun i -> i = 0l) + + let int64s_arent_0L_rem_3L = + Test.make ~name:"int64s arent 0L rem 3L" ~count:1000 ~print:Print.int64 + Gen.int64 (fun i -> Int64.rem i 3L <> 0L) + + let int64s_are_0L = + Test.make ~name:"int64s are 0L" ~count:1000 ~print:Print.int64 + Gen.int64 (fun i -> i = 0L) + (* test from issue #59 *) let ints_smaller_209609 = Test.make ~name:"ints < 209609" ~print:Print.int @@ -645,6 +661,10 @@ module Shrink = struct long_shrink; ints_arent_0_mod_3; ints_are_0; + int32s_arent_0l_rem_3l; + int32s_are_0l; + int64s_arent_0L_rem_3L; + int64s_are_0L; ints_smaller_209609; nats_smaller_5001; char_is_never_abcdef; diff --git a/test/core/QCheck_expect_test.expected.ocaml4.32 b/test/core/QCheck_expect_test.expected.ocaml4.32 index 950e4721..3bd91928 100644 --- a/test/core/QCheck_expect_test.expected.ocaml4.32 +++ b/test/core/QCheck_expect_test.expected.ocaml4.32 @@ -221,6 +221,30 @@ Test ints are 0 failed (30 shrink steps): --- Failure -------------------------------------------------------------------- +Test int32s arent 0l rem 3l failed (41 shrink steps): + +-21l + +--- Failure -------------------------------------------------------------------- + +Test int32s are 0l failed (31 shrink steps): + +-1l + +--- Failure -------------------------------------------------------------------- + +Test int64s arent 0L rem 3L failed (90 shrink steps): + +-21L + +--- Failure -------------------------------------------------------------------- + +Test int64s are 0L failed (63 shrink steps): + +-1L + +--- Failure -------------------------------------------------------------------- + Test ints < 209609 failed (20 shrink steps): 209609 @@ -1417,7 +1441,7 @@ stats dist: 6.. 10: 0 ================================================================================ 1 warning(s) -failure (64 tests failed, 3 tests errored, ran 154 tests) +failure (68 tests failed, 3 tests errored, ran 158 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_expect_test.expected.ocaml4.64 b/test/core/QCheck_expect_test.expected.ocaml4.64 index 573c9c46..426055f0 100644 --- a/test/core/QCheck_expect_test.expected.ocaml4.64 +++ b/test/core/QCheck_expect_test.expected.ocaml4.64 @@ -253,6 +253,30 @@ Test ints are 0 failed (62 shrink steps): --- Failure -------------------------------------------------------------------- +Test int32s arent 0l rem 3l failed (41 shrink steps): + +-21l + +--- Failure -------------------------------------------------------------------- + +Test int32s are 0l failed (31 shrink steps): + +-1l + +--- Failure -------------------------------------------------------------------- + +Test int64s arent 0L rem 3L failed (90 shrink steps): + +-21L + +--- Failure -------------------------------------------------------------------- + +Test int64s are 0L failed (63 shrink steps): + +-1L + +--- Failure -------------------------------------------------------------------- + Test ints < 209609 failed (52 shrink steps): 209609 @@ -1449,7 +1473,7 @@ stats dist: 6.. 10: 0 ================================================================================ 1 warning(s) -failure (64 tests failed, 3 tests errored, ran 154 tests) +failure (68 tests failed, 3 tests errored, ran 158 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_expect_test.expected.ocaml5.32 b/test/core/QCheck_expect_test.expected.ocaml5.32 index 5689abcc..3ee23b48 100644 --- a/test/core/QCheck_expect_test.expected.ocaml5.32 +++ b/test/core/QCheck_expect_test.expected.ocaml5.32 @@ -231,6 +231,30 @@ Test ints are 0 failed (29 shrink steps): --- Failure -------------------------------------------------------------------- +Test int32s arent 0l rem 3l failed (37 shrink steps): + +21l + +--- Failure -------------------------------------------------------------------- + +Test int32s are 0l failed (31 shrink steps): + +1l + +--- Failure -------------------------------------------------------------------- + +Test int64s arent 0L rem 3L failed (83 shrink steps): + +705L + +--- Failure -------------------------------------------------------------------- + +Test int64s are 0L failed (63 shrink steps): + +1L + +--- Failure -------------------------------------------------------------------- + Test ints < 209609 failed (20 shrink steps): 209609 @@ -1427,7 +1451,7 @@ stats dist: -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (64 tests failed, 3 tests errored, ran 154 tests) +failure (68 tests failed, 3 tests errored, ran 158 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_expect_test.expected.ocaml5.64 b/test/core/QCheck_expect_test.expected.ocaml5.64 index c9a06d29..22ddaf52 100644 --- a/test/core/QCheck_expect_test.expected.ocaml5.64 +++ b/test/core/QCheck_expect_test.expected.ocaml5.64 @@ -263,6 +263,30 @@ Test ints are 0 failed (61 shrink steps): --- Failure -------------------------------------------------------------------- +Test int32s arent 0l rem 3l failed (37 shrink steps): + +21l + +--- Failure -------------------------------------------------------------------- + +Test int32s are 0l failed (31 shrink steps): + +1l + +--- Failure -------------------------------------------------------------------- + +Test int64s arent 0L rem 3L failed (83 shrink steps): + +705L + +--- Failure -------------------------------------------------------------------- + +Test int64s are 0L failed (63 shrink steps): + +1L + +--- Failure -------------------------------------------------------------------- + Test ints < 209609 failed (52 shrink steps): 209609 @@ -1459,7 +1483,7 @@ stats dist: -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (64 tests failed, 3 tests errored, ran 154 tests) +failure (68 tests failed, 3 tests errored, ran 158 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_tests.ml b/test/core/QCheck_tests.ml index c6ad9078..35e5ffaa 100644 --- a/test/core/QCheck_tests.ml +++ b/test/core/QCheck_tests.ml @@ -476,6 +476,22 @@ module Shrink = struct Test.make ~name:"ints are 0" ~count:1000 int (fun i -> Printf.printf "%i\n" i; i = 0) + let int32s_arent_0l_rem_3l = + Test.make ~name:"int32s arent 0l rem 3l" ~count:1000 + int32 (fun i -> Int32.rem i 3l <> 0l) + + let int32s_are_0l = + Test.make ~name:"int32s are 0l" ~count:1000 + int32 (fun i -> i = 0l) + + let int64s_arent_0L_rem_3L = + Test.make ~name:"int64s arent 0L rem 3L" ~count:1000 + int64 (fun i -> Int64.rem i 3L <> 0L) + + let int64s_are_0L = + Test.make ~name:"int64s are 0L" ~count:1000 + int64 (fun i -> i = 0L) + (* test from issue #59 *) let ints_smaller_209609 = Test.make ~name:"ints < 209609" @@ -721,6 +737,10 @@ module Shrink = struct long_shrink; ints_arent_0_mod_3; ints_are_0; + int32s_arent_0l_rem_3l; + int32s_are_0l; + int64s_arent_0L_rem_3L; + int64s_are_0L; ints_smaller_209609; nats_smaller_5001; char_is_never_abcdef; From db86774714b31176300e77f533bc9652756eb0b9 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 20 Jan 2025 16:27:26 +0100 Subject: [PATCH 274/391] Add Observable.int{32,64} function tests for QCheck and QCheck2 --- .../QCheck2_expect_test.expected.ocaml4.32 | 16 +++++++++-- .../QCheck2_expect_test.expected.ocaml4.64 | 16 +++++++++-- .../QCheck2_expect_test.expected.ocaml5.32 | 16 +++++++++-- .../QCheck2_expect_test.expected.ocaml5.64 | 16 +++++++++-- test/core/QCheck2_tests.ml | 28 +++++++++++++++++-- .../QCheck_expect_test.expected.ocaml4.32 | 17 +++++++++-- .../QCheck_expect_test.expected.ocaml4.64 | 16 +++++++++-- .../QCheck_expect_test.expected.ocaml5.32 | 16 +++++++++-- .../QCheck_expect_test.expected.ocaml5.64 | 16 +++++++++-- test/core/QCheck_tests.ml | 26 +++++++++++++++-- 10 files changed, 161 insertions(+), 22 deletions(-) diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.32 b/test/core/QCheck2_expect_test.expected.ocaml4.32 index 33e05068..dd496ce8 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.32 @@ -558,12 +558,24 @@ Test sum list = 0 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute failed (37 shrink steps): +Test fail_pred_map_commute_int failed (37 shrink steps): ([1], {_ -> 0}, {0 -> false; 1 -> true; -489114431 -> false; -334037599 -> false; -1002044798 -> false; 3 -> false; 607479396 -> false; 4 -> false; 5 -> false; 442140485 -> false; 50542662 -> false; 38 -> false; 281414086 -> false; 757535206 -> false; 6 -> false; 7 -> false; 8 -> false; 629085609 -> false; 10 -> false; -765856245 -> false; 44 -> false; 12 -> false; -386873971 -> false; 15 -> false; 47 -> false; -842421617 -> false; 588710735 -> false; 49 -> false; 18 -> false; 51 -> false; 449695123 -> false; 20 -> false; 21 -> false; -386709771 -> false; -92591850 -> false; 136918038 -> false; 54 -> false; -484444937 -> false; -1042148456 -> false; 24 -> false; 1062551480 -> false; 747852089 -> false; 25 -> false; -737785766 -> false; 58 -> false; -530708612 -> false; -60654788 -> false; 28 -> false; 60 -> false; 29 -> false; 947455871 -> false; _ -> false}) --- Failure -------------------------------------------------------------------- +Test fail_pred_map_commute_int32 failed (387 shrink steps): + +([0l; -1l; 0l; 0l], {-3306213l -> 0l; 1197833490l -> 0l; -2892936l -> 0l; -15734l -> 0l; -64486914l -> 0l; -62572l -> 0l; -4339404l -> 0l; -1025877462l -> 0l; -16782l -> 0l; -22376l -> 0l; -30228241l -> 0l; -46196l -> 0l; -6612427l -> 0l; -333718l -> 0l; -24l -> 0l; -2847734l -> 0l; 181789747l -> 0l; 963313183l -> 0l; -1820213110l -> 0l; -1l -> 0l; -667437l -> 0l; 1616814262l -> 0l; -1488783487l -> 0l; -14685l -> 0l; 1033594061l -> 0l; -1813075019l -> 0l; -250288l -> 0l; -993818792l -> 0l; -913675600l -> 0l; -227l -> 0l; -302l -> 0l; -8391l -> 0l; -120912964l -> 0l; -98l -> 0l; -2169702l -> 0l; -84l -> 0l; -22671180l -> 0l; -606578794l -> 0l; -60456482l -> 0l; -113l -> 0l; -171965105l -> 0l; -584024936l -> 0l; -112852100l -> 0l; -7867l -> 0l; -15114120l -> 0l; -962761955l -> 0l; -1210l -> 0l; -1245883l -> 0l; -343930210l -> 0l; -489145187l -> 0l; -57745l -> 0l; -1623262736l -> 0l; -26449710l -> 0l; -257947658l -> 0l; -4425l -> 0l; -275144168l -> 0l; -151l -> 0l; -1367836616l -> 0l; -1655635269l -> 0l; -1712149989l -> 0l; -4517l -> 0l; -93858l -> 0l; -931705118l -> 0l; -605l -> 0l; -46929l -> 0l; -3l -> 0l; -911891077l -> 0l; -1827351201l -> 0l; -366858890l -> 0l; -1823782155l -> 0l; -1370513400l -> 0l; -745364094l -> 0l; -500577l -> 0l; -1423867l -> 0l; -183429445l -> 0l; -7l -> 0l; -82126l -> 0l; -5900l -> 0l; -9l -> 0l; -11801l -> 0l; 0l -> 0l; -978290374l -> 0l; 1798112767l -> 0l; -6l -> 0l; -96730371l -> 0l; 1879036781l -> 0l; -13224855l -> 0l; -662545861l -> 0l; -2420l -> 0l; -128973829l -> 0l; -2950l -> 0l; -1898489l -> 0l; -1067900l -> 0l; -1282346828l -> 0l; -49l -> 0l; -496909396l -> 0l; -70394l -> 0l; -733717781l -> 0l; -61595l -> 0l; -5785873l -> 0l; -4959320l -> 0l; -36l -> 0l; -1713141750l -> 0l; 758591303l -> 0l; -869591443l -> 0l; -4840l -> 0l; -33564l -> 0l; -41063l -> 0l; -53895l -> 0l; -3254553l -> 0l; -59670l -> 0l; -1770246475l -> 0l; -4l -> 0l; 1789163010l -> 0l; -13l -> 0l; -1214991543l -> 0l; -1798798838l -> 0l; -2581l -> 0l; -1334875l -> 0l; -3796979l -> 0l; -56l -> 0l; -5163l -> 0l; -1325091722l -> 0l; -1598932300l -> 0l; -3872l -> 0l; -711933l -> 0l; -18l -> 0l; -12587l -> 0l; -29835l -> 0l; -44753l -> 0l; -683918308l -> 0l; -30797l -> 0l; -321001529l -> 0l; -1196857039l -> 0l; -27l -> 0l; -125144l -> 0l; _ -> 0l}, {-1372162354l -> false; -884582595l -> false; 1800016173l -> false; -779904501l -> false; -2892936l -> false; -1464127158l -> false; -1371977399l -> false; -15734l -> false; -64486914l -> false; -62572l -> false; -4339404l -> false; 877561983l -> false; 414188264l -> false; -1916606788l -> false; 1740280549l -> false; -16782l -> false; -22376l -> false; 617758864l -> false; 2015488394l -> false; -329016050l -> false; 881756612l -> false; -24l -> false; 181789747l -> false; -144023482l -> false; -1l -> true; -667437l -> false; -1963309287l -> false; 728919774l -> false; -1221096930l -> false; 1321175101l -> false; 1033594061l -> false; 951284407l -> false; -1970352360l -> false; -227l -> false; -8391l -> false; -120912964l -> false; -606578794l -> false; 835378038l -> false; -1503106072l -> false; 1417286097l -> false; -584024936l -> false; -7867l -> false; -1641824566l -> false; -15114120l -> false; 1061621111l -> false; 208505287l -> false; -1210l -> false; -1245883l -> false; 337016376l -> false; -489145187l -> false; 62273772l -> false; -423060868l -> false; 216633596l -> false; -4425l -> false; 687296055l -> false; -1655635269l -> false; 1185043051l -> false; -1885981966l -> false; -93858l -> false; 341746486l -> false; 832925959l -> false; 1777069974l -> false; -605l -> false; 250831898l -> false; 1459113028l -> false; 933129766l -> false; -366858890l -> false; -1955762247l -> false; -1979393312l -> false; -2074790497l -> false; 556304992l -> false; -226378611l -> false; -1823782155l -> false; -1868760937l -> false; -500577l -> false; 38077639l -> false; -82126l -> false; -897912102l -> false; -9l -> false; 1676533150l -> false; 0l -> false; 1346850769l -> false; 1798112767l -> false; -6l -> false; 1879036781l -> false; 823827784l -> false; 2063333633l -> false; -13224855l -> false; -2420l -> false; -1759657344l -> false; -1526945920l -> false; 2145450674l -> false; 460955345l -> false; -415731479l -> false; 213874472l -> false; 849685352l -> false; -1957578108l -> false; 1205181759l -> false; -1155824913l -> false; -61595l -> false; -36l -> false; -1928421895l -> false; -4840l -> false; -33564l -> false; -1992511697l -> false; -3254553l -> false; -59670l -> false; -1024615222l -> false; -1770246475l -> false; -4l -> false; -1456428227l -> false; -13l -> false; -841267869l -> false; -1214991543l -> false; 625548763l -> false; -1798798838l -> false; 445235604l -> false; -1325091722l -> false; 1291636512l -> false; 416432296l -> false; -29835l -> false; 403241457l -> false; 199474988l -> false; -44753l -> false; -1584279822l -> false; -321001529l -> false; 340912948l -> false; -1538616721l -> false; -709900296l -> false; -3306213l -> false; 1197833490l -> false; -896768552l -> false; 657999523l -> false; 39544867l -> false; 1137798329l -> false; -1025877462l -> false; -30228241l -> false; 1726278290l -> false; -46196l -> false; -6612427l -> false; -333718l -> false; -2847734l -> false; 963313183l -> false; 606471631l -> false; -1820213110l -> false; 177710964l -> false; 1616814262l -> false; -1488783487l -> false; -14685l -> false; 1036279573l -> false; -1523442268l -> false; -1813075019l -> false; -250288l -> false; 775047850l -> false; -993818792l -> false; -913675600l -> false; -302l -> false; 1748803067l -> false; 1275416085l -> false; -98l -> false; -2169702l -> false; -1341114758l -> false; -84l -> false; -1742175178l -> false; -22671180l -> false; -26503445l -> false; -60456482l -> false; -113l -> false; -171965105l -> false; -112852100l -> false; -962761955l -> false; -343930210l -> false; -467464372l -> false; -57745l -> false; 1216723951l -> false; -1623262736l -> false; -1293530462l -> false; -26449710l -> false; -257947658l -> false; -1976623084l -> false; -275144168l -> false; -151l -> false; -1367836616l -> false; -1712149989l -> false; -4517l -> false; -931705118l -> false; -46929l -> false; -1874058468l -> false; 305281673l -> false; 646604853l -> false; -3l -> false; -911891077l -> false; -1827351201l -> false; 1480739939l -> false; 900400450l -> false; -1058357325l -> false; -1370513400l -> false; -886920683l -> false; 1996318795l -> false; -745364094l -> false; -1423867l -> false; -183429445l -> false; -7l -> false; 1550542030l -> false; -277136218l -> false; -5900l -> false; -664341267l -> false; -11801l -> false; -978290374l -> false; 2035121219l -> false; -155738355l -> false; -1043920263l -> false; -96730371l -> false; -1556572344l -> false; -662545861l -> false; 159279166l -> false; -128973829l -> false; -2950l -> false; -1898489l -> false; -82758570l -> false; 480999450l -> false; 617978198l -> false; -1067900l -> false; -1749017191l -> false; -1282346828l -> false; -49l -> false; 1147662236l -> false; -496909396l -> false; -70394l -> false; -733717781l -> false; -1434263070l -> false; -5785873l -> false; -4959320l -> false; -1460831450l -> false; -1713141750l -> false; 758591303l -> false; -1031603386l -> false; 1904716534l -> false; -869591443l -> false; -41063l -> false; -53895l -> false; 772609659l -> false; 361181180l -> false; 1789163010l -> false; 407384961l -> false; -987899689l -> false; -324827521l -> false; -2581l -> false; -1334875l -> false; 1234269183l -> false; -3796979l -> false; -56l -> false; -5163l -> false; -906342689l -> false; -1598932300l -> false; -3872l -> false; 420661032l -> false; -711933l -> false; -929215411l -> false; -18l -> false; -12587l -> false; -683918308l -> false; -240585914l -> false; -30797l -> false; -547193882l -> false; -1196857039l -> false; 1480038317l -> false; 532907932l -> false; -27l -> false; -288893568l -> false; -125144l -> false; _ -> false}) + +--- Failure -------------------------------------------------------------------- + +Test fail_pred_map_commute_int64 failed (219 shrink steps): + +([0L; 0L], {-1626777584348663391L -> 0L; -5274952442275438188L -> 0L; -1555621157876977468L -> 0L; 9108471596139219934L -> 0L; 7166876332973786910L -> 0L; 7019298611444604923L -> 0L; 3636655765360274557L -> 0L; -5299254572774104738L -> 0L; -33611074348872304L -> 0L; 1085477442822779951L -> 0L; 3550441151034303976L -> 0L; 7853829573999932795L -> 0L; 6570741223274545232L -> 0L; -9223241388095087777L -> 0L; 3145233702944072634L -> 0L; -4960186156748015984L -> 0L; 5949833029125707898L -> 0L; 8250044297663344735L -> 0L; 3926289947985597133L -> 0L; 2674458630179017557L -> 0L; 0L -> -1L; -1193494039317325605L -> 0L; -23581541164203791L -> 0L; 3262032974310066661L -> 0L; -1083726450716131347L -> 0L; 3148929065222398081L -> 0L; 34456112471805905L -> 0L; 3132053619847090208L -> 0L; 4099074157624200352L -> 0L; 4022909997771204357L -> 0L; -6581111995121167737L -> 0L; -3281956828365339039L -> 0L; 4382910041385585448L -> 0L; -5864916610580718835L -> 0L; 8584186777924536731L -> 0L; -5377162036943921244L -> 0L; 339138576765681485L -> 0L; -4861691548228816402L -> 0L; 7026031596079050131L -> 0L; 3839024356120653743L -> 0L; 2199816067032997124L -> 0L; -2789393114105475891L -> 0L; -4463380249671362201L -> 0L; -1431140827820444116L -> 0L; -6458440647188139180L -> 0L; -9103791047430776407L -> 0L; 6524619502474106000L -> 0L; -5429908502784908672L -> 0L; 7055687245367390835L -> 0L; -2349216052260771303L -> 0L; 4964388269721627631L -> 0L; -2751672235835279302L -> 0L; -2252793449446692507L -> 0L; -1091171088418411431L -> 0L; -3626926192832236521L -> 0L; 6786696509634778717L -> 0L; 6167793918440440992L -> 0L; -5290890539702059298L -> 0L; -4254817774861764540L -> 0L; -223583522706374158L -> 0L; 1105996183800211020L -> 0L; _ -> 0L}, {-1626777584348663391L -> false; -1555621157876977468L -> false; 9108471596139219934L -> false; 7732265564533085874L -> false; 7166876332973786910L -> false; 3550441151034303976L -> false; 1085477442822779951L -> false; 7853829573999932795L -> false; 3536675290503201843L -> false; -9128436253306377212L -> false; 3145233702944072634L -> false; -767017806279838012L -> false; 3926289947985597133L -> false; -6420956448021483933L -> false; 0L -> true; -23581541164203791L -> false; 3262032974310066661L -> false; 6391072603087371769L -> false; 1235568768376798224L -> false; -3909837786300313525L -> false; 34456112471805905L -> false; -6428055735629983608L -> false; 2623804087025851129L -> false; 4022909997771204357L -> false; -6581111995121167737L -> false; -6030988397309468346L -> false; -5864916610580718835L -> false; -5377162036943921244L -> false; -6495357859524114684L -> false; -1611032219521099730L -> false; 310391246715086669L -> false; 6408542658405221565L -> false; 2199816067032997124L -> false; 3839024356120653743L -> false; -4745654685023142655L -> false; 6847978435200344376L -> false; -2789393114105475891L -> false; -4463380249671362201L -> false; 3840360328563700082L -> false; -1431140827820444116L -> false; -6458440647188139180L -> false; -7765421792345238673L -> false; -4378680565567194056L -> false; -2349216052260771303L -> false; -2727353340127719681L -> false; 103321857428247527L -> false; -2252793449446692507L -> false; 6786696509634778717L -> false; -5290890539702059298L -> false; -264972637768065869L -> false; -4254817774861764540L -> false; 844666124734041018L -> false; 1105996183800211020L -> false; 4619286360921092268L -> false; -5274952442275438188L -> false; -6795560563734300894L -> false; 7019298611444604923L -> false; 3636655765360274557L -> false; 6165875408190569670L -> false; -5299254572774104738L -> false; -33611074348872304L -> false; 6570741223274545232L -> false; 3192165204308451046L -> false; -7819072410914830782L -> false; -9223241388095087777L -> false; -1424296199548586816L -> false; 6480341267797276322L -> false; -2341802166847999862L -> false; -4960186156748015984L -> false; 5949833029125707898L -> false; 8250044297663344735L -> false; 5214084478326154921L -> false; -1751416471876264704L -> false; 1281239262848334764L -> false; 2674458630179017557L -> false; 7080697169726960547L -> false; -1193494039317325605L -> false; 1924277706246431661L -> false; -4572301776388457843L -> false; -1775944920399996443L -> false; -1476499248608534591L -> false; -1083726450716131347L -> false; 3148929065222398081L -> false; 5135918803737217981L -> false; 3132053619847090208L -> false; -8795479186954029747L -> false; 4099074157624200352L -> false; -1725358293392483925L -> false; -883157324790385183L -> false; -3281956828365339039L -> false; 4382910041385585448L -> false; 7959678776239405401L -> false; 8584186777924536731L -> false; 6156908854039039331L -> false; 770656223494446708L -> false; 339138576765681485L -> false; 5155757567267116618L -> false; -4861691548228816402L -> false; -5029806468813998902L -> false; -5916595597725606869L -> false; -4925674386326338647L -> false; 8028367910303937204L -> false; 7026031596079050131L -> false; -5014191838822778121L -> false; -5381171409130864747L -> false; 8555424481824659787L -> false; 5886333856077963766L -> false; 3049517074836180120L -> false; -9103791047430776407L -> false; 6524619502474106000L -> false; -482660119496121524L -> false; -5429908502784908672L -> false; 7055687245367390835L -> false; 4964388269721627631L -> false; -2751672235835279302L -> false; -3626926192832236521L -> false; -1091171088418411431L -> false; 6167793918440440992L -> false; -1881974088854145838L -> false; 2212053705486708444L -> false; -223583522706374158L -> false; _ -> false}) + +--- Failure -------------------------------------------------------------------- + Test fail_pred_strings failed (2 shrink steps): {"some random string" -> true; _ -> false} @@ -1471,7 +1483,7 @@ stats dist: 6.. 10: 0 ================================================================================ 1 warning(s) -failure (68 tests failed, 3 tests errored, ran 150 tests) +failure (70 tests failed, 3 tests errored, ran 152 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.64 b/test/core/QCheck2_expect_test.expected.ocaml4.64 index e9309343..3f43bef7 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.64 @@ -622,12 +622,24 @@ Test sum list = 0 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute failed (122 shrink steps): +Test fail_pred_map_commute_int failed (122 shrink steps): ([0], {0 -> 1; 2 -> 0; 20 -> 0; 4 -> 0; 54 -> 0; 6 -> 0; 8 -> 0; 60 -> 0; 12 -> 0; _ -> 0}, {0 -> true; -1487654178632829215 -> false; -2792235260416531278 -> false; 2 -> false; 3324124342680534771 -> false; 20 -> false; 4 -> false; -2849913598173370635 -> false; 54 -> false; 6 -> false; 8 -> false; 815755449952469177 -> false; 4035005642433201833 -> false; -2961585594425353332 -> false; 60 -> false; 12 -> false; 3780670741311086221 -> false; _ -> false}) --- Failure -------------------------------------------------------------------- +Test fail_pred_map_commute_int32 failed (387 shrink steps): + +([0l; -1l; 0l; 0l], {-3306213l -> 0l; 1197833490l -> 0l; -2892936l -> 0l; -15734l -> 0l; -64486914l -> 0l; -62572l -> 0l; -4339404l -> 0l; -1025877462l -> 0l; -16782l -> 0l; -22376l -> 0l; -30228241l -> 0l; -46196l -> 0l; -6612427l -> 0l; -333718l -> 0l; -24l -> 0l; -2847734l -> 0l; 181789747l -> 0l; 963313183l -> 0l; -1820213110l -> 0l; -1l -> 0l; -667437l -> 0l; 1616814262l -> 0l; -1488783487l -> 0l; -14685l -> 0l; 1033594061l -> 0l; -1813075019l -> 0l; -250288l -> 0l; -993818792l -> 0l; -913675600l -> 0l; -227l -> 0l; -302l -> 0l; -8391l -> 0l; -120912964l -> 0l; -98l -> 0l; -2169702l -> 0l; -84l -> 0l; -22671180l -> 0l; -606578794l -> 0l; -60456482l -> 0l; -113l -> 0l; -171965105l -> 0l; -584024936l -> 0l; -112852100l -> 0l; -7867l -> 0l; -15114120l -> 0l; -962761955l -> 0l; -1210l -> 0l; -1245883l -> 0l; -343930210l -> 0l; -489145187l -> 0l; -57745l -> 0l; -1623262736l -> 0l; -26449710l -> 0l; -257947658l -> 0l; -4425l -> 0l; -275144168l -> 0l; -151l -> 0l; -1367836616l -> 0l; -1655635269l -> 0l; -1712149989l -> 0l; -4517l -> 0l; -93858l -> 0l; -931705118l -> 0l; -605l -> 0l; -46929l -> 0l; -3l -> 0l; -911891077l -> 0l; -1827351201l -> 0l; -366858890l -> 0l; -1823782155l -> 0l; -1370513400l -> 0l; -745364094l -> 0l; -500577l -> 0l; -1423867l -> 0l; -183429445l -> 0l; -7l -> 0l; -82126l -> 0l; -5900l -> 0l; -9l -> 0l; -11801l -> 0l; 0l -> 0l; -978290374l -> 0l; 1798112767l -> 0l; -6l -> 0l; -96730371l -> 0l; 1879036781l -> 0l; -13224855l -> 0l; -662545861l -> 0l; -2420l -> 0l; -128973829l -> 0l; -2950l -> 0l; -1898489l -> 0l; -1067900l -> 0l; -1282346828l -> 0l; -49l -> 0l; -496909396l -> 0l; -70394l -> 0l; -733717781l -> 0l; -61595l -> 0l; -5785873l -> 0l; -4959320l -> 0l; -36l -> 0l; -1713141750l -> 0l; 758591303l -> 0l; -869591443l -> 0l; -4840l -> 0l; -33564l -> 0l; -41063l -> 0l; -53895l -> 0l; -3254553l -> 0l; -59670l -> 0l; -1770246475l -> 0l; -4l -> 0l; 1789163010l -> 0l; -13l -> 0l; -1214991543l -> 0l; -1798798838l -> 0l; -2581l -> 0l; -1334875l -> 0l; -3796979l -> 0l; -56l -> 0l; -5163l -> 0l; -1325091722l -> 0l; -1598932300l -> 0l; -3872l -> 0l; -711933l -> 0l; -18l -> 0l; -12587l -> 0l; -29835l -> 0l; -44753l -> 0l; -683918308l -> 0l; -30797l -> 0l; -321001529l -> 0l; -1196857039l -> 0l; -27l -> 0l; -125144l -> 0l; _ -> 0l}, {-1372162354l -> false; -884582595l -> false; 1800016173l -> false; -779904501l -> false; -2892936l -> false; -1464127158l -> false; -1371977399l -> false; -15734l -> false; -64486914l -> false; -62572l -> false; -4339404l -> false; 877561983l -> false; 414188264l -> false; -1916606788l -> false; 1740280549l -> false; -16782l -> false; -22376l -> false; 617758864l -> false; 2015488394l -> false; -329016050l -> false; 881756612l -> false; -24l -> false; 181789747l -> false; -144023482l -> false; -1l -> true; -667437l -> false; -1963309287l -> false; 728919774l -> false; -1221096930l -> false; 1321175101l -> false; 1033594061l -> false; 951284407l -> false; -1970352360l -> false; -227l -> false; -8391l -> false; -120912964l -> false; -606578794l -> false; 835378038l -> false; -1503106072l -> false; 1417286097l -> false; -584024936l -> false; -7867l -> false; -1641824566l -> false; -15114120l -> false; 1061621111l -> false; 208505287l -> false; -1210l -> false; -1245883l -> false; 337016376l -> false; -489145187l -> false; 62273772l -> false; -423060868l -> false; 216633596l -> false; -4425l -> false; 687296055l -> false; -1655635269l -> false; 1185043051l -> false; -1885981966l -> false; -93858l -> false; 341746486l -> false; 832925959l -> false; 1777069974l -> false; -605l -> false; 250831898l -> false; 1459113028l -> false; 933129766l -> false; -366858890l -> false; -1955762247l -> false; -1979393312l -> false; -2074790497l -> false; 556304992l -> false; -226378611l -> false; -1823782155l -> false; -1868760937l -> false; -500577l -> false; 38077639l -> false; -82126l -> false; -897912102l -> false; -9l -> false; 1676533150l -> false; 0l -> false; 1346850769l -> false; 1798112767l -> false; -6l -> false; 1879036781l -> false; 823827784l -> false; 2063333633l -> false; -13224855l -> false; -2420l -> false; -1759657344l -> false; -1526945920l -> false; 2145450674l -> false; 460955345l -> false; -415731479l -> false; 213874472l -> false; 849685352l -> false; -1957578108l -> false; 1205181759l -> false; -1155824913l -> false; -61595l -> false; -36l -> false; -1928421895l -> false; -4840l -> false; -33564l -> false; -1992511697l -> false; -3254553l -> false; -59670l -> false; -1024615222l -> false; -1770246475l -> false; -4l -> false; -1456428227l -> false; -13l -> false; -841267869l -> false; -1214991543l -> false; 625548763l -> false; -1798798838l -> false; 445235604l -> false; -1325091722l -> false; 1291636512l -> false; 416432296l -> false; -29835l -> false; 403241457l -> false; 199474988l -> false; -44753l -> false; -1584279822l -> false; -321001529l -> false; 340912948l -> false; -1538616721l -> false; -709900296l -> false; -3306213l -> false; 1197833490l -> false; -896768552l -> false; 657999523l -> false; 39544867l -> false; 1137798329l -> false; -1025877462l -> false; -30228241l -> false; 1726278290l -> false; -46196l -> false; -6612427l -> false; -333718l -> false; -2847734l -> false; 963313183l -> false; 606471631l -> false; -1820213110l -> false; 177710964l -> false; 1616814262l -> false; -1488783487l -> false; -14685l -> false; 1036279573l -> false; -1523442268l -> false; -1813075019l -> false; -250288l -> false; 775047850l -> false; -993818792l -> false; -913675600l -> false; -302l -> false; 1748803067l -> false; 1275416085l -> false; -98l -> false; -2169702l -> false; -1341114758l -> false; -84l -> false; -1742175178l -> false; -22671180l -> false; -26503445l -> false; -60456482l -> false; -113l -> false; -171965105l -> false; -112852100l -> false; -962761955l -> false; -343930210l -> false; -467464372l -> false; -57745l -> false; 1216723951l -> false; -1623262736l -> false; -1293530462l -> false; -26449710l -> false; -257947658l -> false; -1976623084l -> false; -275144168l -> false; -151l -> false; -1367836616l -> false; -1712149989l -> false; -4517l -> false; -931705118l -> false; -46929l -> false; -1874058468l -> false; 305281673l -> false; 646604853l -> false; -3l -> false; -911891077l -> false; -1827351201l -> false; 1480739939l -> false; 900400450l -> false; -1058357325l -> false; -1370513400l -> false; -886920683l -> false; 1996318795l -> false; -745364094l -> false; -1423867l -> false; -183429445l -> false; -7l -> false; 1550542030l -> false; -277136218l -> false; -5900l -> false; -664341267l -> false; -11801l -> false; -978290374l -> false; 2035121219l -> false; -155738355l -> false; -1043920263l -> false; -96730371l -> false; -1556572344l -> false; -662545861l -> false; 159279166l -> false; -128973829l -> false; -2950l -> false; -1898489l -> false; -82758570l -> false; 480999450l -> false; 617978198l -> false; -1067900l -> false; -1749017191l -> false; -1282346828l -> false; -49l -> false; 1147662236l -> false; -496909396l -> false; -70394l -> false; -733717781l -> false; -1434263070l -> false; -5785873l -> false; -4959320l -> false; -1460831450l -> false; -1713141750l -> false; 758591303l -> false; -1031603386l -> false; 1904716534l -> false; -869591443l -> false; -41063l -> false; -53895l -> false; 772609659l -> false; 361181180l -> false; 1789163010l -> false; 407384961l -> false; -987899689l -> false; -324827521l -> false; -2581l -> false; -1334875l -> false; 1234269183l -> false; -3796979l -> false; -56l -> false; -5163l -> false; -906342689l -> false; -1598932300l -> false; -3872l -> false; 420661032l -> false; -711933l -> false; -929215411l -> false; -18l -> false; -12587l -> false; -683918308l -> false; -240585914l -> false; -30797l -> false; -547193882l -> false; -1196857039l -> false; 1480038317l -> false; 532907932l -> false; -27l -> false; -288893568l -> false; -125144l -> false; _ -> false}) + +--- Failure -------------------------------------------------------------------- + +Test fail_pred_map_commute_int64 failed (219 shrink steps): + +([0L; 0L], {-1626777584348663391L -> 0L; -5274952442275438188L -> 0L; -1555621157876977468L -> 0L; 9108471596139219934L -> 0L; 7166876332973786910L -> 0L; 7019298611444604923L -> 0L; 3636655765360274557L -> 0L; -5299254572774104738L -> 0L; -33611074348872304L -> 0L; 1085477442822779951L -> 0L; 3550441151034303976L -> 0L; 7853829573999932795L -> 0L; 6570741223274545232L -> 0L; -9223241388095087777L -> 0L; 3145233702944072634L -> 0L; -4960186156748015984L -> 0L; 5949833029125707898L -> 0L; 8250044297663344735L -> 0L; 3926289947985597133L -> 0L; 2674458630179017557L -> 0L; 0L -> -1L; -1193494039317325605L -> 0L; -23581541164203791L -> 0L; 3262032974310066661L -> 0L; -1083726450716131347L -> 0L; 3148929065222398081L -> 0L; 34456112471805905L -> 0L; 3132053619847090208L -> 0L; 4099074157624200352L -> 0L; 4022909997771204357L -> 0L; -6581111995121167737L -> 0L; -3281956828365339039L -> 0L; 4382910041385585448L -> 0L; -5864916610580718835L -> 0L; 8584186777924536731L -> 0L; -5377162036943921244L -> 0L; 339138576765681485L -> 0L; -4861691548228816402L -> 0L; 7026031596079050131L -> 0L; 3839024356120653743L -> 0L; 2199816067032997124L -> 0L; -2789393114105475891L -> 0L; -4463380249671362201L -> 0L; -1431140827820444116L -> 0L; -6458440647188139180L -> 0L; -9103791047430776407L -> 0L; 6524619502474106000L -> 0L; -5429908502784908672L -> 0L; 7055687245367390835L -> 0L; -2349216052260771303L -> 0L; 4964388269721627631L -> 0L; -2751672235835279302L -> 0L; -2252793449446692507L -> 0L; -1091171088418411431L -> 0L; -3626926192832236521L -> 0L; 6786696509634778717L -> 0L; 6167793918440440992L -> 0L; -5290890539702059298L -> 0L; -4254817774861764540L -> 0L; -223583522706374158L -> 0L; 1105996183800211020L -> 0L; _ -> 0L}, {-1626777584348663391L -> false; -1555621157876977468L -> false; 9108471596139219934L -> false; 7732265564533085874L -> false; 7166876332973786910L -> false; 3550441151034303976L -> false; 1085477442822779951L -> false; 7853829573999932795L -> false; 3536675290503201843L -> false; -9128436253306377212L -> false; 3145233702944072634L -> false; -767017806279838012L -> false; 3926289947985597133L -> false; -6420956448021483933L -> false; 0L -> true; -23581541164203791L -> false; 3262032974310066661L -> false; 6391072603087371769L -> false; 1235568768376798224L -> false; -3909837786300313525L -> false; 34456112471805905L -> false; -6428055735629983608L -> false; 2623804087025851129L -> false; 4022909997771204357L -> false; -6581111995121167737L -> false; -6030988397309468346L -> false; -5864916610580718835L -> false; -5377162036943921244L -> false; -6495357859524114684L -> false; -1611032219521099730L -> false; 310391246715086669L -> false; 6408542658405221565L -> false; 2199816067032997124L -> false; 3839024356120653743L -> false; -4745654685023142655L -> false; 6847978435200344376L -> false; -2789393114105475891L -> false; -4463380249671362201L -> false; 3840360328563700082L -> false; -1431140827820444116L -> false; -6458440647188139180L -> false; -7765421792345238673L -> false; -4378680565567194056L -> false; -2349216052260771303L -> false; -2727353340127719681L -> false; 103321857428247527L -> false; -2252793449446692507L -> false; 6786696509634778717L -> false; -5290890539702059298L -> false; -264972637768065869L -> false; -4254817774861764540L -> false; 844666124734041018L -> false; 1105996183800211020L -> false; 4619286360921092268L -> false; -5274952442275438188L -> false; -6795560563734300894L -> false; 7019298611444604923L -> false; 3636655765360274557L -> false; 6165875408190569670L -> false; -5299254572774104738L -> false; -33611074348872304L -> false; 6570741223274545232L -> false; 3192165204308451046L -> false; -7819072410914830782L -> false; -9223241388095087777L -> false; -1424296199548586816L -> false; 6480341267797276322L -> false; -2341802166847999862L -> false; -4960186156748015984L -> false; 5949833029125707898L -> false; 8250044297663344735L -> false; 5214084478326154921L -> false; -1751416471876264704L -> false; 1281239262848334764L -> false; 2674458630179017557L -> false; 7080697169726960547L -> false; -1193494039317325605L -> false; 1924277706246431661L -> false; -4572301776388457843L -> false; -1775944920399996443L -> false; -1476499248608534591L -> false; -1083726450716131347L -> false; 3148929065222398081L -> false; 5135918803737217981L -> false; 3132053619847090208L -> false; -8795479186954029747L -> false; 4099074157624200352L -> false; -1725358293392483925L -> false; -883157324790385183L -> false; -3281956828365339039L -> false; 4382910041385585448L -> false; 7959678776239405401L -> false; 8584186777924536731L -> false; 6156908854039039331L -> false; 770656223494446708L -> false; 339138576765681485L -> false; 5155757567267116618L -> false; -4861691548228816402L -> false; -5029806468813998902L -> false; -5916595597725606869L -> false; -4925674386326338647L -> false; 8028367910303937204L -> false; 7026031596079050131L -> false; -5014191838822778121L -> false; -5381171409130864747L -> false; 8555424481824659787L -> false; 5886333856077963766L -> false; 3049517074836180120L -> false; -9103791047430776407L -> false; 6524619502474106000L -> false; -482660119496121524L -> false; -5429908502784908672L -> false; 7055687245367390835L -> false; 4964388269721627631L -> false; -2751672235835279302L -> false; -3626926192832236521L -> false; -1091171088418411431L -> false; 6167793918440440992L -> false; -1881974088854145838L -> false; 2212053705486708444L -> false; -223583522706374158L -> false; _ -> false}) + +--- Failure -------------------------------------------------------------------- + Test fail_pred_strings failed (2 shrink steps): {"some random string" -> true; _ -> false} @@ -1535,7 +1547,7 @@ stats dist: 6.. 10: 0 ================================================================================ 1 warning(s) -failure (68 tests failed, 3 tests errored, ran 150 tests) +failure (70 tests failed, 3 tests errored, ran 152 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.32 b/test/core/QCheck2_expect_test.expected.ocaml5.32 index fdbe8e5e..903717b7 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.32 @@ -558,12 +558,24 @@ Test sum list = 0 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute failed (69 shrink steps): +Test fail_pred_map_commute_int failed (69 shrink steps): ([0; 0; 0], {0 -> 1; 1 -> 0; 3 -> 0; 5 -> 0; 6 -> 0; 54 -> 0; 7 -> 0; 8 -> 0; 9 -> 0; _ -> 0}, {1 -> true; 54 -> false; _ -> false}) --- Failure -------------------------------------------------------------------- +Test fail_pred_map_commute_int32 failed (225 shrink steps): + +([0l], {75331484l -> 0l; 1136848737l -> 0l; 25967443l -> 0l; 1809593143l -> 0l; 812652795l -> 0l; 1171110740l -> 0l; 281549282l -> 0l; -877342592l -> 0l; -876617499l -> 0l; 563960163l -> 0l; 0l -> 1l; -348202501l -> 0l; 1943874710l -> 0l; 343894252l -> 0l; 624826382l -> 0l; -1129404246l -> 0l; 388312775l -> 0l; -848968653l -> 0l; -1565076831l -> 0l; 1824307125l -> 0l; -552120330l -> 0l; 1498416944l -> 0l; 851017536l -> 0l; 1579608471l -> 0l; -651202205l -> 0l; -1146538619l -> 0l; 1827731338l -> 0l; -1338530898l -> 0l; -699391038l -> 0l; -900565334l -> 0l; 843997254l -> 0l; -2004379534l -> 0l; 1046391667l -> 0l; 160479057l -> 0l; 222421013l -> 0l; -1019976151l -> 0l; 2025980447l -> 0l; -1835931598l -> 0l; 531452539l -> 0l; -2009399199l -> 0l; 526328917l -> 0l; -1522478843l -> 0l; -264989305l -> 0l; -113975057l -> 0l; 1689928864l -> 0l; 1019502418l -> 0l; -319727598l -> 0l; 1408962275l -> 0l; 2146072025l -> 0l; 1393085524l -> 0l; 1693051712l -> 0l; 1836339186l -> 0l; 1586704254l -> 0l; 543692191l -> 0l; 1586363388l -> 0l; 1712343140l -> 0l; -1289819017l -> 0l; -766883777l -> 0l; 1709020878l -> 0l; 969539258l -> 0l; -1399441934l -> 0l; 325615355l -> 0l; -1671242381l -> 0l; -2084063662l -> 0l; 1594187269l -> 0l; -1302631569l -> 0l; -115890480l -> 0l; -999319234l -> 0l; 362205480l -> 0l; 1909127602l -> 0l; 117081264l -> 0l; -1066809754l -> 0l; -1545717273l -> 0l; 115958783l -> 0l; 871596075l -> 0l; -1205789186l -> 0l; 1981785910l -> 0l; -1614620855l -> 0l; -32077002l -> 0l; -1411456813l -> 0l; 758964460l -> 0l; -769342433l -> 0l; 991708298l -> 0l; _ -> 0l}, {1136848737l -> false; 1809593143l -> false; 812652795l -> false; 1171110740l -> false; -877342592l -> false; 1565050922l -> false; 979572466l -> false; 104217172l -> false; -1856534394l -> false; -348202501l -> false; -673862244l -> false; 308947432l -> false; 343894252l -> false; -2031088625l -> false; 1750645404l -> false; 1157643425l -> false; -848968653l -> false; -1504371044l -> false; -1565076831l -> false; 1824307125l -> false; 982950240l -> false; 2020977849l -> false; 1889265845l -> false; -489771261l -> false; 1498416944l -> false; 851017536l -> false; 1579608471l -> false; -1146538619l -> false; -1163289289l -> false; 1827731338l -> false; -250008166l -> false; -699391038l -> false; 46062239l -> false; 843997254l -> false; -2004379534l -> false; 1046391667l -> false; -672679838l -> false; -1435877828l -> false; 732837526l -> false; -1019976151l -> false; 925913108l -> false; 1332061261l -> false; 139357263l -> false; 531452539l -> false; -2009399199l -> false; 526328917l -> false; -1522478843l -> false; -264989305l -> false; 1689928864l -> false; -1346986691l -> false; -1442906134l -> false; -999075733l -> false; -319727598l -> false; 1408962275l -> false; 1579421435l -> false; 2146072025l -> false; 316542700l -> false; -1391714030l -> false; 1779439473l -> false; -1002646370l -> false; 1836339186l -> false; 931758934l -> false; -2023511228l -> false; 1586704254l -> false; 543692191l -> false; 1586363388l -> false; 1712343140l -> false; -1289819017l -> false; 1976233434l -> false; -335551850l -> false; -564214470l -> false; -766883777l -> false; 1095157970l -> false; 1709020878l -> false; 982225875l -> false; -808156143l -> false; 969539258l -> false; 1324609334l -> false; 325615355l -> false; -1671242381l -> false; 2054541922l -> false; 173881745l -> false; -2084063662l -> false; 1594187269l -> false; 271400805l -> false; -1999936871l -> false; -463057368l -> false; 1909127602l -> false; 117081264l -> false; 115958783l -> false; 871596075l -> false; -1205789186l -> false; -1614620855l -> false; -2146186613l -> false; -1411456813l -> false; 758964460l -> false; -769342433l -> false; 1333986756l -> false; 991708298l -> false; 75331484l -> false; 25967443l -> false; -1988450453l -> false; 281549282l -> false; -215338467l -> false; 1823853744l -> false; -876617499l -> false; 563960163l -> false; 0l -> true; -1371167900l -> false; 569394672l -> false; 1943874710l -> false; -21969680l -> false; 624826382l -> false; -1862005476l -> false; -1129404246l -> false; 388312775l -> false; 1225087295l -> false; 909448910l -> false; -318097162l -> false; -552120330l -> false; -2015935885l -> false; 2142387483l -> false; -651202205l -> false; 150441917l -> false; -1731710824l -> false; -1338530898l -> false; -900565334l -> false; -238820569l -> false; 160479057l -> false; 222421013l -> false; 1802048184l -> false; 2025980447l -> false; -1636965277l -> false; 1326978241l -> false; -1835931598l -> false; 1314132578l -> false; -1464012521l -> false; 1071316774l -> false; 604359939l -> false; 854723166l -> false; -761515858l -> false; -113975057l -> false; -666518516l -> false; -915084559l -> false; 1019502418l -> false; -702876054l -> false; 146771378l -> false; 1393085524l -> false; 1693051712l -> false; 1775680850l -> false; 1900637913l -> false; -1835687180l -> false; -1399441934l -> false; -1662345616l -> false; -1302631569l -> false; -115890480l -> false; -999319234l -> false; 362205480l -> false; -1066809754l -> false; -1545717273l -> false; 1981785910l -> false; -19251138l -> false; -32077002l -> false; -1002197755l -> false; 1195624707l -> false; _ -> false}) + +--- Failure -------------------------------------------------------------------- + +Test fail_pred_map_commute_int64 failed (409 shrink steps): + +([0L], {5854787549706481689L -> 0L; 3145329330861579979L -> 0L; 4882728146457597343L -> 0L; 9213678680194827455L -> 0L; 5300276494079701428L -> 0L; -9132719513648881735L -> 0L; 5100807290077018335L -> 0L; 4259354711344712502L -> 0L; -364061021052118635L -> 0L; -3581328212534219819L -> 0L; -8630303840787971041L -> 0L; -2978122754581212173L -> 0L; -4683856205808377145L -> 0L; -2954498161550507231L -> 0L; 8310294664523726142L -> 0L; 558752675069655569L -> 0L; 8199640615007233109L -> 0L; 1555660693178054105L -> 0L; 3734321537045757188L -> 0L; 7617254280160726422L -> 0L; -7095101722225497728L -> 0L; 2408366282890716208L -> 0L; -4292043424114694448L -> 0L; 6051446892539839664L -> 0L; -2620576406080708837L -> 0L; 3910553276736898631L -> 0L; -6049404088872216425L -> 0L; -7268555609988799200L -> 0L; -6934743764498995030L -> 0L; 4876048078141422706L -> 0L; -8915325446919098823L -> 0L; 2098138445044356137L -> 0L; 7859313320400495093L -> 0L; -1257408099724075377L -> 0L; 7835339442358508915L -> 0L; -1373219575348706144L -> 0L; -5629923125916047561L -> 0L; 5846432512550235357L -> 0L; -7434366745648348883L -> 0L; 2422190457351331666L -> 0L; -7267280566018852192L -> 0L; 3299736282478619448L -> 0L; 5029882331043609063L -> 0L; 3903578586206863836L -> 0L; -7619916642310435274L -> 0L; -2371338759413642156L -> 0L; -679766008357102884L -> 0L; 1340692257137144601L -> 0L; -790015524249429917L -> 0L; -4379154747792360737L -> 0L; 8399933408910938616L -> 0L; 6480637981859985820L -> 0L; -2308579306926069217L -> 0L; -8608744547020170782L -> 0L; -5594759985566186977L -> 0L; 2301544867433440993L -> 0L; 323546263287575941L -> 0L; -6538996838665322453L -> 0L; -2454988279788980498L -> 0L; 866928363553278728L -> 0L; 5164393405417580120L -> 0L; -499476091573676884L -> 0L; 4479813258449401643L -> 0L; -4763149175045705024L -> 0L; 469304370363482895L -> 0L; -2804630954669580607L -> 0L; 3734790826411290913L -> 0L; -227934510922809045L -> 0L; -3580496456230202944L -> 0L; -8950985269485293698L -> 0L; 212249186598423999L -> 0L; 639669963429369605L -> 0L; -2051861136476049823L -> 0L; 8348878307193905173L -> 0L; -3686676770270027707L -> 0L; 3224777727913298872L -> 0L; -5364159185804582406L -> 0L; 6806501729242859693L -> 0L; -1441073676419344347L -> 0L; -3765043485710736446L -> 0L; 7194818492908892508L -> 0L; -2796892171845744540L -> 0L; -4420431099744708779L -> 0L; 1019954390233679959L -> 0L; -2530663500164660862L -> 0L; -2264698731421349299L -> 0L; -6301941405625428267L -> 0L; -1495518350952249754L -> 0L; 6790791859713076536L -> 0L; -8660185765070272892L -> 0L; 0L -> -1L; 6461206961562494132L -> 0L; 4161392575889986945L -> 0L; -6062160849957200379L -> 0L; 2050777921649849245L -> 0L; -2338474396491590209L -> 0L; 6040222022058163474L -> 0L; 4420706034848988623L -> 0L; 7007967583009742492L -> 0L; -6721953801867170697L -> 0L; -7885266170714706233L -> 0L; 4322769158609909940L -> 0L; -898939348400618792L -> 0L; 1398507300916388863L -> 0L; -3768157736633469270L -> 0L; 3259727538054383679L -> 0L; 7887016748577155308L -> 0L; 689252303200971584L -> 0L; 1153745841753386362L -> 0L; -7622842036935762123L -> 0L; -2655363517875144787L -> 0L; -3316185614787998640L -> 0L; -2161834059847512675L -> 0L; 7772143368369364168L -> 0L; 643735998272900932L -> 0L; 4986005544098925810L -> 0L; 2746391341985398187L -> 0L; -4380764207063965457L -> 0L; -5178825119209008517L -> 0L; 3567420727005224228L -> 0L; -6591184801704195820L -> 0L; -7799749368733739938L -> 0L; -6139115887619923128L -> 0L; 6435651773147788786L -> 0L; -4281744317789616022L -> 0L; 6784366724273561670L -> 0L; -3312092294417046138L -> 0L; 9177166544734112775L -> 0L; -5748946431569544365L -> 0L; 5663627078768118084L -> 0L; 8366279157860053843L -> 0L; 7340188779816032270L -> 0L; 4494217989422939968L -> 0L; 8511705671936252155L -> 0L; 4164139407125837706L -> 0L; 153637279587014926L -> 0L; -7394159616171936648L -> 0L; -9043869006878631603L -> 0L; 5240182597792645198L -> 0L; 5448217779542124314L -> 0L; -1656305904791530564L -> 0L; -1116361473951770628L -> 0L; 2259397563612834240L -> 0L; 2701623574335708358L -> 0L; 7687356893908644279L -> 0L; -1474435637026224678L -> 0L; -1138120395318770637L -> 0L; 2550568742267673149L -> 0L; 5808672460943173892L -> 0L; -3394167952197954244L -> 0L; -7127307218936826104L -> 0L; _ -> 0L}, {6624469717750982933L -> false; 2021251694365224308L -> false; 8650950383192901855L -> false; 5854787549706481689L -> false; -4928040426617547498L -> false; 3145329330861579979L -> false; 5644156449197797917L -> false; 5100807290077018335L -> false; 7739738019688281706L -> false; -697925149460693359L -> false; -3581328212534219819L -> false; -8630303840787971041L -> false; 4607169608843350895L -> false; -2954498161550507231L -> false; 3734321537045757188L -> false; 7617254280160726422L -> false; 2408366282890716208L -> false; 8414158256060592983L -> false; -1651026652789754360L -> false; 3634915250346921677L -> false; 6051446892539839664L -> false; -6049404088872216425L -> false; -1360668418930804589L -> false; -5039996349090530917L -> false; -6625930574039947025L -> false; 6646442352002793285L -> false; -8915325446919098823L -> false; 2098138445044356137L -> false; 5263684004213940067L -> false; 4235768524330941733L -> false; -1257408099724075377L -> false; -8709033821355250350L -> false; 7835339442358508915L -> false; -5629923125916047561L -> false; 5846432512550235357L -> false; 1038681120125353343L -> false; 2748006016942766304L -> false; -465696954319541446L -> false; 6398423988255904594L -> false; 5721159553842941691L -> false; -7267280566018852192L -> false; 4431190379031682950L -> false; 3299736282478619448L -> false; 5029882331043609063L -> false; 3903578586206863836L -> false; -2371338759413642156L -> false; 5261709869629193788L -> false; -8697432166782222197L -> false; -983603998581652585L -> false; -5785263784427206614L -> false; -4379154747792360737L -> false; 2277179348638815545L -> false; 6480637981859985820L -> false; -8608744547020170782L -> false; -830997075387711629L -> false; 2301544867433440993L -> false; 8163177680305655068L -> false; -2454988279788980498L -> false; 5164393405417580120L -> false; 1132050760977963309L -> false; -499476091573676884L -> false; 4479813258449401643L -> false; -6461224430753660866L -> false; -1006257629865130445L -> false; 8294186685546713542L -> false; -971072539264035131L -> false; -3580496456230202944L -> false; -1025726531324723941L -> false; 2142699480843765254L -> false; -8950985269485293698L -> false; 7356720237191965167L -> false; 4207231707586613858L -> false; 639669963429369605L -> false; -2051861136476049823L -> false; -1988816249583056245L -> false; 9188472469558943175L -> false; -3686676770270027707L -> false; 3224777727913298872L -> false; -1441073676419344347L -> false; -2417519916452520533L -> false; -7884216401522586609L -> false; -2796892171845744540L -> false; -2530663500164660862L -> false; -2264698731421349299L -> false; -6301941405625428267L -> false; 1118769919115618925L -> false; -3315022889335032034L -> false; 6790791859713076536L -> false; -6287885895726259950L -> false; 7036501100000084257L -> false; -8660185765070272892L -> false; 0L -> true; 1256017657628421411L -> false; 4161392575889986945L -> false; -6062160849957200379L -> false; 2050777921649849245L -> false; -5707081726479912303L -> false; 7007967583009742492L -> false; 2222440151561842948L -> false; -6721953801867170697L -> false; -7885266170714706233L -> false; 4322769158609909940L -> false; -898939348400618792L -> false; 1398507300916388863L -> false; -7314527457266255534L -> false; -3768157736633469270L -> false; 3906053329638043395L -> false; -2423282696440615857L -> false; 3262857228003744550L -> false; -294629012482506639L -> false; 689252303200971584L -> false; -949171309053917101L -> false; 1153745841753386362L -> false; -7139720054173349629L -> false; 5729429493169192938L -> false; 3147513210109551715L -> false; -7622842036935762123L -> false; -2655363517875144787L -> false; -8540329665204613710L -> false; -3316185614787998640L -> false; -7171948333957854763L -> false; 643735998272900932L -> false; 4986005544098925810L -> false; -7639906882480959204L -> false; -4380764207063965457L -> false; 2818999576258038632L -> false; 3508863594680469870L -> false; -8690914547174917743L -> false; 1098465513758097547L -> false; 4218628012430961849L -> false; 6435651773147788786L -> false; 9009339763374318376L -> false; -3161092180305721636L -> false; 8487857972336733594L -> false; 6784366724273561670L -> false; -3312092294417046138L -> false; 1583416881273542902L -> false; -5748946431569544365L -> false; -8876028441964492915L -> false; 8328121679685965390L -> false; 1737879028445335557L -> false; 7340188779816032270L -> false; 4494217989422939968L -> false; 7083777351172515530L -> false; -3270685705223979163L -> false; 8520094710095194968L -> false; 4164139407125837706L -> false; 153637279587014926L -> false; -1656305904791530564L -> false; 5240182597792645198L -> false; -8365460935410113080L -> false; 2259397563612834240L -> false; -4404877394737171205L -> false; -6753006748206940599L -> false; 2022662898930300274L -> false; 2701623574335708358L -> false; 7687356893908644279L -> false; -931329658461140236L -> false; -2452190344785809016L -> false; 5808672460943173892L -> false; -3394167952197954244L -> false; -8959165302033331105L -> false; 3993033237256830916L -> false; 4972040655077426416L -> false; 4882728146457597343L -> false; 9213678680194827455L -> false; 5300276494079701428L -> false; -9132719513648881735L -> false; -7123352971536208992L -> false; 4259354711344712502L -> false; 8040921812849396650L -> false; -364061021052118635L -> false; 1359540546038184604L -> false; -4045157926296238604L -> false; 2619877327226739617L -> false; -2978122754581212173L -> false; -5943664818246816981L -> false; -4683856205808377145L -> false; 8310294664523726142L -> false; 558752675069655569L -> false; 8199640615007233109L -> false; 8503977350048285922L -> false; 2741028434103436854L -> false; 1555660693178054105L -> false; -1213860894341146248L -> false; -7095101722225497728L -> false; -4292043424114694448L -> false; -2620576406080708837L -> false; 3910553276736898631L -> false; -7268555609988799200L -> false; -6934743764498995030L -> false; 4876048078141422706L -> false; 5076578730158835782L -> false; -4290997597638374224L -> false; 7859313320400495093L -> false; -9073896469922473758L -> false; -1373219575348706144L -> false; -7434366745648348883L -> false; -8252951406749682434L -> false; 3976766521418821020L -> false; 4221739137319150436L -> false; 7626491182175802526L -> false; 2422190457351331666L -> false; 1324477536709314583L -> false; -7308516696705877236L -> false; -1441184219299041128L -> false; -7619916642310435274L -> false; -1366216905461382541L -> false; 4166104326466068382L -> false; -679766008357102884L -> false; 1340692257137144601L -> false; -3347868337765287544L -> false; 8624184165625915808L -> false; 2331860220219071134L -> false; -790015524249429917L -> false; 8399933408910938616L -> false; -2308579306926069217L -> false; -5594759985566186977L -> false; 197835813572346897L -> false; 323546263287575941L -> false; -6538996838665322453L -> false; 866928363553278728L -> false; 5479429944191365165L -> false; -7729052846454806041L -> false; -4304406580070181007L -> false; -4763149175045705024L -> false; 469304370363482895L -> false; -2804630954669580607L -> false; -2238043473974805486L -> false; 3734790826411290913L -> false; -227934510922809045L -> false; 5699328150978489073L -> false; 4601270508136665021L -> false; 212249186598423999L -> false; 8348878307193905173L -> false; -7973754506024961452L -> false; -5364159185804582406L -> false; 6806501729242859693L -> false; -3765043485710736446L -> false; 7194818492908892508L -> false; 1019954390233679959L -> false; -4420431099744708779L -> false; 8114335019049414454L -> false; -2889137903793420078L -> false; -1495518350952249754L -> false; -569354245761226691L -> false; -8589663454077811882L -> false; 6461206961562494132L -> false; 7813289179577223734L -> false; -6887763749911475116L -> false; -2338474396491590209L -> false; 6040222022058163474L -> false; 4420706034848988623L -> false; 6586471556538983659L -> false; -2662379650000679469L -> false; -1991171025695944950L -> false; 7012460325344924441L -> false; 7983768007747169077L -> false; 3259727538054383679L -> false; 7887016748577155308L -> false; -2161834059847512675L -> false; 7772143368369364168L -> false; 2746391341985398187L -> false; -6044975648356418603L -> false; -5178825119209008517L -> false; -8711565572371958878L -> false; 3567420727005224228L -> false; -6591184801704195820L -> false; -7799749368733739938L -> false; -2307913367909538993L -> false; -6139115887619923128L -> false; -2966172447767866175L -> false; -6622094766643380931L -> false; 3173163354060602924L -> false; -4281744317789616022L -> false; 9177166544734112775L -> false; 5663627078768118084L -> false; 8366279157860053843L -> false; 8511705671936252155L -> false; 3630742237263843231L -> false; -7394159616171936648L -> false; -9043869006878631603L -> false; -2073201129865962220L -> false; 5448217779542124314L -> false; -4677740139754242931L -> false; -9018937089320797157L -> false; -6704152621528229497L -> false; 2595706173326502376L -> false; 8038783472656886325L -> false; -1116361473951770628L -> false; 8827581399887526968L -> false; -594959241272658988L -> false; 2654816421495205220L -> false; 2445531497888324919L -> false; -2862675227543729570L -> false; -1474435637026224678L -> false; -7958909181723079423L -> false; -1138120395318770637L -> false; 2550568742267673149L -> false; 1533772787097910211L -> false; -7127307218936826104L -> false; _ -> false}) + +--- Failure -------------------------------------------------------------------- + Test fail_pred_strings failed (2 shrink steps): {"some random string" -> true; _ -> false} @@ -1471,7 +1483,7 @@ stats dist: -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (68 tests failed, 3 tests errored, ran 150 tests) +failure (70 tests failed, 3 tests errored, ran 152 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.64 b/test/core/QCheck2_expect_test.expected.ocaml5.64 index 5c70207e..71b112c8 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.64 @@ -614,12 +614,24 @@ Test sum list = 0 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute failed (244 shrink steps): +Test fail_pred_map_commute_int failed (244 shrink steps): ([0; 0], {16 -> 0; 32 -> 0; 0 -> 13; 65 -> 0; 18 -> 0; 2 -> 0; 19 -> 0; 3 -> 0; 20 -> 0; 68 -> 0; 21 -> 0; 5 -> 0; 37 -> 0; 53 -> 0; 86 -> 0; 7 -> 0; 24 -> 0; 8 -> 0; 9 -> 0; 10 -> 0; 43 -> 0; 28 -> 0; 14 -> 0; 78 -> 0; 15 -> 0; _ -> 0}, {66275786897687936 -> false; 0 -> false; 37585042864641 -> false; 182146 -> false; 54366856439509634 -> false; -381189003139879806 -> false; 2 -> false; 30621323267 -> false; 166274844009475 -> false; 3 -> false; 364293 -> false; 5 -> false; 7 -> false; 10526600 -> false; 8 -> false; 9 -> false; 2954 -> false; 19210 -> false; 728586 -> false; 38660875690317962 -> false; 10 -> false; 5515 -> false; 14035467 -> false; 155189854408843 -> false; 13 -> true; -3511326262846579571 -> false; 25614 -> false; 14 -> false; 28815 -> false; 427189276652303 -> false; 8640826060088079 -> false; 15 -> false; 272 -> false; 74855824 -> false; 943820830864 -> false; 16 -> false; 17 -> false; 21053201 -> false; 650955088232081 -> false; 1843063293562136465 -> false; 18 -> false; -1207743061799580782 -> false; 2582479384970564114 -> false; 32215751026835 -> false; 19 -> false; 558005797129117203 -> false; 28579901716 -> false; 20 -> false; 5909 -> false; 38421 -> false; 99807765 -> false; 1258427774485 -> false; 77321751380635925 -> false; 21 -> false; 28070934 -> false; 116134203798 -> false; 867940117642775 -> false; 408 -> false; 43550326424 -> false; 24 -> false; 6257335833 -> false; 16686228889 -> false; 26 -> false; 43493485151607707 -> false; 51228 -> false; 1825056284 -> false; 23731525532 -> false; 133019875207580 -> false; 28 -> false; 6303 -> false; 544 -> false; 149711648 -> false; 1887641661728 -> false; 32 -> false; 136609 -> false; 1295265 -> false; 34 -> false; -796804578571543518 -> false; -3143884152072092894 -> false; 7203 -> false; 1301910176464163 -> false; 933 -> false; 37 -> false; 7894950 -> false; 2215 -> false; 56179084987493288 -> false; 2737584426 -> false; 199615531 -> false; 2516855548971 -> false; 88367715863583915 -> false; 1724444827403006379 -> false; 43 -> false; 1727020 -> false; 798462124 -> false; 45 -> false; 10067422195886 -> false; 1735880235285551 -> false; 10533578435154991 -> false; 3193848497 -> false; 366162237130545 -> false; 7406422337218353 -> false; 6908082 -> false; 51 -> false; -2381024303006854989 -> false; -3341657596864116300 -> false; 10805 -> false; 17798644149 -> false; 50742399343542325 -> false; 53 -> false; 24497058614 -> false; 353932811574 -> false; 99543603255 -> false; 21477167351223 -> false; -119319574914777289 -> false; 102456 -> false; 971448 -> false; 40269688783544 -> false; 3650112569 -> false; 5921213 -> false; 15821017021 -> false; 88679916805053 -> false; 830 -> false; 12606 -> false; 171817338809791 -> false; 6943520941142207 -> false; 1089 -> false; 65 -> false; 2590530 -> false; 273219 -> false; 68 -> false; 14407 -> false; 13348983111 -> false; 15800367652732487 -> false; 37427912 -> false; 325477544116040 -> false; 1417674849728090569 -> false; 58067101899 -> false; 204 -> false; 15789900 -> false; 8343114444 -> false; 21775163212 -> false; 77 -> false; 11865762766 -> false; 78 -> false; 4431 -> false; 3151 -> false; 57991313535476943 -> false; 68304 -> false; 647632 -> false; 530899217361 -> false; 3947475 -> false; 18433762261521235 -> false; 28089542493746644 -> false; 44183857931791957 -> false; 399231062 -> false; -1759927375200850090 -> false; 86 -> false; 5033711097943 -> false; 1596924248 -> false; 1415731246296 -> false; 3454041 -> false; 19750459565915609 -> false; 90 -> false; 8899322074 -> false; 3234503663319679322 -> false; 485724 -> false; 20134844391772 -> false; 1245 -> false; -2772163063813019426 -> false; 85908669404895 -> false; 3471760470571103 -> false; 21067156870309983 -> false; 909328030552912351 -> false; 18713956 -> false; 29033550949 -> false; -2219752219093363099 -> false; 102 -> false; 4171557222 -> false; 2325595319255300198 -> false; -3390706662452617370 -> false; 28995656767738471 -> false; 265449608680 -> false; 2118364168588763240 -> false; 1158207106723147241 -> false; 14044771246873322 -> false; 707865623148 -> false; 488216316174060 -> false; 9875229782957804 -> false; -4251440306801319700 -> false; 2441230840770586092 -> false; 622 -> false; 42954334702447 -> false; 32662744818 -> false; 7300225139 -> false; 132724804340 -> false; 472959556293621 -> false; 244108158087030 -> false; 4937614891478902 -> false; 4727 -> false; 354719667220215 -> false; 16331372409 -> false; 66362402170 -> false; 236479778146810 -> false; -127238344995975558 -> false; 3323 -> false; 31642034043 -> false; 177359833610107 -> false; 1661 -> false; 15573813630 -> false; 457702796413182 -> false; 9258027921522942 -> false; 4629013960761471 -> false; _ -> false}) --- Failure -------------------------------------------------------------------- +Test fail_pred_map_commute_int32 failed (225 shrink steps): + +([0l], {75331484l -> 0l; 1136848737l -> 0l; 25967443l -> 0l; 1809593143l -> 0l; 812652795l -> 0l; 1171110740l -> 0l; 281549282l -> 0l; -877342592l -> 0l; -876617499l -> 0l; 563960163l -> 0l; 0l -> 1l; -348202501l -> 0l; 1943874710l -> 0l; 343894252l -> 0l; 624826382l -> 0l; -1129404246l -> 0l; 388312775l -> 0l; -848968653l -> 0l; -1565076831l -> 0l; 1824307125l -> 0l; -552120330l -> 0l; 1498416944l -> 0l; 851017536l -> 0l; 1579608471l -> 0l; -651202205l -> 0l; -1146538619l -> 0l; 1827731338l -> 0l; -1338530898l -> 0l; -699391038l -> 0l; -900565334l -> 0l; 843997254l -> 0l; -2004379534l -> 0l; 1046391667l -> 0l; 160479057l -> 0l; 222421013l -> 0l; -1019976151l -> 0l; 2025980447l -> 0l; -1835931598l -> 0l; 531452539l -> 0l; -2009399199l -> 0l; 526328917l -> 0l; -1522478843l -> 0l; -264989305l -> 0l; -113975057l -> 0l; 1689928864l -> 0l; 1019502418l -> 0l; -319727598l -> 0l; 1408962275l -> 0l; 2146072025l -> 0l; 1393085524l -> 0l; 1693051712l -> 0l; 1836339186l -> 0l; 1586704254l -> 0l; 543692191l -> 0l; 1586363388l -> 0l; 1712343140l -> 0l; -1289819017l -> 0l; -766883777l -> 0l; 1709020878l -> 0l; 969539258l -> 0l; -1399441934l -> 0l; 325615355l -> 0l; -1671242381l -> 0l; -2084063662l -> 0l; 1594187269l -> 0l; -1302631569l -> 0l; -115890480l -> 0l; -999319234l -> 0l; 362205480l -> 0l; 1909127602l -> 0l; 117081264l -> 0l; -1066809754l -> 0l; -1545717273l -> 0l; 115958783l -> 0l; 871596075l -> 0l; -1205789186l -> 0l; 1981785910l -> 0l; -1614620855l -> 0l; -32077002l -> 0l; -1411456813l -> 0l; 758964460l -> 0l; -769342433l -> 0l; 991708298l -> 0l; _ -> 0l}, {1136848737l -> false; 1809593143l -> false; 812652795l -> false; 1171110740l -> false; -877342592l -> false; 1565050922l -> false; 979572466l -> false; 104217172l -> false; -1856534394l -> false; -348202501l -> false; -673862244l -> false; 308947432l -> false; 343894252l -> false; -2031088625l -> false; 1750645404l -> false; 1157643425l -> false; -848968653l -> false; -1504371044l -> false; -1565076831l -> false; 1824307125l -> false; 982950240l -> false; 2020977849l -> false; 1889265845l -> false; -489771261l -> false; 1498416944l -> false; 851017536l -> false; 1579608471l -> false; -1146538619l -> false; -1163289289l -> false; 1827731338l -> false; -250008166l -> false; -699391038l -> false; 46062239l -> false; 843997254l -> false; -2004379534l -> false; 1046391667l -> false; -672679838l -> false; -1435877828l -> false; 732837526l -> false; -1019976151l -> false; 925913108l -> false; 1332061261l -> false; 139357263l -> false; 531452539l -> false; -2009399199l -> false; 526328917l -> false; -1522478843l -> false; -264989305l -> false; 1689928864l -> false; -1346986691l -> false; -1442906134l -> false; -999075733l -> false; -319727598l -> false; 1408962275l -> false; 1579421435l -> false; 2146072025l -> false; 316542700l -> false; -1391714030l -> false; 1779439473l -> false; -1002646370l -> false; 1836339186l -> false; 931758934l -> false; -2023511228l -> false; 1586704254l -> false; 543692191l -> false; 1586363388l -> false; 1712343140l -> false; -1289819017l -> false; 1976233434l -> false; -335551850l -> false; -564214470l -> false; -766883777l -> false; 1095157970l -> false; 1709020878l -> false; 982225875l -> false; -808156143l -> false; 969539258l -> false; 1324609334l -> false; 325615355l -> false; -1671242381l -> false; 2054541922l -> false; 173881745l -> false; -2084063662l -> false; 1594187269l -> false; 271400805l -> false; -1999936871l -> false; -463057368l -> false; 1909127602l -> false; 117081264l -> false; 115958783l -> false; 871596075l -> false; -1205789186l -> false; -1614620855l -> false; -2146186613l -> false; -1411456813l -> false; 758964460l -> false; -769342433l -> false; 1333986756l -> false; 991708298l -> false; 75331484l -> false; 25967443l -> false; -1988450453l -> false; 281549282l -> false; -215338467l -> false; 1823853744l -> false; -876617499l -> false; 563960163l -> false; 0l -> true; -1371167900l -> false; 569394672l -> false; 1943874710l -> false; -21969680l -> false; 624826382l -> false; -1862005476l -> false; -1129404246l -> false; 388312775l -> false; 1225087295l -> false; 909448910l -> false; -318097162l -> false; -552120330l -> false; -2015935885l -> false; 2142387483l -> false; -651202205l -> false; 150441917l -> false; -1731710824l -> false; -1338530898l -> false; -900565334l -> false; -238820569l -> false; 160479057l -> false; 222421013l -> false; 1802048184l -> false; 2025980447l -> false; -1636965277l -> false; 1326978241l -> false; -1835931598l -> false; 1314132578l -> false; -1464012521l -> false; 1071316774l -> false; 604359939l -> false; 854723166l -> false; -761515858l -> false; -113975057l -> false; -666518516l -> false; -915084559l -> false; 1019502418l -> false; -702876054l -> false; 146771378l -> false; 1393085524l -> false; 1693051712l -> false; 1775680850l -> false; 1900637913l -> false; -1835687180l -> false; -1399441934l -> false; -1662345616l -> false; -1302631569l -> false; -115890480l -> false; -999319234l -> false; 362205480l -> false; -1066809754l -> false; -1545717273l -> false; 1981785910l -> false; -19251138l -> false; -32077002l -> false; -1002197755l -> false; 1195624707l -> false; _ -> false}) + +--- Failure -------------------------------------------------------------------- + +Test fail_pred_map_commute_int64 failed (409 shrink steps): + +([0L], {5854787549706481689L -> 0L; 3145329330861579979L -> 0L; 4882728146457597343L -> 0L; 9213678680194827455L -> 0L; 5300276494079701428L -> 0L; -9132719513648881735L -> 0L; 5100807290077018335L -> 0L; 4259354711344712502L -> 0L; -364061021052118635L -> 0L; -3581328212534219819L -> 0L; -8630303840787971041L -> 0L; -2978122754581212173L -> 0L; -4683856205808377145L -> 0L; -2954498161550507231L -> 0L; 8310294664523726142L -> 0L; 558752675069655569L -> 0L; 8199640615007233109L -> 0L; 1555660693178054105L -> 0L; 3734321537045757188L -> 0L; 7617254280160726422L -> 0L; -7095101722225497728L -> 0L; 2408366282890716208L -> 0L; -4292043424114694448L -> 0L; 6051446892539839664L -> 0L; -2620576406080708837L -> 0L; 3910553276736898631L -> 0L; -6049404088872216425L -> 0L; -7268555609988799200L -> 0L; -6934743764498995030L -> 0L; 4876048078141422706L -> 0L; -8915325446919098823L -> 0L; 2098138445044356137L -> 0L; 7859313320400495093L -> 0L; -1257408099724075377L -> 0L; 7835339442358508915L -> 0L; -1373219575348706144L -> 0L; -5629923125916047561L -> 0L; 5846432512550235357L -> 0L; -7434366745648348883L -> 0L; 2422190457351331666L -> 0L; -7267280566018852192L -> 0L; 3299736282478619448L -> 0L; 5029882331043609063L -> 0L; 3903578586206863836L -> 0L; -7619916642310435274L -> 0L; -2371338759413642156L -> 0L; -679766008357102884L -> 0L; 1340692257137144601L -> 0L; -790015524249429917L -> 0L; -4379154747792360737L -> 0L; 8399933408910938616L -> 0L; 6480637981859985820L -> 0L; -2308579306926069217L -> 0L; -8608744547020170782L -> 0L; -5594759985566186977L -> 0L; 2301544867433440993L -> 0L; 323546263287575941L -> 0L; -6538996838665322453L -> 0L; -2454988279788980498L -> 0L; 866928363553278728L -> 0L; 5164393405417580120L -> 0L; -499476091573676884L -> 0L; 4479813258449401643L -> 0L; -4763149175045705024L -> 0L; 469304370363482895L -> 0L; -2804630954669580607L -> 0L; 3734790826411290913L -> 0L; -227934510922809045L -> 0L; -3580496456230202944L -> 0L; -8950985269485293698L -> 0L; 212249186598423999L -> 0L; 639669963429369605L -> 0L; -2051861136476049823L -> 0L; 8348878307193905173L -> 0L; -3686676770270027707L -> 0L; 3224777727913298872L -> 0L; -5364159185804582406L -> 0L; 6806501729242859693L -> 0L; -1441073676419344347L -> 0L; -3765043485710736446L -> 0L; 7194818492908892508L -> 0L; -2796892171845744540L -> 0L; -4420431099744708779L -> 0L; 1019954390233679959L -> 0L; -2530663500164660862L -> 0L; -2264698731421349299L -> 0L; -6301941405625428267L -> 0L; -1495518350952249754L -> 0L; 6790791859713076536L -> 0L; -8660185765070272892L -> 0L; 0L -> -1L; 6461206961562494132L -> 0L; 4161392575889986945L -> 0L; -6062160849957200379L -> 0L; 2050777921649849245L -> 0L; -2338474396491590209L -> 0L; 6040222022058163474L -> 0L; 4420706034848988623L -> 0L; 7007967583009742492L -> 0L; -6721953801867170697L -> 0L; -7885266170714706233L -> 0L; 4322769158609909940L -> 0L; -898939348400618792L -> 0L; 1398507300916388863L -> 0L; -3768157736633469270L -> 0L; 3259727538054383679L -> 0L; 7887016748577155308L -> 0L; 689252303200971584L -> 0L; 1153745841753386362L -> 0L; -7622842036935762123L -> 0L; -2655363517875144787L -> 0L; -3316185614787998640L -> 0L; -2161834059847512675L -> 0L; 7772143368369364168L -> 0L; 643735998272900932L -> 0L; 4986005544098925810L -> 0L; 2746391341985398187L -> 0L; -4380764207063965457L -> 0L; -5178825119209008517L -> 0L; 3567420727005224228L -> 0L; -6591184801704195820L -> 0L; -7799749368733739938L -> 0L; -6139115887619923128L -> 0L; 6435651773147788786L -> 0L; -4281744317789616022L -> 0L; 6784366724273561670L -> 0L; -3312092294417046138L -> 0L; 9177166544734112775L -> 0L; -5748946431569544365L -> 0L; 5663627078768118084L -> 0L; 8366279157860053843L -> 0L; 7340188779816032270L -> 0L; 4494217989422939968L -> 0L; 8511705671936252155L -> 0L; 4164139407125837706L -> 0L; 153637279587014926L -> 0L; -7394159616171936648L -> 0L; -9043869006878631603L -> 0L; 5240182597792645198L -> 0L; 5448217779542124314L -> 0L; -1656305904791530564L -> 0L; -1116361473951770628L -> 0L; 2259397563612834240L -> 0L; 2701623574335708358L -> 0L; 7687356893908644279L -> 0L; -1474435637026224678L -> 0L; -1138120395318770637L -> 0L; 2550568742267673149L -> 0L; 5808672460943173892L -> 0L; -3394167952197954244L -> 0L; -7127307218936826104L -> 0L; _ -> 0L}, {6624469717750982933L -> false; 2021251694365224308L -> false; 8650950383192901855L -> false; 5854787549706481689L -> false; -4928040426617547498L -> false; 3145329330861579979L -> false; 5644156449197797917L -> false; 5100807290077018335L -> false; 7739738019688281706L -> false; -697925149460693359L -> false; -3581328212534219819L -> false; -8630303840787971041L -> false; 4607169608843350895L -> false; -2954498161550507231L -> false; 3734321537045757188L -> false; 7617254280160726422L -> false; 2408366282890716208L -> false; 8414158256060592983L -> false; -1651026652789754360L -> false; 3634915250346921677L -> false; 6051446892539839664L -> false; -6049404088872216425L -> false; -1360668418930804589L -> false; -5039996349090530917L -> false; -6625930574039947025L -> false; 6646442352002793285L -> false; -8915325446919098823L -> false; 2098138445044356137L -> false; 5263684004213940067L -> false; 4235768524330941733L -> false; -1257408099724075377L -> false; -8709033821355250350L -> false; 7835339442358508915L -> false; -5629923125916047561L -> false; 5846432512550235357L -> false; 1038681120125353343L -> false; 2748006016942766304L -> false; -465696954319541446L -> false; 6398423988255904594L -> false; 5721159553842941691L -> false; -7267280566018852192L -> false; 4431190379031682950L -> false; 3299736282478619448L -> false; 5029882331043609063L -> false; 3903578586206863836L -> false; -2371338759413642156L -> false; 5261709869629193788L -> false; -8697432166782222197L -> false; -983603998581652585L -> false; -5785263784427206614L -> false; -4379154747792360737L -> false; 2277179348638815545L -> false; 6480637981859985820L -> false; -8608744547020170782L -> false; -830997075387711629L -> false; 2301544867433440993L -> false; 8163177680305655068L -> false; -2454988279788980498L -> false; 5164393405417580120L -> false; 1132050760977963309L -> false; -499476091573676884L -> false; 4479813258449401643L -> false; -6461224430753660866L -> false; -1006257629865130445L -> false; 8294186685546713542L -> false; -971072539264035131L -> false; -3580496456230202944L -> false; -1025726531324723941L -> false; 2142699480843765254L -> false; -8950985269485293698L -> false; 7356720237191965167L -> false; 4207231707586613858L -> false; 639669963429369605L -> false; -2051861136476049823L -> false; -1988816249583056245L -> false; 9188472469558943175L -> false; -3686676770270027707L -> false; 3224777727913298872L -> false; -1441073676419344347L -> false; -2417519916452520533L -> false; -7884216401522586609L -> false; -2796892171845744540L -> false; -2530663500164660862L -> false; -2264698731421349299L -> false; -6301941405625428267L -> false; 1118769919115618925L -> false; -3315022889335032034L -> false; 6790791859713076536L -> false; -6287885895726259950L -> false; 7036501100000084257L -> false; -8660185765070272892L -> false; 0L -> true; 1256017657628421411L -> false; 4161392575889986945L -> false; -6062160849957200379L -> false; 2050777921649849245L -> false; -5707081726479912303L -> false; 7007967583009742492L -> false; 2222440151561842948L -> false; -6721953801867170697L -> false; -7885266170714706233L -> false; 4322769158609909940L -> false; -898939348400618792L -> false; 1398507300916388863L -> false; -7314527457266255534L -> false; -3768157736633469270L -> false; 3906053329638043395L -> false; -2423282696440615857L -> false; 3262857228003744550L -> false; -294629012482506639L -> false; 689252303200971584L -> false; -949171309053917101L -> false; 1153745841753386362L -> false; -7139720054173349629L -> false; 5729429493169192938L -> false; 3147513210109551715L -> false; -7622842036935762123L -> false; -2655363517875144787L -> false; -8540329665204613710L -> false; -3316185614787998640L -> false; -7171948333957854763L -> false; 643735998272900932L -> false; 4986005544098925810L -> false; -7639906882480959204L -> false; -4380764207063965457L -> false; 2818999576258038632L -> false; 3508863594680469870L -> false; -8690914547174917743L -> false; 1098465513758097547L -> false; 4218628012430961849L -> false; 6435651773147788786L -> false; 9009339763374318376L -> false; -3161092180305721636L -> false; 8487857972336733594L -> false; 6784366724273561670L -> false; -3312092294417046138L -> false; 1583416881273542902L -> false; -5748946431569544365L -> false; -8876028441964492915L -> false; 8328121679685965390L -> false; 1737879028445335557L -> false; 7340188779816032270L -> false; 4494217989422939968L -> false; 7083777351172515530L -> false; -3270685705223979163L -> false; 8520094710095194968L -> false; 4164139407125837706L -> false; 153637279587014926L -> false; -1656305904791530564L -> false; 5240182597792645198L -> false; -8365460935410113080L -> false; 2259397563612834240L -> false; -4404877394737171205L -> false; -6753006748206940599L -> false; 2022662898930300274L -> false; 2701623574335708358L -> false; 7687356893908644279L -> false; -931329658461140236L -> false; -2452190344785809016L -> false; 5808672460943173892L -> false; -3394167952197954244L -> false; -8959165302033331105L -> false; 3993033237256830916L -> false; 4972040655077426416L -> false; 4882728146457597343L -> false; 9213678680194827455L -> false; 5300276494079701428L -> false; -9132719513648881735L -> false; -7123352971536208992L -> false; 4259354711344712502L -> false; 8040921812849396650L -> false; -364061021052118635L -> false; 1359540546038184604L -> false; -4045157926296238604L -> false; 2619877327226739617L -> false; -2978122754581212173L -> false; -5943664818246816981L -> false; -4683856205808377145L -> false; 8310294664523726142L -> false; 558752675069655569L -> false; 8199640615007233109L -> false; 8503977350048285922L -> false; 2741028434103436854L -> false; 1555660693178054105L -> false; -1213860894341146248L -> false; -7095101722225497728L -> false; -4292043424114694448L -> false; -2620576406080708837L -> false; 3910553276736898631L -> false; -7268555609988799200L -> false; -6934743764498995030L -> false; 4876048078141422706L -> false; 5076578730158835782L -> false; -4290997597638374224L -> false; 7859313320400495093L -> false; -9073896469922473758L -> false; -1373219575348706144L -> false; -7434366745648348883L -> false; -8252951406749682434L -> false; 3976766521418821020L -> false; 4221739137319150436L -> false; 7626491182175802526L -> false; 2422190457351331666L -> false; 1324477536709314583L -> false; -7308516696705877236L -> false; -1441184219299041128L -> false; -7619916642310435274L -> false; -1366216905461382541L -> false; 4166104326466068382L -> false; -679766008357102884L -> false; 1340692257137144601L -> false; -3347868337765287544L -> false; 8624184165625915808L -> false; 2331860220219071134L -> false; -790015524249429917L -> false; 8399933408910938616L -> false; -2308579306926069217L -> false; -5594759985566186977L -> false; 197835813572346897L -> false; 323546263287575941L -> false; -6538996838665322453L -> false; 866928363553278728L -> false; 5479429944191365165L -> false; -7729052846454806041L -> false; -4304406580070181007L -> false; -4763149175045705024L -> false; 469304370363482895L -> false; -2804630954669580607L -> false; -2238043473974805486L -> false; 3734790826411290913L -> false; -227934510922809045L -> false; 5699328150978489073L -> false; 4601270508136665021L -> false; 212249186598423999L -> false; 8348878307193905173L -> false; -7973754506024961452L -> false; -5364159185804582406L -> false; 6806501729242859693L -> false; -3765043485710736446L -> false; 7194818492908892508L -> false; 1019954390233679959L -> false; -4420431099744708779L -> false; 8114335019049414454L -> false; -2889137903793420078L -> false; -1495518350952249754L -> false; -569354245761226691L -> false; -8589663454077811882L -> false; 6461206961562494132L -> false; 7813289179577223734L -> false; -6887763749911475116L -> false; -2338474396491590209L -> false; 6040222022058163474L -> false; 4420706034848988623L -> false; 6586471556538983659L -> false; -2662379650000679469L -> false; -1991171025695944950L -> false; 7012460325344924441L -> false; 7983768007747169077L -> false; 3259727538054383679L -> false; 7887016748577155308L -> false; -2161834059847512675L -> false; 7772143368369364168L -> false; 2746391341985398187L -> false; -6044975648356418603L -> false; -5178825119209008517L -> false; -8711565572371958878L -> false; 3567420727005224228L -> false; -6591184801704195820L -> false; -7799749368733739938L -> false; -2307913367909538993L -> false; -6139115887619923128L -> false; -2966172447767866175L -> false; -6622094766643380931L -> false; 3173163354060602924L -> false; -4281744317789616022L -> false; 9177166544734112775L -> false; 5663627078768118084L -> false; 8366279157860053843L -> false; 8511705671936252155L -> false; 3630742237263843231L -> false; -7394159616171936648L -> false; -9043869006878631603L -> false; -2073201129865962220L -> false; 5448217779542124314L -> false; -4677740139754242931L -> false; -9018937089320797157L -> false; -6704152621528229497L -> false; 2595706173326502376L -> false; 8038783472656886325L -> false; -1116361473951770628L -> false; 8827581399887526968L -> false; -594959241272658988L -> false; 2654816421495205220L -> false; 2445531497888324919L -> false; -2862675227543729570L -> false; -1474435637026224678L -> false; -7958909181723079423L -> false; -1138120395318770637L -> false; 2550568742267673149L -> false; 1533772787097910211L -> false; -7127307218936826104L -> false; _ -> false}) + +--- Failure -------------------------------------------------------------------- + Test fail_pred_strings failed (2 shrink steps): {"some random string" -> true; _ -> false} @@ -1527,7 +1539,7 @@ stats dist: -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (68 tests failed, 3 tests errored, ran 150 tests) +failure (70 tests failed, 3 tests errored, ran 152 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_tests.ml b/test/core/QCheck2_tests.ml index 57d914e4..39469b16 100644 --- a/test/core/QCheck2_tests.ml +++ b/test/core/QCheck2_tests.ml @@ -720,8 +720,8 @@ end module Function = struct open QCheck2 - let fail_pred_map_commute = - Test.make ~name:"fail_pred_map_commute" ~count:100 ~long_factor:100 + let fail_pred_map_commute_int = + Test.make ~name:"fail_pred_map_commute_int" ~count:100 ~long_factor:100 ~print:Print.(triple (list int) Fn.print Fn.print) Gen.(triple (small_list small_int) @@ -730,6 +730,26 @@ module Function = struct (fun (l,Fun (_,f),Fun (_,p)) -> List.filter p (List.map f l) = List.map f (List.filter p l)) + let fail_pred_map_commute_int32 = + Test.make ~name:"fail_pred_map_commute_int32" ~count:100 ~long_factor:100 + ~print:Print.(triple (list int32) Fn.print Fn.print) + Gen.(triple + (small_list int32) + (fun1 ~print:Print.int32 Observable.int32 int32) + (fun1 ~print:Print.bool Observable.int32 bool)) + (fun (l,Fun (_,f),Fun (_,p)) -> + List.filter p (List.map f l) = List.map f (List.filter p l)) + + let fail_pred_map_commute_int64 = + Test.make ~name:"fail_pred_map_commute_int64" ~count:100 ~long_factor:100 + ~print:Print.(triple (list int64) Fn.print Fn.print) + Gen.(triple + (small_list int64) + (fun1 ~print:Print.int64 Observable.int64 int64) + (fun1 ~print:Print.bool Observable.int64 bool)) + (fun (l,Fun (_,f),Fun (_,p)) -> + List.filter p (List.map f l) = List.map f (List.filter p l)) + let fail_pred_strings = Test.make ~name:"fail_pred_strings" ~count:100 ~print:Fn.print (fun1 Observable.string ~print:Print.bool Gen.bool) @@ -793,7 +813,9 @@ module Function = struct = List.fold_left f (List.fold_left f acc is) is) (*Typo*) let tests = [ - fail_pred_map_commute; + fail_pred_map_commute_int; + fail_pred_map_commute_int32; + fail_pred_map_commute_int64; fail_pred_strings; prop_foldleft_foldright; prop_foldleft_foldright_uncurry; diff --git a/test/core/QCheck_expect_test.expected.ocaml4.32 b/test/core/QCheck_expect_test.expected.ocaml4.32 index 3bd91928..9461d4da 100644 --- a/test/core/QCheck_expect_test.expected.ocaml4.32 +++ b/test/core/QCheck_expect_test.expected.ocaml4.32 @@ -527,10 +527,23 @@ Test sum list = 0 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute failed (48 shrink steps): +Test fail_pred_map_commute_int failed (48 shrink steps): ([1], {_ -> 0}, {1 -> true; _ -> false}) +--- Failure -------------------------------------------------------------------- + +Test fail_pred_map_commute_int32 failed (149 shrink steps): + +([-2l], {_ -> 0l}, {-2l -> true; _ -> false}) + +--- Failure -------------------------------------------------------------------- + +Test fail_pred_map_commute_int64 failed (181 shrink steps): + +([3L], {_ -> 0L}, {3L -> true; _ -> false}) + + --- Failure -------------------------------------------------------------------- Test fail_pred_strings failed (2 shrink steps): @@ -1441,7 +1454,7 @@ stats dist: 6.. 10: 0 ================================================================================ 1 warning(s) -failure (68 tests failed, 3 tests errored, ran 158 tests) +failure (70 tests failed, 3 tests errored, ran 160 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_expect_test.expected.ocaml4.64 b/test/core/QCheck_expect_test.expected.ocaml4.64 index 426055f0..2f4e4b95 100644 --- a/test/core/QCheck_expect_test.expected.ocaml4.64 +++ b/test/core/QCheck_expect_test.expected.ocaml4.64 @@ -559,12 +559,24 @@ Test sum list = 0 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute failed (77 shrink steps): +Test fail_pred_map_commute_int failed (77 shrink steps): ([1], {_ -> 0}, {1 -> true; _ -> false}) --- Failure -------------------------------------------------------------------- +Test fail_pred_map_commute_int32 failed (149 shrink steps): + +([-2l], {_ -> 0l}, {-2l -> true; _ -> false}) + +--- Failure -------------------------------------------------------------------- + +Test fail_pred_map_commute_int64 failed (181 shrink steps): + +([3L], {_ -> 0L}, {3L -> true; _ -> false}) + +--- Failure -------------------------------------------------------------------- + Test fail_pred_strings failed (2 shrink steps): {"some random string" -> true; _ -> false} @@ -1473,7 +1485,7 @@ stats dist: 6.. 10: 0 ================================================================================ 1 warning(s) -failure (68 tests failed, 3 tests errored, ran 158 tests) +failure (70 tests failed, 3 tests errored, ran 160 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_expect_test.expected.ocaml5.32 b/test/core/QCheck_expect_test.expected.ocaml5.32 index 3ee23b48..cbe359b1 100644 --- a/test/core/QCheck_expect_test.expected.ocaml5.32 +++ b/test/core/QCheck_expect_test.expected.ocaml5.32 @@ -537,12 +537,24 @@ Test sum list = 0 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute failed (47 shrink steps): +Test fail_pred_map_commute_int failed (47 shrink steps): ([1], {_ -> 0}, {1 -> true; _ -> false}) --- Failure -------------------------------------------------------------------- +Test fail_pred_map_commute_int32 failed (110 shrink steps): + +([-1l], {_ -> 0l}, {-1l -> true; _ -> false}) + +--- Failure -------------------------------------------------------------------- + +Test fail_pred_map_commute_int64 failed (185 shrink steps): + +([6L], {_ -> 0L}, {6L -> true; _ -> false}) + +--- Failure -------------------------------------------------------------------- + Test fail_pred_strings failed (2 shrink steps): {"some random string" -> true; _ -> false} @@ -1451,7 +1463,7 @@ stats dist: -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (68 tests failed, 3 tests errored, ran 158 tests) +failure (70 tests failed, 3 tests errored, ran 160 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_expect_test.expected.ocaml5.64 b/test/core/QCheck_expect_test.expected.ocaml5.64 index 22ddaf52..7d79e531 100644 --- a/test/core/QCheck_expect_test.expected.ocaml5.64 +++ b/test/core/QCheck_expect_test.expected.ocaml5.64 @@ -569,12 +569,24 @@ Test sum list = 0 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute failed (89 shrink steps): +Test fail_pred_map_commute_int failed (89 shrink steps): ([1], {_ -> 0}, {0 -> true; _ -> false}) --- Failure -------------------------------------------------------------------- +Test fail_pred_map_commute_int32 failed (110 shrink steps): + +([-1l], {_ -> 0l}, {-1l -> true; _ -> false}) + +--- Failure -------------------------------------------------------------------- + +Test fail_pred_map_commute_int64 failed (185 shrink steps): + +([6L], {_ -> 0L}, {6L -> true; _ -> false}) + +--- Failure -------------------------------------------------------------------- + Test fail_pred_strings failed (2 shrink steps): {"some random string" -> true; _ -> false} @@ -1483,7 +1495,7 @@ stats dist: -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (68 tests failed, 3 tests errored, ran 158 tests) +failure (70 tests failed, 3 tests errored, ran 160 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_tests.ml b/test/core/QCheck_tests.ml index 35e5ffaa..8dc8ebf0 100644 --- a/test/core/QCheck_tests.ml +++ b/test/core/QCheck_tests.ml @@ -796,8 +796,8 @@ end module Function = struct open QCheck - let fail_pred_map_commute = - Test.make ~name:"fail_pred_map_commute" ~count:100 ~long_factor:100 + let fail_pred_map_commute_int = + Test.make ~name:"fail_pred_map_commute_int" ~count:100 ~long_factor:100 (triple (small_list small_int) (fun1 Observable.int int) @@ -805,6 +805,24 @@ module Function = struct (fun (l,Fun (_,f),Fun (_,p)) -> List.filter p (List.map f l) = List.map f (List.filter p l)) + let fail_pred_map_commute_int32 = + Test.make ~name:"fail_pred_map_commute_int32" ~count:100 ~long_factor:100 + (triple + (small_list int32) + (fun1 Observable.int32 int32) + (fun1 Observable.int32 bool)) + (fun (l,Fun (_,f),Fun (_,p)) -> + List.filter p (List.map f l) = List.map f (List.filter p l)) + + let fail_pred_map_commute_int64 = + Test.make ~name:"fail_pred_map_commute_int64" ~count:100 ~long_factor:100 + (triple + (small_list int64) + (fun1 Observable.int64 int64) + (fun1 Observable.int64 bool)) + (fun (l,Fun (_,f),Fun (_,p)) -> + List.filter p (List.map f l) = List.map f (List.filter p l)) + let fail_pred_strings = Test.make ~name:"fail_pred_strings" ~count:100 (fun1 Observable.string bool) @@ -865,7 +883,9 @@ module Function = struct = List.fold_left f (List.fold_left f acc is) is) (*Typo*) let tests = [ - fail_pred_map_commute; + fail_pred_map_commute_int; + fail_pred_map_commute_int32; + fail_pred_map_commute_int64; fail_pred_strings; prop_foldleft_foldright; prop_foldleft_foldright_uncurry; From c4f4abcc228d1a0659fdb342ff2234b56347175f Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 20 Jan 2025 22:19:10 +0100 Subject: [PATCH 275/391] Add int{32,64} stats tests for QCheck and QCheck2 --- .../QCheck2_expect_test.expected.ocaml4.32 | 152 ++++++++++++++++- .../QCheck2_expect_test.expected.ocaml4.64 | 152 ++++++++++++++++- .../QCheck2_expect_test.expected.ocaml5.32 | 153 +++++++++++++++++- .../QCheck2_expect_test.expected.ocaml5.64 | 153 +++++++++++++++++- test/core/QCheck2_tests.ml | 13 ++ .../QCheck_expect_test.expected.ocaml4.32 | 153 +++++++++++++++++- .../QCheck_expect_test.expected.ocaml4.64 | 152 ++++++++++++++++- .../QCheck_expect_test.expected.ocaml5.32 | 153 +++++++++++++++++- .../QCheck_expect_test.expected.ocaml5.64 | 153 +++++++++++++++++- test/core/QCheck_tests.ml | 13 ++ 10 files changed, 1238 insertions(+), 9 deletions(-) diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.32 b/test/core/QCheck2_expect_test.expected.ocaml4.32 index dd496ce8..efae3f87 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.32 @@ -1432,6 +1432,156 @@ stats dist: 858993470.. 966367652: 0 966367653.. 1073741823: ################# 189 ++++ Stats for int32 lower dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32926.27, stddev: 18808.64, median 33297, min 0, max 65534 + 0.. 3276: ################################################ 481 + 3277.. 6553: ################################################## 497 + 6554.. 9830: ############################################### 469 + 9831..13107: #################################################### 515 + 13108..16384: ############################################### 470 + 16385..19661: ####################################################### 544 + 19662..22938: ################################################# 487 + 22939..26215: ################################################ 477 + 26216..29492: ################################################### 509 + 29493..32769: ############################################### 470 + 32770..36046: ################################################## 502 + 36047..39323: ##################################################### 530 + 39324..42600: ##################################################### 533 + 42601..45877: ##################################################### 525 + 45878..49154: ###################################################### 537 + 49155..52431: ################################################# 494 + 52432..55708: ############################################### 473 + 55709..58985: ################################################# 486 + 58986..62262: ################################################### 509 + 62263..65539: ################################################# 492 + ++++ Stats for int32 upper dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32678.65, stddev: 19067.06, median 32890, min 10, max 65523 + 10.. 3285: #################################################### 514 + 3286.. 6561: ################################################### 505 + 6562.. 9837: ####################################################### 541 + 9838..13113: ################################################# 491 + 13114..16389: ##################################################### 522 + 16390..19665: ################################################## 495 + 19666..22941: ############################################### 470 + 22942..26217: #################################################### 512 + 26218..29493: ############################################### 468 + 29494..32769: ############################################## 457 + 32770..36045: #################################################### 514 + 36046..39321: ############################################### 468 + 39322..42597: #################################################### 520 + 42598..45873: ################################################### 510 + 45874..49149: #################################################### 521 + 49150..52425: ############################################# 450 + 52426..55701: ##################################################### 526 + 55702..58977: ##################################################### 522 + 58978..62253: ################################################## 493 + 62254..65529: ################################################## 501 + ++++ Stats for int64 lower dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32767.87, stddev: 18950.16, median 33187, min 0, max 65532 + 0.. 3276: ################################################## 513 + 3277.. 6553: ################################################# 500 + 6554.. 9830: ################################################ 491 + 9831..13107: ################################################# 500 + 13108..16384: ################################################# 500 + 16385..19661: ################################################### 526 + 19662..22938: ################################################ 491 + 22939..26215: ############################################## 472 + 26216..29492: ################################################## 510 + 29493..32769: ########################################### 439 + 32770..36046: ################################################# 503 + 36047..39323: ################################################### 521 + 39324..42600: ################################################### 524 + 42601..45877: ############################################## 477 + 45878..49154: ####################################################### 560 + 49155..52431: ################################################# 506 + 52432..55708: ############################################### 482 + 55709..58985: ################################################ 492 + 58986..62262: ################################################ 496 + 62263..65539: ################################################ 497 + ++++ Stats for int64 lower-mid dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32779.13, stddev: 18897.20, median 32848, min 0, max 65535 + 0.. 3276: ############################################### 473 + 3277.. 6553: ################################################## 502 + 6554.. 9830: #################################################### 522 + 9831..13107: ################################################# 494 + 13108..16384: ##################################################### 535 + 16385..19661: ############################################### 471 + 19662..22938: ################################################# 495 + 22939..26215: #################################################### 522 + 26216..29492: ################################################ 489 + 29493..32769: ################################################ 487 + 32770..36046: ################################################# 493 + 36047..39323: ############################################### 476 + 39324..42600: ################################################# 494 + 42601..45877: ##################################################### 538 + 45878..49154: ####################################################### 550 + 49155..52431: ############################################### 479 + 52432..55708: ################################################### 513 + 55709..58985: ################################################ 487 + 58986..62262: ############################################### 470 + 62263..65539: ################################################### 510 + ++++ Stats for int64 upper-mid dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32833.01, stddev: 18869.35, median 32737, min 2, max 65534 + 2.. 3278: ################################################# 475 + 3279.. 6555: #################################################### 497 + 6556.. 9832: #################################################### 496 + 9833..13109: #################################################### 502 + 13110..16386: ###################################################### 514 + 16387..19663: ################################################### 492 + 19664..22940: #################################################### 501 + 22941..26217: ###################################################### 522 + 26218..29494: ##################################################### 505 + 29495..32771: #################################################### 502 + 32772..36048: ##################################################### 504 + 36049..39325: ###################################################### 519 + 39326..42602: ################################################# 469 + 42603..45879: ################################################### 493 + 45880..49156: ################################################### 491 + 49157..52433: #################################################### 498 + 52434..55710: #################################################### 495 + 55711..58987: ###################################################### 519 + 58988..62264: ####################################################### 523 + 62265..65541: ################################################## 483 + ++++ Stats for int64 upper dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32717.82, stddev: 19106.27, median 32768, min 2, max 65523 + 2.. 3278: ##################################################### 522 + 3279.. 6555: ###################################################### 530 + 6556.. 9832: #################################################### 510 + 9833..13109: ################################################# 484 + 13110..16386: ################################################# 488 + 16387..19663: ###################################################### 530 + 19664..22940: ################################################## 494 + 22941..26217: ################################################### 502 + 26218..29494: ################################################ 477 + 29495..32771: ############################################### 463 + 32772..36048: ############################################## 457 + 36049..39325: ################################################# 483 + 39326..42602: ##################################################### 521 + 42603..45879: #################################################### 519 + 45880..49156: ################################################# 485 + 49157..52433: ################################################ 476 + 52434..55710: #################################################### 510 + 55711..58987: ####################################################### 539 + 58988..62264: #################################################### 519 + 62265..65541: ################################################## 491 + +++ Stats for exponential 10. dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: @@ -1483,7 +1633,7 @@ stats dist: 6.. 10: 0 ================================================================================ 1 warning(s) -failure (70 tests failed, 3 tests errored, ran 152 tests) +failure (70 tests failed, 3 tests errored, ran 158 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.64 b/test/core/QCheck2_expect_test.expected.ocaml4.64 index 3f43bef7..41a9f8e7 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.64 @@ -1496,6 +1496,156 @@ stats dist: 3689348814741910784.. 4150517416584649599: 0 4150517416584649600.. 4611686018427387903: ################# 189 ++++ Stats for int32 lower dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32926.27, stddev: 18808.64, median 33297, min 0, max 65534 + 0.. 3276: ################################################ 481 + 3277.. 6553: ################################################## 497 + 6554.. 9830: ############################################### 469 + 9831..13107: #################################################### 515 + 13108..16384: ############################################### 470 + 16385..19661: ####################################################### 544 + 19662..22938: ################################################# 487 + 22939..26215: ################################################ 477 + 26216..29492: ################################################### 509 + 29493..32769: ############################################### 470 + 32770..36046: ################################################## 502 + 36047..39323: ##################################################### 530 + 39324..42600: ##################################################### 533 + 42601..45877: ##################################################### 525 + 45878..49154: ###################################################### 537 + 49155..52431: ################################################# 494 + 52432..55708: ############################################### 473 + 55709..58985: ################################################# 486 + 58986..62262: ################################################### 509 + 62263..65539: ################################################# 492 + ++++ Stats for int32 upper dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32678.65, stddev: 19067.06, median 32890, min 10, max 65523 + 10.. 3285: #################################################### 514 + 3286.. 6561: ################################################### 505 + 6562.. 9837: ####################################################### 541 + 9838..13113: ################################################# 491 + 13114..16389: ##################################################### 522 + 16390..19665: ################################################## 495 + 19666..22941: ############################################### 470 + 22942..26217: #################################################### 512 + 26218..29493: ############################################### 468 + 29494..32769: ############################################## 457 + 32770..36045: #################################################### 514 + 36046..39321: ############################################### 468 + 39322..42597: #################################################### 520 + 42598..45873: ################################################### 510 + 45874..49149: #################################################### 521 + 49150..52425: ############################################# 450 + 52426..55701: ##################################################### 526 + 55702..58977: ##################################################### 522 + 58978..62253: ################################################## 493 + 62254..65529: ################################################## 501 + ++++ Stats for int64 lower dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32767.87, stddev: 18950.16, median 33187, min 0, max 65532 + 0.. 3276: ################################################## 513 + 3277.. 6553: ################################################# 500 + 6554.. 9830: ################################################ 491 + 9831..13107: ################################################# 500 + 13108..16384: ################################################# 500 + 16385..19661: ################################################### 526 + 19662..22938: ################################################ 491 + 22939..26215: ############################################## 472 + 26216..29492: ################################################## 510 + 29493..32769: ########################################### 439 + 32770..36046: ################################################# 503 + 36047..39323: ################################################### 521 + 39324..42600: ################################################### 524 + 42601..45877: ############################################## 477 + 45878..49154: ####################################################### 560 + 49155..52431: ################################################# 506 + 52432..55708: ############################################### 482 + 55709..58985: ################################################ 492 + 58986..62262: ################################################ 496 + 62263..65539: ################################################ 497 + ++++ Stats for int64 lower-mid dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32779.13, stddev: 18897.20, median 32848, min 0, max 65535 + 0.. 3276: ############################################### 473 + 3277.. 6553: ################################################## 502 + 6554.. 9830: #################################################### 522 + 9831..13107: ################################################# 494 + 13108..16384: ##################################################### 535 + 16385..19661: ############################################### 471 + 19662..22938: ################################################# 495 + 22939..26215: #################################################### 522 + 26216..29492: ################################################ 489 + 29493..32769: ################################################ 487 + 32770..36046: ################################################# 493 + 36047..39323: ############################################### 476 + 39324..42600: ################################################# 494 + 42601..45877: ##################################################### 538 + 45878..49154: ####################################################### 550 + 49155..52431: ############################################### 479 + 52432..55708: ################################################### 513 + 55709..58985: ################################################ 487 + 58986..62262: ############################################### 470 + 62263..65539: ################################################### 510 + ++++ Stats for int64 upper-mid dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32833.01, stddev: 18869.35, median 32737, min 2, max 65534 + 2.. 3278: ################################################# 475 + 3279.. 6555: #################################################### 497 + 6556.. 9832: #################################################### 496 + 9833..13109: #################################################### 502 + 13110..16386: ###################################################### 514 + 16387..19663: ################################################### 492 + 19664..22940: #################################################### 501 + 22941..26217: ###################################################### 522 + 26218..29494: ##################################################### 505 + 29495..32771: #################################################### 502 + 32772..36048: ##################################################### 504 + 36049..39325: ###################################################### 519 + 39326..42602: ################################################# 469 + 42603..45879: ################################################### 493 + 45880..49156: ################################################### 491 + 49157..52433: #################################################### 498 + 52434..55710: #################################################### 495 + 55711..58987: ###################################################### 519 + 58988..62264: ####################################################### 523 + 62265..65541: ################################################## 483 + ++++ Stats for int64 upper dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32717.82, stddev: 19106.27, median 32768, min 2, max 65523 + 2.. 3278: ##################################################### 522 + 3279.. 6555: ###################################################### 530 + 6556.. 9832: #################################################### 510 + 9833..13109: ################################################# 484 + 13110..16386: ################################################# 488 + 16387..19663: ###################################################### 530 + 19664..22940: ################################################## 494 + 22941..26217: ################################################### 502 + 26218..29494: ################################################ 477 + 29495..32771: ############################################### 463 + 32772..36048: ############################################## 457 + 36049..39325: ################################################# 483 + 39326..42602: ##################################################### 521 + 42603..45879: #################################################### 519 + 45880..49156: ################################################# 485 + 49157..52433: ################################################ 476 + 52434..55710: #################################################### 510 + 55711..58987: ####################################################### 539 + 58988..62264: #################################################### 519 + 62265..65541: ################################################## 491 + +++ Stats for exponential 10. dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: @@ -1547,7 +1697,7 @@ stats dist: 6.. 10: 0 ================================================================================ 1 warning(s) -failure (70 tests failed, 3 tests errored, ran 152 tests) +failure (70 tests failed, 3 tests errored, ran 158 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.32 b/test/core/QCheck2_expect_test.expected.ocaml5.32 index 903717b7..d90b3c41 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.32 @@ -1432,6 +1432,157 @@ stats dist: 858993470.. 966367652: 0 966367653.. 1073741823: ################# 195 ++++ Stats for int32 lower dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32719.66, stddev: 18976.66, median 32730, min 9, max 65532 + 9.. 3285: ################################################### 506 + 3286.. 6562: #################################################### 508 + 6563.. 9839: ################################################# 481 + 9840..13116: ################################################### 506 + 13117..16393: #################################################### 517 + 16394..19670: #################################################### 512 + 19671..22947: ################################################## 496 + 22948..26224: #################################################### 510 + 26225..29501: ################################################# 486 + 29502..32778: ################################################## 491 + 32779..36055: ################################################## 495 + 36056..39332: ################################################## 489 + 39333..42609: ################################################## 493 + 42610..45886: ####################################################### 537 + 45887..49163: ################################################## 497 + 49164..52440: ################################################# 479 + 52441..55717: ################################################## 493 + 55718..58994: ################################################## 494 + 58995..62271: ################################################# 481 + 62272..65548: ###################################################### 529 + ++++ Stats for int32 upper dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32555.02, stddev: 18918.49, median 32323, min 3, max 65534 + 3.. 3279: ###################################################### 547 + 3280.. 6556: ################################################ 482 + 6557.. 9833: ############################################### 473 + 9834..13110: ################################################## 509 + 13111..16387: ################################################## 507 + 16388..19664: ################################################## 507 + 19665..22941: ################################################ 482 + 22942..26218: ##################################################### 536 + 26219..29495: ####################################################### 550 + 29496..32772: ############################################## 468 + 32773..36049: #################################################### 528 + 36050..39326: ################################################ 488 + 39327..42603: ################################################ 483 + 42604..45880: ################################################ 489 + 45881..49157: ############################################# 450 + 49158..52434: ################################################ 483 + 52435..55711: ###################################################### 548 + 55712..58988: ################################################ 489 + 58989..62265: ################################################# 498 + 62266..65542: ################################################ 483 + ++++ Stats for int64 lower dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32452.50, stddev: 18981.40, median 32331, min 22, max 65532 + 22.. 3297: ##################################################### 533 + 3298.. 6573: ##################################################### 528 + 6574.. 9849: ################################################### 510 + 9850..13125: ################################################### 506 + 13126..16401: ################################################ 476 + 16402..19677: ################################################# 489 + 19678..22953: ####################################################### 543 + 22954..26229: ################################################# 486 + 26230..29505: ################################################## 501 + 29506..32781: ################################################## 501 + 32782..36057: ################################################### 505 + 36058..39333: ############################################## 463 + 39334..42609: ################################################## 498 + 42610..45885: #################################################### 517 + 45886..49161: ################################################### 510 + 49162..52437: ############################################### 471 + 52438..55713: ################################################## 497 + 55714..58989: ################################################## 494 + 58990..62265: ############################################# 454 + 62266..65541: #################################################### 518 + ++++ Stats for int64 lower-mid dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32748.75, stddev: 18818.12, median 32802, min 3, max 65533 + 3.. 3279: ################################################### 500 + 3280.. 6556: ################################################### 506 + 6557.. 9833: ############################################### 464 + 9834..13110: ################################################### 502 + 13111..16387: ################################################## 496 + 16388..19664: #################################################### 513 + 19665..22941: ################################################## 490 + 22942..26218: ####################################################### 538 + 26219..29495: ##################################################### 524 + 29496..32772: ############################################### 462 + 32773..36049: ################################################## 494 + 36050..39326: ##################################################### 523 + 39327..42603: ################################################### 504 + 42604..45880: ##################################################### 525 + 45881..49157: ################################################ 477 + 49158..52434: ################################################# 487 + 52435..55711: ##################################################### 527 + 55712..58988: #################################################### 509 + 58989..62265: ################################################ 470 + 62266..65542: ################################################# 489 + ++++ Stats for int64 upper-mid dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32869.52, stddev: 18881.85, median 33046, min 9, max 65529 + 9.. 3284: ################################################## 489 + 3285.. 6560: ################################################# 486 + 6561.. 9836: ################################################### 504 + 9837..13112: ################################################## 492 + 13113..16388: ###################################################### 528 + 16389..19664: ################################################## 494 + 19665..22940: ############################################### 461 + 22941..26216: ###################################################### 533 + 26217..29492: ################################################## 489 + 29493..32768: ################################################# 486 + 32769..36044: ################################################## 495 + 36045..39320: ##################################################### 518 + 39321..42596: ################################################### 504 + 42597..45872: ####################################################### 535 + 45873..49148: ################################################ 472 + 49149..52424: #################################################### 513 + 52425..55700: ################################################### 499 + 55701..58976: ##################################################### 517 + 58977..62252: #################################################### 508 + 62253..65528: ################################################ 476 + 65529..68804: 1 + ++++ Stats for int64 upper dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32499.47, stddev: 18881.21, median 32265, min 5, max 65534 + 5.. 3281: ###################################################### 547 + 3282.. 6558: ################################################ 484 + 6559.. 9835: ############################################# 460 + 9836..13112: ################################################## 505 + 13113..16389: ##################################################### 536 + 16390..19666: ################################################# 496 + 19667..22943: ################################################ 492 + 22944..26220: ################################################# 502 + 26221..29497: ##################################################### 540 + 29498..32774: ################################################## 508 + 32775..36051: ####################################################### 554 + 36052..39328: ################################################ 491 + 39329..42605: ################################################# 498 + 42606..45882: ############################################## 467 + 45883..49159: ############################################ 447 + 49160..52436: ############################################### 475 + 52437..55713: ################################################## 508 + 55714..58990: ################################################### 515 + 58991..62267: ################################################# 499 + 62268..65544: ############################################### 476 + +++ Stats for exponential 10. dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: @@ -1483,7 +1634,7 @@ stats dist: -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (70 tests failed, 3 tests errored, ran 152 tests) +failure (70 tests failed, 3 tests errored, ran 158 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.64 b/test/core/QCheck2_expect_test.expected.ocaml5.64 index 71b112c8..ab32eaa6 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.64 @@ -1488,6 +1488,157 @@ stats dist: 3689348814741910784.. 4150517416584649599: 0 4150517416584649600.. 4611686018427387903: ################# 195 ++++ Stats for int32 lower dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32719.66, stddev: 18976.66, median 32730, min 9, max 65532 + 9.. 3285: ################################################### 506 + 3286.. 6562: #################################################### 508 + 6563.. 9839: ################################################# 481 + 9840..13116: ################################################### 506 + 13117..16393: #################################################### 517 + 16394..19670: #################################################### 512 + 19671..22947: ################################################## 496 + 22948..26224: #################################################### 510 + 26225..29501: ################################################# 486 + 29502..32778: ################################################## 491 + 32779..36055: ################################################## 495 + 36056..39332: ################################################## 489 + 39333..42609: ################################################## 493 + 42610..45886: ####################################################### 537 + 45887..49163: ################################################## 497 + 49164..52440: ################################################# 479 + 52441..55717: ################################################## 493 + 55718..58994: ################################################## 494 + 58995..62271: ################################################# 481 + 62272..65548: ###################################################### 529 + ++++ Stats for int32 upper dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32555.02, stddev: 18918.49, median 32323, min 3, max 65534 + 3.. 3279: ###################################################### 547 + 3280.. 6556: ################################################ 482 + 6557.. 9833: ############################################### 473 + 9834..13110: ################################################## 509 + 13111..16387: ################################################## 507 + 16388..19664: ################################################## 507 + 19665..22941: ################################################ 482 + 22942..26218: ##################################################### 536 + 26219..29495: ####################################################### 550 + 29496..32772: ############################################## 468 + 32773..36049: #################################################### 528 + 36050..39326: ################################################ 488 + 39327..42603: ################################################ 483 + 42604..45880: ################################################ 489 + 45881..49157: ############################################# 450 + 49158..52434: ################################################ 483 + 52435..55711: ###################################################### 548 + 55712..58988: ################################################ 489 + 58989..62265: ################################################# 498 + 62266..65542: ################################################ 483 + ++++ Stats for int64 lower dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32452.50, stddev: 18981.40, median 32331, min 22, max 65532 + 22.. 3297: ##################################################### 533 + 3298.. 6573: ##################################################### 528 + 6574.. 9849: ################################################### 510 + 9850..13125: ################################################### 506 + 13126..16401: ################################################ 476 + 16402..19677: ################################################# 489 + 19678..22953: ####################################################### 543 + 22954..26229: ################################################# 486 + 26230..29505: ################################################## 501 + 29506..32781: ################################################## 501 + 32782..36057: ################################################### 505 + 36058..39333: ############################################## 463 + 39334..42609: ################################################## 498 + 42610..45885: #################################################### 517 + 45886..49161: ################################################### 510 + 49162..52437: ############################################### 471 + 52438..55713: ################################################## 497 + 55714..58989: ################################################## 494 + 58990..62265: ############################################# 454 + 62266..65541: #################################################### 518 + ++++ Stats for int64 lower-mid dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32748.75, stddev: 18818.12, median 32802, min 3, max 65533 + 3.. 3279: ################################################### 500 + 3280.. 6556: ################################################### 506 + 6557.. 9833: ############################################### 464 + 9834..13110: ################################################### 502 + 13111..16387: ################################################## 496 + 16388..19664: #################################################### 513 + 19665..22941: ################################################## 490 + 22942..26218: ####################################################### 538 + 26219..29495: ##################################################### 524 + 29496..32772: ############################################### 462 + 32773..36049: ################################################## 494 + 36050..39326: ##################################################### 523 + 39327..42603: ################################################### 504 + 42604..45880: ##################################################### 525 + 45881..49157: ################################################ 477 + 49158..52434: ################################################# 487 + 52435..55711: ##################################################### 527 + 55712..58988: #################################################### 509 + 58989..62265: ################################################ 470 + 62266..65542: ################################################# 489 + ++++ Stats for int64 upper-mid dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32869.52, stddev: 18881.85, median 33046, min 9, max 65529 + 9.. 3284: ################################################## 489 + 3285.. 6560: ################################################# 486 + 6561.. 9836: ################################################### 504 + 9837..13112: ################################################## 492 + 13113..16388: ###################################################### 528 + 16389..19664: ################################################## 494 + 19665..22940: ############################################### 461 + 22941..26216: ###################################################### 533 + 26217..29492: ################################################## 489 + 29493..32768: ################################################# 486 + 32769..36044: ################################################## 495 + 36045..39320: ##################################################### 518 + 39321..42596: ################################################### 504 + 42597..45872: ####################################################### 535 + 45873..49148: ################################################ 472 + 49149..52424: #################################################### 513 + 52425..55700: ################################################### 499 + 55701..58976: ##################################################### 517 + 58977..62252: #################################################### 508 + 62253..65528: ################################################ 476 + 65529..68804: 1 + ++++ Stats for int64 upper dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32499.47, stddev: 18881.21, median 32265, min 5, max 65534 + 5.. 3281: ###################################################### 547 + 3282.. 6558: ################################################ 484 + 6559.. 9835: ############################################# 460 + 9836..13112: ################################################## 505 + 13113..16389: ##################################################### 536 + 16390..19666: ################################################# 496 + 19667..22943: ################################################ 492 + 22944..26220: ################################################# 502 + 26221..29497: ##################################################### 540 + 29498..32774: ################################################## 508 + 32775..36051: ####################################################### 554 + 36052..39328: ################################################ 491 + 39329..42605: ################################################# 498 + 42606..45882: ############################################## 467 + 45883..49159: ############################################ 447 + 49160..52436: ############################################### 475 + 52437..55713: ################################################## 508 + 55714..58990: ################################################### 515 + 58991..62267: ################################################# 499 + 62268..65544: ############################################### 476 + +++ Stats for exponential 10. dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: @@ -1539,7 +1690,7 @@ stats dist: -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (70 tests failed, 3 tests errored, ran 152 tests) +failure (70 tests failed, 3 tests errored, ran 158 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_tests.ml b/test/core/QCheck2_tests.ml index 39469b16..1502a280 100644 --- a/test/core/QCheck2_tests.ml +++ b/test/core/QCheck2_tests.ml @@ -940,6 +940,18 @@ module Stats = struct Test.make ~name:"oneof int dist" ~count:1000 ~stats:[dist] (Gen.oneofl[min_int;-1;0;1;max_int]) (fun _ -> true); ] + let int_32_64_dist_tests = + let stat32 shift = [("dist",fun i -> Int32.(to_int (logand 0xffffl (shift i))))] in + let stat64 shift = [("dist",fun i -> Int64.(to_int (logand 0xffffL (shift i))))] in + [ (* stats are int-based, so for these to work for 31-bit ints, consider blocks of 16 bits *) + Test.make ~name:"int32 lower dist" ~count:10000 ~stats:(stat32 (fun i -> i)) Gen.int32 (fun _ -> true); + Test.make ~name:"int32 upper dist" ~count:10000 ~stats:(stat32 (fun i -> Int32.shift_right_logical i 16)) Gen.int32 (fun _ -> true); + Test.make ~name:"int64 lower dist" ~count:10000 ~stats:(stat64 (fun i -> i)) Gen.int64 (fun _ -> true); + Test.make ~name:"int64 lower-mid dist" ~count:10000 ~stats:(stat64 (fun i -> Int64.shift_right i 16)) Gen.int64 (fun _ -> true); + Test.make ~name:"int64 upper-mid dist" ~count:10000 ~stats:(stat64 (fun i -> Int64.shift_right i 32)) Gen.int64 (fun _ -> true); + Test.make ~name:"int64 upper dist" ~count:10000 ~stats:(stat64 (fun i -> Int64.shift_right_logical i 48)) Gen.int64 (fun _ -> true); + ] + let exponential_tests = let float_dist = ("dist",int_of_float) in [ Test.make ~name:"exponential 10. dist" ~count:5_000 ~stats:[float_dist] (Gen.exponential 10.) (fun _ -> true); @@ -967,5 +979,6 @@ module Stats = struct @ list_len_tests @ array_len_tests @ int_dist_tests + @ int_32_64_dist_tests @ exponential_tests end diff --git a/test/core/QCheck_expect_test.expected.ocaml4.32 b/test/core/QCheck_expect_test.expected.ocaml4.32 index 9461d4da..88ac7e97 100644 --- a/test/core/QCheck_expect_test.expected.ocaml4.32 +++ b/test/core/QCheck_expect_test.expected.ocaml4.32 @@ -543,7 +543,6 @@ Test fail_pred_map_commute_int64 failed (181 shrink steps): ([3L], {_ -> 0L}, {3L -> true; _ -> false}) - --- Failure -------------------------------------------------------------------- Test fail_pred_strings failed (2 shrink steps): @@ -1403,6 +1402,156 @@ stats dist: 858993470.. 966367652: 0 966367653.. 1073741823: ################# 189 ++++ Stats for int32 lower dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32926.27, stddev: 18808.64, median 33297, min 0, max 65534 + 0.. 3276: ################################################ 481 + 3277.. 6553: ################################################## 497 + 6554.. 9830: ############################################### 469 + 9831..13107: #################################################### 515 + 13108..16384: ############################################### 470 + 16385..19661: ####################################################### 544 + 19662..22938: ################################################# 487 + 22939..26215: ################################################ 477 + 26216..29492: ################################################### 509 + 29493..32769: ############################################### 470 + 32770..36046: ################################################## 502 + 36047..39323: ##################################################### 530 + 39324..42600: ##################################################### 533 + 42601..45877: ##################################################### 525 + 45878..49154: ###################################################### 537 + 49155..52431: ################################################# 494 + 52432..55708: ############################################### 473 + 55709..58985: ################################################# 486 + 58986..62262: ################################################### 509 + 62263..65539: ################################################# 492 + ++++ Stats for int32 upper dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32678.65, stddev: 19067.06, median 32890, min 10, max 65523 + 10.. 3285: #################################################### 514 + 3286.. 6561: ################################################### 505 + 6562.. 9837: ####################################################### 541 + 9838..13113: ################################################# 491 + 13114..16389: ##################################################### 522 + 16390..19665: ################################################## 495 + 19666..22941: ############################################### 470 + 22942..26217: #################################################### 512 + 26218..29493: ############################################### 468 + 29494..32769: ############################################## 457 + 32770..36045: #################################################### 514 + 36046..39321: ############################################### 468 + 39322..42597: #################################################### 520 + 42598..45873: ################################################### 510 + 45874..49149: #################################################### 521 + 49150..52425: ############################################# 450 + 52426..55701: ##################################################### 526 + 55702..58977: ##################################################### 522 + 58978..62253: ################################################## 493 + 62254..65529: ################################################## 501 + ++++ Stats for int64 lower dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32767.87, stddev: 18950.16, median 33187, min 0, max 65532 + 0.. 3276: ################################################## 513 + 3277.. 6553: ################################################# 500 + 6554.. 9830: ################################################ 491 + 9831..13107: ################################################# 500 + 13108..16384: ################################################# 500 + 16385..19661: ################################################### 526 + 19662..22938: ################################################ 491 + 22939..26215: ############################################## 472 + 26216..29492: ################################################## 510 + 29493..32769: ########################################### 439 + 32770..36046: ################################################# 503 + 36047..39323: ################################################### 521 + 39324..42600: ################################################### 524 + 42601..45877: ############################################## 477 + 45878..49154: ####################################################### 560 + 49155..52431: ################################################# 506 + 52432..55708: ############################################### 482 + 55709..58985: ################################################ 492 + 58986..62262: ################################################ 496 + 62263..65539: ################################################ 497 + ++++ Stats for int64 lower-mid dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32779.13, stddev: 18897.20, median 32848, min 0, max 65535 + 0.. 3276: ############################################### 473 + 3277.. 6553: ################################################## 502 + 6554.. 9830: #################################################### 522 + 9831..13107: ################################################# 494 + 13108..16384: ##################################################### 535 + 16385..19661: ############################################### 471 + 19662..22938: ################################################# 495 + 22939..26215: #################################################### 522 + 26216..29492: ################################################ 489 + 29493..32769: ################################################ 487 + 32770..36046: ################################################# 493 + 36047..39323: ############################################### 476 + 39324..42600: ################################################# 494 + 42601..45877: ##################################################### 538 + 45878..49154: ####################################################### 550 + 49155..52431: ############################################### 479 + 52432..55708: ################################################### 513 + 55709..58985: ################################################ 487 + 58986..62262: ############################################### 470 + 62263..65539: ################################################### 510 + ++++ Stats for int64 upper-mid dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32833.01, stddev: 18869.35, median 32737, min 2, max 65534 + 2.. 3278: ################################################# 475 + 3279.. 6555: #################################################### 497 + 6556.. 9832: #################################################### 496 + 9833..13109: #################################################### 502 + 13110..16386: ###################################################### 514 + 16387..19663: ################################################### 492 + 19664..22940: #################################################### 501 + 22941..26217: ###################################################### 522 + 26218..29494: ##################################################### 505 + 29495..32771: #################################################### 502 + 32772..36048: ##################################################### 504 + 36049..39325: ###################################################### 519 + 39326..42602: ################################################# 469 + 42603..45879: ################################################### 493 + 45880..49156: ################################################### 491 + 49157..52433: #################################################### 498 + 52434..55710: #################################################### 495 + 55711..58987: ###################################################### 519 + 58988..62264: ####################################################### 523 + 62265..65541: ################################################## 483 + ++++ Stats for int64 upper dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32717.82, stddev: 19106.27, median 32768, min 2, max 65523 + 2.. 3278: ##################################################### 522 + 3279.. 6555: ###################################################### 530 + 6556.. 9832: #################################################### 510 + 9833..13109: ################################################# 484 + 13110..16386: ################################################# 488 + 16387..19663: ###################################################### 530 + 19664..22940: ################################################## 494 + 22941..26217: ################################################### 502 + 26218..29494: ################################################ 477 + 29495..32771: ############################################### 463 + 32772..36048: ############################################## 457 + 36049..39325: ################################################# 483 + 39326..42602: ##################################################### 521 + 42603..45879: #################################################### 519 + 45880..49156: ################################################# 485 + 49157..52433: ################################################ 476 + 52434..55710: #################################################### 510 + 55711..58987: ####################################################### 539 + 58988..62264: #################################################### 519 + 62265..65541: ################################################## 491 + +++ Stats for exponential 10. dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: @@ -1454,7 +1603,7 @@ stats dist: 6.. 10: 0 ================================================================================ 1 warning(s) -failure (70 tests failed, 3 tests errored, ran 160 tests) +failure (70 tests failed, 3 tests errored, ran 166 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_expect_test.expected.ocaml4.64 b/test/core/QCheck_expect_test.expected.ocaml4.64 index 2f4e4b95..2b8dbf6c 100644 --- a/test/core/QCheck_expect_test.expected.ocaml4.64 +++ b/test/core/QCheck_expect_test.expected.ocaml4.64 @@ -1434,6 +1434,156 @@ stats dist: 3689348814741910784.. 4150517416584649599: 0 4150517416584649600.. 4611686018427387903: ################# 189 ++++ Stats for int32 lower dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32926.27, stddev: 18808.64, median 33297, min 0, max 65534 + 0.. 3276: ################################################ 481 + 3277.. 6553: ################################################## 497 + 6554.. 9830: ############################################### 469 + 9831..13107: #################################################### 515 + 13108..16384: ############################################### 470 + 16385..19661: ####################################################### 544 + 19662..22938: ################################################# 487 + 22939..26215: ################################################ 477 + 26216..29492: ################################################### 509 + 29493..32769: ############################################### 470 + 32770..36046: ################################################## 502 + 36047..39323: ##################################################### 530 + 39324..42600: ##################################################### 533 + 42601..45877: ##################################################### 525 + 45878..49154: ###################################################### 537 + 49155..52431: ################################################# 494 + 52432..55708: ############################################### 473 + 55709..58985: ################################################# 486 + 58986..62262: ################################################### 509 + 62263..65539: ################################################# 492 + ++++ Stats for int32 upper dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32678.65, stddev: 19067.06, median 32890, min 10, max 65523 + 10.. 3285: #################################################### 514 + 3286.. 6561: ################################################### 505 + 6562.. 9837: ####################################################### 541 + 9838..13113: ################################################# 491 + 13114..16389: ##################################################### 522 + 16390..19665: ################################################## 495 + 19666..22941: ############################################### 470 + 22942..26217: #################################################### 512 + 26218..29493: ############################################### 468 + 29494..32769: ############################################## 457 + 32770..36045: #################################################### 514 + 36046..39321: ############################################### 468 + 39322..42597: #################################################### 520 + 42598..45873: ################################################### 510 + 45874..49149: #################################################### 521 + 49150..52425: ############################################# 450 + 52426..55701: ##################################################### 526 + 55702..58977: ##################################################### 522 + 58978..62253: ################################################## 493 + 62254..65529: ################################################## 501 + ++++ Stats for int64 lower dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32767.87, stddev: 18950.16, median 33187, min 0, max 65532 + 0.. 3276: ################################################## 513 + 3277.. 6553: ################################################# 500 + 6554.. 9830: ################################################ 491 + 9831..13107: ################################################# 500 + 13108..16384: ################################################# 500 + 16385..19661: ################################################### 526 + 19662..22938: ################################################ 491 + 22939..26215: ############################################## 472 + 26216..29492: ################################################## 510 + 29493..32769: ########################################### 439 + 32770..36046: ################################################# 503 + 36047..39323: ################################################### 521 + 39324..42600: ################################################### 524 + 42601..45877: ############################################## 477 + 45878..49154: ####################################################### 560 + 49155..52431: ################################################# 506 + 52432..55708: ############################################### 482 + 55709..58985: ################################################ 492 + 58986..62262: ################################################ 496 + 62263..65539: ################################################ 497 + ++++ Stats for int64 lower-mid dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32779.13, stddev: 18897.20, median 32848, min 0, max 65535 + 0.. 3276: ############################################### 473 + 3277.. 6553: ################################################## 502 + 6554.. 9830: #################################################### 522 + 9831..13107: ################################################# 494 + 13108..16384: ##################################################### 535 + 16385..19661: ############################################### 471 + 19662..22938: ################################################# 495 + 22939..26215: #################################################### 522 + 26216..29492: ################################################ 489 + 29493..32769: ################################################ 487 + 32770..36046: ################################################# 493 + 36047..39323: ############################################### 476 + 39324..42600: ################################################# 494 + 42601..45877: ##################################################### 538 + 45878..49154: ####################################################### 550 + 49155..52431: ############################################### 479 + 52432..55708: ################################################### 513 + 55709..58985: ################################################ 487 + 58986..62262: ############################################### 470 + 62263..65539: ################################################### 510 + ++++ Stats for int64 upper-mid dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32833.01, stddev: 18869.35, median 32737, min 2, max 65534 + 2.. 3278: ################################################# 475 + 3279.. 6555: #################################################### 497 + 6556.. 9832: #################################################### 496 + 9833..13109: #################################################### 502 + 13110..16386: ###################################################### 514 + 16387..19663: ################################################### 492 + 19664..22940: #################################################### 501 + 22941..26217: ###################################################### 522 + 26218..29494: ##################################################### 505 + 29495..32771: #################################################### 502 + 32772..36048: ##################################################### 504 + 36049..39325: ###################################################### 519 + 39326..42602: ################################################# 469 + 42603..45879: ################################################### 493 + 45880..49156: ################################################### 491 + 49157..52433: #################################################### 498 + 52434..55710: #################################################### 495 + 55711..58987: ###################################################### 519 + 58988..62264: ####################################################### 523 + 62265..65541: ################################################## 483 + ++++ Stats for int64 upper dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32717.82, stddev: 19106.27, median 32768, min 2, max 65523 + 2.. 3278: ##################################################### 522 + 3279.. 6555: ###################################################### 530 + 6556.. 9832: #################################################### 510 + 9833..13109: ################################################# 484 + 13110..16386: ################################################# 488 + 16387..19663: ###################################################### 530 + 19664..22940: ################################################## 494 + 22941..26217: ################################################### 502 + 26218..29494: ################################################ 477 + 29495..32771: ############################################### 463 + 32772..36048: ############################################## 457 + 36049..39325: ################################################# 483 + 39326..42602: ##################################################### 521 + 42603..45879: #################################################### 519 + 45880..49156: ################################################# 485 + 49157..52433: ################################################ 476 + 52434..55710: #################################################### 510 + 55711..58987: ####################################################### 539 + 58988..62264: #################################################### 519 + 62265..65541: ################################################## 491 + +++ Stats for exponential 10. dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: @@ -1485,7 +1635,7 @@ stats dist: 6.. 10: 0 ================================================================================ 1 warning(s) -failure (70 tests failed, 3 tests errored, ran 160 tests) +failure (70 tests failed, 3 tests errored, ran 166 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_expect_test.expected.ocaml5.32 b/test/core/QCheck_expect_test.expected.ocaml5.32 index cbe359b1..a6eb099c 100644 --- a/test/core/QCheck_expect_test.expected.ocaml5.32 +++ b/test/core/QCheck_expect_test.expected.ocaml5.32 @@ -1412,6 +1412,157 @@ stats dist: 858993470.. 966367652: 0 966367653.. 1073741823: ################# 195 ++++ Stats for int32 lower dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32719.66, stddev: 18976.66, median 32730, min 9, max 65532 + 9.. 3285: ################################################### 506 + 3286.. 6562: #################################################### 508 + 6563.. 9839: ################################################# 481 + 9840..13116: ################################################### 506 + 13117..16393: #################################################### 517 + 16394..19670: #################################################### 512 + 19671..22947: ################################################## 496 + 22948..26224: #################################################### 510 + 26225..29501: ################################################# 486 + 29502..32778: ################################################## 491 + 32779..36055: ################################################## 495 + 36056..39332: ################################################## 489 + 39333..42609: ################################################## 493 + 42610..45886: ####################################################### 537 + 45887..49163: ################################################## 497 + 49164..52440: ################################################# 479 + 52441..55717: ################################################## 493 + 55718..58994: ################################################## 494 + 58995..62271: ################################################# 481 + 62272..65548: ###################################################### 529 + ++++ Stats for int32 upper dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32555.02, stddev: 18918.49, median 32323, min 3, max 65534 + 3.. 3279: ###################################################### 547 + 3280.. 6556: ################################################ 482 + 6557.. 9833: ############################################### 473 + 9834..13110: ################################################## 509 + 13111..16387: ################################################## 507 + 16388..19664: ################################################## 507 + 19665..22941: ################################################ 482 + 22942..26218: ##################################################### 536 + 26219..29495: ####################################################### 550 + 29496..32772: ############################################## 468 + 32773..36049: #################################################### 528 + 36050..39326: ################################################ 488 + 39327..42603: ################################################ 483 + 42604..45880: ################################################ 489 + 45881..49157: ############################################# 450 + 49158..52434: ################################################ 483 + 52435..55711: ###################################################### 548 + 55712..58988: ################################################ 489 + 58989..62265: ################################################# 498 + 62266..65542: ################################################ 483 + ++++ Stats for int64 lower dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32452.50, stddev: 18981.40, median 32331, min 22, max 65532 + 22.. 3297: ##################################################### 533 + 3298.. 6573: ##################################################### 528 + 6574.. 9849: ################################################### 510 + 9850..13125: ################################################### 506 + 13126..16401: ################################################ 476 + 16402..19677: ################################################# 489 + 19678..22953: ####################################################### 543 + 22954..26229: ################################################# 486 + 26230..29505: ################################################## 501 + 29506..32781: ################################################## 501 + 32782..36057: ################################################### 505 + 36058..39333: ############################################## 463 + 39334..42609: ################################################## 498 + 42610..45885: #################################################### 517 + 45886..49161: ################################################### 510 + 49162..52437: ############################################### 471 + 52438..55713: ################################################## 497 + 55714..58989: ################################################## 494 + 58990..62265: ############################################# 454 + 62266..65541: #################################################### 518 + ++++ Stats for int64 lower-mid dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32748.75, stddev: 18818.12, median 32802, min 3, max 65533 + 3.. 3279: ################################################### 500 + 3280.. 6556: ################################################### 506 + 6557.. 9833: ############################################### 464 + 9834..13110: ################################################### 502 + 13111..16387: ################################################## 496 + 16388..19664: #################################################### 513 + 19665..22941: ################################################## 490 + 22942..26218: ####################################################### 538 + 26219..29495: ##################################################### 524 + 29496..32772: ############################################### 462 + 32773..36049: ################################################## 494 + 36050..39326: ##################################################### 523 + 39327..42603: ################################################### 504 + 42604..45880: ##################################################### 525 + 45881..49157: ################################################ 477 + 49158..52434: ################################################# 487 + 52435..55711: ##################################################### 527 + 55712..58988: #################################################### 509 + 58989..62265: ################################################ 470 + 62266..65542: ################################################# 489 + ++++ Stats for int64 upper-mid dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32869.52, stddev: 18881.85, median 33046, min 9, max 65529 + 9.. 3284: ################################################## 489 + 3285.. 6560: ################################################# 486 + 6561.. 9836: ################################################### 504 + 9837..13112: ################################################## 492 + 13113..16388: ###################################################### 528 + 16389..19664: ################################################## 494 + 19665..22940: ############################################### 461 + 22941..26216: ###################################################### 533 + 26217..29492: ################################################## 489 + 29493..32768: ################################################# 486 + 32769..36044: ################################################## 495 + 36045..39320: ##################################################### 518 + 39321..42596: ################################################### 504 + 42597..45872: ####################################################### 535 + 45873..49148: ################################################ 472 + 49149..52424: #################################################### 513 + 52425..55700: ################################################### 499 + 55701..58976: ##################################################### 517 + 58977..62252: #################################################### 508 + 62253..65528: ################################################ 476 + 65529..68804: 1 + ++++ Stats for int64 upper dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32499.47, stddev: 18881.21, median 32265, min 5, max 65534 + 5.. 3281: ###################################################### 547 + 3282.. 6558: ################################################ 484 + 6559.. 9835: ############################################# 460 + 9836..13112: ################################################## 505 + 13113..16389: ##################################################### 536 + 16390..19666: ################################################# 496 + 19667..22943: ################################################ 492 + 22944..26220: ################################################# 502 + 26221..29497: ##################################################### 540 + 29498..32774: ################################################## 508 + 32775..36051: ####################################################### 554 + 36052..39328: ################################################ 491 + 39329..42605: ################################################# 498 + 42606..45882: ############################################## 467 + 45883..49159: ############################################ 447 + 49160..52436: ############################################### 475 + 52437..55713: ################################################## 508 + 55714..58990: ################################################### 515 + 58991..62267: ################################################# 499 + 62268..65544: ############################################### 476 + +++ Stats for exponential 10. dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: @@ -1463,7 +1614,7 @@ stats dist: -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (70 tests failed, 3 tests errored, ran 160 tests) +failure (70 tests failed, 3 tests errored, ran 166 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_expect_test.expected.ocaml5.64 b/test/core/QCheck_expect_test.expected.ocaml5.64 index 7d79e531..f102d825 100644 --- a/test/core/QCheck_expect_test.expected.ocaml5.64 +++ b/test/core/QCheck_expect_test.expected.ocaml5.64 @@ -1444,6 +1444,157 @@ stats dist: 3689348814741910784.. 4150517416584649599: 0 4150517416584649600.. 4611686018427387903: ################# 195 ++++ Stats for int32 lower dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32719.66, stddev: 18976.66, median 32730, min 9, max 65532 + 9.. 3285: ################################################### 506 + 3286.. 6562: #################################################### 508 + 6563.. 9839: ################################################# 481 + 9840..13116: ################################################### 506 + 13117..16393: #################################################### 517 + 16394..19670: #################################################### 512 + 19671..22947: ################################################## 496 + 22948..26224: #################################################### 510 + 26225..29501: ################################################# 486 + 29502..32778: ################################################## 491 + 32779..36055: ################################################## 495 + 36056..39332: ################################################## 489 + 39333..42609: ################################################## 493 + 42610..45886: ####################################################### 537 + 45887..49163: ################################################## 497 + 49164..52440: ################################################# 479 + 52441..55717: ################################################## 493 + 55718..58994: ################################################## 494 + 58995..62271: ################################################# 481 + 62272..65548: ###################################################### 529 + ++++ Stats for int32 upper dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32555.02, stddev: 18918.49, median 32323, min 3, max 65534 + 3.. 3279: ###################################################### 547 + 3280.. 6556: ################################################ 482 + 6557.. 9833: ############################################### 473 + 9834..13110: ################################################## 509 + 13111..16387: ################################################## 507 + 16388..19664: ################################################## 507 + 19665..22941: ################################################ 482 + 22942..26218: ##################################################### 536 + 26219..29495: ####################################################### 550 + 29496..32772: ############################################## 468 + 32773..36049: #################################################### 528 + 36050..39326: ################################################ 488 + 39327..42603: ################################################ 483 + 42604..45880: ################################################ 489 + 45881..49157: ############################################# 450 + 49158..52434: ################################################ 483 + 52435..55711: ###################################################### 548 + 55712..58988: ################################################ 489 + 58989..62265: ################################################# 498 + 62266..65542: ################################################ 483 + ++++ Stats for int64 lower dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32452.50, stddev: 18981.40, median 32331, min 22, max 65532 + 22.. 3297: ##################################################### 533 + 3298.. 6573: ##################################################### 528 + 6574.. 9849: ################################################### 510 + 9850..13125: ################################################### 506 + 13126..16401: ################################################ 476 + 16402..19677: ################################################# 489 + 19678..22953: ####################################################### 543 + 22954..26229: ################################################# 486 + 26230..29505: ################################################## 501 + 29506..32781: ################################################## 501 + 32782..36057: ################################################### 505 + 36058..39333: ############################################## 463 + 39334..42609: ################################################## 498 + 42610..45885: #################################################### 517 + 45886..49161: ################################################### 510 + 49162..52437: ############################################### 471 + 52438..55713: ################################################## 497 + 55714..58989: ################################################## 494 + 58990..62265: ############################################# 454 + 62266..65541: #################################################### 518 + ++++ Stats for int64 lower-mid dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32748.75, stddev: 18818.12, median 32802, min 3, max 65533 + 3.. 3279: ################################################### 500 + 3280.. 6556: ################################################### 506 + 6557.. 9833: ############################################### 464 + 9834..13110: ################################################### 502 + 13111..16387: ################################################## 496 + 16388..19664: #################################################### 513 + 19665..22941: ################################################## 490 + 22942..26218: ####################################################### 538 + 26219..29495: ##################################################### 524 + 29496..32772: ############################################### 462 + 32773..36049: ################################################## 494 + 36050..39326: ##################################################### 523 + 39327..42603: ################################################### 504 + 42604..45880: ##################################################### 525 + 45881..49157: ################################################ 477 + 49158..52434: ################################################# 487 + 52435..55711: ##################################################### 527 + 55712..58988: #################################################### 509 + 58989..62265: ################################################ 470 + 62266..65542: ################################################# 489 + ++++ Stats for int64 upper-mid dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32869.52, stddev: 18881.85, median 33046, min 9, max 65529 + 9.. 3284: ################################################## 489 + 3285.. 6560: ################################################# 486 + 6561.. 9836: ################################################### 504 + 9837..13112: ################################################## 492 + 13113..16388: ###################################################### 528 + 16389..19664: ################################################## 494 + 19665..22940: ############################################### 461 + 22941..26216: ###################################################### 533 + 26217..29492: ################################################## 489 + 29493..32768: ################################################# 486 + 32769..36044: ################################################## 495 + 36045..39320: ##################################################### 518 + 39321..42596: ################################################### 504 + 42597..45872: ####################################################### 535 + 45873..49148: ################################################ 472 + 49149..52424: #################################################### 513 + 52425..55700: ################################################### 499 + 55701..58976: ##################################################### 517 + 58977..62252: #################################################### 508 + 62253..65528: ################################################ 476 + 65529..68804: 1 + ++++ Stats for int64 upper dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +stats dist: + num: 10000, avg: 32499.47, stddev: 18881.21, median 32265, min 5, max 65534 + 5.. 3281: ###################################################### 547 + 3282.. 6558: ################################################ 484 + 6559.. 9835: ############################################# 460 + 9836..13112: ################################################## 505 + 13113..16389: ##################################################### 536 + 16390..19666: ################################################# 496 + 19667..22943: ################################################ 492 + 22944..26220: ################################################# 502 + 26221..29497: ##################################################### 540 + 29498..32774: ################################################## 508 + 32775..36051: ####################################################### 554 + 36052..39328: ################################################ 491 + 39329..42605: ################################################# 498 + 42606..45882: ############################################## 467 + 45883..49159: ############################################ 447 + 49160..52436: ############################################### 475 + 52437..55713: ################################################## 508 + 55714..58990: ################################################### 515 + 58991..62267: ################################################# 499 + 62268..65544: ############################################### 476 + +++ Stats for exponential 10. dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: @@ -1495,7 +1646,7 @@ stats dist: -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (70 tests failed, 3 tests errored, ran 160 tests) +failure (70 tests failed, 3 tests errored, ran 166 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_tests.ml b/test/core/QCheck_tests.ml index 8dc8ebf0..2b929503 100644 --- a/test/core/QCheck_tests.ml +++ b/test/core/QCheck_tests.ml @@ -1010,6 +1010,18 @@ module Stats = struct Test.make ~name:"oneof int dist" ~count:1000 (add_stat dist (oneofl[min_int;-1;0;1;max_int])) (fun _ -> true); ] + let int_32_64_dist_tests = + let add_stat32 shift arb = add_stat ("dist",fun i -> Int32.(to_int (logand 0xffffl (shift i)))) arb in + let add_stat64 shift arb = add_stat ("dist",fun i -> Int64.(to_int (logand 0xffffL (shift i)))) arb in + [ (* stats are int-based, so for these to work for 31-bit ints, consider blocks of 16 bits *) + Test.make ~name:"int32 lower dist" ~count:10000 (add_stat32 (fun i -> i) int32) (fun _ -> true); + Test.make ~name:"int32 upper dist" ~count:10000 (add_stat32 (fun i -> Int32.shift_right_logical i 16) int32) (fun _ -> true); + Test.make ~name:"int64 lower dist" ~count:10000 (add_stat64 (fun i -> i) int64) (fun _ -> true); + Test.make ~name:"int64 lower-mid dist" ~count:10000 (add_stat64 (fun i -> Int64.shift_right i 16) int64) (fun _ -> true); + Test.make ~name:"int64 upper-mid dist" ~count:10000 (add_stat64 (fun i -> Int64.shift_right i 32) int64) (fun _ -> true); + Test.make ~name:"int64 upper dist" ~count:10000 (add_stat64 (fun i -> Int64.shift_right_logical i 48) int64) (fun _ -> true); + ] + let exponential_tests = let float_dist = ("dist",int_of_float) in [ Test.make ~name:"exponential 10. dist" ~count:5_000 (add_stat float_dist (exponential 10.)) (fun _ -> true); @@ -1043,5 +1055,6 @@ module Stats = struct @ list_len_tests @ array_len_tests @ int_dist_tests + @ int_32_64_dist_tests @ exponential_tests end From 716202f312c05d656336c6be1c97ffd372f1456f Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 20 Jan 2025 22:39:07 +0100 Subject: [PATCH 276/391] Add QCheck int option unit tests --- test/core/QCheck_unit_tests.ml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/core/QCheck_unit_tests.ml b/test/core/QCheck_unit_tests.ml index f07af0d1..f7d82fab 100644 --- a/test/core/QCheck_unit_tests.ml +++ b/test/core/QCheck_unit_tests.ml @@ -161,6 +161,14 @@ module Shrink = struct let run_test () = QCheck.Shrink.list_spine [pred;succ] ignore in Alcotest.(check unit) "doesn't compare elements" () @@ run_test () + let test_int_option () = + List.iter (alco_check Alcotest.(option int) (trace_false Shrink.(option int)) "on repeated failure") + [ ("option int Some 42", Some 42, [None; Some 21; Some 32; Some 37; Some 40; Some 41]); + ("option int None", None, []) ]; + List.iter (alco_check Alcotest.(option int) (trace_true Shrink.(option int)) "on repeated success") + [ ("option int Some 42", Some 42, [None]); + ("option int None", None, []) ] + let tests = ("Shrink", Alcotest.[ test_case "bool" `Quick test_bool; test_case "int" `Quick test_int; @@ -173,6 +181,7 @@ module Shrink = struct test_case "int list" `Quick test_int_list; test_case "int32 list" `Quick test_int32_list; test_case "list_spine" `Quick test_list_spine_compare; + test_case "int option" `Quick test_int_option; ]) end From 4338c6b851b5b80f1aa9643433df140f76c9b9b2 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 20 Jan 2025 22:46:28 +0100 Subject: [PATCH 277/391] Add QCheck (int,string) result unit tests --- test/core/QCheck_unit_tests.ml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/core/QCheck_unit_tests.ml b/test/core/QCheck_unit_tests.ml index f7d82fab..e776d368 100644 --- a/test/core/QCheck_unit_tests.ml +++ b/test/core/QCheck_unit_tests.ml @@ -169,6 +169,17 @@ module Shrink = struct [ ("option int Some 42", Some 42, [None]); ("option int None", None, []) ] + let test_int_string_result () = + List.iter (alco_check Alcotest.(result int string) (trace_false Shrink.(result int string)) "on repeated failure") + [ ("result int string Ok 55", Ok 55, [Ok 28; Ok 42; Ok 49; Ok 52; Ok 54]); + ("result int string Error \"oops\"", Error "oops", [Error "oo"; Error "ps"; Error "ops"; Error "hops"; + Error "lops"; Error "nops"; Error "ohps"; Error "olps"; + Error "onps"; Error "oois"; Error "ooms"; Error "ooos"; + Error "oopj"; Error "oopo"; Error "oopq"; Error "oopr"]) ]; + List.iter (alco_check Alcotest.(result int string) (trace_true Shrink.(result int string)) "on repeated success") + [ ("result int string Ok 55", Ok 55, [Ok 28; Ok 14; Ok 7; Ok 4; Ok 2; Ok 1; Ok 0]); + ("result int string Error \"oops\"", Error "oops", [Error "oo"; Error ""]) ] + let tests = ("Shrink", Alcotest.[ test_case "bool" `Quick test_bool; test_case "int" `Quick test_int; @@ -182,6 +193,7 @@ module Shrink = struct test_case "int32 list" `Quick test_int32_list; test_case "list_spine" `Quick test_list_spine_compare; test_case "int option" `Quick test_int_option; + test_case "(int,string) result" `Quick test_int_string_result; ]) end From 22e36f4e1a4c50165b029cd35ce91d51f8f8dd27 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 21 Jan 2025 22:18:02 +0100 Subject: [PATCH 278/391] Add positive tests of option and result --- test/core/QCheck2_expect_test.expected.ocaml4.32 | 2 +- test/core/QCheck2_expect_test.expected.ocaml4.64 | 2 +- test/core/QCheck2_expect_test.expected.ocaml5.32 | 2 +- test/core/QCheck2_expect_test.expected.ocaml5.64 | 2 +- test/core/QCheck2_tests.ml | 12 ++++++++++++ test/core/QCheck_expect_test.expected.ocaml4.32 | 2 +- test/core/QCheck_expect_test.expected.ocaml4.64 | 2 +- test/core/QCheck_expect_test.expected.ocaml5.32 | 2 +- test/core/QCheck_expect_test.expected.ocaml5.64 | 2 +- test/core/QCheck_tests.ml | 10 ++++++++++ 10 files changed, 30 insertions(+), 8 deletions(-) diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.32 b/test/core/QCheck2_expect_test.expected.ocaml4.32 index efae3f87..d390be9a 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.32 @@ -1633,7 +1633,7 @@ stats dist: 6.. 10: 0 ================================================================================ 1 warning(s) -failure (70 tests failed, 3 tests errored, ran 158 tests) +failure (70 tests failed, 3 tests errored, ran 160 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.64 b/test/core/QCheck2_expect_test.expected.ocaml4.64 index 41a9f8e7..c62c7afc 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.64 @@ -1697,7 +1697,7 @@ stats dist: 6.. 10: 0 ================================================================================ 1 warning(s) -failure (70 tests failed, 3 tests errored, ran 158 tests) +failure (70 tests failed, 3 tests errored, ran 160 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.32 b/test/core/QCheck2_expect_test.expected.ocaml5.32 index d90b3c41..65225e58 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.32 @@ -1634,7 +1634,7 @@ stats dist: -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (70 tests failed, 3 tests errored, ran 158 tests) +failure (70 tests failed, 3 tests errored, ran 160 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.64 b/test/core/QCheck2_expect_test.expected.ocaml5.64 index ab32eaa6..9b4faa85 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.64 @@ -1690,7 +1690,7 @@ stats dist: -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (70 tests failed, 3 tests errored, ran 158 tests) +failure (70 tests failed, 3 tests errored, ran 160 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_tests.ml b/test/core/QCheck2_tests.ml index 1502a280..973cd061 100644 --- a/test/core/QCheck2_tests.ml +++ b/test/core/QCheck2_tests.ml @@ -320,6 +320,16 @@ module Generator = struct Gen.(small_nat >>= fun i -> array_repeat i unit >>= fun l -> return (i,l)) (fun (i,l) -> Array.length l = i) + let int_option_test = + Test.make ~name:"int option right range" ~count:1000 ~print:Print.(option int) + Gen.(option (int_bound 1000)) + (function None -> true | Some i -> 0 <= i && i <= 1000) + + let int_string_result_test = + Test.make ~name:"(int,string) result right range" ~count:1000 ~print:Print.(result int string) + Gen.(result (int_bound 1000) string_small) + (function Ok i -> 0 <= i && i <= 1000 | Error s -> String.length s < 100) + let passing_tree_rev = Test.make ~name:"tree_rev_is_involutive" ~count:1000 IntTree.gen_tree @@ -350,6 +360,8 @@ module Generator = struct list_test; list_repeat_test; array_repeat_test; + int_option_test; + int_string_result_test; passing_tree_rev; ] end diff --git a/test/core/QCheck_expect_test.expected.ocaml4.32 b/test/core/QCheck_expect_test.expected.ocaml4.32 index 88ac7e97..42d77bf8 100644 --- a/test/core/QCheck_expect_test.expected.ocaml4.32 +++ b/test/core/QCheck_expect_test.expected.ocaml4.32 @@ -1603,7 +1603,7 @@ stats dist: 6.. 10: 0 ================================================================================ 1 warning(s) -failure (70 tests failed, 3 tests errored, ran 166 tests) +failure (70 tests failed, 3 tests errored, ran 168 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_expect_test.expected.ocaml4.64 b/test/core/QCheck_expect_test.expected.ocaml4.64 index 2b8dbf6c..6cd84dbc 100644 --- a/test/core/QCheck_expect_test.expected.ocaml4.64 +++ b/test/core/QCheck_expect_test.expected.ocaml4.64 @@ -1635,7 +1635,7 @@ stats dist: 6.. 10: 0 ================================================================================ 1 warning(s) -failure (70 tests failed, 3 tests errored, ran 166 tests) +failure (70 tests failed, 3 tests errored, ran 168 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_expect_test.expected.ocaml5.32 b/test/core/QCheck_expect_test.expected.ocaml5.32 index a6eb099c..cc0b6265 100644 --- a/test/core/QCheck_expect_test.expected.ocaml5.32 +++ b/test/core/QCheck_expect_test.expected.ocaml5.32 @@ -1614,7 +1614,7 @@ stats dist: -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (70 tests failed, 3 tests errored, ran 166 tests) +failure (70 tests failed, 3 tests errored, ran 168 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_expect_test.expected.ocaml5.64 b/test/core/QCheck_expect_test.expected.ocaml5.64 index f102d825..6bedb252 100644 --- a/test/core/QCheck_expect_test.expected.ocaml5.64 +++ b/test/core/QCheck_expect_test.expected.ocaml5.64 @@ -1646,7 +1646,7 @@ stats dist: -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (70 tests failed, 3 tests errored, ran 166 tests) +failure (70 tests failed, 3 tests errored, ran 168 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_tests.ml b/test/core/QCheck_tests.ml index 2b929503..a7ad5708 100644 --- a/test/core/QCheck_tests.ml +++ b/test/core/QCheck_tests.ml @@ -323,6 +323,14 @@ module Generator = struct Test.make ~name:"array_repeat has constant length" ~count:1000 (make ~print:Print.(pair int (array unit)) gen) (fun (i,l) -> Array.length l = i) + let int_option_test = + Test.make ~name:"int option right range" ~count:1000 + (option (int_bound 1000)) (function None -> true | Some i -> 0 <= i && i <= 1000) + + let int_string_result_test = + Test.make ~name:"(int,string) result right range" ~count:1000 + (result (int_bound 1000) string_small) (function Ok i -> 0 <= i && i <= 1000 | Error s -> String.length s < 100) + let passing_tree_rev = Test.make ~name:"tree_rev_is_involutive" ~count:1000 (make IntTree.gen_tree) @@ -431,6 +439,8 @@ module Generator = struct list_test; list_repeat_test; array_repeat_test; + int_option_test; + int_string_result_test; passing_tree_rev; nat_split2_spec; pos_split2_spec; From eb7727bb7bc5b42b5e8ca6d126e3f91271342479 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 21 Jan 2025 23:23:54 +0100 Subject: [PATCH 279/391] Add negative tests of option and result --- .../QCheck2_expect_test.expected.ocaml4.32 | 26 ++++++++++++++++++- .../QCheck2_expect_test.expected.ocaml4.64 | 26 ++++++++++++++++++- .../QCheck2_expect_test.expected.ocaml5.32 | 26 ++++++++++++++++++- .../QCheck2_expect_test.expected.ocaml5.64 | 26 ++++++++++++++++++- test/core/QCheck2_tests.ml | 20 ++++++++++++++ .../QCheck_expect_test.expected.ocaml4.32 | 26 ++++++++++++++++++- .../QCheck_expect_test.expected.ocaml4.64 | 26 ++++++++++++++++++- .../QCheck_expect_test.expected.ocaml5.32 | 26 ++++++++++++++++++- .../QCheck_expect_test.expected.ocaml5.64 | 26 ++++++++++++++++++- test/core/QCheck_tests.ml | 20 ++++++++++++++ 10 files changed, 240 insertions(+), 8 deletions(-) diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.32 b/test/core/QCheck2_expect_test.expected.ocaml4.32 index d390be9a..b9cfd534 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.32 @@ -546,6 +546,30 @@ Test lists have unique elems failed (11 shrink steps): --- Failure -------------------------------------------------------------------- +Test int option are none failed (1 shrink steps): + +Some (0) + +--- Failure -------------------------------------------------------------------- + +Test int option are some 100 or more failed (1 shrink steps): + +None + +--- Failure -------------------------------------------------------------------- + +Test (int,string) result are Ok failed (0 shrink steps): + +Error ("") + +--- Failure -------------------------------------------------------------------- + +Test (int,string) result are Error failed (1 shrink steps): + +Ok (0) + +--- Failure -------------------------------------------------------------------- + Test tree contains only 42 failed (2 shrink steps): Leaf 0 @@ -1633,7 +1657,7 @@ stats dist: 6.. 10: 0 ================================================================================ 1 warning(s) -failure (70 tests failed, 3 tests errored, ran 160 tests) +failure (74 tests failed, 3 tests errored, ran 164 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.64 b/test/core/QCheck2_expect_test.expected.ocaml4.64 index c62c7afc..4d129b41 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.64 @@ -610,6 +610,30 @@ Test lists have unique elems failed (11 shrink steps): --- Failure -------------------------------------------------------------------- +Test int option are none failed (1 shrink steps): + +Some (0) + +--- Failure -------------------------------------------------------------------- + +Test int option are some 100 or more failed (1 shrink steps): + +None + +--- Failure -------------------------------------------------------------------- + +Test (int,string) result are Ok failed (0 shrink steps): + +Error ("") + +--- Failure -------------------------------------------------------------------- + +Test (int,string) result are Error failed (1 shrink steps): + +Ok (0) + +--- Failure -------------------------------------------------------------------- + Test tree contains only 42 failed (2 shrink steps): Leaf 0 @@ -1697,7 +1721,7 @@ stats dist: 6.. 10: 0 ================================================================================ 1 warning(s) -failure (70 tests failed, 3 tests errored, ran 160 tests) +failure (74 tests failed, 3 tests errored, ran 164 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.32 b/test/core/QCheck2_expect_test.expected.ocaml5.32 index 65225e58..b7135d47 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.32 @@ -546,6 +546,30 @@ Test lists have unique elems failed (10 shrink steps): --- Failure -------------------------------------------------------------------- +Test int option are none failed (1 shrink steps): + +Some (0) + +--- Failure -------------------------------------------------------------------- + +Test int option are some 100 or more failed (0 shrink steps): + +None + +--- Failure -------------------------------------------------------------------- + +Test (int,string) result are Ok failed (1 shrink steps): + +Error ("") + +--- Failure -------------------------------------------------------------------- + +Test (int,string) result are Error failed (1 shrink steps): + +Ok (0) + +--- Failure -------------------------------------------------------------------- + Test tree contains only 42 failed (2 shrink steps): Leaf 0 @@ -1634,7 +1658,7 @@ stats dist: -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (70 tests failed, 3 tests errored, ran 160 tests) +failure (74 tests failed, 3 tests errored, ran 164 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.64 b/test/core/QCheck2_expect_test.expected.ocaml5.64 index 9b4faa85..d637b68c 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.64 @@ -602,6 +602,30 @@ Test lists have unique elems failed (10 shrink steps): --- Failure -------------------------------------------------------------------- +Test int option are none failed (1 shrink steps): + +Some (0) + +--- Failure -------------------------------------------------------------------- + +Test int option are some 100 or more failed (0 shrink steps): + +None + +--- Failure -------------------------------------------------------------------- + +Test (int,string) result are Ok failed (1 shrink steps): + +Error ("") + +--- Failure -------------------------------------------------------------------- + +Test (int,string) result are Error failed (1 shrink steps): + +Ok (0) + +--- Failure -------------------------------------------------------------------- + Test tree contains only 42 failed (2 shrink steps): Leaf 0 @@ -1690,7 +1714,7 @@ stats dist: -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (70 tests failed, 3 tests errored, ran 160 tests) +failure (74 tests failed, 3 tests errored, ran 164 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_tests.ml b/test/core/QCheck2_tests.ml index 973cd061..26ee18df 100644 --- a/test/core/QCheck2_tests.ml +++ b/test/core/QCheck2_tests.ml @@ -657,6 +657,22 @@ module Shrink = struct (fun xs -> let ys = List.sort_uniq Int.compare xs in print_list xs; List.length xs = List.length ys) + let int_option_are_none = + Test.make ~name:"int option are none" ~count:1000 ~print:Print.(option int) + Gen.(option (int_bound 1000)) (function None -> true | Some _ -> false) + + let int_option_are_some_100_or_more = + Test.make ~name:"int option are some 100 or more" ~count:1000 ~print:Print.(option int) + Gen.(option (int_bound 1000)) (function None -> false | Some i -> i >= 100) + + let int_string_result_are_ok = + Test.make ~name:"(int,string) result are Ok" ~count:1000 ~print:Print.(result int string) + Gen.(result (int_bound 1000) string_small) (function Ok _ -> true | Error _ -> false) + + let int_string_result_are_error = + Test.make ~name:"(int,string) result are Error" ~count:1000 ~print:Print.(result int string) + Gen.(result (int_bound 1000) string_small) (function Ok _ -> false | Error _ -> true) + let tree_contains_only_42 = Test.make ~name:"tree contains only 42" ~print:IntTree.print_tree IntTree.gen_tree @@ -723,6 +739,10 @@ module Shrink = struct list_shorter_4332; (*list_equal_dupl;*) list_unique_elems; + int_option_are_none; + int_option_are_some_100_or_more; + int_string_result_are_ok; + int_string_result_are_error; tree_contains_only_42; test_gen_no_shrink; ] diff --git a/test/core/QCheck_expect_test.expected.ocaml4.32 b/test/core/QCheck_expect_test.expected.ocaml4.32 index 42d77bf8..ef298ae1 100644 --- a/test/core/QCheck_expect_test.expected.ocaml4.32 +++ b/test/core/QCheck_expect_test.expected.ocaml4.32 @@ -515,6 +515,30 @@ Test lists have unique elems failed (8 shrink steps): --- Failure -------------------------------------------------------------------- +Test int option are none failed (11 shrink steps): + +Some (0) + +--- Failure -------------------------------------------------------------------- + +Test int option are some 100 or more failed (1 shrink steps): + +None + +--- Failure -------------------------------------------------------------------- + +Test (int,string) result are Ok failed (0 shrink steps): + +Error ("") + +--- Failure -------------------------------------------------------------------- + +Test (int,string) result are Error failed (11 shrink steps): + +Ok (0) + +--- Failure -------------------------------------------------------------------- + Test tree contains only 42 failed (10 shrink steps): Leaf 0 @@ -1603,7 +1627,7 @@ stats dist: 6.. 10: 0 ================================================================================ 1 warning(s) -failure (70 tests failed, 3 tests errored, ran 168 tests) +failure (74 tests failed, 3 tests errored, ran 172 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_expect_test.expected.ocaml4.64 b/test/core/QCheck_expect_test.expected.ocaml4.64 index 6cd84dbc..e20d7e92 100644 --- a/test/core/QCheck_expect_test.expected.ocaml4.64 +++ b/test/core/QCheck_expect_test.expected.ocaml4.64 @@ -547,6 +547,30 @@ Test lists have unique elems failed (8 shrink steps): --- Failure -------------------------------------------------------------------- +Test int option are none failed (11 shrink steps): + +Some (0) + +--- Failure -------------------------------------------------------------------- + +Test int option are some 100 or more failed (1 shrink steps): + +None + +--- Failure -------------------------------------------------------------------- + +Test (int,string) result are Ok failed (0 shrink steps): + +Error ("") + +--- Failure -------------------------------------------------------------------- + +Test (int,string) result are Error failed (11 shrink steps): + +Ok (0) + +--- Failure -------------------------------------------------------------------- + Test tree contains only 42 failed (10 shrink steps): Leaf 0 @@ -1635,7 +1659,7 @@ stats dist: 6.. 10: 0 ================================================================================ 1 warning(s) -failure (70 tests failed, 3 tests errored, ran 168 tests) +failure (74 tests failed, 3 tests errored, ran 172 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_expect_test.expected.ocaml5.32 b/test/core/QCheck_expect_test.expected.ocaml5.32 index cc0b6265..c5ee8508 100644 --- a/test/core/QCheck_expect_test.expected.ocaml5.32 +++ b/test/core/QCheck_expect_test.expected.ocaml5.32 @@ -525,6 +525,30 @@ Test lists have unique elems failed (10 shrink steps): --- Failure -------------------------------------------------------------------- +Test int option are none failed (11 shrink steps): + +Some (0) + +--- Failure -------------------------------------------------------------------- + +Test int option are some 100 or more failed (0 shrink steps): + +None + +--- Failure -------------------------------------------------------------------- + +Test (int,string) result are Ok failed (3 shrink steps): + +Error ("") + +--- Failure -------------------------------------------------------------------- + +Test (int,string) result are Error failed (11 shrink steps): + +Ok (0) + +--- Failure -------------------------------------------------------------------- + Test tree contains only 42 failed (9 shrink steps): Leaf 0 @@ -1614,7 +1638,7 @@ stats dist: -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (70 tests failed, 3 tests errored, ran 168 tests) +failure (74 tests failed, 3 tests errored, ran 172 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_expect_test.expected.ocaml5.64 b/test/core/QCheck_expect_test.expected.ocaml5.64 index 6bedb252..fb790ca8 100644 --- a/test/core/QCheck_expect_test.expected.ocaml5.64 +++ b/test/core/QCheck_expect_test.expected.ocaml5.64 @@ -557,6 +557,30 @@ Test lists have unique elems failed (10 shrink steps): --- Failure -------------------------------------------------------------------- +Test int option are none failed (11 shrink steps): + +Some (0) + +--- Failure -------------------------------------------------------------------- + +Test int option are some 100 or more failed (0 shrink steps): + +None + +--- Failure -------------------------------------------------------------------- + +Test (int,string) result are Ok failed (3 shrink steps): + +Error ("") + +--- Failure -------------------------------------------------------------------- + +Test (int,string) result are Error failed (11 shrink steps): + +Ok (0) + +--- Failure -------------------------------------------------------------------- + Test tree contains only 42 failed (9 shrink steps): Leaf 0 @@ -1646,7 +1670,7 @@ stats dist: -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (70 tests failed, 3 tests errored, ran 168 tests) +failure (74 tests failed, 3 tests errored, ran 172 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_tests.ml b/test/core/QCheck_tests.ml index a7ad5708..8501dcbf 100644 --- a/test/core/QCheck_tests.ml +++ b/test/core/QCheck_tests.ml @@ -731,6 +731,22 @@ module Shrink = struct (fun xs -> let ys = List.sort_uniq Int.compare xs in print_list xs; List.length xs = List.length ys) + let int_option_are_none = + Test.make ~name:"int option are none" ~count:1000 + (option (int_bound 1000)) (function None -> true | Some _ -> false) + + let int_option_are_some_100_or_more = + Test.make ~name:"int option are some 100 or more" ~count:1000 + (option (int_bound 1000)) (function None -> false | Some i -> i >= 100) + + let int_string_result_are_ok = + Test.make ~name:"(int,string) result are Ok" ~count:1000 + (result (int_bound 1000) string_small) (function Ok _ -> true | Error _ -> false) + + let int_string_result_are_error = + Test.make ~name:"(int,string) result are Error" ~count:1000 + (result (int_bound 1000) string_small) (function Ok _ -> false | Error _ -> true) + let tree_contains_only_42 = Test.make ~name:"tree contains only 42" IntTree.(make ~print:print_tree ~shrink:shrink_tree gen_tree) @@ -797,6 +813,10 @@ module Shrink = struct list_shorter_4332; (*list_equal_dupl;*) list_unique_elems; + int_option_are_none; + int_option_are_some_100_or_more; + int_string_result_are_ok; + int_string_result_are_error; tree_contains_only_42; test_gen_no_shrink; ] From 657a011ea732613eae7b3b8557c6af794311a80e Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 22 Jan 2025 00:07:55 +0100 Subject: [PATCH 280/391] Add stat/collect tests of option and result --- test/core/QCheck2_expect_test.expected.ocaml4.32 | 16 +++++++++++++++- test/core/QCheck2_expect_test.expected.ocaml4.64 | 16 +++++++++++++++- test/core/QCheck2_expect_test.expected.ocaml5.32 | 16 +++++++++++++++- test/core/QCheck2_expect_test.expected.ocaml5.64 | 16 +++++++++++++++- test/core/QCheck2_tests.ml | 12 +++++++++++- test/core/QCheck_expect_test.expected.ocaml4.32 | 16 +++++++++++++++- test/core/QCheck_expect_test.expected.ocaml4.64 | 16 +++++++++++++++- test/core/QCheck_expect_test.expected.ocaml5.32 | 16 +++++++++++++++- test/core/QCheck_expect_test.expected.ocaml5.64 | 16 +++++++++++++++- test/core/QCheck_tests.ml | 12 +++++++++++- 10 files changed, 142 insertions(+), 10 deletions(-) diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.32 b/test/core/QCheck2_expect_test.expected.ocaml4.32 index b9cfd534..cf908f20 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.32 @@ -1083,6 +1083,20 @@ stats ordered pair sum: 190..199: ## 3433 200..209: 78 ++++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Collect results for test option dist: + +None : 1489 cases +Some _: 8511 cases + ++++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Collect results for test result dist: + +Error _: 2523 cases +Ok _ : 7477 cases + +++ Stats for list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: @@ -1657,7 +1671,7 @@ stats dist: 6.. 10: 0 ================================================================================ 1 warning(s) -failure (74 tests failed, 3 tests errored, ran 164 tests) +failure (74 tests failed, 3 tests errored, ran 166 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.64 b/test/core/QCheck2_expect_test.expected.ocaml4.64 index 4d129b41..0eed7c08 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.64 @@ -1147,6 +1147,20 @@ stats ordered pair sum: 190..199: ## 3433 200..209: 78 ++++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Collect results for test option dist: + +None : 1500 cases +Some _: 8500 cases + ++++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Collect results for test result dist: + +Error _: 2554 cases +Ok _ : 7446 cases + +++ Stats for list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: @@ -1721,7 +1735,7 @@ stats dist: 6.. 10: 0 ================================================================================ 1 warning(s) -failure (74 tests failed, 3 tests errored, ran 164 tests) +failure (74 tests failed, 3 tests errored, ran 166 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.32 b/test/core/QCheck2_expect_test.expected.ocaml5.32 index b7135d47..0781d7c3 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.32 @@ -1083,6 +1083,20 @@ stats ordered pair sum: 190..199: ## 3580 200..209: 125 ++++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Collect results for test option dist: + +None : 1492 cases +Some _: 8508 cases + ++++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Collect results for test result dist: + +Error _: 2439 cases +Ok _ : 7561 cases + +++ Stats for list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: @@ -1658,7 +1672,7 @@ stats dist: -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (74 tests failed, 3 tests errored, ran 164 tests) +failure (74 tests failed, 3 tests errored, ran 166 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.64 b/test/core/QCheck2_expect_test.expected.ocaml5.64 index d637b68c..edb64666 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.64 @@ -1139,6 +1139,20 @@ stats ordered pair sum: 190..199: ## 3580 200..209: 125 ++++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Collect results for test option dist: + +None : 1464 cases +Some _: 8536 cases + ++++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Collect results for test result dist: + +Error _: 2509 cases +Ok _ : 7491 cases + +++ Stats for list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: @@ -1714,7 +1728,7 @@ stats dist: -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (74 tests failed, 3 tests errored, ran 164 tests) +failure (74 tests failed, 3 tests errored, ran 166 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_tests.ml b/test/core/QCheck2_tests.ml index 26ee18df..372478eb 100644 --- a/test/core/QCheck2_tests.ml +++ b/test/core/QCheck2_tests.ml @@ -937,6 +937,14 @@ module Stats = struct ~stats:[("ordered pair difference", (fun (i,j) -> j-i));("ordered pair sum", (fun (i,j) -> i+j))] Gen.(int_bound 100 >>= fun j -> int_bound j >>= fun i -> return (i,j)) (fun _ -> true) + let option_dist = + Test.make ~name:"option dist" ~count:10_000 + ~collect:(function None -> "None " | Some _ -> "Some _") Gen.(option int) (fun _ -> true) + + let result_dist = + Test.make ~name:"result dist" ~count:10_000 + ~collect:(function Ok _ -> "Ok _ " | Error _ -> "Error _") Gen.(result int string) (fun _ -> true) + let list_len_tests = let len = ("len",List.length) in [ (* test from issue #30 *) @@ -1007,7 +1015,9 @@ module Stats = struct @ [pair_dist; triple_dist; quad_dist; - bind_dist;] + bind_dist; + option_dist; + result_dist;] @ list_len_tests @ array_len_tests @ int_dist_tests diff --git a/test/core/QCheck_expect_test.expected.ocaml4.32 b/test/core/QCheck_expect_test.expected.ocaml4.32 index ef298ae1..40fd3c2a 100644 --- a/test/core/QCheck_expect_test.expected.ocaml4.32 +++ b/test/core/QCheck_expect_test.expected.ocaml4.32 @@ -1053,6 +1053,20 @@ stats ordered pair sum: 190..199: ## 3433 200..209: 78 ++++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Collect results for test option dist: + +None : 1489 cases +Some _: 8511 cases + ++++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Collect results for test result dist: + +Error _: 2523 cases +Ok _ : 7477 cases + +++ Stats for list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: @@ -1627,7 +1641,7 @@ stats dist: 6.. 10: 0 ================================================================================ 1 warning(s) -failure (74 tests failed, 3 tests errored, ran 172 tests) +failure (74 tests failed, 3 tests errored, ran 174 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_expect_test.expected.ocaml4.64 b/test/core/QCheck_expect_test.expected.ocaml4.64 index e20d7e92..3551e331 100644 --- a/test/core/QCheck_expect_test.expected.ocaml4.64 +++ b/test/core/QCheck_expect_test.expected.ocaml4.64 @@ -1085,6 +1085,20 @@ stats ordered pair sum: 190..199: ## 3433 200..209: 78 ++++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Collect results for test option dist: + +None : 1500 cases +Some _: 8500 cases + ++++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Collect results for test result dist: + +Error _: 2554 cases +Ok _ : 7446 cases + +++ Stats for list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: @@ -1659,7 +1673,7 @@ stats dist: 6.. 10: 0 ================================================================================ 1 warning(s) -failure (74 tests failed, 3 tests errored, ran 172 tests) +failure (74 tests failed, 3 tests errored, ran 174 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_expect_test.expected.ocaml5.32 b/test/core/QCheck_expect_test.expected.ocaml5.32 index c5ee8508..f8175e88 100644 --- a/test/core/QCheck_expect_test.expected.ocaml5.32 +++ b/test/core/QCheck_expect_test.expected.ocaml5.32 @@ -1063,6 +1063,20 @@ stats ordered pair sum: 190..199: ## 3580 200..209: 125 ++++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Collect results for test option dist: + +None : 1492 cases +Some _: 8508 cases + ++++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Collect results for test result dist: + +Error _: 2439 cases +Ok _ : 7561 cases + +++ Stats for list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: @@ -1638,7 +1652,7 @@ stats dist: -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (74 tests failed, 3 tests errored, ran 172 tests) +failure (74 tests failed, 3 tests errored, ran 174 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_expect_test.expected.ocaml5.64 b/test/core/QCheck_expect_test.expected.ocaml5.64 index fb790ca8..4a2cd374 100644 --- a/test/core/QCheck_expect_test.expected.ocaml5.64 +++ b/test/core/QCheck_expect_test.expected.ocaml5.64 @@ -1095,6 +1095,20 @@ stats ordered pair sum: 190..199: ## 3580 200..209: 125 ++++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Collect results for test option dist: + +None : 1464 cases +Some _: 8536 cases + ++++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Collect results for test result dist: + +Error _: 2509 cases +Ok _ : 7491 cases + +++ Stats for list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: @@ -1670,7 +1684,7 @@ stats dist: -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (74 tests failed, 3 tests errored, ran 172 tests) +failure (74 tests failed, 3 tests errored, ran 174 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_tests.ml b/test/core/QCheck_tests.ml index 8501dcbf..91044a6e 100644 --- a/test/core/QCheck_tests.ml +++ b/test/core/QCheck_tests.ml @@ -1006,6 +1006,14 @@ module Stats = struct (make ~stats:[("ordered pair difference", (fun (i,j) -> j-i));("ordered pair sum", (fun (i,j) -> i+j))] Gen.(int_bound 100 >>= fun j -> int_bound j >>= fun i -> return (i,j))) (fun _ -> true) + let option_dist = + Test.make ~name:"option dist" ~count:10_000 + (set_collect (function None -> "None " | Some _ -> "Some _") (option int)) (fun _ -> true) + + let result_dist = + Test.make ~name:"result dist" ~count:10_000 + (set_collect (function Ok _ -> "Ok _ " | Error _ -> "Error _") (result int string)) (fun _ -> true) + let list_len_tests = let len = ("len",List.length) in [ (* test from issue #30 *) @@ -1081,7 +1089,9 @@ module Stats = struct @ [pair_dist; triple_dist; quad_dist; - bind_dist;] + bind_dist; + option_dist; + result_dist;] @ list_len_tests @ array_len_tests @ int_dist_tests From 29d8b5901ca44ee22de82c2f6e74143e7ec1cfa7 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 23 Jan 2025 14:03:25 +0100 Subject: [PATCH 281/391] Add unit tests of QCheck2.{pair,bind} illustrating problems with the latter --- test/core/QCheck2_unit_tests.ml | 44 +++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/test/core/QCheck2_unit_tests.ml b/test/core/QCheck2_unit_tests.ml index 999bdc81..a058416a 100644 --- a/test/core/QCheck2_unit_tests.ml +++ b/test/core/QCheck2_unit_tests.ml @@ -129,6 +129,48 @@ module Shrink = struct ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) printable) |> repeated_success) ~expected:(if ocaml_major_version < 5 then ['8'; 'a'] else ['#'; 'a']) + let test_pair_small_int () = + if ocaml_major_version < 5 + then + (Alcotest.(check' (list (pair int int))) + ~msg:"69,1 on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (pair small_int small_int)) |> repeated_failure) + ~expected:[(69, 1); (0, 1); (34, 1); (51, 1); (60, 1); (64, 1); (66, 1); (67, 1); (68, 1); (69, 0)]; + Alcotest.(check' (list (pair int int))) + ~msg:"69,1 on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (pair small_int small_int)) |> repeated_success) + ~expected:[(69, 1); (0, 1); (0, 0)]) + else + (Alcotest.(check' (list (pair int int))) + ~msg:"1,29 on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (pair small_int small_int)) |> repeated_failure) + ~expected:[(1, 29); (0, 29); (1, 0); (1, 14); (1, 21); (1, 25); (1, 27); (1, 28)]; + Alcotest.(check' (list (pair int int))) + ~msg:"1,29 on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (pair small_int small_int)) |> repeated_success) + ~expected:[(1, 29); (0, 29); (0, 0)]) + + let test_bind_small_int () = + if ocaml_major_version < 5 + then + (Alcotest.(check' (list (pair int int))) + ~msg:"1,69 on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (small_int >>= fun i -> map (fun j -> (i,j)) small_int)) |> repeated_failure) + ~expected:[(1, 69); (0, 3)(*WTF?*); (1, 0); (1, 34); (1, 51); (1, 60); (1, 64); (1, 66); (1, 67); (1, 68)]; + Alcotest.(check' (list (pair int int))) + ~msg:"1,69 on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (small_int >>= fun i -> map (fun j -> (i,j)) small_int)) |> repeated_success) + ~expected:[(1, 69); (0, 3)(*WTF?*); (0, 0)]) + else + (Alcotest.(check' (list (pair int int))) + ~msg:"29,1 on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (small_int >>= fun i -> map (fun j -> (i,j)) small_int)) |> repeated_failure) + ~expected:[(29, 1); (0, 2)(*WTF?*); (14, 1); (21, 8)(*WTF?*); (25, 7)(*WTF?*); (27, 9)(*WTF?*); (28, 5)(*WTF?*); (29, 0)]; + Alcotest.(check' (list (pair int int))) + ~msg:"29,1 on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (small_int >>= fun i -> map (fun j -> (i,j)) small_int)) |> repeated_success) + ~expected:[(29, 1); (0, 2)(*WTF?*); (0, 0)]) + let tests = ("Shrink", Alcotest.[ test_case "int_towards" `Quick test_int_towards; test_case "int32_towards" `Quick test_int32_towards; @@ -137,6 +179,8 @@ module Shrink = struct test_case "Gen.char tree" `Quick test_char; test_case "Gen.numeral tree" `Quick test_char_numeral; test_case "Gen.printable tree" `Quick test_char_printable; + test_case "Gen.(pair small_int small_int) tree" `Quick test_pair_small_int; + test_case "Gen.bind small_int tree" `Quick test_bind_small_int; ]) end From 343fda13d48bcccd7040157a2e831cf0b3df05ab Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 23 Jan 2025 16:42:20 +0100 Subject: [PATCH 282/391] Add unit tests of QCheck2.{list_size,bytes_size} illustrating problems with them --- test/core/QCheck2_unit_tests.ml | 65 +++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/test/core/QCheck2_unit_tests.ml b/test/core/QCheck2_unit_tests.ml index a058416a..05947918 100644 --- a/test/core/QCheck2_unit_tests.ml +++ b/test/core/QCheck2_unit_tests.ml @@ -171,6 +171,69 @@ module Shrink = struct ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (small_int >>= fun i -> map (fun j -> (i,j)) small_int)) |> repeated_success) ~expected:[(29, 1); (0, 2)(*WTF?*); (0, 0)]) + let test_list_int () = + if ocaml_major_version < 5 + then + (Alcotest.(check' (list (list int))) + ~msg:"[4; 2; 9; 1; 10] on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (list_size (int_bound 8) (int_bound 10))) |> repeated_failure) + ~expected:[ [4; 2; 9; 1; 10]; []; [0; 5](*WTF?*); [4; 8; 9](*WTF?*); [4; 9; 10; 1](*WTF?*); + [0; 2; 9; 1; 10]; [2; 2; 9; 1; 10]; [3; 2; 9; 1; 10]; + [4; 0; 9; 1; 10]; [4; 1; 9; 1; 10]; + [4; 2; 0; 1; 10]; [4; 2; 4; 1; 10]; [4; 2; 6; 1; 10]; [4; 2; 7; 1; 10]; [4; 2; 8; 1; 10]; + [4; 2; 9; 0; 10]; + [4; 2; 9; 1; 0]; [4; 2; 9; 1; 5]; [4; 2; 9; 1; 8]; [4; 2; 9; 1; 9]; ]; + Alcotest.(check' (list (list int))) + ~msg:"[4; 2; 9; 1; 10] on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (list_size (int_bound 8) (int_bound 10))) |> repeated_success) + ~expected:[ [4; 2; 9; 1; 10]; []; ]) + else + (Alcotest.(check' (list (list int))) + ~msg:"[4; 10; 3; 5; 2] repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (list_size (int_bound 8) (int_bound 10))) |> repeated_failure) + ~expected:[ [4; 10; 3; 5; 2]; []; [1; 2](*WTF?*); [9; 5; 4](*WTF?*); [1; 0; 7; 0](*WTF?*); + [0; 10; 3; 5; 2]; [2; 10; 3; 5; 2]; [3; 10; 3; 5; 2]; + [4; 0; 3; 5; 2]; [4; 5; 3; 5; 2]; [4; 8; 3; 5; 2]; [4; 9; 3; 5; 2]; + [4; 10; 0; 5; 2]; [4; 10; 1; 5; 2]; [4; 10; 2; 5; 2]; + [4; 10; 3; 0; 2]; [4; 10; 3; 2; 2]; [4; 10; 3; 3; 2]; [4; 10; 3; 4; 2]; + [4; 10; 3; 5; 0]; [4; 10; 3; 5; 1]; ]; + Alcotest.(check' (list (list int))) + ~msg:"[4; 10; 3; 5; 2] repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (list_size (int_bound 8) (int_bound 10))) |> repeated_success) + ~expected:[ [4; 10; 3; 5; 2]; []; ]) + + let test_bytes_size () = + if ocaml_major_version < 5 + then + (Alcotest.(check' (list bytes)) + ~msg:"\")]}XS\" on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (bytes_size ~gen:printable (int_bound 8))) |> repeated_failure) + ~expected:(List.map String.to_bytes + [ ")]}XS"; ""; "&3"(*WTF?*); "\n'n"(*WTF?*); "< *S"(*WTF?*); + "a]}XS"; "r]}XS"; " ]}XS"; "$]}XS"; "&]}XS"; "']}XS"; "(]}XS"; + ")a}XS"; ")1}XS"; ")G}XS"; ")R}XS"; ")W}XS"; ")Z}XS"; ")[}XS"; ")\\}XS"; + ")]aXS"; ")]4XS"; ")]KXS"; ")]WXS"; ")]]XS"; ")]`XS"; ")]{XS"; ")]|XS"; + ")]}aS"; ")]}/S"; ")]}DS"; ")]}NS"; ")]}SS"; ")]}VS"; ")]}WS"; + ")]}Xa"; ")]}X,"; ")]}X?"; ")]}XI"; ")]}XN"; ")]}XP"; ")]}XQ"; ")]}XR"; ]); + Alcotest.(check' (list bytes)) + ~msg:"\")]}XS\" on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (bytes_size ~gen:printable (int_bound 8))) |> repeated_success) + ~expected:(List.map String.to_bytes [")]}XS"; ""])) + else + (Alcotest.(check' (list bytes)) + ~msg:"\"[PjjX\" on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (bytes_size ~gen:printable (int_bound 8))) |> repeated_failure) + ~expected:(List.map String.to_bytes + [ "[PjjX"; ""; "Y1"(*WTF?*); "6\"U"(*WTF?*); "9ff%"(*WTF?*); + "aPjjX"; "0PjjX"; "EPjjX"; "PPjjX"; "UPjjX"; "XPjjX"; "YPjjX"; "ZPjjX"; + "[ajjX"; "[+jjX"; "[>jjX"; "[GjjX"; "[LjjX"; "[NjjX"; "[OjjX"; + "[PajX"; "[PejX"; "[PgjX"; "[PhjX"; "[PijX"; "[PjaX"; "[PjeX"; "[PjgX"; "[PjhX"; "[PjiX"; + "[Pjja"; "[Pjj/"; "[PjjD"; "[PjjN"; "[PjjS"; "[PjjV"; "[PjjW"; ] ); + Alcotest.(check' (list bytes)) + ~msg:"\"[PjjX\" on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (bytes_size ~gen:printable (int_bound 8))) |> repeated_success) + ~expected:(List.map String.to_bytes ["[PjjX"; ""; ])) + let tests = ("Shrink", Alcotest.[ test_case "int_towards" `Quick test_int_towards; test_case "int32_towards" `Quick test_int32_towards; @@ -181,6 +244,8 @@ module Shrink = struct test_case "Gen.printable tree" `Quick test_char_printable; test_case "Gen.(pair small_int small_int) tree" `Quick test_pair_small_int; test_case "Gen.bind small_int tree" `Quick test_bind_small_int; + test_case "Gen.list_size int" `Quick test_list_int; + test_case "Gen.bytes_size" `Quick test_bytes_size; ]) end From 8d47f2b43d0661fb90f2e3d94333dd53689e9740 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 23 Jan 2025 16:55:30 +0100 Subject: [PATCH 283/391] Add split in QCheck2.Gen.{ap,bind} --- src/core/QCheck2.ml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index 43c53cee..d2dba3ef 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -252,7 +252,11 @@ module Gen = struct let pure (a : 'a) : 'a t = fun _ -> Tree.pure a - let ap (f : ('a -> 'b) t) (x : 'a t) : 'b t = fun st -> Tree.ap (f st) (x st) + let ap (f : ('a -> 'b) t) (x : 'a t) : 'b t = fun st -> + let st' = RS.split st in + let ftree = f st in + let xtree = x st' in + Tree.ap ftree xtree let (<*>) = ap @@ -268,7 +272,10 @@ module Gen = struct let return = pure - let bind (gen : 'a t) (f : 'a -> ('b t)) : 'b t = fun st -> Tree.bind (gen st) (fun a -> f a st) + let bind (gen : 'a t) (f : 'a -> ('b t)) : 'b t = fun st -> + let st' = RS.split st in + let gentree = gen st in + Tree.bind gentree (fun a -> f a st') let (>>=) = bind From 42a7c439c52aedb7a8962895a638674b5dad5f39 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 23 Jan 2025 17:13:30 +0100 Subject: [PATCH 284/391] Update QCheck2 unit tests, QCheck2 expect tests, and ppx_deriving_qcheck2 variant test wrt. {ap,bind} splitting --- .../QCheck2_expect_test.expected.ocaml4.32 | 486 +++++------ .../QCheck2_expect_test.expected.ocaml4.64 | 750 ++++++++--------- .../QCheck2_expect_test.expected.ocaml5.32 | 685 ++++++++-------- .../QCheck2_expect_test.expected.ocaml5.64 | 759 +++++++++--------- test/core/QCheck2_unit_tests.ml | 32 +- .../deriver/qcheck2/test_variants.ml | 4 +- 6 files changed, 1363 insertions(+), 1353 deletions(-) diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.32 b/test/core/QCheck2_expect_test.expected.ocaml4.32 index cf908f20..533ca9ab 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.32 @@ -1,63 +1,64 @@ random seed: 1234 -50 7 0 0 0 0 0 0 0 0 0 0 3 3 3 3 3 3 3 3 3 3 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 (6,fun,50) (0,fun,2) (7,fun,66) (54,fun,9) (2,fun,5) (90,fun,4) (1,fun,4) (37,fun,7) (7,fun,1) (8,fun,5) -(6,fun,50) (0,fun,2) (7,fun,66) (54,fun,9) (2,fun,5) (90,fun,4) (1,fun,4) (37,fun,7) (7,fun,1) (8,fun,5) -(6,fun,50) (0,fun,2) (7,fun,66) (54,fun,9) (2,fun,5) (90,fun,4) (1,fun,4) (37,fun,7) (7,fun,1) (8,fun,5) -(6,fun,50) (0,fun,2) (7,fun,66) (54,fun,9) (2,fun,5) (90,fun,4) (1,fun,4) (37,fun,7) (7,fun,1) (8,fun,5) -(6,fun,50) (0,fun,2) (7,fun,66) (54,fun,9) (2,fun,5) (90,fun,4) (1,fun,4) (37,fun,7) (7,fun,1) (8,fun,5) -(6,fun,50) (0,fun,2) (7,fun,66) (54,fun,9) (2,fun,5) (90,fun,4) (1,fun,4) (37,fun,7) (7,fun,1) (8,fun,5) -(6,fun,50) (0,fun,2) (7,fun,66) (54,fun,9) (2,fun,5) (90,fun,4) (1,fun,4) (37,fun,7) (7,fun,1) (8,fun,5) -(6,fun,50) (0,fun,2) (7,fun,66) (54,fun,9) (2,fun,5) (90,fun,4) (1,fun,4) (37,fun,7) (7,fun,1) (8,fun,5) -911769578 +50 7 0 0 0 0 0 0 0 0 0 0 3 3 3 3 3 3 3 3 3 3 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 (2,fun,16) (6,fun,1) (9,fun,7) (0,fun,9) (60,fun,7) (7,fun,2) (3,fun,9) (54,fun,4) (4,fun,3) (2,fun,0) +(2,fun,16) (6,fun,1) (9,fun,7) (0,fun,9) (60,fun,7) (7,fun,2) (3,fun,9) (54,fun,4) (4,fun,3) (2,fun,0) +(2,fun,16) (6,fun,1) (9,fun,7) (0,fun,9) (60,fun,7) (7,fun,2) (3,fun,9) (54,fun,4) (4,fun,3) (2,fun,0) +(2,fun,16) (6,fun,1) (9,fun,7) (0,fun,9) (60,fun,7) (7,fun,2) (3,fun,9) (54,fun,4) (4,fun,3) (2,fun,0) +(2,fun,16) (6,fun,1) (9,fun,7) (0,fun,9) (60,fun,7) (7,fun,2) (3,fun,9) (54,fun,4) (4,fun,3) (2,fun,0) +(2,fun,16) (6,fun,1) (9,fun,7) (0,fun,9) (60,fun,7) (7,fun,2) (3,fun,9) (54,fun,4) (4,fun,3) (2,fun,0) +(2,fun,16) (6,fun,1) (9,fun,7) (0,fun,9) (60,fun,7) (7,fun,2) (3,fun,9) (54,fun,4) (4,fun,3) (2,fun,0) +(2,fun,16) (6,fun,1) (9,fun,7) (0,fun,9) (60,fun,7) (7,fun,2) (3,fun,9) (54,fun,4) (4,fun,3) (2,fun,0) +-693587245 +882325444 0 -455884789 +441162722 0 -227942394 +220581361 0 -113971197 +110290680 0 -56985598 +55145340 0 -28492799 +27572670 0 -14246399 +13786335 0 -7123199 +6893167 0 -3561599 +3446583 0 -1780799 +1723291 0 -890399 +861645 0 -445199 +430822 0 -222599 +215411 0 -111299 +107705 0 -55649 +53852 0 -27824 +26926 0 -13912 +13463 0 -6956 +6731 0 -3478 +3365 0 -1739 +1682 0 -869 +841 0 -434 +420 0 -217 +210 0 -108 +105 0 -54 +52 0 -27 +26 0 13 0 @@ -116,7 +117,7 @@ Test should_fail_sort_id failed (9 shrink steps): === Error ====================================================================== -Test should_error_raise_exn errored on (1 shrink steps): +Test should_error_raise_exn errored on (2 shrink steps): 0 @@ -175,7 +176,7 @@ Test with shrinking retries failed (0 shrink steps): Warning for test WARN_unlikely_precond: -WARNING: only 0.6% tests (of 2000) passed precondition for "WARN_unlikely_precond" +WARNING: only 0.5% tests (of 2000) passed precondition for "WARN_unlikely_precond" NOTE: it is likely that the precondition is too strong, or that the generator is buggy. @@ -183,7 +184,7 @@ NOTE: it is likely that the precondition is too strong, or that the generator is Test FAIL_unlikely_precond failed: -ERROR: only 0.6% tests (of 2000) passed precondition for "FAIL_unlikely_precond" +ERROR: only 0.5% tests (of 2000) passed precondition for "FAIL_unlikely_precond" NOTE: it is likely that the precondition is too strong, or that the generator is buggy. @@ -234,19 +235,19 @@ Test big bound issue59 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test long_shrink failed (3018 shrink steps): +Test long_shrink failed (3010 shrink steps): ([0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0], [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 1]) --- Failure -------------------------------------------------------------------- -Test ints arent 0 mod 3 failed (2 shrink steps): +Test ints arent 0 mod 3 failed (1 shrink steps): 0 --- Failure -------------------------------------------------------------------- -Test ints are 0 failed (29 shrink steps): +Test ints are 0 failed (30 shrink steps): 1 @@ -356,7 +357,7 @@ Test strings have unique chars failed (18 shrink steps): Test pairs have different components failed (0 shrink steps): -(4, 4) +(6, 6) --- Failure -------------------------------------------------------------------- @@ -366,7 +367,7 @@ Test pairs have same components failed (31 shrink steps): --- Failure -------------------------------------------------------------------- -Test pairs have a zero component failed (58 shrink steps): +Test pairs have a zero component failed (59 shrink steps): (1, 1) @@ -378,7 +379,7 @@ Test pairs are (0,0) failed (31 shrink steps): --- Failure -------------------------------------------------------------------- -Test pairs are ordered failed (43 shrink steps): +Test pairs are ordered failed (44 shrink steps): (1, 0) @@ -390,21 +391,21 @@ Test pairs are ordered reversely failed (29 shrink steps): --- Failure -------------------------------------------------------------------- -Test pairs sum to less than 128 failed (25 shrink steps): +Test pairs sum to less than 128 failed (24 shrink steps): (0, 128) --- Failure -------------------------------------------------------------------- -Test pairs lists rev concat failed (41 shrink steps): +Test pairs lists rev concat failed (38 shrink steps): ([0], [1]) --- Failure -------------------------------------------------------------------- -Test pairs lists no overlap failed (27 shrink steps): +Test pairs lists no overlap failed (17 shrink steps): -([0], [0; 0; 0; 0]) +([0], [0; 0; 0; 0; 0; 0]) --- Failure -------------------------------------------------------------------- @@ -414,19 +415,19 @@ Test triples have pair-wise different components failed (3 shrink steps): --- Failure -------------------------------------------------------------------- -Test triples have same components failed (33 shrink steps): +Test triples have same components failed (32 shrink steps): (0, 1, 0) --- Failure -------------------------------------------------------------------- -Test triples are ordered failed (4 shrink steps): +Test triples are ordered failed (3 shrink steps): -(0, -1, 0) +(0, 0, -1) --- Failure -------------------------------------------------------------------- -Test triples are ordered reversely failed (33 shrink steps): +Test triples are ordered reversely failed (60 shrink steps): (0, 0, 1) @@ -438,7 +439,7 @@ Test quadruples have pair-wise different components failed (4 shrink steps): --- Failure -------------------------------------------------------------------- -Test quadruples have same components failed (61 shrink steps): +Test quadruples have same components failed (60 shrink steps): (0, 1, 0, 1) @@ -446,23 +447,23 @@ Test quadruples have same components failed (61 shrink steps): Test quadruples are ordered failed (5 shrink steps): -(0, 0, -1, 0) +(0, 0, 0, -1) --- Failure -------------------------------------------------------------------- -Test quadruples are ordered reversely failed (34 shrink steps): +Test quadruples are ordered reversely failed (62 shrink steps): (0, 0, 0, 1) --- Failure -------------------------------------------------------------------- -Test forall (a, b) in nat: a < b failed (6 shrink steps): +Test forall (a, b) in nat: a < b failed (7 shrink steps): (0, 0) --- Failure -------------------------------------------------------------------- -Test forall (a, b, c) in nat: a < b < c failed (3 shrink steps): +Test forall (a, b, c) in nat: a < b < c failed (4 shrink steps): (0, 0, 0) @@ -474,31 +475,31 @@ Test forall (a, b, c, d) in nat: a < b < c < d failed (4 shrink steps): --- Failure -------------------------------------------------------------------- -Test forall (a, b, c, d, e) in nat: a < b < c < d < e failed (5 shrink steps): +Test forall (a, b, c, d, e) in nat: a < b < c < d < e failed (4 shrink steps): (0, 0, 0, 0, 0) --- Failure -------------------------------------------------------------------- -Test forall (a, b, c, d, e, f) in nat: a < b < c < d < e < f failed (6 shrink steps): +Test forall (a, b, c, d, e, f) in nat: a < b < c < d < e < f failed (5 shrink steps): (0, 0, 0, 0, 0, 0) --- Failure -------------------------------------------------------------------- -Test forall (a, b, c, d, e, f, g) in nat: a < b < c < d < e < f < g failed (7 shrink steps): +Test forall (a, b, c, d, e, f, g) in nat: a < b < c < d < e < f < g failed (6 shrink steps): (0, 0, 0, 0, 0, 0, 0) --- Failure -------------------------------------------------------------------- -Test forall (a, b, c, d, e, f, g, h) in nat: a < b < c < d < e < f < g < h failed (8 shrink steps): +Test forall (a, b, c, d, e, f, g, h) in nat: a < b < c < d < e < f < g < h failed (6 shrink steps): (0, 0, 0, 0, 0, 0, 0, 0) --- Failure -------------------------------------------------------------------- -Test forall (a, b, c, d, e, f, g, h, i) in nat: a < b < c < d < e < f < g < h < i failed (9 shrink steps): +Test forall (a, b, c, d, e, f, g, h, i) in nat: a < b < c < d < e < f < g < h < i failed (7 shrink steps): (0, 0, 0, 0, 0, 0, 0, 0, 0) @@ -528,13 +529,13 @@ Test lists shorter than 10 failed (16 shrink steps): --- Failure -------------------------------------------------------------------- -Test lists shorter than 432 failed (412 shrink steps): +Test lists shorter than 432 failed (416 shrink steps): [...] list length: 432 --- Failure -------------------------------------------------------------------- -Test lists shorter than 4332 failed (4022 shrink steps): +Test lists shorter than 4332 failed (3962 shrink steps): [...] list length: 4332 @@ -582,21 +583,21 @@ Test sum list = 0 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int failed (37 shrink steps): +Test fail_pred_map_commute_int failed (6 shrink steps): -([1], {_ -> 0}, {0 -> false; 1 -> true; -489114431 -> false; -334037599 -> false; -1002044798 -> false; 3 -> false; 607479396 -> false; 4 -> false; 5 -> false; 442140485 -> false; 50542662 -> false; 38 -> false; 281414086 -> false; 757535206 -> false; 6 -> false; 7 -> false; 8 -> false; 629085609 -> false; 10 -> false; -765856245 -> false; 44 -> false; 12 -> false; -386873971 -> false; 15 -> false; 47 -> false; -842421617 -> false; 588710735 -> false; 49 -> false; 18 -> false; 51 -> false; 449695123 -> false; 20 -> false; 21 -> false; -386709771 -> false; -92591850 -> false; 136918038 -> false; 54 -> false; -484444937 -> false; -1042148456 -> false; 24 -> false; 1062551480 -> false; 747852089 -> false; 25 -> false; -737785766 -> false; 58 -> false; -530708612 -> false; -60654788 -> false; 28 -> false; 60 -> false; 29 -> false; 947455871 -> false; _ -> false}) +([0; 1], {_ -> 0}, {1 -> true; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int32 failed (387 shrink steps): +Test fail_pred_map_commute_int32 failed (82 shrink steps): -([0l; -1l; 0l; 0l], {-3306213l -> 0l; 1197833490l -> 0l; -2892936l -> 0l; -15734l -> 0l; -64486914l -> 0l; -62572l -> 0l; -4339404l -> 0l; -1025877462l -> 0l; -16782l -> 0l; -22376l -> 0l; -30228241l -> 0l; -46196l -> 0l; -6612427l -> 0l; -333718l -> 0l; -24l -> 0l; -2847734l -> 0l; 181789747l -> 0l; 963313183l -> 0l; -1820213110l -> 0l; -1l -> 0l; -667437l -> 0l; 1616814262l -> 0l; -1488783487l -> 0l; -14685l -> 0l; 1033594061l -> 0l; -1813075019l -> 0l; -250288l -> 0l; -993818792l -> 0l; -913675600l -> 0l; -227l -> 0l; -302l -> 0l; -8391l -> 0l; -120912964l -> 0l; -98l -> 0l; -2169702l -> 0l; -84l -> 0l; -22671180l -> 0l; -606578794l -> 0l; -60456482l -> 0l; -113l -> 0l; -171965105l -> 0l; -584024936l -> 0l; -112852100l -> 0l; -7867l -> 0l; -15114120l -> 0l; -962761955l -> 0l; -1210l -> 0l; -1245883l -> 0l; -343930210l -> 0l; -489145187l -> 0l; -57745l -> 0l; -1623262736l -> 0l; -26449710l -> 0l; -257947658l -> 0l; -4425l -> 0l; -275144168l -> 0l; -151l -> 0l; -1367836616l -> 0l; -1655635269l -> 0l; -1712149989l -> 0l; -4517l -> 0l; -93858l -> 0l; -931705118l -> 0l; -605l -> 0l; -46929l -> 0l; -3l -> 0l; -911891077l -> 0l; -1827351201l -> 0l; -366858890l -> 0l; -1823782155l -> 0l; -1370513400l -> 0l; -745364094l -> 0l; -500577l -> 0l; -1423867l -> 0l; -183429445l -> 0l; -7l -> 0l; -82126l -> 0l; -5900l -> 0l; -9l -> 0l; -11801l -> 0l; 0l -> 0l; -978290374l -> 0l; 1798112767l -> 0l; -6l -> 0l; -96730371l -> 0l; 1879036781l -> 0l; -13224855l -> 0l; -662545861l -> 0l; -2420l -> 0l; -128973829l -> 0l; -2950l -> 0l; -1898489l -> 0l; -1067900l -> 0l; -1282346828l -> 0l; -49l -> 0l; -496909396l -> 0l; -70394l -> 0l; -733717781l -> 0l; -61595l -> 0l; -5785873l -> 0l; -4959320l -> 0l; -36l -> 0l; -1713141750l -> 0l; 758591303l -> 0l; -869591443l -> 0l; -4840l -> 0l; -33564l -> 0l; -41063l -> 0l; -53895l -> 0l; -3254553l -> 0l; -59670l -> 0l; -1770246475l -> 0l; -4l -> 0l; 1789163010l -> 0l; -13l -> 0l; -1214991543l -> 0l; -1798798838l -> 0l; -2581l -> 0l; -1334875l -> 0l; -3796979l -> 0l; -56l -> 0l; -5163l -> 0l; -1325091722l -> 0l; -1598932300l -> 0l; -3872l -> 0l; -711933l -> 0l; -18l -> 0l; -12587l -> 0l; -29835l -> 0l; -44753l -> 0l; -683918308l -> 0l; -30797l -> 0l; -321001529l -> 0l; -1196857039l -> 0l; -27l -> 0l; -125144l -> 0l; _ -> 0l}, {-1372162354l -> false; -884582595l -> false; 1800016173l -> false; -779904501l -> false; -2892936l -> false; -1464127158l -> false; -1371977399l -> false; -15734l -> false; -64486914l -> false; -62572l -> false; -4339404l -> false; 877561983l -> false; 414188264l -> false; -1916606788l -> false; 1740280549l -> false; -16782l -> false; -22376l -> false; 617758864l -> false; 2015488394l -> false; -329016050l -> false; 881756612l -> false; -24l -> false; 181789747l -> false; -144023482l -> false; -1l -> true; -667437l -> false; -1963309287l -> false; 728919774l -> false; -1221096930l -> false; 1321175101l -> false; 1033594061l -> false; 951284407l -> false; -1970352360l -> false; -227l -> false; -8391l -> false; -120912964l -> false; -606578794l -> false; 835378038l -> false; -1503106072l -> false; 1417286097l -> false; -584024936l -> false; -7867l -> false; -1641824566l -> false; -15114120l -> false; 1061621111l -> false; 208505287l -> false; -1210l -> false; -1245883l -> false; 337016376l -> false; -489145187l -> false; 62273772l -> false; -423060868l -> false; 216633596l -> false; -4425l -> false; 687296055l -> false; -1655635269l -> false; 1185043051l -> false; -1885981966l -> false; -93858l -> false; 341746486l -> false; 832925959l -> false; 1777069974l -> false; -605l -> false; 250831898l -> false; 1459113028l -> false; 933129766l -> false; -366858890l -> false; -1955762247l -> false; -1979393312l -> false; -2074790497l -> false; 556304992l -> false; -226378611l -> false; -1823782155l -> false; -1868760937l -> false; -500577l -> false; 38077639l -> false; -82126l -> false; -897912102l -> false; -9l -> false; 1676533150l -> false; 0l -> false; 1346850769l -> false; 1798112767l -> false; -6l -> false; 1879036781l -> false; 823827784l -> false; 2063333633l -> false; -13224855l -> false; -2420l -> false; -1759657344l -> false; -1526945920l -> false; 2145450674l -> false; 460955345l -> false; -415731479l -> false; 213874472l -> false; 849685352l -> false; -1957578108l -> false; 1205181759l -> false; -1155824913l -> false; -61595l -> false; -36l -> false; -1928421895l -> false; -4840l -> false; -33564l -> false; -1992511697l -> false; -3254553l -> false; -59670l -> false; -1024615222l -> false; -1770246475l -> false; -4l -> false; -1456428227l -> false; -13l -> false; -841267869l -> false; -1214991543l -> false; 625548763l -> false; -1798798838l -> false; 445235604l -> false; -1325091722l -> false; 1291636512l -> false; 416432296l -> false; -29835l -> false; 403241457l -> false; 199474988l -> false; -44753l -> false; -1584279822l -> false; -321001529l -> false; 340912948l -> false; -1538616721l -> false; -709900296l -> false; -3306213l -> false; 1197833490l -> false; -896768552l -> false; 657999523l -> false; 39544867l -> false; 1137798329l -> false; -1025877462l -> false; -30228241l -> false; 1726278290l -> false; -46196l -> false; -6612427l -> false; -333718l -> false; -2847734l -> false; 963313183l -> false; 606471631l -> false; -1820213110l -> false; 177710964l -> false; 1616814262l -> false; -1488783487l -> false; -14685l -> false; 1036279573l -> false; -1523442268l -> false; -1813075019l -> false; -250288l -> false; 775047850l -> false; -993818792l -> false; -913675600l -> false; -302l -> false; 1748803067l -> false; 1275416085l -> false; -98l -> false; -2169702l -> false; -1341114758l -> false; -84l -> false; -1742175178l -> false; -22671180l -> false; -26503445l -> false; -60456482l -> false; -113l -> false; -171965105l -> false; -112852100l -> false; -962761955l -> false; -343930210l -> false; -467464372l -> false; -57745l -> false; 1216723951l -> false; -1623262736l -> false; -1293530462l -> false; -26449710l -> false; -257947658l -> false; -1976623084l -> false; -275144168l -> false; -151l -> false; -1367836616l -> false; -1712149989l -> false; -4517l -> false; -931705118l -> false; -46929l -> false; -1874058468l -> false; 305281673l -> false; 646604853l -> false; -3l -> false; -911891077l -> false; -1827351201l -> false; 1480739939l -> false; 900400450l -> false; -1058357325l -> false; -1370513400l -> false; -886920683l -> false; 1996318795l -> false; -745364094l -> false; -1423867l -> false; -183429445l -> false; -7l -> false; 1550542030l -> false; -277136218l -> false; -5900l -> false; -664341267l -> false; -11801l -> false; -978290374l -> false; 2035121219l -> false; -155738355l -> false; -1043920263l -> false; -96730371l -> false; -1556572344l -> false; -662545861l -> false; 159279166l -> false; -128973829l -> false; -2950l -> false; -1898489l -> false; -82758570l -> false; 480999450l -> false; 617978198l -> false; -1067900l -> false; -1749017191l -> false; -1282346828l -> false; -49l -> false; 1147662236l -> false; -496909396l -> false; -70394l -> false; -733717781l -> false; -1434263070l -> false; -5785873l -> false; -4959320l -> false; -1460831450l -> false; -1713141750l -> false; 758591303l -> false; -1031603386l -> false; 1904716534l -> false; -869591443l -> false; -41063l -> false; -53895l -> false; 772609659l -> false; 361181180l -> false; 1789163010l -> false; 407384961l -> false; -987899689l -> false; -324827521l -> false; -2581l -> false; -1334875l -> false; 1234269183l -> false; -3796979l -> false; -56l -> false; -5163l -> false; -906342689l -> false; -1598932300l -> false; -3872l -> false; 420661032l -> false; -711933l -> false; -929215411l -> false; -18l -> false; -12587l -> false; -683918308l -> false; -240585914l -> false; -30797l -> false; -547193882l -> false; -1196857039l -> false; 1480038317l -> false; 532907932l -> false; -27l -> false; -288893568l -> false; -125144l -> false; _ -> false}) +([0l; 0l], {-1774179912l -> 0l; 0l -> 10l; -1658413248l -> 0l; -197056364l -> 0l; _ -> 0l}, {5l -> false; 10963850l -> false; 5481925l -> false; 74l -> false; 198l -> false; 674533l -> false; 189713l -> false; 212l -> false; 79063824l -> false; 23l -> false; 1944l -> false; 0l -> false; 86l -> false; 252950l -> false; 1349067l -> false; 20465853l -> false; 567l -> false; 7195026l -> false; 17542160l -> false; 2268l -> false; 6916l -> false; 124744253l -> false; 8l -> false; 10374l -> false; 49l -> false; 15593031l -> false; 11l -> false; 141l -> false; 110666l -> false; 31186063l -> false; 95l -> false; 126475l -> false; 47l -> false; 166325670l -> false; 55333l -> false; 92l -> false; 1011800l -> false; 3597513l -> false; -1658413248l -> false; 5396270l -> false; 62372126l -> false; 221767560l -> false; -197056364l -> false; 23389547l -> false; -1774179912l -> false; 2593l -> false; 332651340l -> false; 247l -> false; 505900l -> false; 283l -> false; 8222888l -> false; 21927700l -> false; 132l -> false; 2698135l -> false; 457187395l -> false; 10l -> true; 13833l -> false; 9593369l -> false; 221332l -> false; 443535120l -> false; -1990017031l -> false; 4796684l -> false; 1296l -> false; 27666l -> false; 9l -> false; 265l -> false; 99l -> false; 83162835l -> false; 11694773l -> false; 5187l -> false; 1134l -> false; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int64 failed (219 shrink steps): +Test fail_pred_map_commute_int64 failed (188 shrink steps): -([0L; 0L], {-1626777584348663391L -> 0L; -5274952442275438188L -> 0L; -1555621157876977468L -> 0L; 9108471596139219934L -> 0L; 7166876332973786910L -> 0L; 7019298611444604923L -> 0L; 3636655765360274557L -> 0L; -5299254572774104738L -> 0L; -33611074348872304L -> 0L; 1085477442822779951L -> 0L; 3550441151034303976L -> 0L; 7853829573999932795L -> 0L; 6570741223274545232L -> 0L; -9223241388095087777L -> 0L; 3145233702944072634L -> 0L; -4960186156748015984L -> 0L; 5949833029125707898L -> 0L; 8250044297663344735L -> 0L; 3926289947985597133L -> 0L; 2674458630179017557L -> 0L; 0L -> -1L; -1193494039317325605L -> 0L; -23581541164203791L -> 0L; 3262032974310066661L -> 0L; -1083726450716131347L -> 0L; 3148929065222398081L -> 0L; 34456112471805905L -> 0L; 3132053619847090208L -> 0L; 4099074157624200352L -> 0L; 4022909997771204357L -> 0L; -6581111995121167737L -> 0L; -3281956828365339039L -> 0L; 4382910041385585448L -> 0L; -5864916610580718835L -> 0L; 8584186777924536731L -> 0L; -5377162036943921244L -> 0L; 339138576765681485L -> 0L; -4861691548228816402L -> 0L; 7026031596079050131L -> 0L; 3839024356120653743L -> 0L; 2199816067032997124L -> 0L; -2789393114105475891L -> 0L; -4463380249671362201L -> 0L; -1431140827820444116L -> 0L; -6458440647188139180L -> 0L; -9103791047430776407L -> 0L; 6524619502474106000L -> 0L; -5429908502784908672L -> 0L; 7055687245367390835L -> 0L; -2349216052260771303L -> 0L; 4964388269721627631L -> 0L; -2751672235835279302L -> 0L; -2252793449446692507L -> 0L; -1091171088418411431L -> 0L; -3626926192832236521L -> 0L; 6786696509634778717L -> 0L; 6167793918440440992L -> 0L; -5290890539702059298L -> 0L; -4254817774861764540L -> 0L; -223583522706374158L -> 0L; 1105996183800211020L -> 0L; _ -> 0L}, {-1626777584348663391L -> false; -1555621157876977468L -> false; 9108471596139219934L -> false; 7732265564533085874L -> false; 7166876332973786910L -> false; 3550441151034303976L -> false; 1085477442822779951L -> false; 7853829573999932795L -> false; 3536675290503201843L -> false; -9128436253306377212L -> false; 3145233702944072634L -> false; -767017806279838012L -> false; 3926289947985597133L -> false; -6420956448021483933L -> false; 0L -> true; -23581541164203791L -> false; 3262032974310066661L -> false; 6391072603087371769L -> false; 1235568768376798224L -> false; -3909837786300313525L -> false; 34456112471805905L -> false; -6428055735629983608L -> false; 2623804087025851129L -> false; 4022909997771204357L -> false; -6581111995121167737L -> false; -6030988397309468346L -> false; -5864916610580718835L -> false; -5377162036943921244L -> false; -6495357859524114684L -> false; -1611032219521099730L -> false; 310391246715086669L -> false; 6408542658405221565L -> false; 2199816067032997124L -> false; 3839024356120653743L -> false; -4745654685023142655L -> false; 6847978435200344376L -> false; -2789393114105475891L -> false; -4463380249671362201L -> false; 3840360328563700082L -> false; -1431140827820444116L -> false; -6458440647188139180L -> false; -7765421792345238673L -> false; -4378680565567194056L -> false; -2349216052260771303L -> false; -2727353340127719681L -> false; 103321857428247527L -> false; -2252793449446692507L -> false; 6786696509634778717L -> false; -5290890539702059298L -> false; -264972637768065869L -> false; -4254817774861764540L -> false; 844666124734041018L -> false; 1105996183800211020L -> false; 4619286360921092268L -> false; -5274952442275438188L -> false; -6795560563734300894L -> false; 7019298611444604923L -> false; 3636655765360274557L -> false; 6165875408190569670L -> false; -5299254572774104738L -> false; -33611074348872304L -> false; 6570741223274545232L -> false; 3192165204308451046L -> false; -7819072410914830782L -> false; -9223241388095087777L -> false; -1424296199548586816L -> false; 6480341267797276322L -> false; -2341802166847999862L -> false; -4960186156748015984L -> false; 5949833029125707898L -> false; 8250044297663344735L -> false; 5214084478326154921L -> false; -1751416471876264704L -> false; 1281239262848334764L -> false; 2674458630179017557L -> false; 7080697169726960547L -> false; -1193494039317325605L -> false; 1924277706246431661L -> false; -4572301776388457843L -> false; -1775944920399996443L -> false; -1476499248608534591L -> false; -1083726450716131347L -> false; 3148929065222398081L -> false; 5135918803737217981L -> false; 3132053619847090208L -> false; -8795479186954029747L -> false; 4099074157624200352L -> false; -1725358293392483925L -> false; -883157324790385183L -> false; -3281956828365339039L -> false; 4382910041385585448L -> false; 7959678776239405401L -> false; 8584186777924536731L -> false; 6156908854039039331L -> false; 770656223494446708L -> false; 339138576765681485L -> false; 5155757567267116618L -> false; -4861691548228816402L -> false; -5029806468813998902L -> false; -5916595597725606869L -> false; -4925674386326338647L -> false; 8028367910303937204L -> false; 7026031596079050131L -> false; -5014191838822778121L -> false; -5381171409130864747L -> false; 8555424481824659787L -> false; 5886333856077963766L -> false; 3049517074836180120L -> false; -9103791047430776407L -> false; 6524619502474106000L -> false; -482660119496121524L -> false; -5429908502784908672L -> false; 7055687245367390835L -> false; 4964388269721627631L -> false; -2751672235835279302L -> false; -3626926192832236521L -> false; -1091171088418411431L -> false; 6167793918440440992L -> false; -1881974088854145838L -> false; 2212053705486708444L -> false; -223583522706374158L -> false; _ -> false}) +([0L; 0L], {-846350636327884360L -> 0L; -7122830660870113674L -> 0L; 0L -> 2L; -5852418530639587665L -> 0L; _ -> 0L}, {165975431736793371L -> false; 988622509L -> false; 359L -> false; 1019310L -> false; 2684127201758L -> false; 404L -> false; 1258954385914640095L -> false; 534L -> false; 1937L -> false; 145228502769694200L -> false; 134L -> false; 209413047969606L -> false; 1963604910111969040L -> false; 536L -> false; 134680508L -> false; 1318163345L -> false; 85701540674L -> false; 1L -> false; 1006547700659L -> false; 69512520L -> false; 213301612346L -> false; 13615172134658831L -> false; 2421L -> false; 13717L -> false; 16308967L -> false; 193638003692925600L -> false; 3562926213990806743L -> false; 1095L -> false; 111487L -> false; 975093085013L -> false; 4026190802637L -> false; 2233739178342464L -> false; 6714423391544747172L -> false; 505L -> false; 413094407878241280L -> false; 31355L -> false; 139608698646404L -> false; 339576540681650169L -> false; -7122830660870113674L -> false; 8L -> false; 67L -> false; 8154483L -> false; 3357211695772373586L -> false; 13778L -> false; 3444L -> false; 764483L -> false; 2583L -> false; 16L -> false; 3124535337L -> false; 4476282261029831448L -> false; 719L -> false; 62711L -> false; 1482933764L -> false; 1116869589171232L -> false; 2863069015209L -> false; 1678605847886186793L -> false; 472107894717990035L -> false; 228537441799L -> false; 314738596478660023L -> false; 1977245018L -> false; 1291L -> false; 7348L -> false; 1509821550989L -> false; 5726138030418L -> false; 821L -> false; 2517908771829280190L -> false; 2L -> true; 279217397292808L -> false; 4077241L -> false; 45809104243350L -> false; 14697L -> false; 108921377077270650L -> false; 139025040L -> false; 539L -> false; 15677L -> false; 5010370776616L -> false; 27230344269317662L -> false; 236053947358995017L -> false; 7838L -> false; 114268720899L -> false; 72614251384847100L -> false; 222974L -> false; 33670127L -> false; 26176630996200L -> false; 54460688538635325L -> false; 442601151298115657L -> false; 629477192957320047L -> false; 221300575649057828L -> false; 2190L -> false; 6889L -> false; 4294603522814L -> false; 1877L -> false; 1950186170027L -> false; 96819001846462800L -> false; 5368254403517L -> false; 556100162L -> false; 4467478356684928L -> false; 104706523984803L -> false; 5105689550497061L -> false; 1722L -> false; 558434794585616L -> false; 2552844775248530L -> false; 2013095401318L -> false; 0L -> false; 15782871L -> false; 8417531L -> false; 2038620L -> false; 22904552121675L -> false; 8952564522059662897L -> false; 522L -> false; 52353261992401L -> false; 121646910L -> false; 4686803006L -> false; 99985130786L -> false; 83615L -> false; 509655L -> false; 3515102255L -> false; 33L -> false; 269L -> false; 1757551127L -> false; 1887276938736L -> false; 547L -> false; 278050081L -> false; 3L -> false; 49992565393L -> false; -5852418530639587665L -> false; 6L -> false; 12859L -> false; 2502L -> false; 67340254L -> false; 741466882L -> false; 487546542506L -> false; 12626297L -> false; 12498141348L -> false; 1761458476154L -> false; 11452276060837L -> false; 471L -> false; 104268780L -> false; 182829953439L -> false; 2260L -> false; 3829267162872795L -> false; 39264946494300L -> false; 2343401503L -> false; 243773271253L -> false; 268L -> false; 530L -> false; 11757L -> false; 891897L -> false; 2636326691L -> false; 24996282696L -> false; -846350636327884360L -> false; 110650287824528914L -> false; 354080921038492526L -> false; 167231L -> false; 14730680L -> false; 41807L -> false; 10211379100994123L -> false; 57134360449L -> false; 20422758201988247L -> false; 16835063L -> false; 370733441L -> false; 445948L -> false; 130335975L -> false; 6249070674L -> false; 1251L -> false; 11022L -> false; 12L -> false; 479L -> false; 958L -> false; 121886635626L -> false; _ -> false}) --- Failure -------------------------------------------------------------------- @@ -606,9 +607,9 @@ Test fail_pred_strings failed (2 shrink steps): --- Failure -------------------------------------------------------------------- -Test fold_left fold_right failed (56 shrink steps): +Test fold_left fold_right failed (169 shrink steps): -(0, [1], {(1, 0) -> 1; (8, 0) -> 0; (6, 4) -> 0; (2, 6) -> 0; (3, 6) -> 0; (2, 16) -> 0; (0, 60) -> 0; (20, 3) -> 0; (12, 60) -> 0; (0, 2) -> 0; (2, 4) -> 0; (1, 6) -> 0; (6, 1) -> 0; (60, 83) -> 0; (3, 5) -> 0; (7, 12) -> 0; (6, 8) -> 0; (2, 2) -> 0; (56, 6) -> 0; (6, 5) -> 0; (12, 3) -> 0; (6, 6) -> 0; (0, 8) -> 0; (0, 58) -> 0; (5, 5) -> 0; (20, 2) -> 0; (54, 0) -> 0; (0, 6) -> 0; (4, 6) -> 0; (4, 56) -> 0; (5, 54) -> 0; (9, 8) -> 0; (8, 6) -> 0; (60, 47) -> 0; (9, 12) -> 0; (4, 20) -> 0; (0, 20) -> 0; (1, 2) -> 0; (28, 2) -> 0; (4, 1) -> 0; (0, 4) -> 0; (8, 3) -> 0; (4, 28) -> 0; (42, 8) -> 0; (6, 0) -> 0; (58, 65) -> 0; (12, 12) -> 0; (5, 6) -> 0; _ -> 0}) +(0, [1], {(83, 0) -> 0; (63, 7) -> 0; (86, 93) -> 0; (3, 4) -> 0; (30, 24) -> 0; (77, 9) -> 0; (37, 7) -> 0; (6, 25) -> 0; (2, 99) -> 0; (0, 11) -> 0; (6, 9) -> 0; (4, 96) -> 0; (9, 39) -> 0; (9, 4) -> 0; (6, 8) -> 0; (9, 9) -> 0; (2, 2) -> 0; (4, 19) -> 0; (5, 26) -> 0; (5, 53) -> 0; (4, 0) -> 0; (7, 1) -> 0; (7, 8) -> 0; (4, 86) -> 0; (0, 0) -> 0; (11, 56) -> 0; (77, 4) -> 0; (27, 4) -> 0; (77, 86) -> 0; (7, 4) -> 0; (84, 7) -> 0; (47, 0) -> 0; (4, 7) -> 0; (2, 7) -> 0; (3, 84) -> 0; (77, 89) -> 0; (9, 25) -> 0; (4, 44) -> 0; (9, 3) -> 0; (6, 3) -> 0; (4, 3) -> 0; (9, 6) -> 0; (4, 1) -> 0; (2, 3) -> 0; (75, 4) -> 0; (96, 1) -> 0; (7, 2) -> 0; (25, 52) -> 0; (3, 3) -> 0; (5, 6) -> 0; (1, 3) -> 0; (46, 0) -> 0; (43, 5) -> 0; (5, 65) -> 0; (6, 4) -> 0; (3, 70) -> 0; (4, 5) -> 0; (7, 0) -> 0; (9, 7) -> 0; (2, 8) -> 0; (3, 5) -> 0; (1, 4) -> 0; (6, 5) -> 0; (53, 75) -> 0; (3, 90) -> 0; (89, 2) -> 0; (81, 0) -> 0; (4, 80) -> 0; (4, 94) -> 0; (89, 9) -> 0; (4, 6) -> 0; (63, 9) -> 0; (3, 24) -> 0; (94, 8) -> 0; (2, 0) -> 0; (9, 87) -> 0; (33, 0) -> 0; (0, 99) -> 0; (5, 2) -> 0; (8, 4) -> 0; (8, 23) -> 0; (8, 3) -> 0; (0, 4) -> 0; (0, 9) -> 0; (86, 1) -> 0; (9, 43) -> 0; (0, 94) -> 0; (0, 7) -> 0; (8, 2) -> 0; (1, 5) -> 0; (78, 3) -> 0; (57, 3) -> 0; (24, 8) -> 0; (1, 0) -> 1; (8, 8) -> 0; (7, 3) -> 0; (3, 48) -> 0; (44, 0) -> 0; (5, 1) -> 0; (93, 89) -> 0; (2, 4) -> 0; (19, 4) -> 0; (2, 47) -> 0; (1, 89) -> 0; (48, 2) -> 0; (6, 19) -> 0; (4, 47) -> 0; (6, 6) -> 0; (3, 7) -> 0; (0, 3) -> 0; (8, 1) -> 0; (0, 8) -> 0; (8, 47) -> 0; (0, 6) -> 0; (8, 77) -> 0; (6, 2) -> 0; (4, 75) -> 0; (20, 7) -> 0; (4, 83) -> 0; (78, 2) -> 0; (5, 9) -> 0; (65, 3) -> 0; (65, 84) -> 0; (96, 9) -> 0; (1, 8) -> 0; (99, 90) -> 0; (6, 7) -> 0; (39, 7) -> 0; (1, 96) -> 0; (26, 83) -> 0; (23, 6) -> 0; (9, 44) -> 0; (5, 44) -> 0; (8, 0) -> 0; (2, 6) -> 0; (3, 6) -> 0; (52, 3) -> 0; (5, 0) -> 0; (4, 52) -> 0; (0, 2) -> 0; (6, 1) -> 0; (2, 1) -> 0; (9, 0) -> 0; (0, 5) -> 0; (3, 23) -> 0; (4, 2) -> 0; (64, 7) -> 0; (8, 48) -> 0; (66, 5) -> 0; (9, 1) -> 0; (7, 9) -> 0; (2, 26) -> 0; (3, 93) -> 0; (3, 0) -> 0; (19, 9) -> 0; (88, 84) -> 0; (7, 7) -> 0; (75, 5) -> 0; (3, 9) -> 0; (47, 77) -> 0; (39, 9) -> 0; (87, 0) -> 0; (9, 47) -> 0; (9, 8) -> 0; (7, 6) -> 0; (3, 34) -> 0; (83, 20) -> 0; (4, 8) -> 0; (5, 4) -> 0; (5, 7) -> 0; (6, 0) -> 0; (1, 25) -> 0; (3, 1) -> 0; _ -> 0}) +++ Messages ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -619,21 +620,21 @@ l=[1], fold_left=1, fold_right=0 --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried failed (376 shrink steps): +Test fold_left fold_right uncurried failed (701 shrink steps): -({(0, 2) -> 0; (13, 0) -> 0; (22, 3) -> 0; (20, 5) -> 0; (2, 93) -> 0; (65, 34) -> 0; (2, 7) -> 0; (0, 7) -> 0; (49, 3) -> 0; (8, 62) -> 0; (8, 2) -> 0; (54, 6) -> 0; (38, 4) -> 0; (7, 0) -> 1; (6, 25) -> 0; (0, 0) -> 0; (3, 4) -> 0; (1, 7) -> 0; (4, 6) -> 0; (8, 1) -> 0; (48, 42) -> 0; (18, 1) -> 0; (90, 14) -> 0; (8, 70) -> 0; (9, 1) -> 0; (38, 2) -> 0; (3, 5) -> 0; (8, 8) -> 0; (9, 3) -> 0; (2, 36) -> 0; (45, 2) -> 0; (18, 6) -> 0; (7, 98) -> 0; (3, 9) -> 0; (2, 31) -> 0; (86, 2) -> 0; (4, 7) -> 0; (1, 1) -> 0; (0, 5) -> 0; (2, 9) -> 0; (1, 5) -> 0; (44, 0) -> 0; (77, 7) -> 0; (5, 8) -> 0; (1, 4) -> 0; (9, 79) -> 0; (48, 1) -> 0; (30, 7) -> 0; (6, 79) -> 0; (5, 1) -> 0; (65, 4) -> 0; (2, 1) -> 0; (4, 1) -> 0; (66, 12) -> 0; (6, 5) -> 0; (7, 3) -> 0; (3, 7) -> 0; (9, 7) -> 0; (9, 9) -> 0; (2, 6) -> 0; (3, 15) -> 0; (5, 3) -> 0; (67, 1) -> 0; (3, 28) -> 0; (1, 87) -> 0; (7, 31) -> 0; (9, 13) -> 0; (32, 1) -> 0; (0, 27) -> 0; (6, 15) -> 0; (20, 0) -> 0; (6, 8) -> 0; (1, 6) -> 0; (0, 6) -> 0; (3, 1) -> 0; (9, 71) -> 0; (95, 4) -> 0; (97, 1) -> 0; (7, 4) -> 0; (84, 3) -> 0; (92, 6) -> 0; (6, 2) -> 0; (8, 4) -> 0; (5, 0) -> 0; (7, 5) -> 0; (9, 8) -> 0; (90, 26) -> 0; (0, 19) -> 0; (1, 13) -> 0; (6, 1) -> 0; (9, 28) -> 0; (9, 6) -> 0; (8, 6) -> 0; (3, 8) -> 0; (7, 62) -> 0; (86, 0) -> 0; (65, 1) -> 0; (7, 1) -> 0; (6, 6) -> 0; (30, 4) -> 0; (7, 67) -> 0; (0, 9) -> 0; (78, 5) -> 0; (17, 3) -> 0; (9, 60) -> 0; (3, 71) -> 0; (88, 1) -> 0; (4, 61) -> 0; (9, 0) -> 0; (45, 0) -> 0; (2, 5) -> 0; (9, 47) -> 0; (18, 5) -> 0; (66, 0) -> 0; (0, 76) -> 0; (8, 3) -> 0; (74, 6) -> 0; (5, 60) -> 0; (5, 80) -> 0; (8, 9) -> 0; (7, 8) -> 0; (39, 4) -> 0; (72, 8) -> 0; (4, 38) -> 0; (70, 31) -> 0; (19, 5) -> 0; (4, 9) -> 0; (0, 1) -> 0; (1, 37) -> 0; (7, 6) -> 0; (6, 3) -> 0; (9, 5) -> 0; (58, 4) -> 0; (54, 5) -> 0; (7, 86) -> 0; (67, 6) -> 0; (0, 8) -> 0; (8, 7) -> 0; (44, 18) -> 0; (3, 0) -> 0; (4, 41) -> 0; (0, 31) -> 0; (1, 51) -> 0; (6, 0) -> 0; (1, 3) -> 0; (70, 1) -> 0; (9, 4) -> 0; (4, 5) -> 0; (1, 8) -> 0; (5, 9) -> 0; (0, 14) -> 0; (3, 3) -> 0; (4, 0) -> 0; (78, 9) -> 0; (0, 4) -> 0; (2, 3) -> 0; (9, 62) -> 0; (35, 1) -> 0; (55, 1) -> 0; _ -> 0}, 0, [7; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0]) +({(5, 4) -> 0; (9, 6) -> 0; (37, 2) -> 0; (3, 8) -> 0; (84, 2) -> 0; (3, 7) -> 0; (2, 43) -> 0; (2, 7) -> 0; (1, 5) -> 0; (67, 9) -> 0; (5, 8) -> 0; (5, 0) -> 1; (4, 9) -> 0; (1, 3) -> 0; (3, 5) -> 0; (1, 9) -> 0; _ -> 0}, 0, [5; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0]) --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried fun last failed (56 shrink steps): +Test fold_left fold_right uncurried fun last failed (34 shrink steps): -(0, [1], {(0, 2) -> 0; (3, 6) -> 0; (0, 20) -> 0; (20, 4) -> 0; (6, 42) -> 0; (47, 6) -> 0; (6, 12) -> 0; (2, 6) -> 0; (0, 58) -> 0; (8, 2) -> 0; (6, 6) -> 0; (8, 60) -> 0; (12, 3) -> 0; (6, 4) -> 0; (16, 8) -> 0; (6, 0) -> 0; (3, 4) -> 0; (12, 0) -> 0; (60, 5) -> 0; (8, 1) -> 0; (6, 8) -> 0; (2, 5) -> 0; (2, 42) -> 0; (5, 4) -> 0; (4, 20) -> 0; (54, 0) -> 0; (12, 4) -> 0; (3, 2) -> 0; (8, 0) -> 0; (4, 7) -> 0; (28, 3) -> 0; (2, 9) -> 0; (65, 54) -> 0; (5, 28) -> 0; (20, 2) -> 0; (6, 2) -> 0; (83, 6) -> 0; (58, 5) -> 0; (5, 6) -> 0; (56, 12) -> 0; (1, 60) -> 0; (4, 9) -> 0; (0, 1) -> 1; (2, 8) -> 0; (2, 0) -> 0; (6, 1) -> 0; (1, 12) -> 0; (60, 0) -> 0; _ -> 0}) +(0, [1], {(3, 9) -> 0; (20, 4) -> 0; (9, 3) -> 0; (4, 48) -> 0; (8, 5) -> 0; (9, 24) -> 0; (47, 7) -> 0; (2, 99) -> 0; (6, 84) -> 0; (6, 6) -> 0; (7, 89) -> 0; (1, 0) -> 1; (47, 2) -> 0; (26, 94) -> 0; (0, 19) -> 0; (90, 5) -> 0; (9, 0) -> 0; (9, 4) -> 0; (2, 5) -> 0; (70, 7) -> 0; (1, 9) -> 0; _ -> 0}) --- Failure -------------------------------------------------------------------- -Test fold_left test, fun first failed (15 shrink steps): +Test fold_left test, fun first failed (108 shrink steps): -({_ -> ""}, "a", [], [0]) +({("h", 3) -> ""; ("Ph\228", 4) -> ""; ("\164~\190\161\005Be2", 3) -> ""; ("T", 4) -> ""; ("\207\244\171\128\185w\173\190\239F5{\147\191\157nQ\132T\252\253|\028(Hf\1373?\181U\137\241\019-\155u\252\243\t\206`\133\140", 89) -> ""; ("\153\247\255", 2) -> ""; ("\240`\139\219Q1\218\240$\024\176\166\0122:-Z\198\184cm\189\186xQ\143\128R\"\235\238TqA\158\224&\151y\209\180=\027\204D\188\171~\226r\253\153\249\163\"E\252\001\020y(\182A\146JE\1457\201\169\012\253\002\193;\166ze\245%\246\143\2338\161\005\161]F\153^T", 7) -> ""; ("\016S\203'a\195X\131\152", 0) -> ""; ("\243u\163\147\135", 8) -> ""; ("1n3\198\148\183\160", 1) -> ""; ("\236\255", 8) -> ""; ("\139}%\161!d\131\167)\0244=\157\130\239]\029i\178\238$*\173V\245\176\023\234\202\150\022\242\170\252l@\216\136\173\228O", 5) -> ""; ("\131\011x$\127\0261u\147j", 4) -> ""; ("\237)\173\152w\006\133\205n\026\157\216c\007\198\239\255\247", 3) -> ""; ("An\177E\018\164\215\143\136\164\215\214\nJ\212\020\180\208\031}\140\023E\245\171o\255\203\195O\204U\227BF\187\174\233\239NMu \198\011\175\136(\160(\2511\007;\022\253\216\173\026\224\242\148\238c\230\n~\180:\175a\241O-7\141\197", 4) -> ""; ("\140", 7) -> ""; ("", 5) -> "a"; ("\014\1333\194\"\220\222\252X\196hA\185\156\197\177\160\197\247K\224N\203U\172\007\148\209O,%($i\027\015\2002`", 1) -> ""; ("\167\162\212\012\145z", 2) -> ""; ("\002\241\197\142\177\162", 8) -> ""; ("/\197p\004L", 9) -> ""; ("'\214\194w#\194\189\207\210", 75) -> ""; ("\216n\128$\161f\233\226", 4) -> ""; ("u).(\174\135f\214!JG\182\252(\249E\218^f\022\250\174zm-\225\203\130Y\250\218\179j\162\180\214\189\027\024\169>Y\219\152\155\234;\2363\200\176\139\031\020/\152\012\b\191\011\153O\129\168\234\016~\175G\016\234\015\169M\169", 9) -> ""; ("w\128n", 5) -> ""; ("", 0) -> ""; ("\022\188\139?", 48) -> ""; ("\219'\188", 4) -> ""; ("", 83) -> ""; ("", 6) -> ""; ("36", 5) -> ""; ("\152\224$\234*J\244\018\181\146\171\"\138H\158\131E\r\014\236\240\024\226\147\214\000\227\022:\157N\197\171\228\250V\145a\204\189:\023\141\182y\144\229/r\200m\b!\137WX\246\017\250f\244I\214K\131\170z+\167d@\131/\166\163s\148\221\199M\224Z\012R\014", 2) -> ""; ("\136\227\237\148\181\138\017]\169\230\187w9d\201\152\019\173`\170\1837(\240\240\168\253L\208\156={\167`\023\214B\142R\142a\176\204F\173\161\214vs\1614<a\206\203~\156\242\216\128\031C\200TD\208Rf\b\"\014\128R4\232[\205\253_iR\021\128(", 23) -> ""; ("\t\132\164\254\016", 84) -> ""; ("\029", 7) -> ""; (",P", 6) -> ""; ("\016{\250\014>m\175m\204X^\137P#UZ<\215\244\028\249\226,`\018\172\193\144\235\183\150\179\133\134e\205\016", 0) -> ""; ("\163+Y\133\129\219\b\168\162]\217|$V", 19) -> ""; ("", 4) -> ""; ("", 9) -> ""; ("\2387\030Ay\" x\219\172\241\178\202\174\232\228\162\239\234\147\021T}\236\136k!\196\195\028a\019\029\188", 94) -> ""; ("\219'\188", 3) -> ""; ("\140\194\177", 5) -> ""; (" kH\148a\135\179#\255\220\139\000BW\234\228&N\199\175m}\167S\242\183\030\172\158\194\027\145\183d5k\127\"\164\024\162#\182n\252\027_V\"^j\020\019\197=\027#`H\004Y\216\197\162@\193v\204~\146\004\204p\149\022s\153\011\176\006\026o\198\169\143U\166\215\201xy\208", 4) -> ""; ("\169", 99) -> ""; ("", 24) -> ""; ("\198\168", 7) -> "a"; ("@\197\242l\146\175\130\216\1692z\178tSW\252'\249j$\195\202\014/Iw\166\020\186cr\":\224n\242c\187\141\023", 3) -> ""; ("\020\215\157", 3) -> ""; _ -> ""}, "", [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0], [5]) --- Failure -------------------------------------------------------------------- @@ -718,21 +719,21 @@ stats char code: +++ Stats for tree's depth ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats depth: - num: 1000, avg: 3.74, stddev: 3.28, median 3, min 1, max 15 - 1: ####################################################### 377 - 2: ################ 113 - 3: ############ 87 - 4: ################# 123 - 5: ########### 81 - 6: #### 33 - 7: ##### 40 - 8: ##### 39 - 9: # 9 - 10: ### 25 - 11: ####### 49 - 12: 4 - 13: # 9 - 14: # 7 + num: 1000, avg: 3.92, stddev: 3.36, median 3, min 1, max 15 + 1: ####################################################### 364 + 2: ############## 96 + 3: ############ 83 + 4: ##################### 145 + 5: ########## 71 + 6: ##### 34 + 7: ###### 44 + 8: ####### 49 + 9: # 11 + 10: ### 24 + 11: ######## 54 + 12: 3 + 13: 6 + 14: # 12 15: 4 +++ Stats for bytes_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -960,128 +961,128 @@ stats len: +++ Stats for pair dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats pair sum: - num: 500000, avg: 100.02, stddev: 41.22, median 100, min 0, max 200 - 0.. 9: ### 2685 - 10.. 19: ######## 7622 - 20.. 29: ############## 12474 - 30.. 39: #################### 17330 - 40.. 49: ########################## 22263 - 50.. 59: ############################### 26982 - 60.. 69: ##################################### 32182 - 70.. 79: ########################################### 37125 - 80.. 89: ################################################# 42287 - 90.. 99: ###################################################### 46691 - 100..109: ####################################################### 46977 - 110..119: ################################################# 42444 - 120..129: ############################################ 37719 - 130..139: ###################################### 32595 - 140..149: ################################ 27588 - 150..159: ########################## 22792 - 160..169: #################### 17805 - 170..179: ############### 13068 - 180..189: ######### 8218 - 190..199: ### 3115 - 200..209: 38 + num: 500000, avg: 99.97, stddev: 41.23, median 100, min 0, max 200 + 0.. 9: ### 2732 + 10.. 19: ######## 7470 + 20.. 29: ############## 12606 + 30.. 39: #################### 17281 + 40.. 49: ######################### 22161 + 50.. 59: ################################ 27693 + 60.. 69: ##################################### 32264 + 70.. 79: ########################################### 37078 + 80.. 89: ################################################ 41933 + 90.. 99: ##################################################### 46178 + 100..109: ####################################################### 47368 + 110..119: ################################################# 42440 + 120..129: ########################################### 37526 + 130..139: ##################################### 32630 + 140..149: ############################### 27558 + 150..159: ########################## 22873 + 160..169: #################### 17956 + 170..179: ############### 13095 + 180..189: ######### 7957 + 190..199: ### 3157 + 200..209: 44 +++ Stats for triple dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats triple sum: - num: 500000, avg: 150.08, stddev: 50.51, median 150, min 0, max 299 - 0.. 14: 345 - 15.. 29: ## 2121 - 30.. 44: ##### 5372 - 45.. 59: ########## 10501 - 60.. 74: ################# 17031 - 75.. 89: ######################### 25417 - 90..104: ################################### 35148 - 105..119: ############################################# 45134 - 120..134: ################################################### 51751 - 135..149: ####################################################### 55090 - 150..164: ###################################################### 55074 - 165..179: #################################################### 52238 - 180..194: ############################################# 45651 - 195..209: ################################### 35994 - 210..224: ######################### 26039 - 225..239: ################# 17749 - 240..254: ########## 10870 - 255..269: ##### 5765 - 270..284: ## 2313 - 285..299: 397 + num: 500000, avg: 150.03, stddev: 50.48, median 150, min 0, max 299 + 0.. 14: 313 + 15.. 29: ## 2122 + 30.. 44: ##### 5446 + 45.. 59: ########## 10500 + 60.. 74: ################ 17013 + 75.. 89: ######################### 25666 + 90..104: ################################### 35268 + 105..119: ############################################# 45180 + 120..134: ################################################### 51212 + 135..149: ###################################################### 55048 + 150..164: ####################################################### 55217 + 165..179: ################################################### 52179 + 180..194: ############################################# 45446 + 195..209: #################################### 36527 + 210..224: ######################### 26036 + 225..239: ################# 17655 + 240..254: ########## 10770 + 255..269: ##### 5786 + 270..284: ## 2253 + 285..299: 363 +++ Stats for quad dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats quad sum: - num: 500000, avg: 200.13, stddev: 58.33, median 200, min 5, max 394 - 5.. 24: 102 - 25.. 44: 842 - 45.. 64: ## 3023 - 65.. 84: ###### 7154 - 85..104: ############ 14368 - 105..124: ##################### 25397 - 125..144: ############################### 37547 - 145..164: ########################################## 50174 - 165..184: ################################################## 60558 - 185..204: ####################################################### 65376 - 205..224: ##################################################### 63687 - 225..244: ############################################### 56248 - 245..264: ###################################### 45384 - 265..284: ########################## 31780 - 285..304: ################ 20158 - 305..324: ######### 10899 - 325..344: #### 5045 - 345..364: # 1848 - 365..384: 386 - 385..404: 24 + num: 500000, avg: 200.05, stddev: 58.23, median 200, min 1, max 395 + 1.. 20: 56 + 21.. 40: 613 + 41.. 60: # 2355 + 61.. 80: ##### 6151 + 81..100: ########## 12762 + 101..120: ################### 22881 + 121..140: ############################# 35023 + 141..160: ######################################## 48107 + 161..180: ################################################# 58482 + 181..200: ###################################################### 64916 + 201..220: ####################################################### 65035 + 221..240: ################################################# 58235 + 241..260: ####################################### 47099 + 261..280: ############################# 34772 + 281..300: ################## 22400 + 301..320: ########## 12463 + 321..340: #### 5856 + 341..360: # 2260 + 361..380: 501 + 381..400: 33 +++ Stats for bind dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats ordered pair difference: - num: 1000000, avg: 25.02, stddev: 22.36, median 19, min 0, max 100 - 0.. 4: ####################################################### 193184 - 5.. 9: ##################################### 130024 - 10.. 14: ############################# 103828 - 15.. 19: ######################## 87496 - 20.. 24: ##################### 74431 - 25.. 29: ################## 64629 - 30.. 34: ################ 56663 - 35.. 39: ############# 48986 - 40.. 44: ############ 43424 - 45.. 49: ########## 37599 - 50.. 54: ######### 32787 - 55.. 59: ######## 28332 - 60.. 64: ###### 24023 - 65.. 69: ##### 20312 - 70.. 74: #### 16649 - 75.. 79: ### 13338 - 80.. 84: ## 10239 - 85.. 89: ## 7391 - 90.. 94: # 4548 - 95.. 99: 2015 - 100..104: 102 + num: 1000000, avg: 24.99, stddev: 22.33, median 19, min 0, max 100 + 0.. 4: ####################################################### 193839 + 5.. 9: #################################### 129347 + 10.. 14: ############################# 103847 + 15.. 19: ######################## 87031 + 20.. 24: ##################### 75338 + 25.. 29: ################## 64783 + 30.. 34: ################ 56422 + 35.. 39: ############## 49351 + 40.. 44: ############ 43140 + 45.. 49: ########## 38109 + 50.. 54: ######### 32501 + 55.. 59: ####### 28129 + 60.. 64: ###### 24178 + 65.. 69: ##### 20069 + 70.. 74: #### 16578 + 75.. 79: ### 13204 + 80.. 84: ## 10269 + 85.. 89: ## 7232 + 90.. 94: # 4471 + 95.. 99: 2047 + 100..104: 115 stats ordered pair sum: - num: 1000000, avg: 75.12, stddev: 46.93, median 72, min 0, max 200 - 0.. 9: ####################################################### 70423 - 10.. 19: ##################################################### 68068 - 20.. 29: ##################################################### 68449 - 30.. 39: ##################################################### 68577 - 40.. 49: ##################################################### 68763 - 50.. 59: ##################################################### 68351 - 60.. 69: ##################################################### 68744 - 70.. 79: ##################################################### 68451 - 80.. 89: ##################################################### 68309 - 90.. 99: ##################################################### 68835 - 100..109: ################################################## 64544 - 110..119: ########################################### 55512 - 120..129: ##################################### 47595 - 130..139: ############################### 39809 - 140..149: ######################### 32677 - 150..159: #################### 26312 - 160..169: ############### 20180 - 170..179: ########### 14265 - 180..189: ###### 8625 - 190..199: ## 3433 - 200..209: 78 + num: 1000000, avg: 75.00, stddev: 46.92, median 72, min 0, max 200 + 0.. 9: ####################################################### 70575 + 10.. 19: ##################################################### 68853 + 20.. 29: ##################################################### 68585 + 30.. 39: ##################################################### 68532 + 40.. 49: ##################################################### 68240 + 50.. 59: ##################################################### 68715 + 60.. 69: ##################################################### 68990 + 70.. 79: ##################################################### 68722 + 80.. 89: ##################################################### 68480 + 90.. 99: ##################################################### 68372 + 100..109: ################################################## 64287 + 110..119: ########################################### 55514 + 120..129: #################################### 47048 + 130..139: ############################### 39962 + 140..149: ######################### 32688 + 150..159: #################### 26183 + 160..169: ############### 19821 + 170..179: ########## 14077 + 180..189: ###### 8713 + 190..199: ## 3560 + 200..209: 83 +++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -1423,27 +1424,27 @@ stats dist: +++ Stats for int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 100000, avg: 336840.90, stddev: 619301756.02, median 895228, min -1073728193, max 1073739280 - -1073728193.. -966354820: ##################################################### 5009 - -966354819.. -858981446: #################################################### 5004 - -858981445.. -751608072: #################################################### 4917 - -751608071.. -644234698: ##################################################### 5028 - -644234697.. -536861324: #################################################### 4962 - -536861323.. -429487950: ##################################################### 5039 - -429487949.. -322114576: #################################################### 4927 - -322114575.. -214741202: ##################################################### 5054 - -214741201.. -107367828: ##################################################### 5065 - -107367827.. 5546: #################################################### 4954 - 5547.. 107378920: #################################################### 4943 - 107378921.. 214752294: ################################################### 4900 - 214752295.. 322125668: ###################################################### 5126 - 322125669.. 429499042: ####################################################### 5198 - 429499043.. 536872416: #################################################### 4988 - 536872417.. 644245790: #################################################### 4940 - 644245791.. 751619164: #################################################### 5002 - 751619165.. 858992538: #################################################### 4928 - 858992539.. 966365912: ##################################################### 5070 - 966365913.. 1073739286: #################################################### 4946 + num: 100000, avg: -2291958.04, stddev: 619491993.46, median -5040258, min -1073697085, max 1073726761 + -1073697085.. -966325893: ################################################### 4878 + -966325892.. -858954700: ####################################################### 5163 + -858954699.. -751583507: #################################################### 4975 + -751583506.. -644212314: ##################################################### 5061 + -644212313.. -536841121: ##################################################### 4982 + -536841120.. -429469928: ###################################################### 5091 + -429469927.. -322098735: ##################################################### 4995 + -322098734.. -214727542: ##################################################### 5016 + -214727541.. -107356349: ##################################################### 5006 + -107356348.. 14844: ##################################################### 5054 + 14845.. 107386037: ##################################################### 4988 + 107386038.. 214757230: #################################################### 4921 + 214757231.. 322128423: ##################################################### 5001 + 322128424.. 429499616: ##################################################### 5048 + 429499617.. 536870809: ##################################################### 5016 + 536870810.. 644242002: ##################################################### 4979 + 644242003.. 751613195: #################################################### 4883 + 751613196.. 858984388: ##################################################### 5063 + 858984389.. 966355581: #################################################### 4929 + 966355582.. 1073726774: #################################################### 4951 +++ Stats for oneof int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -1677,26 +1678,27 @@ random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 1000, avg: 10351291.88, stddev: 432212939.52, median 9, min -1066972208, max 1073741823 - -1066972208.. -959936507: ## 27 - -959936506.. -852900805: ## 22 - -852900804.. -745865103: ## 22 - -745865102.. -638829401: # 18 - -638829400.. -531793699: # 17 - -531793698.. -424757997: ## 21 - -424757996.. -317722295: ### 33 - -317722294.. -210686593: ### 33 - -210686592.. -103650891: ### 32 - -103650890.. 3384811: ####################################################### 516 - 3384812.. 110420513: ### 34 - 110420514.. 217456215: ### 34 - 217456216.. 324491917: # 17 - 324491918.. 431527619: ## 24 - 431527620.. 538563321: ## 26 - 538563322.. 645599023: ## 20 - 645599024.. 752634725: ## 24 - 752634726.. 859670427: ## 27 - 859670428.. 966706129: ## 27 - 966706130.. 1073741823: ## 26 + num: 1000, avg: -3528483.94, stddev: 437402795.33, median 16, min -1058119937, max 1073741823 + -1058119937.. -951526850: ### 31 + -951526849.. -844933762: ## 26 + -844933761.. -738340674: ## 27 + -738340673.. -631747586: ## 21 + -631747585.. -525154498: ## 25 + -525154497.. -418561410: # 19 + -418561409.. -311968322: ## 27 + -311968321.. -205375234: # 19 + -205375233.. -98782146: ### 31 + -98782145.. 7810942: ####################################################### 537 + 7810943.. 114404030: ## 26 + 114404031.. 220997118: ## 20 + 220997119.. 327590206: ## 22 + 327590207.. 434183294: ## 27 + 434183295.. 540776382: # 18 + 540776383.. 647369470: ## 24 + 647369471.. 753962558: ## 24 + 753962559.. 860555646: ## 26 + 860555647.. 967148734: ## 21 + 967148735.. 1073741822: ## 28 + 1073741823.. 1073741823: 1 ================================================================================ success (ran 1 tests) diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.64 b/test/core/QCheck2_expect_test.expected.ocaml4.64 index 0eed7c08..d8df9c73 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.64 @@ -1,133 +1,132 @@ random seed: 1234 -50 7 0 0 0 0 0 0 0 0 0 0 3 3 3 3 3 3 3 3 3 3 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 (6,fun,50) (0,fun,2) (7,fun,66) (54,fun,9) (2,fun,5) (90,fun,4) (1,fun,4) (37,fun,7) (7,fun,1) (8,fun,5) -(6,fun,50) (0,fun,2) (7,fun,66) (54,fun,9) (2,fun,5) (90,fun,4) (1,fun,4) (37,fun,7) (7,fun,1) (8,fun,5) -(6,fun,50) (0,fun,2) (7,fun,66) (54,fun,9) (2,fun,5) (90,fun,4) (1,fun,4) (37,fun,7) (7,fun,1) (8,fun,5) -(6,fun,50) (0,fun,2) (7,fun,66) (54,fun,9) (2,fun,5) (90,fun,4) (1,fun,4) (37,fun,7) (7,fun,1) (8,fun,5) -(6,fun,50) (0,fun,2) (7,fun,66) (54,fun,9) (2,fun,5) (90,fun,4) (1,fun,4) (37,fun,7) (7,fun,1) (8,fun,5) -(6,fun,50) (0,fun,2) (7,fun,66) (54,fun,9) (2,fun,5) (90,fun,4) (1,fun,4) (37,fun,7) (7,fun,1) (8,fun,5) -(6,fun,50) (0,fun,2) (7,fun,66) (54,fun,9) (2,fun,5) (90,fun,4) (1,fun,4) (37,fun,7) (7,fun,1) (8,fun,5) -(6,fun,50) (0,fun,2) (7,fun,66) (54,fun,9) (2,fun,5) (90,fun,4) (1,fun,4) (37,fun,7) (7,fun,1) (8,fun,5) -2724675603984413065 +50 7 0 0 0 0 0 0 0 0 0 0 3 3 3 3 3 3 3 3 3 3 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 (2,fun,16) (6,fun,1) (9,fun,7) (0,fun,9) (60,fun,7) (7,fun,2) (3,fun,9) (54,fun,4) (4,fun,3) (2,fun,0) +(2,fun,16) (6,fun,1) (9,fun,7) (0,fun,9) (60,fun,7) (7,fun,2) (3,fun,9) (54,fun,4) (4,fun,3) (2,fun,0) +(2,fun,16) (6,fun,1) (9,fun,7) (0,fun,9) (60,fun,7) (7,fun,2) (3,fun,9) (54,fun,4) (4,fun,3) (2,fun,0) +(2,fun,16) (6,fun,1) (9,fun,7) (0,fun,9) (60,fun,7) (7,fun,2) (3,fun,9) (54,fun,4) (4,fun,3) (2,fun,0) +(2,fun,16) (6,fun,1) (9,fun,7) (0,fun,9) (60,fun,7) (7,fun,2) (3,fun,9) (54,fun,4) (4,fun,3) (2,fun,0) +(2,fun,16) (6,fun,1) (9,fun,7) (0,fun,9) (60,fun,7) (7,fun,2) (3,fun,9) (54,fun,4) (4,fun,3) (2,fun,0) +(2,fun,16) (6,fun,1) (9,fun,7) (0,fun,9) (60,fun,7) (7,fun,2) (3,fun,9) (54,fun,4) (4,fun,3) (2,fun,0) +(2,fun,16) (6,fun,1) (9,fun,7) (0,fun,9) (60,fun,7) (7,fun,2) (3,fun,9) (54,fun,4) (4,fun,3) (2,fun,0) +-947389732205813673 +1824404893930668959 0 -1362337801992206532 +912202446965334479 0 -681168900996103266 +456101223482667239 0 -340584450498051633 +228050611741333619 0 -170292225249025816 +114025305870666809 0 -85146112624512908 +57012652935333404 0 -42573056312256454 +28506326467666702 0 -21286528156128227 +14253163233833351 0 -10643264078064113 +7126581616916675 0 -5321632039032056 +3563290808458337 0 -2660816019516028 +1781645404229168 0 -1330408009758014 +890822702114584 0 -665204004879007 +445411351057292 0 -332602002439503 +222705675528646 0 -166301001219751 +111352837764323 0 -83150500609875 +55676418882161 0 -41575250304937 +27838209441080 0 -20787625152468 +13919104720540 0 -10393812576234 +6959552360270 0 -5196906288117 +3479776180135 0 -2598453144058 +1739888090067 0 -1299226572029 +869944045033 0 -649613286014 +434972022516 0 -324806643007 +217486011258 0 -162403321503 +108743005629 0 -81201660751 +54371502814 0 -40600830375 +27185751407 0 -20300415187 +13592875703 0 -10150207593 +6796437851 0 -5075103796 +3398218925 0 -2537551898 +1699109462 0 -1268775949 +849554731 0 -634387974 +424777365 0 -317193987 +212388682 0 -158596993 +106194341 0 -79298496 +53097170 0 -39649248 +26548585 0 -19824624 +13274292 0 -9912312 +6637146 0 -4956156 +3318573 0 -2478078 +1659286 0 -1239039 +829643 0 -619519 +414821 0 -309759 +207410 0 -154879 +103705 0 -77439 +51852 0 -38719 +25926 0 -19359 +12963 0 -9679 +6481 0 -4839 +3240 0 -2419 +1620 0 -1209 +810 0 -604 +405 0 -302 +202 0 -151 +101 0 -75 +50 0 -37 +25 0 -18 +12 0 -9 +6 0 -4 -0 -2 +3 0 1 0 @@ -180,7 +179,7 @@ Test should_fail_sort_id failed (9 shrink steps): === Error ====================================================================== -Test should_error_raise_exn errored on (1 shrink steps): +Test should_error_raise_exn errored on (2 shrink steps): 0 @@ -239,7 +238,7 @@ Test with shrinking retries failed (0 shrink steps): Warning for test WARN_unlikely_precond: -WARNING: only 0.5% tests (of 2000) passed precondition for "WARN_unlikely_precond" +WARNING: only 0.4% tests (of 2000) passed precondition for "WARN_unlikely_precond" NOTE: it is likely that the precondition is too strong, or that the generator is buggy. @@ -247,7 +246,7 @@ NOTE: it is likely that the precondition is too strong, or that the generator is Test FAIL_unlikely_precond failed: -ERROR: only 0.5% tests (of 2000) passed precondition for "FAIL_unlikely_precond" +ERROR: only 0.4% tests (of 2000) passed precondition for "FAIL_unlikely_precond" NOTE: it is likely that the precondition is too strong, or that the generator is buggy. @@ -304,9 +303,9 @@ Test long_shrink failed (3039 shrink steps): --- Failure -------------------------------------------------------------------- -Test ints arent 0 mod 3 failed (2 shrink steps): +Test ints arent 0 mod 3 failed (76 shrink steps): -0 +-24381 --- Failure -------------------------------------------------------------------- @@ -420,7 +419,7 @@ Test strings have unique chars failed (18 shrink steps): Test pairs have different components failed (0 shrink steps): -(4, 4) +(6, 6) --- Failure -------------------------------------------------------------------- @@ -430,7 +429,7 @@ Test pairs have same components failed (63 shrink steps): --- Failure -------------------------------------------------------------------- -Test pairs have a zero component failed (122 shrink steps): +Test pairs have a zero component failed (120 shrink steps): (1, 1) @@ -442,7 +441,7 @@ Test pairs are (0,0) failed (63 shrink steps): --- Failure -------------------------------------------------------------------- -Test pairs are ordered failed (94 shrink steps): +Test pairs are ordered failed (90 shrink steps): (1, 0) @@ -454,21 +453,21 @@ Test pairs are ordered reversely failed (62 shrink steps): --- Failure -------------------------------------------------------------------- -Test pairs sum to less than 128 failed (56 shrink steps): +Test pairs sum to less than 128 failed (57 shrink steps): (0, 128) --- Failure -------------------------------------------------------------------- -Test pairs lists rev concat failed (83 shrink steps): +Test pairs lists rev concat failed (72 shrink steps): ([0], [1]) --- Failure -------------------------------------------------------------------- -Test pairs lists no overlap failed (27 shrink steps): +Test pairs lists no overlap failed (17 shrink steps): -([0], [0; 0; 0; 0]) +([0], [0; 0; 0; 0; 0; 0]) --- Failure -------------------------------------------------------------------- @@ -486,11 +485,11 @@ Test triples have same components failed (64 shrink steps): Test triples are ordered failed (3 shrink steps): -(0, -1, 0) +(0, 0, -1) --- Failure -------------------------------------------------------------------- -Test triples are ordered reversely failed (64 shrink steps): +Test triples are ordered reversely failed (63 shrink steps): (0, 0, 1) @@ -502,7 +501,7 @@ Test quadruples have pair-wise different components failed (4 shrink steps): --- Failure -------------------------------------------------------------------- -Test quadruples have same components failed (126 shrink steps): +Test quadruples have same components failed (124 shrink steps): (0, 1, 0, 1) @@ -510,23 +509,23 @@ Test quadruples have same components failed (126 shrink steps): Test quadruples are ordered failed (5 shrink steps): -(0, 0, -1, 0) +(0, 0, 0, -1) --- Failure -------------------------------------------------------------------- -Test quadruples are ordered reversely failed (66 shrink steps): +Test quadruples are ordered reversely failed (126 shrink steps): (0, 0, 0, 1) --- Failure -------------------------------------------------------------------- -Test forall (a, b) in nat: a < b failed (6 shrink steps): +Test forall (a, b) in nat: a < b failed (7 shrink steps): (0, 0) --- Failure -------------------------------------------------------------------- -Test forall (a, b, c) in nat: a < b < c failed (3 shrink steps): +Test forall (a, b, c) in nat: a < b < c failed (4 shrink steps): (0, 0, 0) @@ -538,31 +537,31 @@ Test forall (a, b, c, d) in nat: a < b < c < d failed (4 shrink steps): --- Failure -------------------------------------------------------------------- -Test forall (a, b, c, d, e) in nat: a < b < c < d < e failed (5 shrink steps): +Test forall (a, b, c, d, e) in nat: a < b < c < d < e failed (4 shrink steps): (0, 0, 0, 0, 0) --- Failure -------------------------------------------------------------------- -Test forall (a, b, c, d, e, f) in nat: a < b < c < d < e < f failed (6 shrink steps): +Test forall (a, b, c, d, e, f) in nat: a < b < c < d < e < f failed (5 shrink steps): (0, 0, 0, 0, 0, 0) --- Failure -------------------------------------------------------------------- -Test forall (a, b, c, d, e, f, g) in nat: a < b < c < d < e < f < g failed (7 shrink steps): +Test forall (a, b, c, d, e, f, g) in nat: a < b < c < d < e < f < g failed (6 shrink steps): (0, 0, 0, 0, 0, 0, 0) --- Failure -------------------------------------------------------------------- -Test forall (a, b, c, d, e, f, g, h) in nat: a < b < c < d < e < f < g < h failed (8 shrink steps): +Test forall (a, b, c, d, e, f, g, h) in nat: a < b < c < d < e < f < g < h failed (6 shrink steps): (0, 0, 0, 0, 0, 0, 0, 0) --- Failure -------------------------------------------------------------------- -Test forall (a, b, c, d, e, f, g, h, i) in nat: a < b < c < d < e < f < g < h < i failed (9 shrink steps): +Test forall (a, b, c, d, e, f, g, h, i) in nat: a < b < c < d < e < f < g < h < i failed (7 shrink steps): (0, 0, 0, 0, 0, 0, 0, 0, 0) @@ -592,13 +591,13 @@ Test lists shorter than 10 failed (16 shrink steps): --- Failure -------------------------------------------------------------------- -Test lists shorter than 432 failed (412 shrink steps): +Test lists shorter than 432 failed (416 shrink steps): [...] list length: 432 --- Failure -------------------------------------------------------------------- -Test lists shorter than 4332 failed (4022 shrink steps): +Test lists shorter than 4332 failed (3962 shrink steps): [...] list length: 4332 @@ -646,21 +645,21 @@ Test sum list = 0 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int failed (122 shrink steps): +Test fail_pred_map_commute_int failed (6 shrink steps): -([0], {0 -> 1; 2 -> 0; 20 -> 0; 4 -> 0; 54 -> 0; 6 -> 0; 8 -> 0; 60 -> 0; 12 -> 0; _ -> 0}, {0 -> true; -1487654178632829215 -> false; -2792235260416531278 -> false; 2 -> false; 3324124342680534771 -> false; 20 -> false; 4 -> false; -2849913598173370635 -> false; 54 -> false; 6 -> false; 8 -> false; 815755449952469177 -> false; 4035005642433201833 -> false; -2961585594425353332 -> false; 60 -> false; 12 -> false; 3780670741311086221 -> false; _ -> false}) +([0; 1], {_ -> 0}, {1 -> true; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int32 failed (387 shrink steps): +Test fail_pred_map_commute_int32 failed (82 shrink steps): -([0l; -1l; 0l; 0l], {-3306213l -> 0l; 1197833490l -> 0l; -2892936l -> 0l; -15734l -> 0l; -64486914l -> 0l; -62572l -> 0l; -4339404l -> 0l; -1025877462l -> 0l; -16782l -> 0l; -22376l -> 0l; -30228241l -> 0l; -46196l -> 0l; -6612427l -> 0l; -333718l -> 0l; -24l -> 0l; -2847734l -> 0l; 181789747l -> 0l; 963313183l -> 0l; -1820213110l -> 0l; -1l -> 0l; -667437l -> 0l; 1616814262l -> 0l; -1488783487l -> 0l; -14685l -> 0l; 1033594061l -> 0l; -1813075019l -> 0l; -250288l -> 0l; -993818792l -> 0l; -913675600l -> 0l; -227l -> 0l; -302l -> 0l; -8391l -> 0l; -120912964l -> 0l; -98l -> 0l; -2169702l -> 0l; -84l -> 0l; -22671180l -> 0l; -606578794l -> 0l; -60456482l -> 0l; -113l -> 0l; -171965105l -> 0l; -584024936l -> 0l; -112852100l -> 0l; -7867l -> 0l; -15114120l -> 0l; -962761955l -> 0l; -1210l -> 0l; -1245883l -> 0l; -343930210l -> 0l; -489145187l -> 0l; -57745l -> 0l; -1623262736l -> 0l; -26449710l -> 0l; -257947658l -> 0l; -4425l -> 0l; -275144168l -> 0l; -151l -> 0l; -1367836616l -> 0l; -1655635269l -> 0l; -1712149989l -> 0l; -4517l -> 0l; -93858l -> 0l; -931705118l -> 0l; -605l -> 0l; -46929l -> 0l; -3l -> 0l; -911891077l -> 0l; -1827351201l -> 0l; -366858890l -> 0l; -1823782155l -> 0l; -1370513400l -> 0l; -745364094l -> 0l; -500577l -> 0l; -1423867l -> 0l; -183429445l -> 0l; -7l -> 0l; -82126l -> 0l; -5900l -> 0l; -9l -> 0l; -11801l -> 0l; 0l -> 0l; -978290374l -> 0l; 1798112767l -> 0l; -6l -> 0l; -96730371l -> 0l; 1879036781l -> 0l; -13224855l -> 0l; -662545861l -> 0l; -2420l -> 0l; -128973829l -> 0l; -2950l -> 0l; -1898489l -> 0l; -1067900l -> 0l; -1282346828l -> 0l; -49l -> 0l; -496909396l -> 0l; -70394l -> 0l; -733717781l -> 0l; -61595l -> 0l; -5785873l -> 0l; -4959320l -> 0l; -36l -> 0l; -1713141750l -> 0l; 758591303l -> 0l; -869591443l -> 0l; -4840l -> 0l; -33564l -> 0l; -41063l -> 0l; -53895l -> 0l; -3254553l -> 0l; -59670l -> 0l; -1770246475l -> 0l; -4l -> 0l; 1789163010l -> 0l; -13l -> 0l; -1214991543l -> 0l; -1798798838l -> 0l; -2581l -> 0l; -1334875l -> 0l; -3796979l -> 0l; -56l -> 0l; -5163l -> 0l; -1325091722l -> 0l; -1598932300l -> 0l; -3872l -> 0l; -711933l -> 0l; -18l -> 0l; -12587l -> 0l; -29835l -> 0l; -44753l -> 0l; -683918308l -> 0l; -30797l -> 0l; -321001529l -> 0l; -1196857039l -> 0l; -27l -> 0l; -125144l -> 0l; _ -> 0l}, {-1372162354l -> false; -884582595l -> false; 1800016173l -> false; -779904501l -> false; -2892936l -> false; -1464127158l -> false; -1371977399l -> false; -15734l -> false; -64486914l -> false; -62572l -> false; -4339404l -> false; 877561983l -> false; 414188264l -> false; -1916606788l -> false; 1740280549l -> false; -16782l -> false; -22376l -> false; 617758864l -> false; 2015488394l -> false; -329016050l -> false; 881756612l -> false; -24l -> false; 181789747l -> false; -144023482l -> false; -1l -> true; -667437l -> false; -1963309287l -> false; 728919774l -> false; -1221096930l -> false; 1321175101l -> false; 1033594061l -> false; 951284407l -> false; -1970352360l -> false; -227l -> false; -8391l -> false; -120912964l -> false; -606578794l -> false; 835378038l -> false; -1503106072l -> false; 1417286097l -> false; -584024936l -> false; -7867l -> false; -1641824566l -> false; -15114120l -> false; 1061621111l -> false; 208505287l -> false; -1210l -> false; -1245883l -> false; 337016376l -> false; -489145187l -> false; 62273772l -> false; -423060868l -> false; 216633596l -> false; -4425l -> false; 687296055l -> false; -1655635269l -> false; 1185043051l -> false; -1885981966l -> false; -93858l -> false; 341746486l -> false; 832925959l -> false; 1777069974l -> false; -605l -> false; 250831898l -> false; 1459113028l -> false; 933129766l -> false; -366858890l -> false; -1955762247l -> false; -1979393312l -> false; -2074790497l -> false; 556304992l -> false; -226378611l -> false; -1823782155l -> false; -1868760937l -> false; -500577l -> false; 38077639l -> false; -82126l -> false; -897912102l -> false; -9l -> false; 1676533150l -> false; 0l -> false; 1346850769l -> false; 1798112767l -> false; -6l -> false; 1879036781l -> false; 823827784l -> false; 2063333633l -> false; -13224855l -> false; -2420l -> false; -1759657344l -> false; -1526945920l -> false; 2145450674l -> false; 460955345l -> false; -415731479l -> false; 213874472l -> false; 849685352l -> false; -1957578108l -> false; 1205181759l -> false; -1155824913l -> false; -61595l -> false; -36l -> false; -1928421895l -> false; -4840l -> false; -33564l -> false; -1992511697l -> false; -3254553l -> false; -59670l -> false; -1024615222l -> false; -1770246475l -> false; -4l -> false; -1456428227l -> false; -13l -> false; -841267869l -> false; -1214991543l -> false; 625548763l -> false; -1798798838l -> false; 445235604l -> false; -1325091722l -> false; 1291636512l -> false; 416432296l -> false; -29835l -> false; 403241457l -> false; 199474988l -> false; -44753l -> false; -1584279822l -> false; -321001529l -> false; 340912948l -> false; -1538616721l -> false; -709900296l -> false; -3306213l -> false; 1197833490l -> false; -896768552l -> false; 657999523l -> false; 39544867l -> false; 1137798329l -> false; -1025877462l -> false; -30228241l -> false; 1726278290l -> false; -46196l -> false; -6612427l -> false; -333718l -> false; -2847734l -> false; 963313183l -> false; 606471631l -> false; -1820213110l -> false; 177710964l -> false; 1616814262l -> false; -1488783487l -> false; -14685l -> false; 1036279573l -> false; -1523442268l -> false; -1813075019l -> false; -250288l -> false; 775047850l -> false; -993818792l -> false; -913675600l -> false; -302l -> false; 1748803067l -> false; 1275416085l -> false; -98l -> false; -2169702l -> false; -1341114758l -> false; -84l -> false; -1742175178l -> false; -22671180l -> false; -26503445l -> false; -60456482l -> false; -113l -> false; -171965105l -> false; -112852100l -> false; -962761955l -> false; -343930210l -> false; -467464372l -> false; -57745l -> false; 1216723951l -> false; -1623262736l -> false; -1293530462l -> false; -26449710l -> false; -257947658l -> false; -1976623084l -> false; -275144168l -> false; -151l -> false; -1367836616l -> false; -1712149989l -> false; -4517l -> false; -931705118l -> false; -46929l -> false; -1874058468l -> false; 305281673l -> false; 646604853l -> false; -3l -> false; -911891077l -> false; -1827351201l -> false; 1480739939l -> false; 900400450l -> false; -1058357325l -> false; -1370513400l -> false; -886920683l -> false; 1996318795l -> false; -745364094l -> false; -1423867l -> false; -183429445l -> false; -7l -> false; 1550542030l -> false; -277136218l -> false; -5900l -> false; -664341267l -> false; -11801l -> false; -978290374l -> false; 2035121219l -> false; -155738355l -> false; -1043920263l -> false; -96730371l -> false; -1556572344l -> false; -662545861l -> false; 159279166l -> false; -128973829l -> false; -2950l -> false; -1898489l -> false; -82758570l -> false; 480999450l -> false; 617978198l -> false; -1067900l -> false; -1749017191l -> false; -1282346828l -> false; -49l -> false; 1147662236l -> false; -496909396l -> false; -70394l -> false; -733717781l -> false; -1434263070l -> false; -5785873l -> false; -4959320l -> false; -1460831450l -> false; -1713141750l -> false; 758591303l -> false; -1031603386l -> false; 1904716534l -> false; -869591443l -> false; -41063l -> false; -53895l -> false; 772609659l -> false; 361181180l -> false; 1789163010l -> false; 407384961l -> false; -987899689l -> false; -324827521l -> false; -2581l -> false; -1334875l -> false; 1234269183l -> false; -3796979l -> false; -56l -> false; -5163l -> false; -906342689l -> false; -1598932300l -> false; -3872l -> false; 420661032l -> false; -711933l -> false; -929215411l -> false; -18l -> false; -12587l -> false; -683918308l -> false; -240585914l -> false; -30797l -> false; -547193882l -> false; -1196857039l -> false; 1480038317l -> false; 532907932l -> false; -27l -> false; -288893568l -> false; -125144l -> false; _ -> false}) +([0l; 0l], {-1774179912l -> 0l; 0l -> 10l; -1658413248l -> 0l; -197056364l -> 0l; _ -> 0l}, {5l -> false; 10963850l -> false; 5481925l -> false; 74l -> false; 198l -> false; 674533l -> false; 189713l -> false; 212l -> false; 79063824l -> false; 23l -> false; 1944l -> false; 0l -> false; 86l -> false; 252950l -> false; 1349067l -> false; 20465853l -> false; 567l -> false; 7195026l -> false; 17542160l -> false; 2268l -> false; 6916l -> false; 124744253l -> false; 8l -> false; 10374l -> false; 49l -> false; 15593031l -> false; 11l -> false; 141l -> false; 110666l -> false; 31186063l -> false; 95l -> false; 126475l -> false; 47l -> false; 166325670l -> false; 55333l -> false; 92l -> false; 1011800l -> false; 3597513l -> false; -1658413248l -> false; 5396270l -> false; 62372126l -> false; 221767560l -> false; -197056364l -> false; 23389547l -> false; -1774179912l -> false; 2593l -> false; 332651340l -> false; 247l -> false; 505900l -> false; 283l -> false; 8222888l -> false; 21927700l -> false; 132l -> false; 2698135l -> false; 457187395l -> false; 10l -> true; 13833l -> false; 9593369l -> false; 221332l -> false; 443535120l -> false; -1990017031l -> false; 4796684l -> false; 1296l -> false; 27666l -> false; 9l -> false; 265l -> false; 99l -> false; 83162835l -> false; 11694773l -> false; 5187l -> false; 1134l -> false; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int64 failed (219 shrink steps): +Test fail_pred_map_commute_int64 failed (188 shrink steps): -([0L; 0L], {-1626777584348663391L -> 0L; -5274952442275438188L -> 0L; -1555621157876977468L -> 0L; 9108471596139219934L -> 0L; 7166876332973786910L -> 0L; 7019298611444604923L -> 0L; 3636655765360274557L -> 0L; -5299254572774104738L -> 0L; -33611074348872304L -> 0L; 1085477442822779951L -> 0L; 3550441151034303976L -> 0L; 7853829573999932795L -> 0L; 6570741223274545232L -> 0L; -9223241388095087777L -> 0L; 3145233702944072634L -> 0L; -4960186156748015984L -> 0L; 5949833029125707898L -> 0L; 8250044297663344735L -> 0L; 3926289947985597133L -> 0L; 2674458630179017557L -> 0L; 0L -> -1L; -1193494039317325605L -> 0L; -23581541164203791L -> 0L; 3262032974310066661L -> 0L; -1083726450716131347L -> 0L; 3148929065222398081L -> 0L; 34456112471805905L -> 0L; 3132053619847090208L -> 0L; 4099074157624200352L -> 0L; 4022909997771204357L -> 0L; -6581111995121167737L -> 0L; -3281956828365339039L -> 0L; 4382910041385585448L -> 0L; -5864916610580718835L -> 0L; 8584186777924536731L -> 0L; -5377162036943921244L -> 0L; 339138576765681485L -> 0L; -4861691548228816402L -> 0L; 7026031596079050131L -> 0L; 3839024356120653743L -> 0L; 2199816067032997124L -> 0L; -2789393114105475891L -> 0L; -4463380249671362201L -> 0L; -1431140827820444116L -> 0L; -6458440647188139180L -> 0L; -9103791047430776407L -> 0L; 6524619502474106000L -> 0L; -5429908502784908672L -> 0L; 7055687245367390835L -> 0L; -2349216052260771303L -> 0L; 4964388269721627631L -> 0L; -2751672235835279302L -> 0L; -2252793449446692507L -> 0L; -1091171088418411431L -> 0L; -3626926192832236521L -> 0L; 6786696509634778717L -> 0L; 6167793918440440992L -> 0L; -5290890539702059298L -> 0L; -4254817774861764540L -> 0L; -223583522706374158L -> 0L; 1105996183800211020L -> 0L; _ -> 0L}, {-1626777584348663391L -> false; -1555621157876977468L -> false; 9108471596139219934L -> false; 7732265564533085874L -> false; 7166876332973786910L -> false; 3550441151034303976L -> false; 1085477442822779951L -> false; 7853829573999932795L -> false; 3536675290503201843L -> false; -9128436253306377212L -> false; 3145233702944072634L -> false; -767017806279838012L -> false; 3926289947985597133L -> false; -6420956448021483933L -> false; 0L -> true; -23581541164203791L -> false; 3262032974310066661L -> false; 6391072603087371769L -> false; 1235568768376798224L -> false; -3909837786300313525L -> false; 34456112471805905L -> false; -6428055735629983608L -> false; 2623804087025851129L -> false; 4022909997771204357L -> false; -6581111995121167737L -> false; -6030988397309468346L -> false; -5864916610580718835L -> false; -5377162036943921244L -> false; -6495357859524114684L -> false; -1611032219521099730L -> false; 310391246715086669L -> false; 6408542658405221565L -> false; 2199816067032997124L -> false; 3839024356120653743L -> false; -4745654685023142655L -> false; 6847978435200344376L -> false; -2789393114105475891L -> false; -4463380249671362201L -> false; 3840360328563700082L -> false; -1431140827820444116L -> false; -6458440647188139180L -> false; -7765421792345238673L -> false; -4378680565567194056L -> false; -2349216052260771303L -> false; -2727353340127719681L -> false; 103321857428247527L -> false; -2252793449446692507L -> false; 6786696509634778717L -> false; -5290890539702059298L -> false; -264972637768065869L -> false; -4254817774861764540L -> false; 844666124734041018L -> false; 1105996183800211020L -> false; 4619286360921092268L -> false; -5274952442275438188L -> false; -6795560563734300894L -> false; 7019298611444604923L -> false; 3636655765360274557L -> false; 6165875408190569670L -> false; -5299254572774104738L -> false; -33611074348872304L -> false; 6570741223274545232L -> false; 3192165204308451046L -> false; -7819072410914830782L -> false; -9223241388095087777L -> false; -1424296199548586816L -> false; 6480341267797276322L -> false; -2341802166847999862L -> false; -4960186156748015984L -> false; 5949833029125707898L -> false; 8250044297663344735L -> false; 5214084478326154921L -> false; -1751416471876264704L -> false; 1281239262848334764L -> false; 2674458630179017557L -> false; 7080697169726960547L -> false; -1193494039317325605L -> false; 1924277706246431661L -> false; -4572301776388457843L -> false; -1775944920399996443L -> false; -1476499248608534591L -> false; -1083726450716131347L -> false; 3148929065222398081L -> false; 5135918803737217981L -> false; 3132053619847090208L -> false; -8795479186954029747L -> false; 4099074157624200352L -> false; -1725358293392483925L -> false; -883157324790385183L -> false; -3281956828365339039L -> false; 4382910041385585448L -> false; 7959678776239405401L -> false; 8584186777924536731L -> false; 6156908854039039331L -> false; 770656223494446708L -> false; 339138576765681485L -> false; 5155757567267116618L -> false; -4861691548228816402L -> false; -5029806468813998902L -> false; -5916595597725606869L -> false; -4925674386326338647L -> false; 8028367910303937204L -> false; 7026031596079050131L -> false; -5014191838822778121L -> false; -5381171409130864747L -> false; 8555424481824659787L -> false; 5886333856077963766L -> false; 3049517074836180120L -> false; -9103791047430776407L -> false; 6524619502474106000L -> false; -482660119496121524L -> false; -5429908502784908672L -> false; 7055687245367390835L -> false; 4964388269721627631L -> false; -2751672235835279302L -> false; -3626926192832236521L -> false; -1091171088418411431L -> false; 6167793918440440992L -> false; -1881974088854145838L -> false; 2212053705486708444L -> false; -223583522706374158L -> false; _ -> false}) +([0L; 0L], {-846350636327884360L -> 0L; -7122830660870113674L -> 0L; 0L -> 2L; -5852418530639587665L -> 0L; _ -> 0L}, {165975431736793371L -> false; 988622509L -> false; 359L -> false; 1019310L -> false; 2684127201758L -> false; 404L -> false; 1258954385914640095L -> false; 534L -> false; 1937L -> false; 145228502769694200L -> false; 134L -> false; 209413047969606L -> false; 1963604910111969040L -> false; 536L -> false; 134680508L -> false; 1318163345L -> false; 85701540674L -> false; 1L -> false; 1006547700659L -> false; 69512520L -> false; 213301612346L -> false; 13615172134658831L -> false; 2421L -> false; 13717L -> false; 16308967L -> false; 193638003692925600L -> false; 3562926213990806743L -> false; 1095L -> false; 111487L -> false; 975093085013L -> false; 4026190802637L -> false; 2233739178342464L -> false; 6714423391544747172L -> false; 505L -> false; 413094407878241280L -> false; 31355L -> false; 139608698646404L -> false; 339576540681650169L -> false; -7122830660870113674L -> false; 8L -> false; 67L -> false; 8154483L -> false; 3357211695772373586L -> false; 13778L -> false; 3444L -> false; 764483L -> false; 2583L -> false; 16L -> false; 3124535337L -> false; 4476282261029831448L -> false; 719L -> false; 62711L -> false; 1482933764L -> false; 1116869589171232L -> false; 2863069015209L -> false; 1678605847886186793L -> false; 472107894717990035L -> false; 228537441799L -> false; 314738596478660023L -> false; 1977245018L -> false; 1291L -> false; 7348L -> false; 1509821550989L -> false; 5726138030418L -> false; 821L -> false; 2517908771829280190L -> false; 2L -> true; 279217397292808L -> false; 4077241L -> false; 45809104243350L -> false; 14697L -> false; 108921377077270650L -> false; 139025040L -> false; 539L -> false; 15677L -> false; 5010370776616L -> false; 27230344269317662L -> false; 236053947358995017L -> false; 7838L -> false; 114268720899L -> false; 72614251384847100L -> false; 222974L -> false; 33670127L -> false; 26176630996200L -> false; 54460688538635325L -> false; 442601151298115657L -> false; 629477192957320047L -> false; 221300575649057828L -> false; 2190L -> false; 6889L -> false; 4294603522814L -> false; 1877L -> false; 1950186170027L -> false; 96819001846462800L -> false; 5368254403517L -> false; 556100162L -> false; 4467478356684928L -> false; 104706523984803L -> false; 5105689550497061L -> false; 1722L -> false; 558434794585616L -> false; 2552844775248530L -> false; 2013095401318L -> false; 0L -> false; 15782871L -> false; 8417531L -> false; 2038620L -> false; 22904552121675L -> false; 8952564522059662897L -> false; 522L -> false; 52353261992401L -> false; 121646910L -> false; 4686803006L -> false; 99985130786L -> false; 83615L -> false; 509655L -> false; 3515102255L -> false; 33L -> false; 269L -> false; 1757551127L -> false; 1887276938736L -> false; 547L -> false; 278050081L -> false; 3L -> false; 49992565393L -> false; -5852418530639587665L -> false; 6L -> false; 12859L -> false; 2502L -> false; 67340254L -> false; 741466882L -> false; 487546542506L -> false; 12626297L -> false; 12498141348L -> false; 1761458476154L -> false; 11452276060837L -> false; 471L -> false; 104268780L -> false; 182829953439L -> false; 2260L -> false; 3829267162872795L -> false; 39264946494300L -> false; 2343401503L -> false; 243773271253L -> false; 268L -> false; 530L -> false; 11757L -> false; 891897L -> false; 2636326691L -> false; 24996282696L -> false; -846350636327884360L -> false; 110650287824528914L -> false; 354080921038492526L -> false; 167231L -> false; 14730680L -> false; 41807L -> false; 10211379100994123L -> false; 57134360449L -> false; 20422758201988247L -> false; 16835063L -> false; 370733441L -> false; 445948L -> false; 130335975L -> false; 6249070674L -> false; 1251L -> false; 11022L -> false; 12L -> false; 479L -> false; 958L -> false; 121886635626L -> false; _ -> false}) --- Failure -------------------------------------------------------------------- @@ -670,9 +669,9 @@ Test fail_pred_strings failed (2 shrink steps): --- Failure -------------------------------------------------------------------- -Test fold_left fold_right failed (56 shrink steps): +Test fold_left fold_right failed (169 shrink steps): -(0, [1], {(1, 0) -> 1; (8, 0) -> 0; (6, 4) -> 0; (2, 6) -> 0; (3, 6) -> 0; (2, 16) -> 0; (0, 60) -> 0; (20, 3) -> 0; (12, 60) -> 0; (0, 2) -> 0; (2, 4) -> 0; (1, 6) -> 0; (6, 1) -> 0; (60, 83) -> 0; (3, 5) -> 0; (7, 12) -> 0; (6, 8) -> 0; (2, 2) -> 0; (56, 6) -> 0; (6, 5) -> 0; (12, 3) -> 0; (6, 6) -> 0; (0, 8) -> 0; (0, 58) -> 0; (5, 5) -> 0; (20, 2) -> 0; (54, 0) -> 0; (0, 6) -> 0; (4, 6) -> 0; (4, 56) -> 0; (5, 54) -> 0; (9, 8) -> 0; (8, 6) -> 0; (60, 47) -> 0; (9, 12) -> 0; (4, 20) -> 0; (0, 20) -> 0; (1, 2) -> 0; (28, 2) -> 0; (4, 1) -> 0; (0, 4) -> 0; (8, 3) -> 0; (4, 28) -> 0; (42, 8) -> 0; (6, 0) -> 0; (58, 65) -> 0; (12, 12) -> 0; (5, 6) -> 0; _ -> 0}) +(0, [1], {(83, 0) -> 0; (63, 7) -> 0; (86, 93) -> 0; (3, 4) -> 0; (30, 24) -> 0; (77, 9) -> 0; (37, 7) -> 0; (6, 25) -> 0; (2, 99) -> 0; (0, 11) -> 0; (6, 9) -> 0; (4, 96) -> 0; (9, 39) -> 0; (9, 4) -> 0; (6, 8) -> 0; (9, 9) -> 0; (2, 2) -> 0; (4, 19) -> 0; (5, 26) -> 0; (5, 53) -> 0; (4, 0) -> 0; (7, 1) -> 0; (7, 8) -> 0; (4, 86) -> 0; (0, 0) -> 0; (11, 56) -> 0; (77, 4) -> 0; (27, 4) -> 0; (77, 86) -> 0; (7, 4) -> 0; (84, 7) -> 0; (47, 0) -> 0; (4, 7) -> 0; (2, 7) -> 0; (3, 84) -> 0; (77, 89) -> 0; (9, 25) -> 0; (4, 44) -> 0; (9, 3) -> 0; (6, 3) -> 0; (4, 3) -> 0; (9, 6) -> 0; (4, 1) -> 0; (2, 3) -> 0; (75, 4) -> 0; (96, 1) -> 0; (7, 2) -> 0; (25, 52) -> 0; (3, 3) -> 0; (5, 6) -> 0; (1, 3) -> 0; (46, 0) -> 0; (43, 5) -> 0; (5, 65) -> 0; (6, 4) -> 0; (3, 70) -> 0; (4, 5) -> 0; (7, 0) -> 0; (9, 7) -> 0; (2, 8) -> 0; (3, 5) -> 0; (1, 4) -> 0; (6, 5) -> 0; (53, 75) -> 0; (3, 90) -> 0; (89, 2) -> 0; (81, 0) -> 0; (4, 80) -> 0; (4, 94) -> 0; (89, 9) -> 0; (4, 6) -> 0; (63, 9) -> 0; (3, 24) -> 0; (94, 8) -> 0; (2, 0) -> 0; (9, 87) -> 0; (33, 0) -> 0; (0, 99) -> 0; (5, 2) -> 0; (8, 4) -> 0; (8, 23) -> 0; (8, 3) -> 0; (0, 4) -> 0; (0, 9) -> 0; (86, 1) -> 0; (9, 43) -> 0; (0, 94) -> 0; (0, 7) -> 0; (8, 2) -> 0; (1, 5) -> 0; (78, 3) -> 0; (57, 3) -> 0; (24, 8) -> 0; (1, 0) -> 1; (8, 8) -> 0; (7, 3) -> 0; (3, 48) -> 0; (44, 0) -> 0; (5, 1) -> 0; (93, 89) -> 0; (2, 4) -> 0; (19, 4) -> 0; (2, 47) -> 0; (1, 89) -> 0; (48, 2) -> 0; (6, 19) -> 0; (4, 47) -> 0; (6, 6) -> 0; (3, 7) -> 0; (0, 3) -> 0; (8, 1) -> 0; (0, 8) -> 0; (8, 47) -> 0; (0, 6) -> 0; (8, 77) -> 0; (6, 2) -> 0; (4, 75) -> 0; (20, 7) -> 0; (4, 83) -> 0; (78, 2) -> 0; (5, 9) -> 0; (65, 3) -> 0; (65, 84) -> 0; (96, 9) -> 0; (1, 8) -> 0; (99, 90) -> 0; (6, 7) -> 0; (39, 7) -> 0; (1, 96) -> 0; (26, 83) -> 0; (23, 6) -> 0; (9, 44) -> 0; (5, 44) -> 0; (8, 0) -> 0; (2, 6) -> 0; (3, 6) -> 0; (52, 3) -> 0; (5, 0) -> 0; (4, 52) -> 0; (0, 2) -> 0; (6, 1) -> 0; (2, 1) -> 0; (9, 0) -> 0; (0, 5) -> 0; (3, 23) -> 0; (4, 2) -> 0; (64, 7) -> 0; (8, 48) -> 0; (66, 5) -> 0; (9, 1) -> 0; (7, 9) -> 0; (2, 26) -> 0; (3, 93) -> 0; (3, 0) -> 0; (19, 9) -> 0; (88, 84) -> 0; (7, 7) -> 0; (75, 5) -> 0; (3, 9) -> 0; (47, 77) -> 0; (39, 9) -> 0; (87, 0) -> 0; (9, 47) -> 0; (9, 8) -> 0; (7, 6) -> 0; (3, 34) -> 0; (83, 20) -> 0; (4, 8) -> 0; (5, 4) -> 0; (5, 7) -> 0; (6, 0) -> 0; (1, 25) -> 0; (3, 1) -> 0; _ -> 0}) +++ Messages ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -683,21 +682,21 @@ l=[1], fold_left=1, fold_right=0 --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried failed (376 shrink steps): +Test fold_left fold_right uncurried failed (701 shrink steps): -({(0, 2) -> 0; (13, 0) -> 0; (22, 3) -> 0; (20, 5) -> 0; (2, 93) -> 0; (65, 34) -> 0; (2, 7) -> 0; (0, 7) -> 0; (49, 3) -> 0; (8, 62) -> 0; (8, 2) -> 0; (54, 6) -> 0; (38, 4) -> 0; (7, 0) -> 1; (6, 25) -> 0; (0, 0) -> 0; (3, 4) -> 0; (1, 7) -> 0; (4, 6) -> 0; (8, 1) -> 0; (48, 42) -> 0; (18, 1) -> 0; (90, 14) -> 0; (8, 70) -> 0; (9, 1) -> 0; (38, 2) -> 0; (3, 5) -> 0; (8, 8) -> 0; (9, 3) -> 0; (2, 36) -> 0; (45, 2) -> 0; (18, 6) -> 0; (7, 98) -> 0; (3, 9) -> 0; (2, 31) -> 0; (86, 2) -> 0; (4, 7) -> 0; (1, 1) -> 0; (0, 5) -> 0; (2, 9) -> 0; (1, 5) -> 0; (44, 0) -> 0; (77, 7) -> 0; (5, 8) -> 0; (1, 4) -> 0; (9, 79) -> 0; (48, 1) -> 0; (30, 7) -> 0; (6, 79) -> 0; (5, 1) -> 0; (65, 4) -> 0; (2, 1) -> 0; (4, 1) -> 0; (66, 12) -> 0; (6, 5) -> 0; (7, 3) -> 0; (3, 7) -> 0; (9, 7) -> 0; (9, 9) -> 0; (2, 6) -> 0; (3, 15) -> 0; (5, 3) -> 0; (67, 1) -> 0; (3, 28) -> 0; (1, 87) -> 0; (7, 31) -> 0; (9, 13) -> 0; (32, 1) -> 0; (0, 27) -> 0; (6, 15) -> 0; (20, 0) -> 0; (6, 8) -> 0; (1, 6) -> 0; (0, 6) -> 0; (3, 1) -> 0; (9, 71) -> 0; (95, 4) -> 0; (97, 1) -> 0; (7, 4) -> 0; (84, 3) -> 0; (92, 6) -> 0; (6, 2) -> 0; (8, 4) -> 0; (5, 0) -> 0; (7, 5) -> 0; (9, 8) -> 0; (90, 26) -> 0; (0, 19) -> 0; (1, 13) -> 0; (6, 1) -> 0; (9, 28) -> 0; (9, 6) -> 0; (8, 6) -> 0; (3, 8) -> 0; (7, 62) -> 0; (86, 0) -> 0; (65, 1) -> 0; (7, 1) -> 0; (6, 6) -> 0; (30, 4) -> 0; (7, 67) -> 0; (0, 9) -> 0; (78, 5) -> 0; (17, 3) -> 0; (9, 60) -> 0; (3, 71) -> 0; (88, 1) -> 0; (4, 61) -> 0; (9, 0) -> 0; (45, 0) -> 0; (2, 5) -> 0; (9, 47) -> 0; (18, 5) -> 0; (66, 0) -> 0; (0, 76) -> 0; (8, 3) -> 0; (74, 6) -> 0; (5, 60) -> 0; (5, 80) -> 0; (8, 9) -> 0; (7, 8) -> 0; (39, 4) -> 0; (72, 8) -> 0; (4, 38) -> 0; (70, 31) -> 0; (19, 5) -> 0; (4, 9) -> 0; (0, 1) -> 0; (1, 37) -> 0; (7, 6) -> 0; (6, 3) -> 0; (9, 5) -> 0; (58, 4) -> 0; (54, 5) -> 0; (7, 86) -> 0; (67, 6) -> 0; (0, 8) -> 0; (8, 7) -> 0; (44, 18) -> 0; (3, 0) -> 0; (4, 41) -> 0; (0, 31) -> 0; (1, 51) -> 0; (6, 0) -> 0; (1, 3) -> 0; (70, 1) -> 0; (9, 4) -> 0; (4, 5) -> 0; (1, 8) -> 0; (5, 9) -> 0; (0, 14) -> 0; (3, 3) -> 0; (4, 0) -> 0; (78, 9) -> 0; (0, 4) -> 0; (2, 3) -> 0; (9, 62) -> 0; (35, 1) -> 0; (55, 1) -> 0; _ -> 0}, 0, [7; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0]) +({(5, 4) -> 0; (9, 6) -> 0; (37, 2) -> 0; (3, 8) -> 0; (84, 2) -> 0; (3, 7) -> 0; (2, 43) -> 0; (2, 7) -> 0; (1, 5) -> 0; (67, 9) -> 0; (5, 8) -> 0; (5, 0) -> 1; (4, 9) -> 0; (1, 3) -> 0; (3, 5) -> 0; (1, 9) -> 0; _ -> 0}, 0, [5; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0]) --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried fun last failed (56 shrink steps): +Test fold_left fold_right uncurried fun last failed (34 shrink steps): -(0, [1], {(0, 2) -> 0; (3, 6) -> 0; (0, 20) -> 0; (20, 4) -> 0; (6, 42) -> 0; (47, 6) -> 0; (6, 12) -> 0; (2, 6) -> 0; (0, 58) -> 0; (8, 2) -> 0; (6, 6) -> 0; (8, 60) -> 0; (12, 3) -> 0; (6, 4) -> 0; (16, 8) -> 0; (6, 0) -> 0; (3, 4) -> 0; (12, 0) -> 0; (60, 5) -> 0; (8, 1) -> 0; (6, 8) -> 0; (2, 5) -> 0; (2, 42) -> 0; (5, 4) -> 0; (4, 20) -> 0; (54, 0) -> 0; (12, 4) -> 0; (3, 2) -> 0; (8, 0) -> 0; (4, 7) -> 0; (28, 3) -> 0; (2, 9) -> 0; (65, 54) -> 0; (5, 28) -> 0; (20, 2) -> 0; (6, 2) -> 0; (83, 6) -> 0; (58, 5) -> 0; (5, 6) -> 0; (56, 12) -> 0; (1, 60) -> 0; (4, 9) -> 0; (0, 1) -> 1; (2, 8) -> 0; (2, 0) -> 0; (6, 1) -> 0; (1, 12) -> 0; (60, 0) -> 0; _ -> 0}) +(0, [1], {(3, 9) -> 0; (20, 4) -> 0; (9, 3) -> 0; (4, 48) -> 0; (8, 5) -> 0; (9, 24) -> 0; (47, 7) -> 0; (2, 99) -> 0; (6, 84) -> 0; (6, 6) -> 0; (7, 89) -> 0; (1, 0) -> 1; (47, 2) -> 0; (26, 94) -> 0; (0, 19) -> 0; (90, 5) -> 0; (9, 0) -> 0; (9, 4) -> 0; (2, 5) -> 0; (70, 7) -> 0; (1, 9) -> 0; _ -> 0}) --- Failure -------------------------------------------------------------------- -Test fold_left test, fun first failed (15 shrink steps): +Test fold_left test, fun first failed (108 shrink steps): -({_ -> ""}, "a", [], [0]) +({("h", 3) -> ""; ("Ph\228", 4) -> ""; ("\164~\190\161\005Be2", 3) -> ""; ("T", 4) -> ""; ("\207\244\171\128\185w\173\190\239F5{\147\191\157nQ\132T\252\253|\028(Hf\1373?\181U\137\241\019-\155u\252\243\t\206`\133\140", 89) -> ""; ("\153\247\255", 2) -> ""; ("\240`\139\219Q1\218\240$\024\176\166\0122:-Z\198\184cm\189\186xQ\143\128R\"\235\238TqA\158\224&\151y\209\180=\027\204D\188\171~\226r\253\153\249\163\"E\252\001\020y(\182A\146JE\1457\201\169\012\253\002\193;\166ze\245%\246\143\2338\161\005\161]F\153^T", 7) -> ""; ("\016S\203'a\195X\131\152", 0) -> ""; ("\243u\163\147\135", 8) -> ""; ("1n3\198\148\183\160", 1) -> ""; ("\236\255", 8) -> ""; ("\139}%\161!d\131\167)\0244=\157\130\239]\029i\178\238$*\173V\245\176\023\234\202\150\022\242\170\252l@\216\136\173\228O", 5) -> ""; ("\131\011x$\127\0261u\147j", 4) -> ""; ("\237)\173\152w\006\133\205n\026\157\216c\007\198\239\255\247", 3) -> ""; ("An\177E\018\164\215\143\136\164\215\214\nJ\212\020\180\208\031}\140\023E\245\171o\255\203\195O\204U\227BF\187\174\233\239NMu \198\011\175\136(\160(\2511\007;\022\253\216\173\026\224\242\148\238c\230\n~\180:\175a\241O-7\141\197", 4) -> ""; ("\140", 7) -> ""; ("", 5) -> "a"; ("\014\1333\194\"\220\222\252X\196hA\185\156\197\177\160\197\247K\224N\203U\172\007\148\209O,%($i\027\015\2002`", 1) -> ""; ("\167\162\212\012\145z", 2) -> ""; ("\002\241\197\142\177\162", 8) -> ""; ("/\197p\004L", 9) -> ""; ("'\214\194w#\194\189\207\210", 75) -> ""; ("\216n\128$\161f\233\226", 4) -> ""; ("u).(\174\135f\214!JG\182\252(\249E\218^f\022\250\174zm-\225\203\130Y\250\218\179j\162\180\214\189\027\024\169>Y\219\152\155\234;\2363\200\176\139\031\020/\152\012\b\191\011\153O\129\168\234\016~\175G\016\234\015\169M\169", 9) -> ""; ("w\128n", 5) -> ""; ("", 0) -> ""; ("\022\188\139?", 48) -> ""; ("\219'\188", 4) -> ""; ("", 83) -> ""; ("", 6) -> ""; ("36", 5) -> ""; ("\152\224$\234*J\244\018\181\146\171\"\138H\158\131E\r\014\236\240\024\226\147\214\000\227\022:\157N\197\171\228\250V\145a\204\189:\023\141\182y\144\229/r\200m\b!\137WX\246\017\250f\244I\214K\131\170z+\167d@\131/\166\163s\148\221\199M\224Z\012R\014", 2) -> ""; ("\136\227\237\148\181\138\017]\169\230\187w9d\201\152\019\173`\170\1837(\240\240\168\253L\208\156={\167`\023\214B\142R\142a\176\204F\173\161\214vs\1614<a\206\203~\156\242\216\128\031C\200TD\208Rf\b\"\014\128R4\232[\205\253_iR\021\128(", 23) -> ""; ("\t\132\164\254\016", 84) -> ""; ("\029", 7) -> ""; (",P", 6) -> ""; ("\016{\250\014>m\175m\204X^\137P#UZ<\215\244\028\249\226,`\018\172\193\144\235\183\150\179\133\134e\205\016", 0) -> ""; ("\163+Y\133\129\219\b\168\162]\217|$V", 19) -> ""; ("", 4) -> ""; ("", 9) -> ""; ("\2387\030Ay\" x\219\172\241\178\202\174\232\228\162\239\234\147\021T}\236\136k!\196\195\028a\019\029\188", 94) -> ""; ("\219'\188", 3) -> ""; ("\140\194\177", 5) -> ""; (" kH\148a\135\179#\255\220\139\000BW\234\228&N\199\175m}\167S\242\183\030\172\158\194\027\145\183d5k\127\"\164\024\162#\182n\252\027_V\"^j\020\019\197=\027#`H\004Y\216\197\162@\193v\204~\146\004\204p\149\022s\153\011\176\006\026o\198\169\143U\166\215\201xy\208", 4) -> ""; ("\169", 99) -> ""; ("", 24) -> ""; ("\198\168", 7) -> "a"; ("@\197\242l\146\175\130\216\1692z\178tSW\252'\249j$\195\202\014/Iw\166\020\186cr\":\224n\242c\187\141\023", 3) -> ""; ("\020\215\157", 3) -> ""; _ -> ""}, "", [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0], [5]) --- Failure -------------------------------------------------------------------- @@ -782,21 +781,21 @@ stats char code: +++ Stats for tree's depth ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats depth: - num: 1000, avg: 3.74, stddev: 3.28, median 3, min 1, max 15 - 1: ####################################################### 377 - 2: ################ 113 - 3: ############ 87 - 4: ################# 123 - 5: ########### 81 - 6: #### 33 - 7: ##### 40 - 8: ##### 39 - 9: # 9 - 10: ### 25 - 11: ####### 49 - 12: 4 - 13: # 9 - 14: # 7 + num: 1000, avg: 3.92, stddev: 3.36, median 3, min 1, max 15 + 1: ####################################################### 364 + 2: ############## 96 + 3: ############ 83 + 4: ##################### 145 + 5: ########## 71 + 6: ##### 34 + 7: ###### 44 + 8: ####### 49 + 9: # 11 + 10: ### 24 + 11: ######## 54 + 12: 3 + 13: 6 + 14: # 12 15: 4 +++ Stats for bytes_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -1024,203 +1023,203 @@ stats len: +++ Stats for pair dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats pair sum: - num: 500000, avg: 100.02, stddev: 41.22, median 100, min 0, max 200 - 0.. 9: ### 2685 - 10.. 19: ######## 7622 - 20.. 29: ############## 12474 - 30.. 39: #################### 17330 - 40.. 49: ########################## 22263 - 50.. 59: ############################### 26982 - 60.. 69: ##################################### 32182 - 70.. 79: ########################################### 37125 - 80.. 89: ################################################# 42287 - 90.. 99: ###################################################### 46691 - 100..109: ####################################################### 46977 - 110..119: ################################################# 42444 - 120..129: ############################################ 37719 - 130..139: ###################################### 32595 - 140..149: ################################ 27588 - 150..159: ########################## 22792 - 160..169: #################### 17805 - 170..179: ############### 13068 - 180..189: ######### 8218 - 190..199: ### 3115 - 200..209: 38 + num: 500000, avg: 99.97, stddev: 41.23, median 100, min 0, max 200 + 0.. 9: ### 2732 + 10.. 19: ######## 7470 + 20.. 29: ############## 12606 + 30.. 39: #################### 17281 + 40.. 49: ######################### 22161 + 50.. 59: ################################ 27693 + 60.. 69: ##################################### 32264 + 70.. 79: ########################################### 37078 + 80.. 89: ################################################ 41933 + 90.. 99: ##################################################### 46178 + 100..109: ####################################################### 47368 + 110..119: ################################################# 42440 + 120..129: ########################################### 37526 + 130..139: ##################################### 32630 + 140..149: ############################### 27558 + 150..159: ########################## 22873 + 160..169: #################### 17956 + 170..179: ############### 13095 + 180..189: ######### 7957 + 190..199: ### 3157 + 200..209: 44 +++ Stats for triple dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats triple sum: - num: 500000, avg: 150.08, stddev: 50.51, median 150, min 0, max 299 - 0.. 14: 345 - 15.. 29: ## 2121 - 30.. 44: ##### 5372 - 45.. 59: ########## 10501 - 60.. 74: ################# 17031 - 75.. 89: ######################### 25417 - 90..104: ################################### 35148 - 105..119: ############################################# 45134 - 120..134: ################################################### 51751 - 135..149: ####################################################### 55090 - 150..164: ###################################################### 55074 - 165..179: #################################################### 52238 - 180..194: ############################################# 45651 - 195..209: ################################### 35994 - 210..224: ######################### 26039 - 225..239: ################# 17749 - 240..254: ########## 10870 - 255..269: ##### 5765 - 270..284: ## 2313 - 285..299: 397 + num: 500000, avg: 150.03, stddev: 50.48, median 150, min 0, max 299 + 0.. 14: 313 + 15.. 29: ## 2122 + 30.. 44: ##### 5446 + 45.. 59: ########## 10500 + 60.. 74: ################ 17013 + 75.. 89: ######################### 25666 + 90..104: ################################### 35268 + 105..119: ############################################# 45180 + 120..134: ################################################### 51212 + 135..149: ###################################################### 55048 + 150..164: ####################################################### 55217 + 165..179: ################################################### 52179 + 180..194: ############################################# 45446 + 195..209: #################################### 36527 + 210..224: ######################### 26036 + 225..239: ################# 17655 + 240..254: ########## 10770 + 255..269: ##### 5786 + 270..284: ## 2253 + 285..299: 363 +++ Stats for quad dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats quad sum: - num: 500000, avg: 200.13, stddev: 58.33, median 200, min 5, max 394 - 5.. 24: 102 - 25.. 44: 842 - 45.. 64: ## 3023 - 65.. 84: ###### 7154 - 85..104: ############ 14368 - 105..124: ##################### 25397 - 125..144: ############################### 37547 - 145..164: ########################################## 50174 - 165..184: ################################################## 60558 - 185..204: ####################################################### 65376 - 205..224: ##################################################### 63687 - 225..244: ############################################### 56248 - 245..264: ###################################### 45384 - 265..284: ########################## 31780 - 285..304: ################ 20158 - 305..324: ######### 10899 - 325..344: #### 5045 - 345..364: # 1848 - 365..384: 386 - 385..404: 24 + num: 500000, avg: 200.05, stddev: 58.23, median 200, min 1, max 395 + 1.. 20: 56 + 21.. 40: 613 + 41.. 60: # 2355 + 61.. 80: ##### 6151 + 81..100: ########## 12762 + 101..120: ################### 22881 + 121..140: ############################# 35023 + 141..160: ######################################## 48107 + 161..180: ################################################# 58482 + 181..200: ###################################################### 64916 + 201..220: ####################################################### 65035 + 221..240: ################################################# 58235 + 241..260: ####################################### 47099 + 261..280: ############################# 34772 + 281..300: ################## 22400 + 301..320: ########## 12463 + 321..340: #### 5856 + 341..360: # 2260 + 361..380: 501 + 381..400: 33 +++ Stats for bind dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats ordered pair difference: - num: 1000000, avg: 25.02, stddev: 22.36, median 19, min 0, max 100 - 0.. 4: ####################################################### 193184 - 5.. 9: ##################################### 130024 - 10.. 14: ############################# 103828 - 15.. 19: ######################## 87496 - 20.. 24: ##################### 74431 - 25.. 29: ################## 64629 - 30.. 34: ################ 56663 - 35.. 39: ############# 48986 - 40.. 44: ############ 43424 - 45.. 49: ########## 37599 - 50.. 54: ######### 32787 - 55.. 59: ######## 28332 - 60.. 64: ###### 24023 - 65.. 69: ##### 20312 - 70.. 74: #### 16649 - 75.. 79: ### 13338 - 80.. 84: ## 10239 - 85.. 89: ## 7391 - 90.. 94: # 4548 - 95.. 99: 2015 - 100..104: 102 + num: 1000000, avg: 24.99, stddev: 22.33, median 19, min 0, max 100 + 0.. 4: ####################################################### 193839 + 5.. 9: #################################### 129347 + 10.. 14: ############################# 103847 + 15.. 19: ######################## 87031 + 20.. 24: ##################### 75338 + 25.. 29: ################## 64783 + 30.. 34: ################ 56422 + 35.. 39: ############## 49351 + 40.. 44: ############ 43140 + 45.. 49: ########## 38109 + 50.. 54: ######### 32501 + 55.. 59: ####### 28129 + 60.. 64: ###### 24178 + 65.. 69: ##### 20069 + 70.. 74: #### 16578 + 75.. 79: ### 13204 + 80.. 84: ## 10269 + 85.. 89: ## 7232 + 90.. 94: # 4471 + 95.. 99: 2047 + 100..104: 115 stats ordered pair sum: - num: 1000000, avg: 75.12, stddev: 46.93, median 72, min 0, max 200 - 0.. 9: ####################################################### 70423 - 10.. 19: ##################################################### 68068 - 20.. 29: ##################################################### 68449 - 30.. 39: ##################################################### 68577 - 40.. 49: ##################################################### 68763 - 50.. 59: ##################################################### 68351 - 60.. 69: ##################################################### 68744 - 70.. 79: ##################################################### 68451 - 80.. 89: ##################################################### 68309 - 90.. 99: ##################################################### 68835 - 100..109: ################################################## 64544 - 110..119: ########################################### 55512 - 120..129: ##################################### 47595 - 130..139: ############################### 39809 - 140..149: ######################### 32677 - 150..159: #################### 26312 - 160..169: ############### 20180 - 170..179: ########### 14265 - 180..189: ###### 8625 - 190..199: ## 3433 - 200..209: 78 + num: 1000000, avg: 75.00, stddev: 46.92, median 72, min 0, max 200 + 0.. 9: ####################################################### 70575 + 10.. 19: ##################################################### 68853 + 20.. 29: ##################################################### 68585 + 30.. 39: ##################################################### 68532 + 40.. 49: ##################################################### 68240 + 50.. 59: ##################################################### 68715 + 60.. 69: ##################################################### 68990 + 70.. 79: ##################################################### 68722 + 80.. 89: ##################################################### 68480 + 90.. 99: ##################################################### 68372 + 100..109: ################################################## 64287 + 110..119: ########################################### 55514 + 120..129: #################################### 47048 + 130..139: ############################### 39962 + 140..149: ######################### 32688 + 150..159: #################### 26183 + 160..169: ############### 19821 + 170..179: ########## 14077 + 180..189: ###### 8713 + 190..199: ## 3560 + 200..209: 83 +++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Collect results for test option dist: -None : 1500 cases -Some _: 8500 cases +None : 1489 cases +Some _: 8511 cases +++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Collect results for test result dist: -Error _: 2554 cases -Ok _ : 7446 cases +Error _: 2523 cases +Ok _ : 7477 cases +++ Stats for list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 400.16, stddev: 1371.90, median 9, min 0, max 9987 - 0.. 499: ####################################################### 4246 - 500.. 999: ###### 502 - 1000.. 1499: 13 - 1500.. 1999: 10 - 2000.. 2499: 14 - 2500.. 2999: 14 - 3000.. 3499: 20 - 3500.. 3999: 7 - 4000.. 4499: 13 - 4500.. 4999: 16 - 5000.. 5499: 12 - 5500.. 5999: 15 - 6000.. 6499: 15 - 6500.. 6999: 13 - 7000.. 7499: 16 - 7500.. 7999: 12 - 8000.. 8499: 11 - 8500.. 8999: 16 - 9000.. 9499: 15 - 9500.. 9999: 20 + num: 5000, avg: 361.42, stddev: 1230.75, median 9, min 0, max 9974 + 0.. 498: ####################################################### 4212 + 499.. 997: ####### 578 + 998..1496: 11 + 1497..1995: 15 + 1996..2494: 11 + 2495..2993: 10 + 2994..3492: 13 + 3493..3991: 12 + 3992..4490: 7 + 4491..4989: 8 + 4990..5488: 15 + 5489..5987: 14 + 5988..6486: 12 + 6487..6985: 8 + 6986..7484: 9 + 7485..7983: 19 + 7984..8482: 14 + 8483..8981: 11 + 8982..9480: 11 + 9481..9979: 10 +++ Stats for small_list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 16.14, stddev: 24.86, median 6, min 0, max 99 - 0.. 4: ###################################################### 1923 - 5.. 9: ####################################################### 1936 - 10.. 14: # 61 - 15.. 19: # 59 - 20.. 24: # 62 - 25.. 29: # 70 + num: 5000, avg: 15.79, stddev: 24.64, median 6, min 0, max 99 + 0.. 4: ###################################################### 1930 + 5.. 9: ####################################################### 1957 + 10.. 14: # 59 + 15.. 19: # 66 + 20.. 24: # 61 + 25.. 29: # 52 30.. 34: # 61 - 35.. 39: # 64 - 40.. 44: # 64 - 45.. 49: # 56 - 50.. 54: # 65 - 55.. 59: # 55 - 60.. 64: # 60 - 65.. 69: # 62 - 70.. 74: # 57 - 75.. 79: # 69 - 80.. 84: ## 73 - 85.. 89: # 67 - 90.. 94: # 62 - 95.. 99: ## 74 + 35.. 39: # 65 + 40.. 44: # 62 + 45.. 49: # 64 + 50.. 54: # 70 + 55.. 59: # 63 + 60.. 64: # 50 + 65.. 69: # 51 + 70.. 74: # 52 + 75.. 79: # 63 + 80.. 84: # 56 + 85.. 89: ## 75 + 90.. 94: ## 73 + 95.. 99: # 70 +++ Stats for list_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 7.49, stddev: 1.71, median 8, min 5, max 10 - 5: ####################################################### 867 - 6: ################################################### 813 - 7: ################################################### 815 - 8: #################################################### 833 - 9: ###################################################### 857 - 10: ################################################### 815 + num: 5000, avg: 7.51, stddev: 1.71, median 8, min 5, max 10 + 5: ###################################################### 834 + 6: ##################################################### 825 + 7: ##################################################### 820 + 8: ###################################################### 833 + 9: ####################################################### 844 + 10: ####################################################### 844 +++ Stats for list_repeat len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -1231,63 +1230,63 @@ stats len: +++ Stats for array len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 400.16, stddev: 1371.90, median 9, min 0, max 9987 - 0.. 499: ####################################################### 4246 - 500.. 999: ###### 502 - 1000.. 1499: 13 - 1500.. 1999: 10 - 2000.. 2499: 14 - 2500.. 2999: 14 - 3000.. 3499: 20 - 3500.. 3999: 7 - 4000.. 4499: 13 - 4500.. 4999: 16 - 5000.. 5499: 12 - 5500.. 5999: 15 - 6000.. 6499: 15 - 6500.. 6999: 13 - 7000.. 7499: 16 - 7500.. 7999: 12 - 8000.. 8499: 11 - 8500.. 8999: 16 - 9000.. 9499: 15 - 9500.. 9999: 20 + num: 5000, avg: 361.42, stddev: 1230.75, median 9, min 0, max 9974 + 0.. 498: ####################################################### 4212 + 499.. 997: ####### 578 + 998..1496: 11 + 1497..1995: 15 + 1996..2494: 11 + 2495..2993: 10 + 2994..3492: 13 + 3493..3991: 12 + 3992..4490: 7 + 4491..4989: 8 + 4990..5488: 15 + 5489..5987: 14 + 5988..6486: 12 + 6487..6985: 8 + 6986..7484: 9 + 7485..7983: 19 + 7984..8482: 14 + 8483..8981: 11 + 8982..9480: 11 + 9481..9979: 10 +++ Stats for small_array len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 16.14, stddev: 24.86, median 6, min 0, max 99 - 0.. 4: ###################################################### 1923 - 5.. 9: ####################################################### 1936 - 10.. 14: # 61 - 15.. 19: # 59 - 20.. 24: # 62 - 25.. 29: # 70 + num: 5000, avg: 15.79, stddev: 24.64, median 6, min 0, max 99 + 0.. 4: ###################################################### 1930 + 5.. 9: ####################################################### 1957 + 10.. 14: # 59 + 15.. 19: # 66 + 20.. 24: # 61 + 25.. 29: # 52 30.. 34: # 61 - 35.. 39: # 64 - 40.. 44: # 64 - 45.. 49: # 56 - 50.. 54: # 65 - 55.. 59: # 55 - 60.. 64: # 60 - 65.. 69: # 62 - 70.. 74: # 57 - 75.. 79: # 69 - 80.. 84: ## 73 - 85.. 89: # 67 - 90.. 94: # 62 - 95.. 99: ## 74 + 35.. 39: # 65 + 40.. 44: # 62 + 45.. 49: # 64 + 50.. 54: # 70 + 55.. 59: # 63 + 60.. 64: # 50 + 65.. 69: # 51 + 70.. 74: # 52 + 75.. 79: # 63 + 80.. 84: # 56 + 85.. 89: ## 75 + 90.. 94: ## 73 + 95.. 99: # 70 +++ Stats for array_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 7.49, stddev: 1.71, median 8, min 5, max 10 - 5: ####################################################### 867 - 6: ################################################### 813 - 7: ################################################### 815 - 8: #################################################### 833 - 9: ###################################################### 857 - 10: ################################################### 815 + num: 5000, avg: 7.51, stddev: 1.71, median 8, min 5, max 10 + 5: ###################################################### 834 + 6: ##################################################### 825 + 7: ##################################################### 820 + 8: ###################################################### 833 + 9: ####################################################### 844 + 10: ####################################################### 844 +++ Stats for array_repeat len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -1487,27 +1486,27 @@ stats dist: +++ Stats for int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 100000, avg: 2541076923587387.50, stddev: 2660730801206827008.00, median 158655268318060, min -4611522359435274428, max 4611540922436307689 - -4611522359435274428..-4150369195341695293: ##################################################### 4976 - -4150369195341695292..-3689216031248116157: ##################################################### 4963 - -3689216031248116156..-3228062867154537021: ###################################################### 5038 - -3228062867154537020..-2766909703060957885: ##################################################### 4979 - -2766909703060957884..-2305756538967378749: ##################################################### 5001 - -2305756538967378748..-1844603374873799613: ##################################################### 4982 - -1844603374873799612..-1383450210780220477: ##################################################### 5025 - -1383450210780220476.. -922297046686641341: #################################################### 4901 - -922297046686641340.. -461143882593062205: ####################################################### 5126 - -461143882593062204.. 9281500516931: ##################################################### 5008 - 9281500516932.. 461162445594096067: ###################################################### 5041 - 461162445594096068.. 922315609687675203: ##################################################### 5001 - 922315609687675204.. 1383468773781254339: ##################################################### 4986 - 1383468773781254340.. 1844621937874833475: ##################################################### 4949 - 1844621937874833476.. 2305775101968412611: ##################################################### 5025 - 2305775101968412612.. 2766928266061991747: ##################################################### 5022 - 2766928266061991748.. 3228081430155570883: ##################################################### 4958 - 3228081430155570884.. 3689234594249150019: ##################################################### 4998 - 3689234594249150020.. 4150387758342729155: ##################################################### 4982 - 4150387758342729156.. 4611540922436308291: ###################################################### 5039 + num: 100000, avg: -5866174995160813.00, stddev: 2658200940243709440.00, median -18644524111195217, min -4611457719403274307, max 4611628237031853985 + -4611457719403274307..-4150303421581517892: #################################################### 4943 + -4150303421581517891..-3689149123759761476: ##################################################### 5000 + -3689149123759761475..-3227994825938005060: ###################################################### 5080 + -3227994825938005059..-2766840528116248644: #################################################### 4931 + -2766840528116248643..-2305686230294492228: ##################################################### 5026 + -2305686230294492227..-1844531932472735812: ################################################### 4870 + -1844531932472735811..-1383377634650979396: ##################################################### 5017 + -1383377634650979395.. -922223336829222980: ####################################################### 5157 + -922223336829222979.. -461069039007466564: ###################################################### 5107 + -461069039007466563.. 85258814289852: ###################################################### 5089 + 85258814289853.. 461239556636046268: ##################################################### 5045 + 461239556636046269.. 922393854457802684: #################################################### 4958 + 922393854457802685.. 1383548152279559100: ##################################################### 5007 + 1383548152279559101.. 1844702450101315516: ##################################################### 5052 + 1844702450101315517.. 2305856747923071932: #################################################### 4951 + 2305856747923071933.. 2767011045744828348: ################################################### 4872 + 2767011045744828349.. 3228165343566584764: ################################################### 4845 + 3228165343566584765.. 3689319641388341180: ##################################################### 4990 + 3689319641388341181.. 4150473939210097596: ##################################################### 5046 + 4150473939210097597.. 4611628237031854012: ##################################################### 5014 +++ Stats for oneof int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -1741,26 +1740,27 @@ random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 1000, avg: -55083208105414400.00, stddev: 1847115855773139200.00, median 9, min -4590718933436425025, max 4611686018427387903 - -4590718933436425025..-4130598685843234370: ## 26 - -4130598685843234369..-3670478438250043714: # 13 - -3670478438250043713..-3210358190656853058: ### 37 - -3210358190656853057..-2750237943063662402: ### 30 - -2750237943063662401..-2290117695470471746: ## 27 - -2290117695470471745..-1829997447877281090: ## 24 - -1829997447877281089..-1369877200284090434: ## 27 - -1369877200284090433.. -909756952690899778: ## 27 - -909756952690899777.. -449636705097709122: ## 21 - -449636705097709121.. 10483542495481534: ####################################################### 531 - 10483542495481535.. 470603790088672190: ## 21 - 470603790088672191.. 930724037681862846: ## 27 - 930724037681862847.. 1390844285275053502: ## 24 - 1390844285275053503.. 1850964532868244158: ## 25 - 1850964532868244159.. 2311084780461434814: ## 28 - 2311084780461434815.. 2771205028054625470: ## 23 - 2771205028054625471.. 3231325275647816126: ## 23 - 3231325275647816127.. 3691445523241006782: ## 25 - 3691445523241006783.. 4151565770834197438: # 17 - 4151565770834197439.. 4611686018427387903: ## 24 + num: 1000, avg: -11617229187609574.00, stddev: 1819229268312887040.00, median 16, min -4603354806264772278, max 4611686018427387903 + -4603354806264772278..-4142602765030164279: ## 23 + -4142602765030164278..-3681850723795556279: ## 20 + -3681850723795556278..-3221098682560948279: ### 31 + -3221098682560948278..-2760346641326340279: ## 22 + -2760346641326340278..-2299594600091732279: ## 21 + -2299594600091732278..-1838842558857124279: ### 31 + -1838842558857124278..-1378090517622516279: ## 22 + -1378090517622516278.. -917338476387908279: ## 26 + -917338476387908278.. -456586435153300279: ## 20 + -456586435153300278.. 4165606081307721: ####################################################### 547 + 4165606081307722.. 464917647315915721: ## 21 + 464917647315915722.. 925669688550523721: ### 30 + 925669688550523722.. 1386421729785131721: # 15 + 1386421729785131722.. 1847173771019739721: ## 28 + 1847173771019739722.. 2307925812254347721: ## 22 + 2307925812254347722.. 2768677853488955721: ### 31 + 2768677853488955722.. 3229429894723563721: ## 28 + 3229429894723563722.. 3690181935958171721: # 19 + 3690181935958171722.. 4150933977192779721: ## 21 + 4150933977192779722.. 4611686018427387721: ## 21 + 4611686018427387722.. 4611686018427387903: 1 ================================================================================ success (ran 1 tests) diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.32 b/test/core/QCheck2_expect_test.expected.ocaml5.32 index 0781d7c3..92bac37c 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.32 @@ -1,68 +1,69 @@ random seed: 1234 -45 4 0 0 0 0 0 0 0 0 0 0 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 (8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) -(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) -(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) -(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) -(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) -(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) -(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) -(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) --466273346 -409792091 +45 4 0 0 0 0 0 0 0 0 0 0 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 (8,fun,0) (4,fun,19) (5,fun,32) (54,fun,1) (6,fun,4) (2,fun,6) (2,fun,5) (77,fun,3) (6,fun,1) (1,fun,73) +(8,fun,0) (4,fun,19) (5,fun,32) (54,fun,1) (6,fun,4) (2,fun,6) (2,fun,5) (77,fun,3) (6,fun,1) (1,fun,73) +(8,fun,0) (4,fun,19) (5,fun,32) (54,fun,1) (6,fun,4) (2,fun,6) (2,fun,5) (77,fun,3) (6,fun,1) (1,fun,73) +(8,fun,0) (4,fun,19) (5,fun,32) (54,fun,1) (6,fun,4) (2,fun,6) (2,fun,5) (77,fun,3) (6,fun,1) (1,fun,73) +(8,fun,0) (4,fun,19) (5,fun,32) (54,fun,1) (6,fun,4) (2,fun,6) (2,fun,5) (77,fun,3) (6,fun,1) (1,fun,73) +(8,fun,0) (4,fun,19) (5,fun,32) (54,fun,1) (6,fun,4) (2,fun,6) (2,fun,5) (77,fun,3) (6,fun,1) (1,fun,73) +(8,fun,0) (4,fun,19) (5,fun,32) (54,fun,1) (6,fun,4) (2,fun,6) (2,fun,5) (77,fun,3) (6,fun,1) (1,fun,73) +(8,fun,0) (4,fun,19) (5,fun,32) (54,fun,1) (6,fun,4) (2,fun,6) (2,fun,5) (77,fun,3) (6,fun,1) (1,fun,73) +744896613 0 -204896045 +372448306 0 -102448022 +186224153 0 -51224011 +93112076 0 -25612005 +46556038 0 -12806002 +23278019 0 -6403001 +11639009 0 -3201500 +5819504 0 -1600750 +2909752 0 -800375 +1454876 0 -400187 +727438 0 -200093 +363719 0 -100046 +181859 0 -50023 +90929 0 -25011 +45464 0 -12505 +22732 0 -6252 +11366 0 -3126 +5683 0 -1563 +2841 0 -781 +1420 0 -390 +710 0 -195 +355 0 -97 +177 0 -48 +88 0 -24 +44 0 -12 +22 0 -6 +11 0 -3 +5 +0 +2 0 1 0 @@ -116,7 +117,7 @@ Test should_fail_sort_id failed (11 shrink steps): === Error ====================================================================== -Test should_error_raise_exn errored on (2 shrink steps): +Test should_error_raise_exn errored on (1 shrink steps): 0 @@ -234,7 +235,7 @@ Test big bound issue59 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test long_shrink failed (3038 shrink steps): +Test long_shrink failed (3034 shrink steps): ([0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0], [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 1]) @@ -356,29 +357,29 @@ Test strings have unique chars failed (14 shrink steps): Test pairs have different components failed (0 shrink steps): -(6, 6) +(1, 1) --- Failure -------------------------------------------------------------------- -Test pairs have same components failed (29 shrink steps): +Test pairs have same components failed (28 shrink steps): (0, 1) --- Failure -------------------------------------------------------------------- -Test pairs have a zero component failed (57 shrink steps): +Test pairs have a zero component failed (55 shrink steps): (1, 1) --- Failure -------------------------------------------------------------------- -Test pairs are (0,0) failed (29 shrink steps): +Test pairs are (0,0) failed (28 shrink steps): (0, 1) --- Failure -------------------------------------------------------------------- -Test pairs are ordered failed (42 shrink steps): +Test pairs are ordered failed (38 shrink steps): (1, 0) @@ -390,21 +391,21 @@ Test pairs are ordered reversely failed (30 shrink steps): --- Failure -------------------------------------------------------------------- -Test pairs sum to less than 128 failed (27 shrink steps): +Test pairs sum to less than 128 failed (25 shrink steps): (0, 128) --- Failure -------------------------------------------------------------------- -Test pairs lists rev concat failed (38 shrink steps): +Test pairs lists rev concat failed (46 shrink steps): ([0], [1]) --- Failure -------------------------------------------------------------------- -Test pairs lists no overlap failed (22 shrink steps): +Test pairs lists no overlap failed (18 shrink steps): -([0], [0; 0; 0; 0; 0; 0; 0; 0]) +([0], [0; 0; 0; 0]) --- Failure -------------------------------------------------------------------- @@ -414,7 +415,7 @@ Test triples have pair-wise different components failed (3 shrink steps): --- Failure -------------------------------------------------------------------- -Test triples have same components failed (32 shrink steps): +Test triples have same components failed (33 shrink steps): (0, 1, 0) @@ -426,79 +427,79 @@ Test triples are ordered failed (4 shrink steps): --- Failure -------------------------------------------------------------------- -Test triples are ordered reversely failed (32 shrink steps): +Test triples are ordered reversely failed (59 shrink steps): (0, 0, 1) --- Failure -------------------------------------------------------------------- -Test quadruples have pair-wise different components failed (3 shrink steps): +Test quadruples have pair-wise different components failed (4 shrink steps): (0, 0, 0, 0) --- Failure -------------------------------------------------------------------- -Test quadruples have same components failed (59 shrink steps): +Test quadruples have same components failed (60 shrink steps): (0, 1, 0, 1) --- Failure -------------------------------------------------------------------- -Test quadruples are ordered failed (5 shrink steps): +Test quadruples are ordered failed (6 shrink steps): (0, 0, 0, -1) --- Failure -------------------------------------------------------------------- -Test quadruples are ordered reversely failed (33 shrink steps): +Test quadruples are ordered reversely failed (61 shrink steps): (0, 0, 0, 1) --- Failure -------------------------------------------------------------------- -Test forall (a, b) in nat: a < b failed (3 shrink steps): +Test forall (a, b) in nat: a < b failed (1 shrink steps): (0, 0) --- Failure -------------------------------------------------------------------- -Test forall (a, b, c) in nat: a < b < c failed (5 shrink steps): +Test forall (a, b, c) in nat: a < b < c failed (2 shrink steps): (0, 0, 0) --- Failure -------------------------------------------------------------------- -Test forall (a, b, c, d) in nat: a < b < c < d failed (4 shrink steps): +Test forall (a, b, c, d) in nat: a < b < c < d failed (3 shrink steps): (0, 0, 0, 0) --- Failure -------------------------------------------------------------------- -Test forall (a, b, c, d, e) in nat: a < b < c < d < e failed (5 shrink steps): +Test forall (a, b, c, d, e) in nat: a < b < c < d < e failed (3 shrink steps): (0, 0, 0, 0, 0) --- Failure -------------------------------------------------------------------- -Test forall (a, b, c, d, e, f) in nat: a < b < c < d < e < f failed (6 shrink steps): +Test forall (a, b, c, d, e, f) in nat: a < b < c < d < e < f failed (4 shrink steps): (0, 0, 0, 0, 0, 0) --- Failure -------------------------------------------------------------------- -Test forall (a, b, c, d, e, f, g) in nat: a < b < c < d < e < f < g failed (7 shrink steps): +Test forall (a, b, c, d, e, f, g) in nat: a < b < c < d < e < f < g failed (5 shrink steps): (0, 0, 0, 0, 0, 0, 0) --- Failure -------------------------------------------------------------------- -Test forall (a, b, c, d, e, f, g, h) in nat: a < b < c < d < e < f < g < h failed (8 shrink steps): +Test forall (a, b, c, d, e, f, g, h) in nat: a < b < c < d < e < f < g < h failed (6 shrink steps): (0, 0, 0, 0, 0, 0, 0, 0) --- Failure -------------------------------------------------------------------- -Test forall (a, b, c, d, e, f, g, h, i) in nat: a < b < c < d < e < f < g < h < i failed (9 shrink steps): +Test forall (a, b, c, d, e, f, g, h, i) in nat: a < b < c < d < e < f < g < h < i failed (7 shrink steps): (0, 0, 0, 0, 0, 0, 0, 0, 0) @@ -528,13 +529,13 @@ Test lists shorter than 10 failed (15 shrink steps): --- Failure -------------------------------------------------------------------- -Test lists shorter than 432 failed (413 shrink steps): +Test lists shorter than 432 failed (415 shrink steps): [...] list length: 432 --- Failure -------------------------------------------------------------------- -Test lists shorter than 4332 failed (4002 shrink steps): +Test lists shorter than 4332 failed (4017 shrink steps): [...] list length: 4332 @@ -582,33 +583,33 @@ Test sum list = 0 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int failed (69 shrink steps): +Test fail_pred_map_commute_int failed (78 shrink steps): -([0; 0; 0], {0 -> 1; 1 -> 0; 3 -> 0; 5 -> 0; 6 -> 0; 54 -> 0; 7 -> 0; 8 -> 0; 9 -> 0; _ -> 0}, {1 -> true; 54 -> false; _ -> false}) +([0; 0], {0 -> 1; 1 -> 0; 2 -> 0; 4 -> 0; 5 -> 0; 54 -> 0; 6 -> 0; 23 -> 0; 7 -> 0; 8 -> 0; _ -> 0}, {1 -> true; 2 -> false; 68467171 -> false; 4 -> false; 5 -> false; 6 -> false; 23 -> false; 7 -> false; -368608536 -> false; 1001723384 -> false; 8 -> false; 679324297 -> false; 40674345 -> false; -425026694 -> false; 369726925 -> false; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int32 failed (225 shrink steps): +Test fail_pred_map_commute_int32 failed (64 shrink steps): -([0l], {75331484l -> 0l; 1136848737l -> 0l; 25967443l -> 0l; 1809593143l -> 0l; 812652795l -> 0l; 1171110740l -> 0l; 281549282l -> 0l; -877342592l -> 0l; -876617499l -> 0l; 563960163l -> 0l; 0l -> 1l; -348202501l -> 0l; 1943874710l -> 0l; 343894252l -> 0l; 624826382l -> 0l; -1129404246l -> 0l; 388312775l -> 0l; -848968653l -> 0l; -1565076831l -> 0l; 1824307125l -> 0l; -552120330l -> 0l; 1498416944l -> 0l; 851017536l -> 0l; 1579608471l -> 0l; -651202205l -> 0l; -1146538619l -> 0l; 1827731338l -> 0l; -1338530898l -> 0l; -699391038l -> 0l; -900565334l -> 0l; 843997254l -> 0l; -2004379534l -> 0l; 1046391667l -> 0l; 160479057l -> 0l; 222421013l -> 0l; -1019976151l -> 0l; 2025980447l -> 0l; -1835931598l -> 0l; 531452539l -> 0l; -2009399199l -> 0l; 526328917l -> 0l; -1522478843l -> 0l; -264989305l -> 0l; -113975057l -> 0l; 1689928864l -> 0l; 1019502418l -> 0l; -319727598l -> 0l; 1408962275l -> 0l; 2146072025l -> 0l; 1393085524l -> 0l; 1693051712l -> 0l; 1836339186l -> 0l; 1586704254l -> 0l; 543692191l -> 0l; 1586363388l -> 0l; 1712343140l -> 0l; -1289819017l -> 0l; -766883777l -> 0l; 1709020878l -> 0l; 969539258l -> 0l; -1399441934l -> 0l; 325615355l -> 0l; -1671242381l -> 0l; -2084063662l -> 0l; 1594187269l -> 0l; -1302631569l -> 0l; -115890480l -> 0l; -999319234l -> 0l; 362205480l -> 0l; 1909127602l -> 0l; 117081264l -> 0l; -1066809754l -> 0l; -1545717273l -> 0l; 115958783l -> 0l; 871596075l -> 0l; -1205789186l -> 0l; 1981785910l -> 0l; -1614620855l -> 0l; -32077002l -> 0l; -1411456813l -> 0l; 758964460l -> 0l; -769342433l -> 0l; 991708298l -> 0l; _ -> 0l}, {1136848737l -> false; 1809593143l -> false; 812652795l -> false; 1171110740l -> false; -877342592l -> false; 1565050922l -> false; 979572466l -> false; 104217172l -> false; -1856534394l -> false; -348202501l -> false; -673862244l -> false; 308947432l -> false; 343894252l -> false; -2031088625l -> false; 1750645404l -> false; 1157643425l -> false; -848968653l -> false; -1504371044l -> false; -1565076831l -> false; 1824307125l -> false; 982950240l -> false; 2020977849l -> false; 1889265845l -> false; -489771261l -> false; 1498416944l -> false; 851017536l -> false; 1579608471l -> false; -1146538619l -> false; -1163289289l -> false; 1827731338l -> false; -250008166l -> false; -699391038l -> false; 46062239l -> false; 843997254l -> false; -2004379534l -> false; 1046391667l -> false; -672679838l -> false; -1435877828l -> false; 732837526l -> false; -1019976151l -> false; 925913108l -> false; 1332061261l -> false; 139357263l -> false; 531452539l -> false; -2009399199l -> false; 526328917l -> false; -1522478843l -> false; -264989305l -> false; 1689928864l -> false; -1346986691l -> false; -1442906134l -> false; -999075733l -> false; -319727598l -> false; 1408962275l -> false; 1579421435l -> false; 2146072025l -> false; 316542700l -> false; -1391714030l -> false; 1779439473l -> false; -1002646370l -> false; 1836339186l -> false; 931758934l -> false; -2023511228l -> false; 1586704254l -> false; 543692191l -> false; 1586363388l -> false; 1712343140l -> false; -1289819017l -> false; 1976233434l -> false; -335551850l -> false; -564214470l -> false; -766883777l -> false; 1095157970l -> false; 1709020878l -> false; 982225875l -> false; -808156143l -> false; 969539258l -> false; 1324609334l -> false; 325615355l -> false; -1671242381l -> false; 2054541922l -> false; 173881745l -> false; -2084063662l -> false; 1594187269l -> false; 271400805l -> false; -1999936871l -> false; -463057368l -> false; 1909127602l -> false; 117081264l -> false; 115958783l -> false; 871596075l -> false; -1205789186l -> false; -1614620855l -> false; -2146186613l -> false; -1411456813l -> false; 758964460l -> false; -769342433l -> false; 1333986756l -> false; 991708298l -> false; 75331484l -> false; 25967443l -> false; -1988450453l -> false; 281549282l -> false; -215338467l -> false; 1823853744l -> false; -876617499l -> false; 563960163l -> false; 0l -> true; -1371167900l -> false; 569394672l -> false; 1943874710l -> false; -21969680l -> false; 624826382l -> false; -1862005476l -> false; -1129404246l -> false; 388312775l -> false; 1225087295l -> false; 909448910l -> false; -318097162l -> false; -552120330l -> false; -2015935885l -> false; 2142387483l -> false; -651202205l -> false; 150441917l -> false; -1731710824l -> false; -1338530898l -> false; -900565334l -> false; -238820569l -> false; 160479057l -> false; 222421013l -> false; 1802048184l -> false; 2025980447l -> false; -1636965277l -> false; 1326978241l -> false; -1835931598l -> false; 1314132578l -> false; -1464012521l -> false; 1071316774l -> false; 604359939l -> false; 854723166l -> false; -761515858l -> false; -113975057l -> false; -666518516l -> false; -915084559l -> false; 1019502418l -> false; -702876054l -> false; 146771378l -> false; 1393085524l -> false; 1693051712l -> false; 1775680850l -> false; 1900637913l -> false; -1835687180l -> false; -1399441934l -> false; -1662345616l -> false; -1302631569l -> false; -115890480l -> false; -999319234l -> false; 362205480l -> false; -1066809754l -> false; -1545717273l -> false; 1981785910l -> false; -19251138l -> false; -32077002l -> false; -1002197755l -> false; 1195624707l -> false; _ -> false}) +([0l; 1l], {_ -> 0l}, {2105244496l -> false; 1056359910l -> false; 1364327540l -> false; 1697200981l -> false; 749208472l -> false; -624253901l -> false; -1587859886l -> false; -1229314055l -> false; 79025834l -> false; 954563801l -> false; -1524569688l -> false; -101011561l -> false; -438671296l -> false; 922489845l -> false; -2089504257l -> false; -790819552l -> false; 140774641l -> false; -1966380908l -> false; 269604126l -> false; 1145293881l -> false; 0l -> true; -1777382617l -> false; 1447762681l -> false; 641593092l -> false; -2082304932l -> false; 2143531570l -> false; 263164458l -> false; 162807677l -> false; 901965649l -> false; -1354301954l -> false; 1073036012l -> false; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int64 failed (409 shrink steps): +Test fail_pred_map_commute_int64 failed (123 shrink steps): -([0L], {5854787549706481689L -> 0L; 3145329330861579979L -> 0L; 4882728146457597343L -> 0L; 9213678680194827455L -> 0L; 5300276494079701428L -> 0L; -9132719513648881735L -> 0L; 5100807290077018335L -> 0L; 4259354711344712502L -> 0L; -364061021052118635L -> 0L; -3581328212534219819L -> 0L; -8630303840787971041L -> 0L; -2978122754581212173L -> 0L; -4683856205808377145L -> 0L; -2954498161550507231L -> 0L; 8310294664523726142L -> 0L; 558752675069655569L -> 0L; 8199640615007233109L -> 0L; 1555660693178054105L -> 0L; 3734321537045757188L -> 0L; 7617254280160726422L -> 0L; -7095101722225497728L -> 0L; 2408366282890716208L -> 0L; -4292043424114694448L -> 0L; 6051446892539839664L -> 0L; -2620576406080708837L -> 0L; 3910553276736898631L -> 0L; -6049404088872216425L -> 0L; -7268555609988799200L -> 0L; -6934743764498995030L -> 0L; 4876048078141422706L -> 0L; -8915325446919098823L -> 0L; 2098138445044356137L -> 0L; 7859313320400495093L -> 0L; -1257408099724075377L -> 0L; 7835339442358508915L -> 0L; -1373219575348706144L -> 0L; -5629923125916047561L -> 0L; 5846432512550235357L -> 0L; -7434366745648348883L -> 0L; 2422190457351331666L -> 0L; -7267280566018852192L -> 0L; 3299736282478619448L -> 0L; 5029882331043609063L -> 0L; 3903578586206863836L -> 0L; -7619916642310435274L -> 0L; -2371338759413642156L -> 0L; -679766008357102884L -> 0L; 1340692257137144601L -> 0L; -790015524249429917L -> 0L; -4379154747792360737L -> 0L; 8399933408910938616L -> 0L; 6480637981859985820L -> 0L; -2308579306926069217L -> 0L; -8608744547020170782L -> 0L; -5594759985566186977L -> 0L; 2301544867433440993L -> 0L; 323546263287575941L -> 0L; -6538996838665322453L -> 0L; -2454988279788980498L -> 0L; 866928363553278728L -> 0L; 5164393405417580120L -> 0L; -499476091573676884L -> 0L; 4479813258449401643L -> 0L; -4763149175045705024L -> 0L; 469304370363482895L -> 0L; -2804630954669580607L -> 0L; 3734790826411290913L -> 0L; -227934510922809045L -> 0L; -3580496456230202944L -> 0L; -8950985269485293698L -> 0L; 212249186598423999L -> 0L; 639669963429369605L -> 0L; -2051861136476049823L -> 0L; 8348878307193905173L -> 0L; -3686676770270027707L -> 0L; 3224777727913298872L -> 0L; -5364159185804582406L -> 0L; 6806501729242859693L -> 0L; -1441073676419344347L -> 0L; -3765043485710736446L -> 0L; 7194818492908892508L -> 0L; -2796892171845744540L -> 0L; -4420431099744708779L -> 0L; 1019954390233679959L -> 0L; -2530663500164660862L -> 0L; -2264698731421349299L -> 0L; -6301941405625428267L -> 0L; -1495518350952249754L -> 0L; 6790791859713076536L -> 0L; -8660185765070272892L -> 0L; 0L -> -1L; 6461206961562494132L -> 0L; 4161392575889986945L -> 0L; -6062160849957200379L -> 0L; 2050777921649849245L -> 0L; -2338474396491590209L -> 0L; 6040222022058163474L -> 0L; 4420706034848988623L -> 0L; 7007967583009742492L -> 0L; -6721953801867170697L -> 0L; -7885266170714706233L -> 0L; 4322769158609909940L -> 0L; -898939348400618792L -> 0L; 1398507300916388863L -> 0L; -3768157736633469270L -> 0L; 3259727538054383679L -> 0L; 7887016748577155308L -> 0L; 689252303200971584L -> 0L; 1153745841753386362L -> 0L; -7622842036935762123L -> 0L; -2655363517875144787L -> 0L; -3316185614787998640L -> 0L; -2161834059847512675L -> 0L; 7772143368369364168L -> 0L; 643735998272900932L -> 0L; 4986005544098925810L -> 0L; 2746391341985398187L -> 0L; -4380764207063965457L -> 0L; -5178825119209008517L -> 0L; 3567420727005224228L -> 0L; -6591184801704195820L -> 0L; -7799749368733739938L -> 0L; -6139115887619923128L -> 0L; 6435651773147788786L -> 0L; -4281744317789616022L -> 0L; 6784366724273561670L -> 0L; -3312092294417046138L -> 0L; 9177166544734112775L -> 0L; -5748946431569544365L -> 0L; 5663627078768118084L -> 0L; 8366279157860053843L -> 0L; 7340188779816032270L -> 0L; 4494217989422939968L -> 0L; 8511705671936252155L -> 0L; 4164139407125837706L -> 0L; 153637279587014926L -> 0L; -7394159616171936648L -> 0L; -9043869006878631603L -> 0L; 5240182597792645198L -> 0L; 5448217779542124314L -> 0L; -1656305904791530564L -> 0L; -1116361473951770628L -> 0L; 2259397563612834240L -> 0L; 2701623574335708358L -> 0L; 7687356893908644279L -> 0L; -1474435637026224678L -> 0L; -1138120395318770637L -> 0L; 2550568742267673149L -> 0L; 5808672460943173892L -> 0L; -3394167952197954244L -> 0L; -7127307218936826104L -> 0L; _ -> 0L}, {6624469717750982933L -> false; 2021251694365224308L -> false; 8650950383192901855L -> false; 5854787549706481689L -> false; -4928040426617547498L -> false; 3145329330861579979L -> false; 5644156449197797917L -> false; 5100807290077018335L -> false; 7739738019688281706L -> false; -697925149460693359L -> false; -3581328212534219819L -> false; -8630303840787971041L -> false; 4607169608843350895L -> false; -2954498161550507231L -> false; 3734321537045757188L -> false; 7617254280160726422L -> false; 2408366282890716208L -> false; 8414158256060592983L -> false; -1651026652789754360L -> false; 3634915250346921677L -> false; 6051446892539839664L -> false; -6049404088872216425L -> false; -1360668418930804589L -> false; -5039996349090530917L -> false; -6625930574039947025L -> false; 6646442352002793285L -> false; -8915325446919098823L -> false; 2098138445044356137L -> false; 5263684004213940067L -> false; 4235768524330941733L -> false; -1257408099724075377L -> false; -8709033821355250350L -> false; 7835339442358508915L -> false; -5629923125916047561L -> false; 5846432512550235357L -> false; 1038681120125353343L -> false; 2748006016942766304L -> false; -465696954319541446L -> false; 6398423988255904594L -> false; 5721159553842941691L -> false; -7267280566018852192L -> false; 4431190379031682950L -> false; 3299736282478619448L -> false; 5029882331043609063L -> false; 3903578586206863836L -> false; -2371338759413642156L -> false; 5261709869629193788L -> false; -8697432166782222197L -> false; -983603998581652585L -> false; -5785263784427206614L -> false; -4379154747792360737L -> false; 2277179348638815545L -> false; 6480637981859985820L -> false; -8608744547020170782L -> false; -830997075387711629L -> false; 2301544867433440993L -> false; 8163177680305655068L -> false; -2454988279788980498L -> false; 5164393405417580120L -> false; 1132050760977963309L -> false; -499476091573676884L -> false; 4479813258449401643L -> false; -6461224430753660866L -> false; -1006257629865130445L -> false; 8294186685546713542L -> false; -971072539264035131L -> false; -3580496456230202944L -> false; -1025726531324723941L -> false; 2142699480843765254L -> false; -8950985269485293698L -> false; 7356720237191965167L -> false; 4207231707586613858L -> false; 639669963429369605L -> false; -2051861136476049823L -> false; -1988816249583056245L -> false; 9188472469558943175L -> false; -3686676770270027707L -> false; 3224777727913298872L -> false; -1441073676419344347L -> false; -2417519916452520533L -> false; -7884216401522586609L -> false; -2796892171845744540L -> false; -2530663500164660862L -> false; -2264698731421349299L -> false; -6301941405625428267L -> false; 1118769919115618925L -> false; -3315022889335032034L -> false; 6790791859713076536L -> false; -6287885895726259950L -> false; 7036501100000084257L -> false; -8660185765070272892L -> false; 0L -> true; 1256017657628421411L -> false; 4161392575889986945L -> false; -6062160849957200379L -> false; 2050777921649849245L -> false; -5707081726479912303L -> false; 7007967583009742492L -> false; 2222440151561842948L -> false; -6721953801867170697L -> false; -7885266170714706233L -> false; 4322769158609909940L -> false; -898939348400618792L -> false; 1398507300916388863L -> false; -7314527457266255534L -> false; -3768157736633469270L -> false; 3906053329638043395L -> false; -2423282696440615857L -> false; 3262857228003744550L -> false; -294629012482506639L -> false; 689252303200971584L -> false; -949171309053917101L -> false; 1153745841753386362L -> false; -7139720054173349629L -> false; 5729429493169192938L -> false; 3147513210109551715L -> false; -7622842036935762123L -> false; -2655363517875144787L -> false; -8540329665204613710L -> false; -3316185614787998640L -> false; -7171948333957854763L -> false; 643735998272900932L -> false; 4986005544098925810L -> false; -7639906882480959204L -> false; -4380764207063965457L -> false; 2818999576258038632L -> false; 3508863594680469870L -> false; -8690914547174917743L -> false; 1098465513758097547L -> false; 4218628012430961849L -> false; 6435651773147788786L -> false; 9009339763374318376L -> false; -3161092180305721636L -> false; 8487857972336733594L -> false; 6784366724273561670L -> false; -3312092294417046138L -> false; 1583416881273542902L -> false; -5748946431569544365L -> false; -8876028441964492915L -> false; 8328121679685965390L -> false; 1737879028445335557L -> false; 7340188779816032270L -> false; 4494217989422939968L -> false; 7083777351172515530L -> false; -3270685705223979163L -> false; 8520094710095194968L -> false; 4164139407125837706L -> false; 153637279587014926L -> false; -1656305904791530564L -> false; 5240182597792645198L -> false; -8365460935410113080L -> false; 2259397563612834240L -> false; -4404877394737171205L -> false; -6753006748206940599L -> false; 2022662898930300274L -> false; 2701623574335708358L -> false; 7687356893908644279L -> false; -931329658461140236L -> false; -2452190344785809016L -> false; 5808672460943173892L -> false; -3394167952197954244L -> false; -8959165302033331105L -> false; 3993033237256830916L -> false; 4972040655077426416L -> false; 4882728146457597343L -> false; 9213678680194827455L -> false; 5300276494079701428L -> false; -9132719513648881735L -> false; -7123352971536208992L -> false; 4259354711344712502L -> false; 8040921812849396650L -> false; -364061021052118635L -> false; 1359540546038184604L -> false; -4045157926296238604L -> false; 2619877327226739617L -> false; -2978122754581212173L -> false; -5943664818246816981L -> false; -4683856205808377145L -> false; 8310294664523726142L -> false; 558752675069655569L -> false; 8199640615007233109L -> false; 8503977350048285922L -> false; 2741028434103436854L -> false; 1555660693178054105L -> false; -1213860894341146248L -> false; -7095101722225497728L -> false; -4292043424114694448L -> false; -2620576406080708837L -> false; 3910553276736898631L -> false; -7268555609988799200L -> false; -6934743764498995030L -> false; 4876048078141422706L -> false; 5076578730158835782L -> false; -4290997597638374224L -> false; 7859313320400495093L -> false; -9073896469922473758L -> false; -1373219575348706144L -> false; -7434366745648348883L -> false; -8252951406749682434L -> false; 3976766521418821020L -> false; 4221739137319150436L -> false; 7626491182175802526L -> false; 2422190457351331666L -> false; 1324477536709314583L -> false; -7308516696705877236L -> false; -1441184219299041128L -> false; -7619916642310435274L -> false; -1366216905461382541L -> false; 4166104326466068382L -> false; -679766008357102884L -> false; 1340692257137144601L -> false; -3347868337765287544L -> false; 8624184165625915808L -> false; 2331860220219071134L -> false; -790015524249429917L -> false; 8399933408910938616L -> false; -2308579306926069217L -> false; -5594759985566186977L -> false; 197835813572346897L -> false; 323546263287575941L -> false; -6538996838665322453L -> false; 866928363553278728L -> false; 5479429944191365165L -> false; -7729052846454806041L -> false; -4304406580070181007L -> false; -4763149175045705024L -> false; 469304370363482895L -> false; -2804630954669580607L -> false; -2238043473974805486L -> false; 3734790826411290913L -> false; -227934510922809045L -> false; 5699328150978489073L -> false; 4601270508136665021L -> false; 212249186598423999L -> false; 8348878307193905173L -> false; -7973754506024961452L -> false; -5364159185804582406L -> false; 6806501729242859693L -> false; -3765043485710736446L -> false; 7194818492908892508L -> false; 1019954390233679959L -> false; -4420431099744708779L -> false; 8114335019049414454L -> false; -2889137903793420078L -> false; -1495518350952249754L -> false; -569354245761226691L -> false; -8589663454077811882L -> false; 6461206961562494132L -> false; 7813289179577223734L -> false; -6887763749911475116L -> false; -2338474396491590209L -> false; 6040222022058163474L -> false; 4420706034848988623L -> false; 6586471556538983659L -> false; -2662379650000679469L -> false; -1991171025695944950L -> false; 7012460325344924441L -> false; 7983768007747169077L -> false; 3259727538054383679L -> false; 7887016748577155308L -> false; -2161834059847512675L -> false; 7772143368369364168L -> false; 2746391341985398187L -> false; -6044975648356418603L -> false; -5178825119209008517L -> false; -8711565572371958878L -> false; 3567420727005224228L -> false; -6591184801704195820L -> false; -7799749368733739938L -> false; -2307913367909538993L -> false; -6139115887619923128L -> false; -2966172447767866175L -> false; -6622094766643380931L -> false; 3173163354060602924L -> false; -4281744317789616022L -> false; 9177166544734112775L -> false; 5663627078768118084L -> false; 8366279157860053843L -> false; 8511705671936252155L -> false; 3630742237263843231L -> false; -7394159616171936648L -> false; -9043869006878631603L -> false; -2073201129865962220L -> false; 5448217779542124314L -> false; -4677740139754242931L -> false; -9018937089320797157L -> false; -6704152621528229497L -> false; 2595706173326502376L -> false; 8038783472656886325L -> false; -1116361473951770628L -> false; 8827581399887526968L -> false; -594959241272658988L -> false; 2654816421495205220L -> false; 2445531497888324919L -> false; -2862675227543729570L -> false; -1474435637026224678L -> false; -7958909181723079423L -> false; -1138120395318770637L -> false; 2550568742267673149L -> false; 1533772787097910211L -> false; -7127307218936826104L -> false; _ -> false}) +([0L; 1L], {_ -> 0L}, {-7504258977828779808L -> false; -7093694681182419557L -> false; 3873912968074562848L -> false; 3217825886573894393L -> false; -382865800631504453L -> false; 4099820307503616554L -> false; 699253650458194431L -> false; 8654311839195390489L -> false; -8943431579568790477L -> false; 4918999763344690417L -> false; 2839624487026504606L -> false; -4429540254266880362L -> false; -3212627688888080436L -> false; 8536762249180422736L -> false; 5859742167437376336L -> false; -2190382103531982729L -> false; 4537031266334529194L -> false; 5862395135921190459L -> false; 7824925950931903538L -> false; 0L -> true; 1211095228675665833L -> false; -4111062701435455992L -> false; 3962063715808702212L -> false; 4471203044432927526L -> false; -8445541690265748756L -> false; -6819806278200462828L -> false; -1884078868316734635L -> false; 1157940906807060904L -> false; 9206397994034200062L -> false; -5279863662566198154L -> false; -7633800208299937897L -> false; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_strings failed (2 shrink steps): +Test fail_pred_strings failed (1 shrink steps): {"some random string" -> true; _ -> false} --- Failure -------------------------------------------------------------------- -Test fold_left fold_right failed (32 shrink steps): +Test fold_left fold_right failed (104 shrink steps): -(0, [1], {(5, 5) -> 0; (3, 8) -> 0; (1, 0) -> 1; (3, 0) -> 0; (8, 0) -> 0; (6, 4) -> 0; (9, 2) -> 0; (5, 0) -> 0; (0, 2) -> 0; (2, 0) -> 0; (2, 1) -> 0; (8, 6) -> 0; (0, 3) -> 0; (0, 23) -> 0; (1, 8) -> 0; (0, 4) -> 0; (4, 0) -> 0; (7, 2) -> 0; (2, 5) -> 0; (0, 8) -> 0; (23, 6) -> 0; (0, 0) -> 0; (4, 80) -> 0; _ -> 0}) +(0, [1], {(8, 7) -> 0; (96, 0) -> 0; (79, 32) -> 0; (1, 0) -> 1; (7, 3) -> 0; (4, 48) -> 0; (5, 52) -> 0; (5, 1) -> 0; (4, 78) -> 0; (3, 2) -> 0; (85, 30) -> 0; (36, 1) -> 0; (59, 17) -> 0; (5, 61) -> 0; (3, 44) -> 0; (1, 18) -> 0; (1, 7) -> 0; (9, 4) -> 0; (2, 2) -> 0; (6, 8) -> 0; (6, 6) -> 0; (43, 4) -> 0; (3, 7) -> 0; (0, 3) -> 0; (4, 0) -> 0; (8, 1) -> 0; (30, 0) -> 0; (0, 8) -> 0; (7, 78) -> 0; (9, 52) -> 0; (5, 89) -> 0; (49, 7) -> 0; (97, 2) -> 0; (0, 0) -> 0; (4, 7) -> 0; (0, 6) -> 0; (65, 4) -> 0; (35, 7) -> 0; (6, 2) -> 0; (19, 5) -> 0; (87, 82) -> 0; (7, 61) -> 0; (4, 3) -> 0; (4, 9) -> 0; (6, 3) -> 0; (9, 64) -> 0; (2, 3) -> 0; (8, 13) -> 0; (5, 6) -> 0; (8, 64) -> 0; (8, 0) -> 0; (20, 6) -> 0; (2, 6) -> 0; (3, 6) -> 0; (5, 0) -> 0; (38, 3) -> 0; (0, 2) -> 0; (6, 1) -> 0; (63, 8) -> 0; (27, 5) -> 0; (2, 1) -> 0; (0, 5) -> 0; (9, 0) -> 0; (9, 5) -> 0; (4, 4) -> 0; (6, 5) -> 0; (21, 1) -> 0; (48, 50) -> 0; (77, 7) -> 0; (9, 1) -> 0; (52, 8) -> 0; (13, 40) -> 0; (3, 0) -> 0; (5, 3) -> 0; (1, 1) -> 0; (2, 31) -> 0; (2, 0) -> 0; (69, 31) -> 0; (7, 42) -> 0; (7, 89) -> 0; (7, 6) -> 0; (5, 2) -> 0; (8, 4) -> 0; (83, 37) -> 0; (8, 3) -> 0; (5, 4) -> 0; (35, 3) -> 0; (96, 8) -> 0; (1, 5) -> 0; (2, 15) -> 0; _ -> 0}) +++ Messages ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -619,21 +620,21 @@ l=[1], fold_left=1, fold_right=0 --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried failed (434 shrink steps): +Test fold_left fold_right uncurried failed (481 shrink steps): -({(5, 2) -> 0; (0, 2) -> 0; (2, 80) -> 0; (8, 6) -> 0; (76, 6) -> 0; (3, 8) -> 0; (75, 57) -> 0; (7, 2) -> 0; (43, 1) -> 0; (2, 7) -> 0; (7, 1) -> 0; (76, 3) -> 0; (4, 50) -> 0; (70, 5) -> 0; (49, 46) -> 0; (71, 31) -> 0; (67, 0) -> 0; (32, 96) -> 0; (9, 1) -> 0; (8, 8) -> 0; (53, 8) -> 0; (76, 5) -> 0; (2, 5) -> 0; (5, 4) -> 0; (9, 3) -> 0; (6, 65) -> 0; (75, 2) -> 0; (35, 96) -> 0; (3, 2) -> 0; (24, 1) -> 0; (75, 4) -> 0; (48, 8) -> 0; (0, 16) -> 0; (26, 73) -> 0; (2, 88) -> 0; (76, 7) -> 0; (6, 9) -> 0; (71, 59) -> 0; (4, 7) -> 0; (1, 1) -> 0; (4, 22) -> 0; (0, 5) -> 0; (1, 5) -> 0; (1, 4) -> 0; (8, 45) -> 0; (2, 47) -> 0; (0, 1) -> 0; (6, 10) -> 0; (73, 0) -> 0; (27, 3) -> 0; (88, 7) -> 0; (5, 1) -> 0; (3, 6) -> 0; (77, 8) -> 0; (2, 1) -> 0; (1, 2) -> 0; (4, 1) -> 0; (47, 6) -> 0; (76, 9) -> 0; (6, 5) -> 0; (7, 3) -> 0; (9, 87) -> 0; (3, 7) -> 0; (17, 0) -> 0; (43, 55) -> 0; (4, 2) -> 0; (12, 7) -> 0; (7, 79) -> 0; (2, 56) -> 0; (52, 0) -> 0; (9, 2) -> 0; (49, 0) -> 0; (7, 9) -> 0; (2, 75) -> 0; (75, 5) -> 0; (2, 2) -> 0; (6, 4) -> 0; (1, 3) -> 0; (19, 6) -> 0; (4, 55) -> 0; (1, 6) -> 0; (6, 7) -> 0; (6, 24) -> 0; (0, 6) -> 0; (86, 6) -> 0; (3, 1) -> 0; (4, 5) -> 0; (82, 4) -> 0; (5, 70) -> 0; (5, 9) -> 0; (37, 2) -> 0; (45, 1) -> 0; (7, 4) -> 0; (0, 4) -> 1; (6, 95) -> 0; (6, 2) -> 0; (1, 0) -> 0; (8, 4) -> 0; (1, 22) -> 0; (67, 7) -> 0; (92, 7) -> 0; (7, 5) -> 0; (4, 4) -> 0; (9, 8) -> 0; (49, 5) -> 0; (1, 9) -> 0; _ -> 0}, 0, [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 4]) +({(3, 9) -> 0; (5, 2) -> 0; (96, 4) -> 0; (9, 6) -> 0; (8, 6) -> 0; (98, 74) -> 0; (7, 20) -> 0; (8, 0) -> 0; (3, 8) -> 0; (4, 0) -> 0; (7, 2) -> 0; (4, 7) -> 0; (0, 5) -> 0; (6, 75) -> 0; (2, 2) -> 0; (6, 0) -> 0; (8, 4) -> 0; (0, 1) -> 1; (80, 4) -> 0; (89, 0) -> 0; (49, 85) -> 0; (2, 0) -> 0; (6, 1) -> 0; (3, 5) -> 0; _ -> 0}, 0, [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 1]) --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried fun last failed (37 shrink steps): +Test fold_left fold_right uncurried fun last failed (30 shrink steps): -(0, [0; 0; 0; 0], {(9, 5) -> 0; (0, 2) -> 0; (56, 0) -> 0; (4, 1) -> 0; (8, 5) -> 0; (5, 9) -> 0; (8, 6) -> 0; (3, 8) -> 0; (8, 0) -> 0; (84, 8) -> 0; (23, 4) -> 0; (4, 0) -> 0; (0, 7) -> 0; (7, 8) -> 0; (0, 5) -> 0; (0, 4) -> 0; (1, 5) -> 0; (80, 8) -> 0; (5, 7) -> 0; (2, 2) -> 0; (6, 4) -> 0; (0, 0) -> 56; (0, 23) -> 0; (0, 56) -> 1; (1, 3) -> 0; (0, 1) -> 0; (56, 2) -> 0; (89, 8) -> 0; (7, 7) -> 0; (2, 5) -> 0; (4, 3) -> 0; _ -> 0}) +(0, [1], {(7, 2) -> 0; (8, 7) -> 0; (0, 7) -> 0; (0, 5) -> 0; (4, 8) -> 0; (50, 4) -> 0; (5, 64) -> 0; (0, 1) -> 1; (32, 49) -> 0; (8, 8) -> 0; _ -> 0}) --- Failure -------------------------------------------------------------------- -Test fold_left test, fun first failed (925 shrink steps): +Test fold_left test, fun first failed (19 shrink steps): -({("\167$\000\199\169\156V\241\027\212\178d3\196\136\249\1941_=#\216\196\226\186\220\153\150Z)\000\255\184\132`\225\239&uS\235]\212\231\021\028\204\020\t,", 9) -> ""; ("\156\031\194\253\204B\188\154 \167\012\253\2322;", 8) -> ""; ("{\182\172t", 5) -> ""; ("\169\240\228A#\212U\193\172\019\150\238\236\133\209\188\240\135\225\191\241\181\179\243\139\\.\"\190m\204&9\209?\001\171\247\160T\2049\153\0028\184\014;X", 13) -> ""; ("\003\212\207\236\178\162\182m\147\190\b>W\141\242\195\206j\201\202\166B\145k\229\211J\015\139(\224\143\149\190\196(_\017\170\138", 4) -> ""; ("\130\229\219\227\133\160\213\236\2221\245\129-\183\141r\146sXj\000\2210\200\1576\209\1396s '\026\172\251\236\166X\220\200\176$Z0\024\190", 2) -> ""; ("a\0171\198^,5\170C\139\157\\h\001\026\199", 8) -> ""; ("\189\221\014\254\188\175\205JF", 5) -> ""; ("", 2) -> "a"; ("\165\233\214\166\195\197", 5) -> ""; ("&\169\2415\201", 2) -> ""; ("S\194irBA", 37) -> ""; ("\224\2280\186", 1) -> ""; ("!\209\194\238\0266s\001!\233\234(7\127\228C\136n$\21162^^\012\014\199\178`\148\141\228\18599\205\136\136\189\213\134\019|\197\005\235\151\003\197D%\172\144\238\173[\228\191\235p\177I\180\237\189y\247\250w\143z~\016\003\142\149\157\142\234\\3P\140\030\000\028\205K\188&\202w\1519`\188\015", 2) -> ""; ("\128]\190\164\164\151)\214", 22) -> ""; ("u\251\19988\194\165\242J", 7) -> ""; ("}\129\237\213\203\137\197(W\172Q\171\188\140\205\014\143k~\163\187\140o\130\146r", 0) -> ""; ("\133+\142\011\209\135", 1) -> ""; ("E\212\169=n", 9) -> ""; ("l\022\133\005\016D\026\230\156", 18) -> ""; ("\031\131g\029\215", 31) -> ""; ("/*j", 6) -> ""; ("h\031\226a\226\148\128", 9) -> ""; ("\151", 1) -> ""; ("\221\184V\247\225\254\209iW;_d\144\t\179>2\252\221pO<\134F\005\252\151\163\138\007\219z\136\215\237]92G\000A\135\139\166\214\186\232\199\236\000\132_\006\241\169Gz\"\155\183\215-\233\249", 1) -> ""; ("z\211oC\210\198\155", 8) -> ""; ("}P8\147\167\142j9u\187\007\128\213Y\181E'\130\r\242ng\2088\198\004\136GJ\179-\197Iw\017\197\223\173\250\229D\160\171\t\222\223>6\219\201@^X\221(s\029\127\005-F+\232\213B\170\150\188\018f+>\215\240k\135\023\214P\157", 9) -> ""; ("~f-L\151\011", 2) -> ""; ("!\178\019\016\134%\026", 2) -> ""; ("\255U\t4f*\254\237\181S\020\181\130\184\230\017C\185\200\187:Q\002\210\028\152G\228O\026\012\003\234\011\148z\177\166&\024\178F\188\213u\128R~\\\171\194\r~v\020\160\221(\157wa!a\bAf\127^\169\241;\246\011B\b+\249\179\193\230\137\232\147\247\251\180ey\166q<\150_\158", 6) -> ""; ("\005\140\184\232$", 78) -> ""; (".NF\153", 6) -> ""; ("\180\130\236\011(\210M9", 9) -> ""; ("I\219\224\171\142\155\209\027\011\237\020;\245\176\141(\202\248\023\174\216\156\173+\028\209\193?\154t\196\146\147\181\252#\229\128jz\199\212\194\2302\185\162\208UXq>\024F&\241i\182\165\214I\249*?\136_\142f\163\230\167\210U`W \150X\157=\235pe\200\019\208\138j", 1) -> ""; ("\196\210\239\158\131\198\1516\208\165\163\011\251B\219\161\001\237\224\194T\t\148\158\197\031\145\025\192\148\210t1\235\159\015\176\197.\248a\028'\222r\200= \208w", 36) -> ""; ("\228x[", 91) -> ""; ("\001\143", 7) -> ""; ("\136u\1473\235\255\232\211\129\129\172\n\012\004\\O2.a\228(\218\205\223\011\"\n<\181$\245v\002\016s]\161\170\000q\205\161wM\230\223\143%\t\232\175\171j\129x\022\159\215\182\019\240\002\014}\0052\234\202\226\157,\148-\147\200\158\181\189\196\143f", 38) -> ""; ("@\192\163\234", 72) -> ""; ("\131\158Y\139\199\014\149d$", 9) -> ""; ("-\152", 9) -> ""; _ -> ""}, "", [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 2], [0]) +({("\022/\026D\153\138", 2) -> ""; ("Y", 4) -> ""; ("yc\144x\186\136\219\157\227", 6) -> ""; ("^\127\023\014*\023c\018", 2) -> ""; ("\022MlqC", 2) -> ""; ("\205)\019\136", 4) -> ""; ("l\186\218\222!\214E", 2) -> ""; ("\249)\003\207\189\129\145Sd\186X\238\179\",3GTId\005\223\134\211%#N\2128fD\190\251\b\169\155v\223\023\157", 6) -> ""; ("\173\188C\247%\150k=", 2) -> "a"; (";", 2) -> ""; _ -> ""}, "a", [], [0]) --- Failure -------------------------------------------------------------------- @@ -718,22 +719,22 @@ stats char code: +++ Stats for tree's depth ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats depth: - num: 1000, avg: 4.13, stddev: 3.52, median 3, min 1, max 15 - 1: ####################################################### 339 - 2: ################ 104 - 3: ############### 98 - 4: ##################### 133 - 5: ######### 60 - 6: #### 29 - 7: ######## 54 - 8: ####### 48 - 9: ## 16 - 10: ### 21 - 11: ########### 68 - 12: 1 - 13: # 8 - 14: ## 16 - 15: 5 + num: 1000, avg: 3.90, stddev: 3.44, median 3, min 1, max 15 + 1: ####################################################### 376 + 2: ############## 98 + 3: ############ 84 + 4: #################### 139 + 5: ########## 71 + 6: ## 18 + 7: ####### 49 + 8: ####### 49 + 9: # 12 + 10: ### 25 + 11: ###### 43 + 12: 6 + 13: # 10 + 14: # 13 + 15: # 7 +++ Stats for bytes_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -960,203 +961,203 @@ stats len: +++ Stats for pair dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats pair sum: - num: 500000, avg: 100.05, stddev: 41.29, median 100, min 0, max 200 - 0.. 9: ### 2618 - 10.. 19: ######## 7630 - 20.. 29: ############## 12505 - 30.. 39: #################### 17451 - 40.. 49: ########################## 22280 - 50.. 59: ############################### 27307 - 60.. 69: ##################################### 32151 - 70.. 79: ########################################### 37199 - 80.. 89: ################################################# 41901 - 90.. 99: ###################################################### 46313 - 100..109: ####################################################### 46965 - 110..119: ################################################# 42462 - 120..129: ########################################### 37348 - 130..139: ###################################### 32613 - 140..149: ################################ 27606 - 150..159: ########################### 23221 - 160..169: ##################### 18125 - 170..179: ############### 12890 - 180..189: ######### 8059 - 190..199: ### 3297 + num: 500000, avg: 100.10, stddev: 41.22, median 100, min 0, max 200 + 0.. 9: ### 2753 + 10.. 19: ######## 7572 + 20.. 29: ############## 12416 + 30.. 39: #################### 17234 + 40.. 49: ######################### 22216 + 50.. 59: ############################### 27110 + 60.. 69: ##################################### 32089 + 70.. 79: ########################################## 36885 + 80.. 89: ################################################ 41775 + 90.. 99: ###################################################### 46764 + 100..109: ####################################################### 47231 + 110..119: ################################################# 42910 + 120..129: ########################################### 37485 + 130..139: ###################################### 32673 + 140..149: ################################ 27901 + 150..159: ########################## 22900 + 160..169: #################### 17756 + 170..179: ############## 12867 + 180..189: ######### 8198 + 190..199: ### 3206 200..209: 59 +++ Stats for triple dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats triple sum: - num: 500000, avg: 150.04, stddev: 50.53, median 150, min 1, max 300 - 1.. 15: 360 - 16.. 30: ## 2261 - 31.. 45: ##### 5712 - 46.. 60: ########## 10854 - 61.. 75: ################# 17760 - 76.. 90: ########################## 26151 - 91..105: ################################### 36079 - 106..120: ############################################# 45498 - 121..135: ################################################### 51977 - 136..150: ####################################################### 55179 - 151..165: ###################################################### 54821 - 166..180: ################################################### 51709 - 181..195: ############################################# 45166 - 196..210: ################################### 35354 - 211..225: ######################### 25436 - 226..240: ################# 17179 - 241..255: ########## 10652 - 256..270: ##### 5447 - 271..285: ## 2065 - 286..300: 340 + num: 500000, avg: 149.97, stddev: 50.47, median 150, min 2, max 300 + 2.. 16: 436 + 17.. 31: ## 2462 + 32.. 46: ###### 6168 + 47.. 61: ########### 11181 + 62.. 76: ################# 17966 + 77.. 91: ########################## 26835 + 92..106: #################################### 36662 + 107..121: ############################################# 46199 + 122..136: #################################################### 52565 + 137..151: ####################################################### 55318 + 152..166: ###################################################### 54923 + 167..181: ################################################## 51081 + 182..196: ############################################ 44563 + 197..211: ################################## 34853 + 212..226: ######################## 24865 + 227..241: ################ 16598 + 242..256: ######### 10006 + 257..271: ##### 5146 + 272..286: # 1935 + 287..301: 238 +++ Stats for quad dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats quad sum: - num: 500000, avg: 200.06, stddev: 58.39, median 200, min 2, max 394 - 2.. 21: 61 - 22.. 41: 658 - 42.. 61: ## 2534 - 62.. 81: ##### 6444 - 82..101: ########### 13334 - 102..121: ################### 23279 - 122..141: ############################## 35888 - 142..161: ######################################### 48824 - 162..181: ################################################## 59008 - 182..201: ####################################################### 64896 - 202..221: ###################################################### 64051 - 222..241: ################################################# 57864 - 242..261: ####################################### 46793 - 262..281: ############################ 33955 - 282..301: ################## 21775 - 302..321: ########## 12187 - 322..341: #### 5645 - 342..361: # 2244 - 362..381: 529 - 382..401: 31 + num: 500000, avg: 200.11, stddev: 58.32, median 200, min 5, max 398 + 5.. 24: 93 + 25.. 44: 803 + 45.. 64: ## 2950 + 65.. 84: ###### 7307 + 85..104: ############ 14442 + 105..124: ##################### 25228 + 125..144: ################################ 37961 + 145..164: ########################################## 50311 + 165..184: ################################################## 60055 + 185..204: ####################################################### 65159 + 205..224: ##################################################### 63845 + 225..244: ############################################### 56537 + 245..264: ###################################### 45021 + 265..284: ########################### 32167 + 285..304: ################ 19919 + 305..324: ######### 10874 + 325..344: #### 5069 + 345..364: # 1849 + 365..384: 393 + 385..404: 17 +++ Stats for bind dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats ordered pair difference: - num: 1000000, avg: 25.01, stddev: 22.38, median 19, min 0, max 100 - 0.. 4: ####################################################### 193610 - 5.. 9: #################################### 130051 - 10.. 14: ############################# 104209 - 15.. 19: ######################## 86993 - 20.. 24: ##################### 74295 - 25.. 29: ################## 64874 - 30.. 34: ################ 56447 - 35.. 39: ############## 49416 - 40.. 44: ############ 43051 - 45.. 49: ########## 37580 - 50.. 54: ######### 32378 - 55.. 59: ######## 28558 - 60.. 64: ###### 23971 - 65.. 69: ##### 20146 - 70.. 74: #### 16446 - 75.. 79: ### 13215 - 80.. 84: ## 10294 - 85.. 89: ## 7639 - 90.. 94: # 4698 - 95.. 99: 2041 - 100..104: 88 + num: 1000000, avg: 25.01, stddev: 22.36, median 19, min 0, max 100 + 0.. 4: ####################################################### 193620 + 5.. 9: #################################### 129807 + 10.. 14: ############################# 103875 + 15.. 19: ######################## 87161 + 20.. 24: ##################### 74588 + 25.. 29: ################## 64327 + 30.. 34: ################ 56519 + 35.. 39: ############## 49825 + 40.. 44: ############ 43263 + 45.. 49: ########## 37612 + 50.. 54: ######### 32623 + 55.. 59: ####### 28125 + 60.. 64: ###### 24206 + 65.. 69: ##### 20107 + 70.. 74: #### 16712 + 75.. 79: ### 13309 + 80.. 84: ## 10347 + 85.. 89: ## 7339 + 90.. 94: # 4591 + 95.. 99: 1957 + 100..104: 87 stats ordered pair sum: - num: 1000000, avg: 74.97, stddev: 46.86, median 72, min 0, max 200 - 0.. 9: ####################################################### 70320 - 10.. 19: ##################################################### 68731 - 20.. 29: ##################################################### 68374 - 30.. 39: ##################################################### 68544 - 40.. 49: ##################################################### 68756 - 50.. 59: ##################################################### 68837 - 60.. 69: ##################################################### 68759 - 70.. 79: ##################################################### 68517 - 80.. 89: ##################################################### 68692 - 90.. 99: ###################################################### 69123 - 100..109: ################################################## 64777 - 110..119: ########################################### 55288 - 120..129: #################################### 47156 - 130..139: ############################### 39635 - 140..149: ######################### 32590 - 150..159: #################### 25685 - 160..169: ############### 19842 - 170..179: ########## 14038 - 180..189: ###### 8631 - 190..199: ## 3580 - 200..209: 125 + num: 1000000, avg: 75.09, stddev: 46.93, median 72, min 0, max 200 + 0.. 9: ####################################################### 70091 + 10.. 19: ##################################################### 68426 + 20.. 29: ##################################################### 68723 + 30.. 39: ##################################################### 68717 + 40.. 49: ##################################################### 68445 + 50.. 59: ##################################################### 68798 + 60.. 69: ##################################################### 68591 + 70.. 79: ##################################################### 68385 + 80.. 89: ##################################################### 68603 + 90.. 99: ##################################################### 68647 + 100..109: ################################################## 64063 + 110..119: ########################################### 55810 + 120..129: ##################################### 47218 + 130..139: ############################### 39763 + 140..149: ######################### 32908 + 150..159: #################### 26241 + 160..169: ############### 20137 + 170..179: ########### 14180 + 180..189: ###### 8622 + 190..199: ## 3523 + 200..209: 109 +++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Collect results for test option dist: -None : 1492 cases -Some _: 8508 cases +None : 1481 cases +Some _: 8519 cases +++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Collect results for test result dist: -Error _: 2439 cases -Ok _ : 7561 cases +Error _: 2469 cases +Ok _ : 7531 cases +++ Stats for list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 374.46, stddev: 1320.15, median 9, min 0, max 9984 - 0.. 499: ####################################################### 4269 - 500.. 999: ###### 503 - 1000.. 1499: 13 - 1500.. 1999: 6 - 2000.. 2499: 22 - 2500.. 2999: 13 - 3000.. 3499: 10 - 3500.. 3999: 5 - 4000.. 4499: 15 - 4500.. 4999: 10 - 5000.. 5499: 15 - 5500.. 5999: 12 - 6000.. 6499: 6 - 6500.. 6999: 12 - 7000.. 7499: 11 - 7500.. 7999: 15 - 8000.. 8499: 21 - 8500.. 8999: 11 - 9000.. 9499: 15 - 9500.. 9999: 16 + num: 5000, avg: 344.34, stddev: 1211.86, median 9, min 0, max 9901 + 0.. 495: ####################################################### 4276 + 496.. 991: ###### 509 + 992..1487: 19 + 1488..1983: 10 + 1984..2479: 13 + 2480..2975: 13 + 2976..3471: 9 + 3472..3967: 13 + 3968..4463: 15 + 4464..4959: 8 + 4960..5455: 11 + 5456..5951: 17 + 5952..6447: 9 + 6448..6943: 9 + 6944..7439: 12 + 7440..7935: 8 + 7936..8431: 8 + 8432..8927: 15 + 8928..9423: 13 + 9424..9919: 13 +++ Stats for small_list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 15.36, stddev: 23.76, median 6, min 0, max 99 - 0.. 4: ###################################################### 1933 - 5.. 9: ####################################################### 1962 + num: 5000, avg: 15.62, stddev: 24.13, median 6, min 0, max 99 + 0.. 4: ##################################################### 1920 + 5.. 9: ####################################################### 1958 10.. 14: # 69 - 15.. 19: # 57 - 20.. 24: # 51 - 25.. 29: # 62 - 30.. 34: # 63 - 35.. 39: # 65 - 40.. 44: ## 77 - 45.. 49: # 71 - 50.. 54: # 56 - 55.. 59: # 60 + 15.. 19: # 68 + 20.. 24: # 58 + 25.. 29: # 61 + 30.. 34: # 65 + 35.. 39: # 51 + 40.. 44: ## 78 + 45.. 49: # 54 + 50.. 54: # 59 + 55.. 59: # 66 60.. 64: # 66 - 65.. 69: # 65 - 70.. 74: # 69 - 75.. 79: # 48 - 80.. 84: # 53 - 85.. 89: # 58 - 90.. 94: # 64 - 95.. 99: # 51 + 65.. 69: # 49 + 70.. 74: # 66 + 75.. 79: ## 76 + 80.. 84: # 60 + 85.. 89: # 63 + 90.. 94: # 61 + 95.. 99: # 52 +++ Stats for list_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 7.50, stddev: 1.71, median 8, min 5, max 10 - 5: ###################################################### 853 - 6: #################################################### 819 - 7: #################################################### 820 - 8: #################################################### 825 - 9: ####################################################### 857 - 10: ##################################################### 826 + num: 5000, avg: 7.48, stddev: 1.71, median 7, min 5, max 10 + 5: ##################################################### 845 + 6: ###################################################### 857 + 7: #################################################### 830 + 8: ################################################## 790 + 9: ####################################################### 862 + 10: #################################################### 816 +++ Stats for list_repeat len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -1167,63 +1168,63 @@ stats len: +++ Stats for array len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 374.46, stddev: 1320.15, median 9, min 0, max 9984 - 0.. 499: ####################################################### 4269 - 500.. 999: ###### 503 - 1000.. 1499: 13 - 1500.. 1999: 6 - 2000.. 2499: 22 - 2500.. 2999: 13 - 3000.. 3499: 10 - 3500.. 3999: 5 - 4000.. 4499: 15 - 4500.. 4999: 10 - 5000.. 5499: 15 - 5500.. 5999: 12 - 6000.. 6499: 6 - 6500.. 6999: 12 - 7000.. 7499: 11 - 7500.. 7999: 15 - 8000.. 8499: 21 - 8500.. 8999: 11 - 9000.. 9499: 15 - 9500.. 9999: 16 + num: 5000, avg: 344.34, stddev: 1211.86, median 9, min 0, max 9901 + 0.. 495: ####################################################### 4276 + 496.. 991: ###### 509 + 992..1487: 19 + 1488..1983: 10 + 1984..2479: 13 + 2480..2975: 13 + 2976..3471: 9 + 3472..3967: 13 + 3968..4463: 15 + 4464..4959: 8 + 4960..5455: 11 + 5456..5951: 17 + 5952..6447: 9 + 6448..6943: 9 + 6944..7439: 12 + 7440..7935: 8 + 7936..8431: 8 + 8432..8927: 15 + 8928..9423: 13 + 9424..9919: 13 +++ Stats for small_array len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 15.36, stddev: 23.76, median 6, min 0, max 99 - 0.. 4: ###################################################### 1933 - 5.. 9: ####################################################### 1962 + num: 5000, avg: 15.62, stddev: 24.13, median 6, min 0, max 99 + 0.. 4: ##################################################### 1920 + 5.. 9: ####################################################### 1958 10.. 14: # 69 - 15.. 19: # 57 - 20.. 24: # 51 - 25.. 29: # 62 - 30.. 34: # 63 - 35.. 39: # 65 - 40.. 44: ## 77 - 45.. 49: # 71 - 50.. 54: # 56 - 55.. 59: # 60 + 15.. 19: # 68 + 20.. 24: # 58 + 25.. 29: # 61 + 30.. 34: # 65 + 35.. 39: # 51 + 40.. 44: ## 78 + 45.. 49: # 54 + 50.. 54: # 59 + 55.. 59: # 66 60.. 64: # 66 - 65.. 69: # 65 - 70.. 74: # 69 - 75.. 79: # 48 - 80.. 84: # 53 - 85.. 89: # 58 - 90.. 94: # 64 - 95.. 99: # 51 + 65.. 69: # 49 + 70.. 74: # 66 + 75.. 79: ## 76 + 80.. 84: # 60 + 85.. 89: # 63 + 90.. 94: # 61 + 95.. 99: # 52 +++ Stats for array_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 7.50, stddev: 1.71, median 8, min 5, max 10 - 5: ###################################################### 853 - 6: #################################################### 819 - 7: #################################################### 820 - 8: #################################################### 825 - 9: ####################################################### 857 - 10: ##################################################### 826 + num: 5000, avg: 7.48, stddev: 1.71, median 7, min 5, max 10 + 5: ##################################################### 845 + 6: ###################################################### 857 + 7: #################################################### 830 + 8: ################################################## 790 + 9: ####################################################### 862 + 10: #################################################### 816 +++ Stats for array_repeat len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -1423,27 +1424,27 @@ stats dist: +++ Stats for int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 100000, avg: -2481754.31, stddev: 618398387.27, median -5669677, min -1073719962, max 1073717275 - -1073719962.. -966348101: ##################################################### 4978 - -966348100.. -858976239: ##################################################### 5008 - -858976238.. -751604377: #################################################### 4907 - -751604376.. -644232515: ###################################################### 5037 - -644232514.. -536860653: ###################################################### 5069 - -536860652.. -429488791: ###################################################### 5052 - -429488790.. -322116929: ###################################################### 5035 - -322116928.. -214745067: ####################################################### 5128 - -214745066.. -107373205: ##################################################### 5017 - -107373204.. -1343: ##################################################### 5021 - -1342.. 107370519: ##################################################### 5010 - 107370520.. 214742381: ##################################################### 4964 - 214742382.. 322114243: ##################################################### 4957 - 322114244.. 429486105: ##################################################### 4994 - 429486106.. 536857967: ##################################################### 5025 - 536857968.. 644229829: ###################################################### 5047 - 644229830.. 751601691: ##################################################### 4988 - 751601692.. 858973553: #################################################### 4924 - 858973554.. 966345415: #################################################### 4852 - 966345416.. 1073717277: ##################################################### 4987 + num: 100000, avg: 1375300.54, stddev: 620110315.04, median -3852464, min -1073736753, max 1073733862 + -1073736753.. -966363223: #################################################### 4972 + -966363222.. -858989692: ##################################################### 5032 + -858989691.. -751616161: #################################################### 4928 + -751616160.. -644242630: #################################################### 4920 + -644242629.. -536869099: ##################################################### 5037 + -536869098.. -429495568: #################################################### 4964 + -429495567.. -322122037: ##################################################### 5020 + -322122036.. -214748506: ##################################################### 4995 + -214748505.. -107374975: ####################################################### 5175 + -107374974.. -1444: ###################################################### 5156 + -1443.. 107372087: ################################################### 4824 + 107372088.. 214745618: ##################################################### 5043 + 214745619.. 322119149: #################################################### 4899 + 322119150.. 429492680: #################################################### 4959 + 429492681.. 536866211: #################################################### 4920 + 536866212.. 644239742: ##################################################### 5036 + 644239743.. 751613273: ##################################################### 5049 + 751613274.. 858986804: #################################################### 4913 + 858986805.. 966360335: ##################################################### 5040 + 966360336.. 1073733866: ###################################################### 5118 +++ Stats for oneof int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -1678,26 +1679,26 @@ random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 1000, avg: -20587725.59, stddev: 427231078.01, median 8, min -1072292884, max 1073741823 - -1072292884.. -964991149: ## 26 - -964991148.. -857689413: ### 31 - -857689412.. -750387677: ## 22 - -750387676.. -643085941: ## 22 - -643085940.. -535784205: ## 27 - -535784204.. -428482469: ### 30 - -428482468.. -321180733: ## 29 - -321180732.. -213878997: ## 20 - -213878996.. -106577261: ## 20 - -106577260.. 724475: ####################################################### 543 - 724476.. 108026211: ## 22 - 108026212.. 215327947: ## 22 - 215327948.. 322629683: ### 32 - 322629684.. 429931419: ## 29 - 429931420.. 537233155: ## 20 - 537233156.. 644534891: ## 21 - 644534892.. 751836627: ## 20 - 751836628.. 859138363: ## 22 - 859138364.. 966440099: ## 24 - 966440100.. 1073741823: # 18 + num: 1000, avg: 12189159.05, stddev: 451294853.72, median 10, min -1073230792, max 1073741823 + -1073230792.. -965882162: ## 19 + -965882161.. -858533531: ### 30 + -858533530.. -751184900: ### 29 + -751184899.. -643836269: ## 23 + -643836268.. -536487638: ### 29 + -536487637.. -429139007: ## 20 + -429139006.. -321790376: ## 22 + -321790375.. -214441745: ## 27 + -214441744.. -107093114: ### 30 + -107093113.. 255517: ####################################################### 512 + 255518.. 107604148: ## 20 + 107604149.. 214952779: ## 21 + 214952780.. 322301410: ### 28 + 322301411.. 429650041: ## 25 + 429650042.. 536998672: ## 26 + 536998673.. 644347303: ## 27 + 644347304.. 751695934: ### 30 + 751695935.. 859044565: ## 20 + 859044566.. 966393196: ### 34 + 966393197.. 1073741823: ### 28 ================================================================================ success (ran 1 tests) diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.64 b/test/core/QCheck2_expect_test.expected.ocaml5.64 index edb64666..a31f0fd2 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.64 @@ -1,118 +1,125 @@ random seed: 1234 -45 4 0 0 0 0 0 0 0 0 0 0 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 (8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) -(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) -(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) -(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) -(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) -(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) -(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) -(8,fun,45) (4,fun,5) (5,fun,23) (54,fun,6) (6,fun,9) (2,fun,9) (2,fun,9) (77,fun,6) (6,fun,54) (1,fun,3) --1592932412304362665 -98783772632201765 +45 4 0 0 0 0 0 0 0 0 0 0 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 (8,fun,0) (4,fun,19) (5,fun,32) (54,fun,1) (6,fun,4) (2,fun,6) (2,fun,5) (77,fun,3) (6,fun,1) (1,fun,73) +(8,fun,0) (4,fun,19) (5,fun,32) (54,fun,1) (6,fun,4) (2,fun,6) (2,fun,5) (77,fun,3) (6,fun,1) (1,fun,73) +(8,fun,0) (4,fun,19) (5,fun,32) (54,fun,1) (6,fun,4) (2,fun,6) (2,fun,5) (77,fun,3) (6,fun,1) (1,fun,73) +(8,fun,0) (4,fun,19) (5,fun,32) (54,fun,1) (6,fun,4) (2,fun,6) (2,fun,5) (77,fun,3) (6,fun,1) (1,fun,73) +(8,fun,0) (4,fun,19) (5,fun,32) (54,fun,1) (6,fun,4) (2,fun,6) (2,fun,5) (77,fun,3) (6,fun,1) (1,fun,73) +(8,fun,0) (4,fun,19) (5,fun,32) (54,fun,1) (6,fun,4) (2,fun,6) (2,fun,5) (77,fun,3) (6,fun,1) (1,fun,73) +(8,fun,0) (4,fun,19) (5,fun,32) (54,fun,1) (6,fun,4) (2,fun,6) (2,fun,5) (77,fun,3) (6,fun,1) (1,fun,73) +(8,fun,0) (4,fun,19) (5,fun,32) (54,fun,1) (6,fun,4) (2,fun,6) (2,fun,5) (77,fun,3) (6,fun,1) (1,fun,73) +1443152170069087821 0 -49391886316100882 +721576085034543910 0 -24695943158050441 +360788042517271955 0 -12347971579025220 +180394021258635977 0 -6173985789512610 +90197010629317988 0 -3086992894756305 +45098505314658994 0 -1543496447378152 +22549252657329497 0 -771748223689076 +11274626328664748 0 -385874111844538 +5637313164332374 0 -192937055922269 +2818656582166187 0 -96468527961134 +1409328291083093 0 -48234263980567 +704664145541546 0 -24117131990283 +352332072770773 0 -12058565995141 +176166036385386 0 -6029282997570 +88083018192693 0 -3014641498785 +44041509096346 0 -1507320749392 +22020754548173 0 -753660374696 +11010377274086 0 -376830187348 +5505188637043 0 -188415093674 +2752594318521 0 -94207546837 +1376297159260 0 -47103773418 +688148579630 0 -23551886709 +344074289815 0 -11775943354 +172037144907 0 -5887971677 +86018572453 0 -2943985838 +43009286226 0 -1471992919 +21504643113 0 -735996459 +10752321556 0 -367998229 +5376160778 0 -183999114 +2688080389 0 -91999557 +1344040194 0 -45999778 +672020097 0 -22999889 +336010048 0 -11499944 +168005024 0 -5749972 +84002512 0 -2874986 +42001256 0 -1437493 +21000628 0 -718746 +10500314 0 -359373 +5250157 0 -179686 +2625078 0 -89843 +1312539 0 -44921 +656269 0 -22460 +328134 0 -11230 +164067 0 -5615 +82033 0 -2807 +41016 0 -1403 +20508 0 -701 +10254 0 -350 +5127 0 -175 +2563 0 -87 +1281 0 -43 +640 0 -21 +320 +0 +160 +0 +80 +0 +40 +0 +20 0 10 0 @@ -172,7 +179,7 @@ Test should_fail_sort_id failed (11 shrink steps): === Error ====================================================================== -Test should_error_raise_exn errored on (2 shrink steps): +Test should_error_raise_exn errored on (1 shrink steps): 0 @@ -231,7 +238,7 @@ Test with shrinking retries failed (0 shrink steps): Warning for test WARN_unlikely_precond: -WARNING: only 0.8% tests (of 2000) passed precondition for "WARN_unlikely_precond" +WARNING: only 0.7% tests (of 2000) passed precondition for "WARN_unlikely_precond" NOTE: it is likely that the precondition is too strong, or that the generator is buggy. @@ -239,7 +246,7 @@ NOTE: it is likely that the precondition is too strong, or that the generator is Test FAIL_unlikely_precond failed: -ERROR: only 0.8% tests (of 2000) passed precondition for "FAIL_unlikely_precond" +ERROR: only 0.7% tests (of 2000) passed precondition for "FAIL_unlikely_precond" NOTE: it is likely that the precondition is too strong, or that the generator is buggy. @@ -290,7 +297,7 @@ Test big bound issue59 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test long_shrink failed (3029 shrink steps): +Test long_shrink failed (3067 shrink steps): ([0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0], [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 1]) @@ -302,7 +309,7 @@ Test ints arent 0 mod 3 failed (1 shrink steps): --- Failure -------------------------------------------------------------------- -Test ints are 0 failed (57 shrink steps): +Test ints are 0 failed (60 shrink steps): 1 @@ -412,11 +419,11 @@ Test strings have unique chars failed (14 shrink steps): Test pairs have different components failed (0 shrink steps): -(6, 6) +(1, 1) --- Failure -------------------------------------------------------------------- -Test pairs have same components failed (63 shrink steps): +Test pairs have same components failed (62 shrink steps): (0, 1) @@ -428,39 +435,39 @@ Test pairs have a zero component failed (122 shrink steps): --- Failure -------------------------------------------------------------------- -Test pairs are (0,0) failed (63 shrink steps): +Test pairs are (0,0) failed (62 shrink steps): (0, 1) --- Failure -------------------------------------------------------------------- -Test pairs are ordered failed (88 shrink steps): +Test pairs are ordered failed (100 shrink steps): (1, 0) --- Failure -------------------------------------------------------------------- -Test pairs are ordered reversely failed (62 shrink steps): +Test pairs are ordered reversely failed (61 shrink steps): (0, 1) --- Failure -------------------------------------------------------------------- -Test pairs sum to less than 128 failed (58 shrink steps): +Test pairs sum to less than 128 failed (57 shrink steps): (0, 128) --- Failure -------------------------------------------------------------------- -Test pairs lists rev concat failed (72 shrink steps): +Test pairs lists rev concat failed (76 shrink steps): ([0], [1]) --- Failure -------------------------------------------------------------------- -Test pairs lists no overlap failed (22 shrink steps): +Test pairs lists no overlap failed (18 shrink steps): -([0], [0; 0; 0; 0; 0; 0; 0; 0]) +([0], [0; 0; 0; 0]) --- Failure -------------------------------------------------------------------- @@ -470,91 +477,91 @@ Test triples have pair-wise different components failed (3 shrink steps): --- Failure -------------------------------------------------------------------- -Test triples have same components failed (63 shrink steps): +Test triples have same components failed (64 shrink steps): (0, 1, 0) --- Failure -------------------------------------------------------------------- -Test triples are ordered failed (3 shrink steps): +Test triples are ordered failed (4 shrink steps): (0, 0, -1) --- Failure -------------------------------------------------------------------- -Test triples are ordered reversely failed (122 shrink steps): +Test triples are ordered reversely failed (61 shrink steps): (0, 0, 1) --- Failure -------------------------------------------------------------------- -Test quadruples have pair-wise different components failed (3 shrink steps): +Test quadruples have pair-wise different components failed (4 shrink steps): (0, 0, 0, 0) --- Failure -------------------------------------------------------------------- -Test quadruples have same components failed (122 shrink steps): +Test quadruples have same components failed (126 shrink steps): (0, 1, 0, 1) --- Failure -------------------------------------------------------------------- -Test quadruples are ordered failed (4 shrink steps): +Test quadruples are ordered failed (6 shrink steps): (0, 0, 0, -1) --- Failure -------------------------------------------------------------------- -Test quadruples are ordered reversely failed (124 shrink steps): +Test quadruples are ordered reversely failed (187 shrink steps): (0, 0, 0, 1) --- Failure -------------------------------------------------------------------- -Test forall (a, b) in nat: a < b failed (3 shrink steps): +Test forall (a, b) in nat: a < b failed (1 shrink steps): (0, 0) --- Failure -------------------------------------------------------------------- -Test forall (a, b, c) in nat: a < b < c failed (5 shrink steps): +Test forall (a, b, c) in nat: a < b < c failed (2 shrink steps): (0, 0, 0) --- Failure -------------------------------------------------------------------- -Test forall (a, b, c, d) in nat: a < b < c < d failed (4 shrink steps): +Test forall (a, b, c, d) in nat: a < b < c < d failed (3 shrink steps): (0, 0, 0, 0) --- Failure -------------------------------------------------------------------- -Test forall (a, b, c, d, e) in nat: a < b < c < d < e failed (5 shrink steps): +Test forall (a, b, c, d, e) in nat: a < b < c < d < e failed (3 shrink steps): (0, 0, 0, 0, 0) --- Failure -------------------------------------------------------------------- -Test forall (a, b, c, d, e, f) in nat: a < b < c < d < e < f failed (6 shrink steps): +Test forall (a, b, c, d, e, f) in nat: a < b < c < d < e < f failed (4 shrink steps): (0, 0, 0, 0, 0, 0) --- Failure -------------------------------------------------------------------- -Test forall (a, b, c, d, e, f, g) in nat: a < b < c < d < e < f < g failed (7 shrink steps): +Test forall (a, b, c, d, e, f, g) in nat: a < b < c < d < e < f < g failed (5 shrink steps): (0, 0, 0, 0, 0, 0, 0) --- Failure -------------------------------------------------------------------- -Test forall (a, b, c, d, e, f, g, h) in nat: a < b < c < d < e < f < g < h failed (8 shrink steps): +Test forall (a, b, c, d, e, f, g, h) in nat: a < b < c < d < e < f < g < h failed (6 shrink steps): (0, 0, 0, 0, 0, 0, 0, 0) --- Failure -------------------------------------------------------------------- -Test forall (a, b, c, d, e, f, g, h, i) in nat: a < b < c < d < e < f < g < h < i failed (9 shrink steps): +Test forall (a, b, c, d, e, f, g, h, i) in nat: a < b < c < d < e < f < g < h < i failed (7 shrink steps): (0, 0, 0, 0, 0, 0, 0, 0, 0) @@ -584,13 +591,13 @@ Test lists shorter than 10 failed (15 shrink steps): --- Failure -------------------------------------------------------------------- -Test lists shorter than 432 failed (413 shrink steps): +Test lists shorter than 432 failed (415 shrink steps): [...] list length: 432 --- Failure -------------------------------------------------------------------- -Test lists shorter than 4332 failed (4002 shrink steps): +Test lists shorter than 4332 failed (4017 shrink steps): [...] list length: 4332 @@ -638,33 +645,33 @@ Test sum list = 0 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int failed (244 shrink steps): +Test fail_pred_map_commute_int failed (126 shrink steps): -([0; 0], {16 -> 0; 32 -> 0; 0 -> 13; 65 -> 0; 18 -> 0; 2 -> 0; 19 -> 0; 3 -> 0; 20 -> 0; 68 -> 0; 21 -> 0; 5 -> 0; 37 -> 0; 53 -> 0; 86 -> 0; 7 -> 0; 24 -> 0; 8 -> 0; 9 -> 0; 10 -> 0; 43 -> 0; 28 -> 0; 14 -> 0; 78 -> 0; 15 -> 0; _ -> 0}, {66275786897687936 -> false; 0 -> false; 37585042864641 -> false; 182146 -> false; 54366856439509634 -> false; -381189003139879806 -> false; 2 -> false; 30621323267 -> false; 166274844009475 -> false; 3 -> false; 364293 -> false; 5 -> false; 7 -> false; 10526600 -> false; 8 -> false; 9 -> false; 2954 -> false; 19210 -> false; 728586 -> false; 38660875690317962 -> false; 10 -> false; 5515 -> false; 14035467 -> false; 155189854408843 -> false; 13 -> true; -3511326262846579571 -> false; 25614 -> false; 14 -> false; 28815 -> false; 427189276652303 -> false; 8640826060088079 -> false; 15 -> false; 272 -> false; 74855824 -> false; 943820830864 -> false; 16 -> false; 17 -> false; 21053201 -> false; 650955088232081 -> false; 1843063293562136465 -> false; 18 -> false; -1207743061799580782 -> false; 2582479384970564114 -> false; 32215751026835 -> false; 19 -> false; 558005797129117203 -> false; 28579901716 -> false; 20 -> false; 5909 -> false; 38421 -> false; 99807765 -> false; 1258427774485 -> false; 77321751380635925 -> false; 21 -> false; 28070934 -> false; 116134203798 -> false; 867940117642775 -> false; 408 -> false; 43550326424 -> false; 24 -> false; 6257335833 -> false; 16686228889 -> false; 26 -> false; 43493485151607707 -> false; 51228 -> false; 1825056284 -> false; 23731525532 -> false; 133019875207580 -> false; 28 -> false; 6303 -> false; 544 -> false; 149711648 -> false; 1887641661728 -> false; 32 -> false; 136609 -> false; 1295265 -> false; 34 -> false; -796804578571543518 -> false; -3143884152072092894 -> false; 7203 -> false; 1301910176464163 -> false; 933 -> false; 37 -> false; 7894950 -> false; 2215 -> false; 56179084987493288 -> false; 2737584426 -> false; 199615531 -> false; 2516855548971 -> false; 88367715863583915 -> false; 1724444827403006379 -> false; 43 -> false; 1727020 -> false; 798462124 -> false; 45 -> false; 10067422195886 -> false; 1735880235285551 -> false; 10533578435154991 -> false; 3193848497 -> false; 366162237130545 -> false; 7406422337218353 -> false; 6908082 -> false; 51 -> false; -2381024303006854989 -> false; -3341657596864116300 -> false; 10805 -> false; 17798644149 -> false; 50742399343542325 -> false; 53 -> false; 24497058614 -> false; 353932811574 -> false; 99543603255 -> false; 21477167351223 -> false; -119319574914777289 -> false; 102456 -> false; 971448 -> false; 40269688783544 -> false; 3650112569 -> false; 5921213 -> false; 15821017021 -> false; 88679916805053 -> false; 830 -> false; 12606 -> false; 171817338809791 -> false; 6943520941142207 -> false; 1089 -> false; 65 -> false; 2590530 -> false; 273219 -> false; 68 -> false; 14407 -> false; 13348983111 -> false; 15800367652732487 -> false; 37427912 -> false; 325477544116040 -> false; 1417674849728090569 -> false; 58067101899 -> false; 204 -> false; 15789900 -> false; 8343114444 -> false; 21775163212 -> false; 77 -> false; 11865762766 -> false; 78 -> false; 4431 -> false; 3151 -> false; 57991313535476943 -> false; 68304 -> false; 647632 -> false; 530899217361 -> false; 3947475 -> false; 18433762261521235 -> false; 28089542493746644 -> false; 44183857931791957 -> false; 399231062 -> false; -1759927375200850090 -> false; 86 -> false; 5033711097943 -> false; 1596924248 -> false; 1415731246296 -> false; 3454041 -> false; 19750459565915609 -> false; 90 -> false; 8899322074 -> false; 3234503663319679322 -> false; 485724 -> false; 20134844391772 -> false; 1245 -> false; -2772163063813019426 -> false; 85908669404895 -> false; 3471760470571103 -> false; 21067156870309983 -> false; 909328030552912351 -> false; 18713956 -> false; 29033550949 -> false; -2219752219093363099 -> false; 102 -> false; 4171557222 -> false; 2325595319255300198 -> false; -3390706662452617370 -> false; 28995656767738471 -> false; 265449608680 -> false; 2118364168588763240 -> false; 1158207106723147241 -> false; 14044771246873322 -> false; 707865623148 -> false; 488216316174060 -> false; 9875229782957804 -> false; -4251440306801319700 -> false; 2441230840770586092 -> false; 622 -> false; 42954334702447 -> false; 32662744818 -> false; 7300225139 -> false; 132724804340 -> false; 472959556293621 -> false; 244108158087030 -> false; 4937614891478902 -> false; 4727 -> false; 354719667220215 -> false; 16331372409 -> false; 66362402170 -> false; 236479778146810 -> false; -127238344995975558 -> false; 3323 -> false; 31642034043 -> false; 177359833610107 -> false; 1661 -> false; 15573813630 -> false; 457702796413182 -> false; 9258027921522942 -> false; 4629013960761471 -> false; _ -> false}) +([0; 0], {0 -> 1; 1 -> 0; 2 -> 0; 4 -> 0; 5 -> 0; 54 -> 0; 6 -> 0; 23 -> 0; 7 -> 0; 8 -> 0; _ -> 0}, {1 -> true; 2 -> false; 1937055216023938291 -> false; 4 -> false; 5 -> false; 6 -> false; 23 -> false; 7 -> false; 8 -> false; 1902342822135566409 -> false; 428248039555175850 -> false; -3503595968806948661 -> false; -1248855469987920965 -> false; 4114456028088165916 -> false; 1562088908592064063 -> false; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int32 failed (225 shrink steps): +Test fail_pred_map_commute_int32 failed (64 shrink steps): -([0l], {75331484l -> 0l; 1136848737l -> 0l; 25967443l -> 0l; 1809593143l -> 0l; 812652795l -> 0l; 1171110740l -> 0l; 281549282l -> 0l; -877342592l -> 0l; -876617499l -> 0l; 563960163l -> 0l; 0l -> 1l; -348202501l -> 0l; 1943874710l -> 0l; 343894252l -> 0l; 624826382l -> 0l; -1129404246l -> 0l; 388312775l -> 0l; -848968653l -> 0l; -1565076831l -> 0l; 1824307125l -> 0l; -552120330l -> 0l; 1498416944l -> 0l; 851017536l -> 0l; 1579608471l -> 0l; -651202205l -> 0l; -1146538619l -> 0l; 1827731338l -> 0l; -1338530898l -> 0l; -699391038l -> 0l; -900565334l -> 0l; 843997254l -> 0l; -2004379534l -> 0l; 1046391667l -> 0l; 160479057l -> 0l; 222421013l -> 0l; -1019976151l -> 0l; 2025980447l -> 0l; -1835931598l -> 0l; 531452539l -> 0l; -2009399199l -> 0l; 526328917l -> 0l; -1522478843l -> 0l; -264989305l -> 0l; -113975057l -> 0l; 1689928864l -> 0l; 1019502418l -> 0l; -319727598l -> 0l; 1408962275l -> 0l; 2146072025l -> 0l; 1393085524l -> 0l; 1693051712l -> 0l; 1836339186l -> 0l; 1586704254l -> 0l; 543692191l -> 0l; 1586363388l -> 0l; 1712343140l -> 0l; -1289819017l -> 0l; -766883777l -> 0l; 1709020878l -> 0l; 969539258l -> 0l; -1399441934l -> 0l; 325615355l -> 0l; -1671242381l -> 0l; -2084063662l -> 0l; 1594187269l -> 0l; -1302631569l -> 0l; -115890480l -> 0l; -999319234l -> 0l; 362205480l -> 0l; 1909127602l -> 0l; 117081264l -> 0l; -1066809754l -> 0l; -1545717273l -> 0l; 115958783l -> 0l; 871596075l -> 0l; -1205789186l -> 0l; 1981785910l -> 0l; -1614620855l -> 0l; -32077002l -> 0l; -1411456813l -> 0l; 758964460l -> 0l; -769342433l -> 0l; 991708298l -> 0l; _ -> 0l}, {1136848737l -> false; 1809593143l -> false; 812652795l -> false; 1171110740l -> false; -877342592l -> false; 1565050922l -> false; 979572466l -> false; 104217172l -> false; -1856534394l -> false; -348202501l -> false; -673862244l -> false; 308947432l -> false; 343894252l -> false; -2031088625l -> false; 1750645404l -> false; 1157643425l -> false; -848968653l -> false; -1504371044l -> false; -1565076831l -> false; 1824307125l -> false; 982950240l -> false; 2020977849l -> false; 1889265845l -> false; -489771261l -> false; 1498416944l -> false; 851017536l -> false; 1579608471l -> false; -1146538619l -> false; -1163289289l -> false; 1827731338l -> false; -250008166l -> false; -699391038l -> false; 46062239l -> false; 843997254l -> false; -2004379534l -> false; 1046391667l -> false; -672679838l -> false; -1435877828l -> false; 732837526l -> false; -1019976151l -> false; 925913108l -> false; 1332061261l -> false; 139357263l -> false; 531452539l -> false; -2009399199l -> false; 526328917l -> false; -1522478843l -> false; -264989305l -> false; 1689928864l -> false; -1346986691l -> false; -1442906134l -> false; -999075733l -> false; -319727598l -> false; 1408962275l -> false; 1579421435l -> false; 2146072025l -> false; 316542700l -> false; -1391714030l -> false; 1779439473l -> false; -1002646370l -> false; 1836339186l -> false; 931758934l -> false; -2023511228l -> false; 1586704254l -> false; 543692191l -> false; 1586363388l -> false; 1712343140l -> false; -1289819017l -> false; 1976233434l -> false; -335551850l -> false; -564214470l -> false; -766883777l -> false; 1095157970l -> false; 1709020878l -> false; 982225875l -> false; -808156143l -> false; 969539258l -> false; 1324609334l -> false; 325615355l -> false; -1671242381l -> false; 2054541922l -> false; 173881745l -> false; -2084063662l -> false; 1594187269l -> false; 271400805l -> false; -1999936871l -> false; -463057368l -> false; 1909127602l -> false; 117081264l -> false; 115958783l -> false; 871596075l -> false; -1205789186l -> false; -1614620855l -> false; -2146186613l -> false; -1411456813l -> false; 758964460l -> false; -769342433l -> false; 1333986756l -> false; 991708298l -> false; 75331484l -> false; 25967443l -> false; -1988450453l -> false; 281549282l -> false; -215338467l -> false; 1823853744l -> false; -876617499l -> false; 563960163l -> false; 0l -> true; -1371167900l -> false; 569394672l -> false; 1943874710l -> false; -21969680l -> false; 624826382l -> false; -1862005476l -> false; -1129404246l -> false; 388312775l -> false; 1225087295l -> false; 909448910l -> false; -318097162l -> false; -552120330l -> false; -2015935885l -> false; 2142387483l -> false; -651202205l -> false; 150441917l -> false; -1731710824l -> false; -1338530898l -> false; -900565334l -> false; -238820569l -> false; 160479057l -> false; 222421013l -> false; 1802048184l -> false; 2025980447l -> false; -1636965277l -> false; 1326978241l -> false; -1835931598l -> false; 1314132578l -> false; -1464012521l -> false; 1071316774l -> false; 604359939l -> false; 854723166l -> false; -761515858l -> false; -113975057l -> false; -666518516l -> false; -915084559l -> false; 1019502418l -> false; -702876054l -> false; 146771378l -> false; 1393085524l -> false; 1693051712l -> false; 1775680850l -> false; 1900637913l -> false; -1835687180l -> false; -1399441934l -> false; -1662345616l -> false; -1302631569l -> false; -115890480l -> false; -999319234l -> false; 362205480l -> false; -1066809754l -> false; -1545717273l -> false; 1981785910l -> false; -19251138l -> false; -32077002l -> false; -1002197755l -> false; 1195624707l -> false; _ -> false}) +([0l; 1l], {_ -> 0l}, {2105244496l -> false; 1056359910l -> false; 1364327540l -> false; 1697200981l -> false; 749208472l -> false; -624253901l -> false; -1587859886l -> false; -1229314055l -> false; 79025834l -> false; 954563801l -> false; -1524569688l -> false; -101011561l -> false; -438671296l -> false; 922489845l -> false; -2089504257l -> false; -790819552l -> false; 140774641l -> false; -1966380908l -> false; 269604126l -> false; 1145293881l -> false; 0l -> true; -1777382617l -> false; 1447762681l -> false; 641593092l -> false; -2082304932l -> false; 2143531570l -> false; 263164458l -> false; 162807677l -> false; 901965649l -> false; -1354301954l -> false; 1073036012l -> false; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int64 failed (409 shrink steps): +Test fail_pred_map_commute_int64 failed (123 shrink steps): -([0L], {5854787549706481689L -> 0L; 3145329330861579979L -> 0L; 4882728146457597343L -> 0L; 9213678680194827455L -> 0L; 5300276494079701428L -> 0L; -9132719513648881735L -> 0L; 5100807290077018335L -> 0L; 4259354711344712502L -> 0L; -364061021052118635L -> 0L; -3581328212534219819L -> 0L; -8630303840787971041L -> 0L; -2978122754581212173L -> 0L; -4683856205808377145L -> 0L; -2954498161550507231L -> 0L; 8310294664523726142L -> 0L; 558752675069655569L -> 0L; 8199640615007233109L -> 0L; 1555660693178054105L -> 0L; 3734321537045757188L -> 0L; 7617254280160726422L -> 0L; -7095101722225497728L -> 0L; 2408366282890716208L -> 0L; -4292043424114694448L -> 0L; 6051446892539839664L -> 0L; -2620576406080708837L -> 0L; 3910553276736898631L -> 0L; -6049404088872216425L -> 0L; -7268555609988799200L -> 0L; -6934743764498995030L -> 0L; 4876048078141422706L -> 0L; -8915325446919098823L -> 0L; 2098138445044356137L -> 0L; 7859313320400495093L -> 0L; -1257408099724075377L -> 0L; 7835339442358508915L -> 0L; -1373219575348706144L -> 0L; -5629923125916047561L -> 0L; 5846432512550235357L -> 0L; -7434366745648348883L -> 0L; 2422190457351331666L -> 0L; -7267280566018852192L -> 0L; 3299736282478619448L -> 0L; 5029882331043609063L -> 0L; 3903578586206863836L -> 0L; -7619916642310435274L -> 0L; -2371338759413642156L -> 0L; -679766008357102884L -> 0L; 1340692257137144601L -> 0L; -790015524249429917L -> 0L; -4379154747792360737L -> 0L; 8399933408910938616L -> 0L; 6480637981859985820L -> 0L; -2308579306926069217L -> 0L; -8608744547020170782L -> 0L; -5594759985566186977L -> 0L; 2301544867433440993L -> 0L; 323546263287575941L -> 0L; -6538996838665322453L -> 0L; -2454988279788980498L -> 0L; 866928363553278728L -> 0L; 5164393405417580120L -> 0L; -499476091573676884L -> 0L; 4479813258449401643L -> 0L; -4763149175045705024L -> 0L; 469304370363482895L -> 0L; -2804630954669580607L -> 0L; 3734790826411290913L -> 0L; -227934510922809045L -> 0L; -3580496456230202944L -> 0L; -8950985269485293698L -> 0L; 212249186598423999L -> 0L; 639669963429369605L -> 0L; -2051861136476049823L -> 0L; 8348878307193905173L -> 0L; -3686676770270027707L -> 0L; 3224777727913298872L -> 0L; -5364159185804582406L -> 0L; 6806501729242859693L -> 0L; -1441073676419344347L -> 0L; -3765043485710736446L -> 0L; 7194818492908892508L -> 0L; -2796892171845744540L -> 0L; -4420431099744708779L -> 0L; 1019954390233679959L -> 0L; -2530663500164660862L -> 0L; -2264698731421349299L -> 0L; -6301941405625428267L -> 0L; -1495518350952249754L -> 0L; 6790791859713076536L -> 0L; -8660185765070272892L -> 0L; 0L -> -1L; 6461206961562494132L -> 0L; 4161392575889986945L -> 0L; -6062160849957200379L -> 0L; 2050777921649849245L -> 0L; -2338474396491590209L -> 0L; 6040222022058163474L -> 0L; 4420706034848988623L -> 0L; 7007967583009742492L -> 0L; -6721953801867170697L -> 0L; -7885266170714706233L -> 0L; 4322769158609909940L -> 0L; -898939348400618792L -> 0L; 1398507300916388863L -> 0L; -3768157736633469270L -> 0L; 3259727538054383679L -> 0L; 7887016748577155308L -> 0L; 689252303200971584L -> 0L; 1153745841753386362L -> 0L; -7622842036935762123L -> 0L; -2655363517875144787L -> 0L; -3316185614787998640L -> 0L; -2161834059847512675L -> 0L; 7772143368369364168L -> 0L; 643735998272900932L -> 0L; 4986005544098925810L -> 0L; 2746391341985398187L -> 0L; -4380764207063965457L -> 0L; -5178825119209008517L -> 0L; 3567420727005224228L -> 0L; -6591184801704195820L -> 0L; -7799749368733739938L -> 0L; -6139115887619923128L -> 0L; 6435651773147788786L -> 0L; -4281744317789616022L -> 0L; 6784366724273561670L -> 0L; -3312092294417046138L -> 0L; 9177166544734112775L -> 0L; -5748946431569544365L -> 0L; 5663627078768118084L -> 0L; 8366279157860053843L -> 0L; 7340188779816032270L -> 0L; 4494217989422939968L -> 0L; 8511705671936252155L -> 0L; 4164139407125837706L -> 0L; 153637279587014926L -> 0L; -7394159616171936648L -> 0L; -9043869006878631603L -> 0L; 5240182597792645198L -> 0L; 5448217779542124314L -> 0L; -1656305904791530564L -> 0L; -1116361473951770628L -> 0L; 2259397563612834240L -> 0L; 2701623574335708358L -> 0L; 7687356893908644279L -> 0L; -1474435637026224678L -> 0L; -1138120395318770637L -> 0L; 2550568742267673149L -> 0L; 5808672460943173892L -> 0L; -3394167952197954244L -> 0L; -7127307218936826104L -> 0L; _ -> 0L}, {6624469717750982933L -> false; 2021251694365224308L -> false; 8650950383192901855L -> false; 5854787549706481689L -> false; -4928040426617547498L -> false; 3145329330861579979L -> false; 5644156449197797917L -> false; 5100807290077018335L -> false; 7739738019688281706L -> false; -697925149460693359L -> false; -3581328212534219819L -> false; -8630303840787971041L -> false; 4607169608843350895L -> false; -2954498161550507231L -> false; 3734321537045757188L -> false; 7617254280160726422L -> false; 2408366282890716208L -> false; 8414158256060592983L -> false; -1651026652789754360L -> false; 3634915250346921677L -> false; 6051446892539839664L -> false; -6049404088872216425L -> false; -1360668418930804589L -> false; -5039996349090530917L -> false; -6625930574039947025L -> false; 6646442352002793285L -> false; -8915325446919098823L -> false; 2098138445044356137L -> false; 5263684004213940067L -> false; 4235768524330941733L -> false; -1257408099724075377L -> false; -8709033821355250350L -> false; 7835339442358508915L -> false; -5629923125916047561L -> false; 5846432512550235357L -> false; 1038681120125353343L -> false; 2748006016942766304L -> false; -465696954319541446L -> false; 6398423988255904594L -> false; 5721159553842941691L -> false; -7267280566018852192L -> false; 4431190379031682950L -> false; 3299736282478619448L -> false; 5029882331043609063L -> false; 3903578586206863836L -> false; -2371338759413642156L -> false; 5261709869629193788L -> false; -8697432166782222197L -> false; -983603998581652585L -> false; -5785263784427206614L -> false; -4379154747792360737L -> false; 2277179348638815545L -> false; 6480637981859985820L -> false; -8608744547020170782L -> false; -830997075387711629L -> false; 2301544867433440993L -> false; 8163177680305655068L -> false; -2454988279788980498L -> false; 5164393405417580120L -> false; 1132050760977963309L -> false; -499476091573676884L -> false; 4479813258449401643L -> false; -6461224430753660866L -> false; -1006257629865130445L -> false; 8294186685546713542L -> false; -971072539264035131L -> false; -3580496456230202944L -> false; -1025726531324723941L -> false; 2142699480843765254L -> false; -8950985269485293698L -> false; 7356720237191965167L -> false; 4207231707586613858L -> false; 639669963429369605L -> false; -2051861136476049823L -> false; -1988816249583056245L -> false; 9188472469558943175L -> false; -3686676770270027707L -> false; 3224777727913298872L -> false; -1441073676419344347L -> false; -2417519916452520533L -> false; -7884216401522586609L -> false; -2796892171845744540L -> false; -2530663500164660862L -> false; -2264698731421349299L -> false; -6301941405625428267L -> false; 1118769919115618925L -> false; -3315022889335032034L -> false; 6790791859713076536L -> false; -6287885895726259950L -> false; 7036501100000084257L -> false; -8660185765070272892L -> false; 0L -> true; 1256017657628421411L -> false; 4161392575889986945L -> false; -6062160849957200379L -> false; 2050777921649849245L -> false; -5707081726479912303L -> false; 7007967583009742492L -> false; 2222440151561842948L -> false; -6721953801867170697L -> false; -7885266170714706233L -> false; 4322769158609909940L -> false; -898939348400618792L -> false; 1398507300916388863L -> false; -7314527457266255534L -> false; -3768157736633469270L -> false; 3906053329638043395L -> false; -2423282696440615857L -> false; 3262857228003744550L -> false; -294629012482506639L -> false; 689252303200971584L -> false; -949171309053917101L -> false; 1153745841753386362L -> false; -7139720054173349629L -> false; 5729429493169192938L -> false; 3147513210109551715L -> false; -7622842036935762123L -> false; -2655363517875144787L -> false; -8540329665204613710L -> false; -3316185614787998640L -> false; -7171948333957854763L -> false; 643735998272900932L -> false; 4986005544098925810L -> false; -7639906882480959204L -> false; -4380764207063965457L -> false; 2818999576258038632L -> false; 3508863594680469870L -> false; -8690914547174917743L -> false; 1098465513758097547L -> false; 4218628012430961849L -> false; 6435651773147788786L -> false; 9009339763374318376L -> false; -3161092180305721636L -> false; 8487857972336733594L -> false; 6784366724273561670L -> false; -3312092294417046138L -> false; 1583416881273542902L -> false; -5748946431569544365L -> false; -8876028441964492915L -> false; 8328121679685965390L -> false; 1737879028445335557L -> false; 7340188779816032270L -> false; 4494217989422939968L -> false; 7083777351172515530L -> false; -3270685705223979163L -> false; 8520094710095194968L -> false; 4164139407125837706L -> false; 153637279587014926L -> false; -1656305904791530564L -> false; 5240182597792645198L -> false; -8365460935410113080L -> false; 2259397563612834240L -> false; -4404877394737171205L -> false; -6753006748206940599L -> false; 2022662898930300274L -> false; 2701623574335708358L -> false; 7687356893908644279L -> false; -931329658461140236L -> false; -2452190344785809016L -> false; 5808672460943173892L -> false; -3394167952197954244L -> false; -8959165302033331105L -> false; 3993033237256830916L -> false; 4972040655077426416L -> false; 4882728146457597343L -> false; 9213678680194827455L -> false; 5300276494079701428L -> false; -9132719513648881735L -> false; -7123352971536208992L -> false; 4259354711344712502L -> false; 8040921812849396650L -> false; -364061021052118635L -> false; 1359540546038184604L -> false; -4045157926296238604L -> false; 2619877327226739617L -> false; -2978122754581212173L -> false; -5943664818246816981L -> false; -4683856205808377145L -> false; 8310294664523726142L -> false; 558752675069655569L -> false; 8199640615007233109L -> false; 8503977350048285922L -> false; 2741028434103436854L -> false; 1555660693178054105L -> false; -1213860894341146248L -> false; -7095101722225497728L -> false; -4292043424114694448L -> false; -2620576406080708837L -> false; 3910553276736898631L -> false; -7268555609988799200L -> false; -6934743764498995030L -> false; 4876048078141422706L -> false; 5076578730158835782L -> false; -4290997597638374224L -> false; 7859313320400495093L -> false; -9073896469922473758L -> false; -1373219575348706144L -> false; -7434366745648348883L -> false; -8252951406749682434L -> false; 3976766521418821020L -> false; 4221739137319150436L -> false; 7626491182175802526L -> false; 2422190457351331666L -> false; 1324477536709314583L -> false; -7308516696705877236L -> false; -1441184219299041128L -> false; -7619916642310435274L -> false; -1366216905461382541L -> false; 4166104326466068382L -> false; -679766008357102884L -> false; 1340692257137144601L -> false; -3347868337765287544L -> false; 8624184165625915808L -> false; 2331860220219071134L -> false; -790015524249429917L -> false; 8399933408910938616L -> false; -2308579306926069217L -> false; -5594759985566186977L -> false; 197835813572346897L -> false; 323546263287575941L -> false; -6538996838665322453L -> false; 866928363553278728L -> false; 5479429944191365165L -> false; -7729052846454806041L -> false; -4304406580070181007L -> false; -4763149175045705024L -> false; 469304370363482895L -> false; -2804630954669580607L -> false; -2238043473974805486L -> false; 3734790826411290913L -> false; -227934510922809045L -> false; 5699328150978489073L -> false; 4601270508136665021L -> false; 212249186598423999L -> false; 8348878307193905173L -> false; -7973754506024961452L -> false; -5364159185804582406L -> false; 6806501729242859693L -> false; -3765043485710736446L -> false; 7194818492908892508L -> false; 1019954390233679959L -> false; -4420431099744708779L -> false; 8114335019049414454L -> false; -2889137903793420078L -> false; -1495518350952249754L -> false; -569354245761226691L -> false; -8589663454077811882L -> false; 6461206961562494132L -> false; 7813289179577223734L -> false; -6887763749911475116L -> false; -2338474396491590209L -> false; 6040222022058163474L -> false; 4420706034848988623L -> false; 6586471556538983659L -> false; -2662379650000679469L -> false; -1991171025695944950L -> false; 7012460325344924441L -> false; 7983768007747169077L -> false; 3259727538054383679L -> false; 7887016748577155308L -> false; -2161834059847512675L -> false; 7772143368369364168L -> false; 2746391341985398187L -> false; -6044975648356418603L -> false; -5178825119209008517L -> false; -8711565572371958878L -> false; 3567420727005224228L -> false; -6591184801704195820L -> false; -7799749368733739938L -> false; -2307913367909538993L -> false; -6139115887619923128L -> false; -2966172447767866175L -> false; -6622094766643380931L -> false; 3173163354060602924L -> false; -4281744317789616022L -> false; 9177166544734112775L -> false; 5663627078768118084L -> false; 8366279157860053843L -> false; 8511705671936252155L -> false; 3630742237263843231L -> false; -7394159616171936648L -> false; -9043869006878631603L -> false; -2073201129865962220L -> false; 5448217779542124314L -> false; -4677740139754242931L -> false; -9018937089320797157L -> false; -6704152621528229497L -> false; 2595706173326502376L -> false; 8038783472656886325L -> false; -1116361473951770628L -> false; 8827581399887526968L -> false; -594959241272658988L -> false; 2654816421495205220L -> false; 2445531497888324919L -> false; -2862675227543729570L -> false; -1474435637026224678L -> false; -7958909181723079423L -> false; -1138120395318770637L -> false; 2550568742267673149L -> false; 1533772787097910211L -> false; -7127307218936826104L -> false; _ -> false}) +([0L; 1L], {_ -> 0L}, {-7504258977828779808L -> false; -7093694681182419557L -> false; 3873912968074562848L -> false; 3217825886573894393L -> false; -382865800631504453L -> false; 4099820307503616554L -> false; 699253650458194431L -> false; 8654311839195390489L -> false; -8943431579568790477L -> false; 4918999763344690417L -> false; 2839624487026504606L -> false; -4429540254266880362L -> false; -3212627688888080436L -> false; 8536762249180422736L -> false; 5859742167437376336L -> false; -2190382103531982729L -> false; 4537031266334529194L -> false; 5862395135921190459L -> false; 7824925950931903538L -> false; 0L -> true; 1211095228675665833L -> false; -4111062701435455992L -> false; 3962063715808702212L -> false; 4471203044432927526L -> false; -8445541690265748756L -> false; -6819806278200462828L -> false; -1884078868316734635L -> false; 1157940906807060904L -> false; 9206397994034200062L -> false; -5279863662566198154L -> false; -7633800208299937897L -> false; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_strings failed (2 shrink steps): +Test fail_pred_strings failed (1 shrink steps): {"some random string" -> true; _ -> false} --- Failure -------------------------------------------------------------------- -Test fold_left fold_right failed (32 shrink steps): +Test fold_left fold_right failed (104 shrink steps): -(0, [1], {(5, 5) -> 0; (3, 8) -> 0; (1, 0) -> 1; (3, 0) -> 0; (8, 0) -> 0; (6, 4) -> 0; (9, 2) -> 0; (5, 0) -> 0; (0, 2) -> 0; (2, 0) -> 0; (2, 1) -> 0; (8, 6) -> 0; (0, 3) -> 0; (0, 23) -> 0; (1, 8) -> 0; (0, 4) -> 0; (4, 0) -> 0; (7, 2) -> 0; (2, 5) -> 0; (0, 8) -> 0; (23, 6) -> 0; (0, 0) -> 0; (4, 80) -> 0; _ -> 0}) +(0, [1], {(8, 7) -> 0; (96, 0) -> 0; (79, 32) -> 0; (1, 0) -> 1; (7, 3) -> 0; (4, 48) -> 0; (5, 52) -> 0; (5, 1) -> 0; (4, 78) -> 0; (3, 2) -> 0; (85, 30) -> 0; (36, 1) -> 0; (59, 17) -> 0; (5, 61) -> 0; (3, 44) -> 0; (1, 18) -> 0; (1, 7) -> 0; (9, 4) -> 0; (2, 2) -> 0; (6, 8) -> 0; (6, 6) -> 0; (43, 4) -> 0; (3, 7) -> 0; (0, 3) -> 0; (4, 0) -> 0; (8, 1) -> 0; (30, 0) -> 0; (0, 8) -> 0; (7, 78) -> 0; (9, 52) -> 0; (5, 89) -> 0; (49, 7) -> 0; (97, 2) -> 0; (0, 0) -> 0; (4, 7) -> 0; (0, 6) -> 0; (65, 4) -> 0; (35, 7) -> 0; (6, 2) -> 0; (19, 5) -> 0; (87, 82) -> 0; (7, 61) -> 0; (4, 3) -> 0; (4, 9) -> 0; (6, 3) -> 0; (9, 64) -> 0; (2, 3) -> 0; (8, 13) -> 0; (5, 6) -> 0; (8, 64) -> 0; (8, 0) -> 0; (20, 6) -> 0; (2, 6) -> 0; (3, 6) -> 0; (5, 0) -> 0; (38, 3) -> 0; (0, 2) -> 0; (6, 1) -> 0; (63, 8) -> 0; (27, 5) -> 0; (2, 1) -> 0; (0, 5) -> 0; (9, 0) -> 0; (9, 5) -> 0; (4, 4) -> 0; (6, 5) -> 0; (21, 1) -> 0; (48, 50) -> 0; (77, 7) -> 0; (9, 1) -> 0; (52, 8) -> 0; (13, 40) -> 0; (3, 0) -> 0; (5, 3) -> 0; (1, 1) -> 0; (2, 31) -> 0; (2, 0) -> 0; (69, 31) -> 0; (7, 42) -> 0; (7, 89) -> 0; (7, 6) -> 0; (5, 2) -> 0; (8, 4) -> 0; (83, 37) -> 0; (8, 3) -> 0; (5, 4) -> 0; (35, 3) -> 0; (96, 8) -> 0; (1, 5) -> 0; (2, 15) -> 0; _ -> 0}) +++ Messages ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -675,21 +682,21 @@ l=[1], fold_left=1, fold_right=0 --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried failed (434 shrink steps): +Test fold_left fold_right uncurried failed (481 shrink steps): -({(5, 2) -> 0; (0, 2) -> 0; (2, 80) -> 0; (8, 6) -> 0; (76, 6) -> 0; (3, 8) -> 0; (75, 57) -> 0; (7, 2) -> 0; (43, 1) -> 0; (2, 7) -> 0; (7, 1) -> 0; (76, 3) -> 0; (4, 50) -> 0; (70, 5) -> 0; (49, 46) -> 0; (71, 31) -> 0; (67, 0) -> 0; (32, 96) -> 0; (9, 1) -> 0; (8, 8) -> 0; (53, 8) -> 0; (76, 5) -> 0; (2, 5) -> 0; (5, 4) -> 0; (9, 3) -> 0; (6, 65) -> 0; (75, 2) -> 0; (35, 96) -> 0; (3, 2) -> 0; (24, 1) -> 0; (75, 4) -> 0; (48, 8) -> 0; (0, 16) -> 0; (26, 73) -> 0; (2, 88) -> 0; (76, 7) -> 0; (6, 9) -> 0; (71, 59) -> 0; (4, 7) -> 0; (1, 1) -> 0; (4, 22) -> 0; (0, 5) -> 0; (1, 5) -> 0; (1, 4) -> 0; (8, 45) -> 0; (2, 47) -> 0; (0, 1) -> 0; (6, 10) -> 0; (73, 0) -> 0; (27, 3) -> 0; (88, 7) -> 0; (5, 1) -> 0; (3, 6) -> 0; (77, 8) -> 0; (2, 1) -> 0; (1, 2) -> 0; (4, 1) -> 0; (47, 6) -> 0; (76, 9) -> 0; (6, 5) -> 0; (7, 3) -> 0; (9, 87) -> 0; (3, 7) -> 0; (17, 0) -> 0; (43, 55) -> 0; (4, 2) -> 0; (12, 7) -> 0; (7, 79) -> 0; (2, 56) -> 0; (52, 0) -> 0; (9, 2) -> 0; (49, 0) -> 0; (7, 9) -> 0; (2, 75) -> 0; (75, 5) -> 0; (2, 2) -> 0; (6, 4) -> 0; (1, 3) -> 0; (19, 6) -> 0; (4, 55) -> 0; (1, 6) -> 0; (6, 7) -> 0; (6, 24) -> 0; (0, 6) -> 0; (86, 6) -> 0; (3, 1) -> 0; (4, 5) -> 0; (82, 4) -> 0; (5, 70) -> 0; (5, 9) -> 0; (37, 2) -> 0; (45, 1) -> 0; (7, 4) -> 0; (0, 4) -> 1; (6, 95) -> 0; (6, 2) -> 0; (1, 0) -> 0; (8, 4) -> 0; (1, 22) -> 0; (67, 7) -> 0; (92, 7) -> 0; (7, 5) -> 0; (4, 4) -> 0; (9, 8) -> 0; (49, 5) -> 0; (1, 9) -> 0; _ -> 0}, 0, [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 4]) +({(3, 9) -> 0; (5, 2) -> 0; (96, 4) -> 0; (9, 6) -> 0; (8, 6) -> 0; (98, 74) -> 0; (7, 20) -> 0; (8, 0) -> 0; (3, 8) -> 0; (4, 0) -> 0; (7, 2) -> 0; (4, 7) -> 0; (0, 5) -> 0; (6, 75) -> 0; (2, 2) -> 0; (6, 0) -> 0; (8, 4) -> 0; (0, 1) -> 1; (80, 4) -> 0; (89, 0) -> 0; (49, 85) -> 0; (2, 0) -> 0; (6, 1) -> 0; (3, 5) -> 0; _ -> 0}, 0, [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 1]) --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried fun last failed (37 shrink steps): +Test fold_left fold_right uncurried fun last failed (30 shrink steps): -(0, [0; 0; 0; 0], {(9, 5) -> 0; (0, 2) -> 0; (56, 0) -> 0; (4, 1) -> 0; (8, 5) -> 0; (5, 9) -> 0; (8, 6) -> 0; (3, 8) -> 0; (8, 0) -> 0; (84, 8) -> 0; (23, 4) -> 0; (4, 0) -> 0; (0, 7) -> 0; (7, 8) -> 0; (0, 5) -> 0; (0, 4) -> 0; (1, 5) -> 0; (80, 8) -> 0; (5, 7) -> 0; (2, 2) -> 0; (6, 4) -> 0; (0, 0) -> 56; (0, 23) -> 0; (0, 56) -> 1; (1, 3) -> 0; (0, 1) -> 0; (56, 2) -> 0; (89, 8) -> 0; (7, 7) -> 0; (2, 5) -> 0; (4, 3) -> 0; _ -> 0}) +(0, [1], {(7, 2) -> 0; (8, 7) -> 0; (0, 7) -> 0; (0, 5) -> 0; (4, 8) -> 0; (50, 4) -> 0; (5, 64) -> 0; (0, 1) -> 1; (32, 49) -> 0; (8, 8) -> 0; _ -> 0}) --- Failure -------------------------------------------------------------------- -Test fold_left test, fun first failed (925 shrink steps): +Test fold_left test, fun first failed (19 shrink steps): -({("\167$\000\199\169\156V\241\027\212\178d3\196\136\249\1941_=#\216\196\226\186\220\153\150Z)\000\255\184\132`\225\239&uS\235]\212\231\021\028\204\020\t,", 9) -> ""; ("\156\031\194\253\204B\188\154 \167\012\253\2322;", 8) -> ""; ("{\182\172t", 5) -> ""; ("\169\240\228A#\212U\193\172\019\150\238\236\133\209\188\240\135\225\191\241\181\179\243\139\\.\"\190m\204&9\209?\001\171\247\160T\2049\153\0028\184\014;X", 13) -> ""; ("\003\212\207\236\178\162\182m\147\190\b>W\141\242\195\206j\201\202\166B\145k\229\211J\015\139(\224\143\149\190\196(_\017\170\138", 4) -> ""; ("\130\229\219\227\133\160\213\236\2221\245\129-\183\141r\146sXj\000\2210\200\1576\209\1396s '\026\172\251\236\166X\220\200\176$Z0\024\190", 2) -> ""; ("a\0171\198^,5\170C\139\157\\h\001\026\199", 8) -> ""; ("\189\221\014\254\188\175\205JF", 5) -> ""; ("", 2) -> "a"; ("\165\233\214\166\195\197", 5) -> ""; ("&\169\2415\201", 2) -> ""; ("S\194irBA", 37) -> ""; ("\224\2280\186", 1) -> ""; ("!\209\194\238\0266s\001!\233\234(7\127\228C\136n$\21162^^\012\014\199\178`\148\141\228\18599\205\136\136\189\213\134\019|\197\005\235\151\003\197D%\172\144\238\173[\228\191\235p\177I\180\237\189y\247\250w\143z~\016\003\142\149\157\142\234\\3P\140\030\000\028\205K\188&\202w\1519`\188\015", 2) -> ""; ("\128]\190\164\164\151)\214", 22) -> ""; ("u\251\19988\194\165\242J", 7) -> ""; ("}\129\237\213\203\137\197(W\172Q\171\188\140\205\014\143k~\163\187\140o\130\146r", 0) -> ""; ("\133+\142\011\209\135", 1) -> ""; ("E\212\169=n", 9) -> ""; ("l\022\133\005\016D\026\230\156", 18) -> ""; ("\031\131g\029\215", 31) -> ""; ("/*j", 6) -> ""; ("h\031\226a\226\148\128", 9) -> ""; ("\151", 1) -> ""; ("\221\184V\247\225\254\209iW;_d\144\t\179>2\252\221pO<\134F\005\252\151\163\138\007\219z\136\215\237]92G\000A\135\139\166\214\186\232\199\236\000\132_\006\241\169Gz\"\155\183\215-\233\249", 1) -> ""; ("z\211oC\210\198\155", 8) -> ""; ("}P8\147\167\142j9u\187\007\128\213Y\181E'\130\r\242ng\2088\198\004\136GJ\179-\197Iw\017\197\223\173\250\229D\160\171\t\222\223>6\219\201@^X\221(s\029\127\005-F+\232\213B\170\150\188\018f+>\215\240k\135\023\214P\157", 9) -> ""; ("~f-L\151\011", 2) -> ""; ("!\178\019\016\134%\026", 2) -> ""; ("\255U\t4f*\254\237\181S\020\181\130\184\230\017C\185\200\187:Q\002\210\028\152G\228O\026\012\003\234\011\148z\177\166&\024\178F\188\213u\128R~\\\171\194\r~v\020\160\221(\157wa!a\bAf\127^\169\241;\246\011B\b+\249\179\193\230\137\232\147\247\251\180ey\166q<\150_\158", 6) -> ""; ("\005\140\184\232$", 78) -> ""; (".NF\153", 6) -> ""; ("\180\130\236\011(\210M9", 9) -> ""; ("I\219\224\171\142\155\209\027\011\237\020;\245\176\141(\202\248\023\174\216\156\173+\028\209\193?\154t\196\146\147\181\252#\229\128jz\199\212\194\2302\185\162\208UXq>\024F&\241i\182\165\214I\249*?\136_\142f\163\230\167\210U`W \150X\157=\235pe\200\019\208\138j", 1) -> ""; ("\196\210\239\158\131\198\1516\208\165\163\011\251B\219\161\001\237\224\194T\t\148\158\197\031\145\025\192\148\210t1\235\159\015\176\197.\248a\028'\222r\200= \208w", 36) -> ""; ("\228x[", 91) -> ""; ("\001\143", 7) -> ""; ("\136u\1473\235\255\232\211\129\129\172\n\012\004\\O2.a\228(\218\205\223\011\"\n<\181$\245v\002\016s]\161\170\000q\205\161wM\230\223\143%\t\232\175\171j\129x\022\159\215\182\019\240\002\014}\0052\234\202\226\157,\148-\147\200\158\181\189\196\143f", 38) -> ""; ("@\192\163\234", 72) -> ""; ("\131\158Y\139\199\014\149d$", 9) -> ""; ("-\152", 9) -> ""; _ -> ""}, "", [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 2], [0]) +({("\022/\026D\153\138", 2) -> ""; ("Y", 4) -> ""; ("yc\144x\186\136\219\157\227", 6) -> ""; ("^\127\023\014*\023c\018", 2) -> ""; ("\022MlqC", 2) -> ""; ("\205)\019\136", 4) -> ""; ("l\186\218\222!\214E", 2) -> ""; ("\249)\003\207\189\129\145Sd\186X\238\179\",3GTId\005\223\134\211%#N\2128fD\190\251\b\169\155v\223\023\157", 6) -> ""; ("\173\188C\247%\150k=", 2) -> "a"; (";", 2) -> ""; _ -> ""}, "a", [], [0]) --- Failure -------------------------------------------------------------------- @@ -774,22 +781,22 @@ stats char code: +++ Stats for tree's depth ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats depth: - num: 1000, avg: 4.13, stddev: 3.52, median 3, min 1, max 15 - 1: ####################################################### 339 - 2: ################ 104 - 3: ############### 98 - 4: ##################### 133 - 5: ######### 60 - 6: #### 29 - 7: ######## 54 - 8: ####### 48 - 9: ## 16 - 10: ### 21 - 11: ########### 68 - 12: 1 - 13: # 8 - 14: ## 16 - 15: 5 + num: 1000, avg: 3.90, stddev: 3.44, median 3, min 1, max 15 + 1: ####################################################### 376 + 2: ############## 98 + 3: ############ 84 + 4: #################### 139 + 5: ########## 71 + 6: ## 18 + 7: ####### 49 + 8: ####### 49 + 9: # 12 + 10: ### 25 + 11: ###### 43 + 12: 6 + 13: # 10 + 14: # 13 + 15: # 7 +++ Stats for bytes_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -1016,203 +1023,203 @@ stats len: +++ Stats for pair dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats pair sum: - num: 500000, avg: 100.05, stddev: 41.29, median 100, min 0, max 200 - 0.. 9: ### 2618 - 10.. 19: ######## 7630 - 20.. 29: ############## 12505 - 30.. 39: #################### 17451 - 40.. 49: ########################## 22280 - 50.. 59: ############################### 27307 - 60.. 69: ##################################### 32151 - 70.. 79: ########################################### 37199 - 80.. 89: ################################################# 41901 - 90.. 99: ###################################################### 46313 - 100..109: ####################################################### 46965 - 110..119: ################################################# 42462 - 120..129: ########################################### 37348 - 130..139: ###################################### 32613 - 140..149: ################################ 27606 - 150..159: ########################### 23221 - 160..169: ##################### 18125 - 170..179: ############### 12890 - 180..189: ######### 8059 - 190..199: ### 3297 + num: 500000, avg: 100.10, stddev: 41.22, median 100, min 0, max 200 + 0.. 9: ### 2753 + 10.. 19: ######## 7572 + 20.. 29: ############## 12416 + 30.. 39: #################### 17234 + 40.. 49: ######################### 22216 + 50.. 59: ############################### 27110 + 60.. 69: ##################################### 32089 + 70.. 79: ########################################## 36885 + 80.. 89: ################################################ 41775 + 90.. 99: ###################################################### 46764 + 100..109: ####################################################### 47231 + 110..119: ################################################# 42910 + 120..129: ########################################### 37485 + 130..139: ###################################### 32673 + 140..149: ################################ 27901 + 150..159: ########################## 22900 + 160..169: #################### 17756 + 170..179: ############## 12867 + 180..189: ######### 8198 + 190..199: ### 3206 200..209: 59 +++ Stats for triple dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats triple sum: - num: 500000, avg: 150.04, stddev: 50.53, median 150, min 1, max 300 - 1.. 15: 360 - 16.. 30: ## 2261 - 31.. 45: ##### 5712 - 46.. 60: ########## 10854 - 61.. 75: ################# 17760 - 76.. 90: ########################## 26151 - 91..105: ################################### 36079 - 106..120: ############################################# 45498 - 121..135: ################################################### 51977 - 136..150: ####################################################### 55179 - 151..165: ###################################################### 54821 - 166..180: ################################################### 51709 - 181..195: ############################################# 45166 - 196..210: ################################### 35354 - 211..225: ######################### 25436 - 226..240: ################# 17179 - 241..255: ########## 10652 - 256..270: ##### 5447 - 271..285: ## 2065 - 286..300: 340 + num: 500000, avg: 149.97, stddev: 50.47, median 150, min 2, max 300 + 2.. 16: 436 + 17.. 31: ## 2462 + 32.. 46: ###### 6168 + 47.. 61: ########### 11181 + 62.. 76: ################# 17966 + 77.. 91: ########################## 26835 + 92..106: #################################### 36662 + 107..121: ############################################# 46199 + 122..136: #################################################### 52565 + 137..151: ####################################################### 55318 + 152..166: ###################################################### 54923 + 167..181: ################################################## 51081 + 182..196: ############################################ 44563 + 197..211: ################################## 34853 + 212..226: ######################## 24865 + 227..241: ################ 16598 + 242..256: ######### 10006 + 257..271: ##### 5146 + 272..286: # 1935 + 287..301: 238 +++ Stats for quad dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats quad sum: - num: 500000, avg: 200.06, stddev: 58.39, median 200, min 2, max 394 - 2.. 21: 61 - 22.. 41: 658 - 42.. 61: ## 2534 - 62.. 81: ##### 6444 - 82..101: ########### 13334 - 102..121: ################### 23279 - 122..141: ############################## 35888 - 142..161: ######################################### 48824 - 162..181: ################################################## 59008 - 182..201: ####################################################### 64896 - 202..221: ###################################################### 64051 - 222..241: ################################################# 57864 - 242..261: ####################################### 46793 - 262..281: ############################ 33955 - 282..301: ################## 21775 - 302..321: ########## 12187 - 322..341: #### 5645 - 342..361: # 2244 - 362..381: 529 - 382..401: 31 + num: 500000, avg: 200.11, stddev: 58.32, median 200, min 5, max 398 + 5.. 24: 93 + 25.. 44: 803 + 45.. 64: ## 2950 + 65.. 84: ###### 7307 + 85..104: ############ 14442 + 105..124: ##################### 25228 + 125..144: ################################ 37961 + 145..164: ########################################## 50311 + 165..184: ################################################## 60055 + 185..204: ####################################################### 65159 + 205..224: ##################################################### 63845 + 225..244: ############################################### 56537 + 245..264: ###################################### 45021 + 265..284: ########################### 32167 + 285..304: ################ 19919 + 305..324: ######### 10874 + 325..344: #### 5069 + 345..364: # 1849 + 365..384: 393 + 385..404: 17 +++ Stats for bind dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats ordered pair difference: - num: 1000000, avg: 25.01, stddev: 22.38, median 19, min 0, max 100 - 0.. 4: ####################################################### 193610 - 5.. 9: #################################### 130051 - 10.. 14: ############################# 104209 - 15.. 19: ######################## 86993 - 20.. 24: ##################### 74295 - 25.. 29: ################## 64874 - 30.. 34: ################ 56447 - 35.. 39: ############## 49416 - 40.. 44: ############ 43051 - 45.. 49: ########## 37580 - 50.. 54: ######### 32378 - 55.. 59: ######## 28558 - 60.. 64: ###### 23971 - 65.. 69: ##### 20146 - 70.. 74: #### 16446 - 75.. 79: ### 13215 - 80.. 84: ## 10294 - 85.. 89: ## 7639 - 90.. 94: # 4698 - 95.. 99: 2041 - 100..104: 88 + num: 1000000, avg: 25.01, stddev: 22.36, median 19, min 0, max 100 + 0.. 4: ####################################################### 193620 + 5.. 9: #################################### 129807 + 10.. 14: ############################# 103875 + 15.. 19: ######################## 87161 + 20.. 24: ##################### 74588 + 25.. 29: ################## 64327 + 30.. 34: ################ 56519 + 35.. 39: ############## 49825 + 40.. 44: ############ 43263 + 45.. 49: ########## 37612 + 50.. 54: ######### 32623 + 55.. 59: ####### 28125 + 60.. 64: ###### 24206 + 65.. 69: ##### 20107 + 70.. 74: #### 16712 + 75.. 79: ### 13309 + 80.. 84: ## 10347 + 85.. 89: ## 7339 + 90.. 94: # 4591 + 95.. 99: 1957 + 100..104: 87 stats ordered pair sum: - num: 1000000, avg: 74.97, stddev: 46.86, median 72, min 0, max 200 - 0.. 9: ####################################################### 70320 - 10.. 19: ##################################################### 68731 - 20.. 29: ##################################################### 68374 - 30.. 39: ##################################################### 68544 - 40.. 49: ##################################################### 68756 - 50.. 59: ##################################################### 68837 - 60.. 69: ##################################################### 68759 - 70.. 79: ##################################################### 68517 - 80.. 89: ##################################################### 68692 - 90.. 99: ###################################################### 69123 - 100..109: ################################################## 64777 - 110..119: ########################################### 55288 - 120..129: #################################### 47156 - 130..139: ############################### 39635 - 140..149: ######################### 32590 - 150..159: #################### 25685 - 160..169: ############### 19842 - 170..179: ########## 14038 - 180..189: ###### 8631 - 190..199: ## 3580 - 200..209: 125 + num: 1000000, avg: 75.09, stddev: 46.93, median 72, min 0, max 200 + 0.. 9: ####################################################### 70091 + 10.. 19: ##################################################### 68426 + 20.. 29: ##################################################### 68723 + 30.. 39: ##################################################### 68717 + 40.. 49: ##################################################### 68445 + 50.. 59: ##################################################### 68798 + 60.. 69: ##################################################### 68591 + 70.. 79: ##################################################### 68385 + 80.. 89: ##################################################### 68603 + 90.. 99: ##################################################### 68647 + 100..109: ################################################## 64063 + 110..119: ########################################### 55810 + 120..129: ##################################### 47218 + 130..139: ############################### 39763 + 140..149: ######################### 32908 + 150..159: #################### 26241 + 160..169: ############### 20137 + 170..179: ########### 14180 + 180..189: ###### 8622 + 190..199: ## 3523 + 200..209: 109 +++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Collect results for test option dist: -None : 1464 cases -Some _: 8536 cases +None : 1481 cases +Some _: 8519 cases +++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Collect results for test result dist: -Error _: 2509 cases -Ok _ : 7491 cases +Error _: 2469 cases +Ok _ : 7531 cases +++ Stats for list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 381.08, stddev: 1328.05, median 9, min 0, max 9993 - 0.. 499: ####################################################### 4260 - 500.. 999: ###### 515 - 1000.. 1499: 8 - 1500.. 1999: 11 - 2000.. 2499: 10 - 2500.. 2999: 10 - 3000.. 3499: 9 - 3500.. 3999: 18 - 4000.. 4499: 14 - 4500.. 4999: 9 - 5000.. 5499: 9 - 5500.. 5999: 14 - 6000.. 6499: 15 - 6500.. 6999: 7 - 7000.. 7499: 10 - 7500.. 7999: 23 - 8000.. 8499: 10 - 8500.. 8999: 22 - 9000.. 9499: 16 - 9500.. 9999: 10 + num: 5000, avg: 344.34, stddev: 1211.86, median 9, min 0, max 9901 + 0.. 495: ####################################################### 4276 + 496.. 991: ###### 509 + 992..1487: 19 + 1488..1983: 10 + 1984..2479: 13 + 2480..2975: 13 + 2976..3471: 9 + 3472..3967: 13 + 3968..4463: 15 + 4464..4959: 8 + 4960..5455: 11 + 5456..5951: 17 + 5952..6447: 9 + 6448..6943: 9 + 6944..7439: 12 + 7440..7935: 8 + 7936..8431: 8 + 8432..8927: 15 + 8928..9423: 13 + 9424..9919: 13 +++ Stats for small_list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 16.58, stddev: 25.30, median 6, min 0, max 99 - 0.. 4: ################################################### 1848 - 5.. 9: ####################################################### 1992 - 10.. 14: # 47 - 15.. 19: # 62 - 20.. 24: # 56 - 25.. 29: # 67 - 30.. 34: # 66 - 35.. 39: # 57 - 40.. 44: # 59 - 45.. 49: # 62 - 50.. 54: ## 75 - 55.. 59: # 70 - 60.. 64: # 55 - 65.. 69: # 68 - 70.. 74: ## 74 - 75.. 79: # 56 - 80.. 84: # 66 - 85.. 89: ## 74 - 90.. 94: # 64 - 95.. 99: ## 82 + num: 5000, avg: 15.62, stddev: 24.13, median 6, min 0, max 99 + 0.. 4: ##################################################### 1920 + 5.. 9: ####################################################### 1958 + 10.. 14: # 69 + 15.. 19: # 68 + 20.. 24: # 58 + 25.. 29: # 61 + 30.. 34: # 65 + 35.. 39: # 51 + 40.. 44: ## 78 + 45.. 49: # 54 + 50.. 54: # 59 + 55.. 59: # 66 + 60.. 64: # 66 + 65.. 69: # 49 + 70.. 74: # 66 + 75.. 79: ## 76 + 80.. 84: # 60 + 85.. 89: # 63 + 90.. 94: # 61 + 95.. 99: # 52 +++ Stats for list_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 7.50, stddev: 1.72, median 8, min 5, max 10 - 5: ####################################################### 854 - 6: ################################################### 802 - 7: ##################################################### 835 - 8: ##################################################### 838 - 9: #################################################### 818 - 10: ###################################################### 853 + num: 5000, avg: 7.48, stddev: 1.71, median 7, min 5, max 10 + 5: ##################################################### 845 + 6: ###################################################### 857 + 7: #################################################### 830 + 8: ################################################## 790 + 9: ####################################################### 862 + 10: #################################################### 816 +++ Stats for list_repeat len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -1223,63 +1230,63 @@ stats len: +++ Stats for array len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 381.08, stddev: 1328.05, median 9, min 0, max 9993 - 0.. 499: ####################################################### 4260 - 500.. 999: ###### 515 - 1000.. 1499: 8 - 1500.. 1999: 11 - 2000.. 2499: 10 - 2500.. 2999: 10 - 3000.. 3499: 9 - 3500.. 3999: 18 - 4000.. 4499: 14 - 4500.. 4999: 9 - 5000.. 5499: 9 - 5500.. 5999: 14 - 6000.. 6499: 15 - 6500.. 6999: 7 - 7000.. 7499: 10 - 7500.. 7999: 23 - 8000.. 8499: 10 - 8500.. 8999: 22 - 9000.. 9499: 16 - 9500.. 9999: 10 + num: 5000, avg: 344.34, stddev: 1211.86, median 9, min 0, max 9901 + 0.. 495: ####################################################### 4276 + 496.. 991: ###### 509 + 992..1487: 19 + 1488..1983: 10 + 1984..2479: 13 + 2480..2975: 13 + 2976..3471: 9 + 3472..3967: 13 + 3968..4463: 15 + 4464..4959: 8 + 4960..5455: 11 + 5456..5951: 17 + 5952..6447: 9 + 6448..6943: 9 + 6944..7439: 12 + 7440..7935: 8 + 7936..8431: 8 + 8432..8927: 15 + 8928..9423: 13 + 9424..9919: 13 +++ Stats for small_array len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 16.58, stddev: 25.30, median 6, min 0, max 99 - 0.. 4: ################################################### 1848 - 5.. 9: ####################################################### 1992 - 10.. 14: # 47 - 15.. 19: # 62 - 20.. 24: # 56 - 25.. 29: # 67 - 30.. 34: # 66 - 35.. 39: # 57 - 40.. 44: # 59 - 45.. 49: # 62 - 50.. 54: ## 75 - 55.. 59: # 70 - 60.. 64: # 55 - 65.. 69: # 68 - 70.. 74: ## 74 - 75.. 79: # 56 - 80.. 84: # 66 - 85.. 89: ## 74 - 90.. 94: # 64 - 95.. 99: ## 82 + num: 5000, avg: 15.62, stddev: 24.13, median 6, min 0, max 99 + 0.. 4: ##################################################### 1920 + 5.. 9: ####################################################### 1958 + 10.. 14: # 69 + 15.. 19: # 68 + 20.. 24: # 58 + 25.. 29: # 61 + 30.. 34: # 65 + 35.. 39: # 51 + 40.. 44: ## 78 + 45.. 49: # 54 + 50.. 54: # 59 + 55.. 59: # 66 + 60.. 64: # 66 + 65.. 69: # 49 + 70.. 74: # 66 + 75.. 79: ## 76 + 80.. 84: # 60 + 85.. 89: # 63 + 90.. 94: # 61 + 95.. 99: # 52 +++ Stats for array_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 7.50, stddev: 1.72, median 8, min 5, max 10 - 5: ####################################################### 854 - 6: ################################################### 802 - 7: ##################################################### 835 - 8: ##################################################### 838 - 9: #################################################### 818 - 10: ###################################################### 853 + num: 5000, avg: 7.48, stddev: 1.71, median 7, min 5, max 10 + 5: ##################################################### 845 + 6: ###################################################### 857 + 7: #################################################### 830 + 8: ################################################## 790 + 9: ####################################################### 862 + 10: #################################################### 816 +++ Stats for array_repeat len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -1479,27 +1486,27 @@ stats dist: +++ Stats for int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 100000, avg: -7215552342607541.00, stddev: 2666234426234218496.00, median -16620417636667326, min -4611371852367564818, max 4611613630315464842 - -4611371852367564818..-4150222578233413331: ##################################################### 5003 - -4150222578233413330..-3689073304099261843: ####################################################### 5106 - -3689073304099261842..-3227924029965110355: ###################################################### 5052 - -3227924029965110354..-2766774755830958867: ###################################################### 5017 - -2766774755830958866..-2305625481696807379: #################################################### 4852 - -2305625481696807378..-1844476207562655891: ###################################################### 5016 - -1844476207562655890..-1383326933428504403: ###################################################### 5083 - -1383326933428504402.. -922177659294352915: ##################################################### 4986 - -922177659294352914.. -461028385160201427: ###################################################### 5042 - -461028385160201426.. 120888973950061: ###################################################### 5017 - 120888973950062.. 461270163108101549: ##################################################### 4977 - 461270163108101550.. 922419437242253037: ##################################################### 5000 - 922419437242253038.. 1383568711376404525: ###################################################### 5022 - 1383568711376404526.. 1844717985510556013: #################################################### 4896 - 1844717985510556014.. 2305867259644707501: #################################################### 4884 - 2305867259644707502.. 2767016533778858989: ##################################################### 4981 - 2767016533778858990.. 3228165807913010477: ###################################################### 5026 - 3228165807913010478.. 3689315082047161965: ###################################################### 5016 - 3689315082047161966.. 4150464356181313453: ###################################################### 5021 - 4150464356181313454.. 4611613630315464941: ##################################################### 5003 + num: 100000, avg: -16187567683715200.00, stddev: 2661643267167753216.00, median -19064865724378010, min -4611580124327955972, max 4611682453232767028 + -4611580124327955972..-4150416995449919813: #################################################### 4939 + -4150416995449919812..-3689253866571883653: ###################################################### 5114 + -3689253866571883652..-3228090737693847493: ##################################################### 5019 + -3228090737693847492..-2766927608815811333: ###################################################### 5064 + -2766927608815811332..-2305764479937775173: ###################################################### 5071 + -2305764479937775172..-1844601351059739013: ####################################################### 5132 + -1844601351059739012..-1383438222181702853: ##################################################### 4949 + -1383438222181702852.. -922275093303666693: ##################################################### 5015 + -922275093303666692.. -461111964425630533: ##################################################### 4962 + -461111964425630532.. 51164452405627: #################################################### 4934 + 51164452405628.. 461214293330441787: ##################################################### 5001 + 461214293330441788.. 922377422208477947: ###################################################### 5097 + 922377422208477948.. 1383540551086514107: ##################################################### 4949 + 1383540551086514108.. 1844703679964550267: ##################################################### 4994 + 1844703679964550268.. 2305866808842586427: ##################################################### 4969 + 2305866808842586428.. 2767029937720622587: ###################################################### 5055 + 2767029937720622588.. 3228193066598658747: ################################################### 4839 + 3228193066598658748.. 3689356195476694907: #################################################### 4912 + 3689356195476694908.. 4150519324354731067: ##################################################### 5027 + 4150519324354731068.. 4611682453232767227: ##################################################### 4958 +++ Stats for oneof int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -1734,27 +1741,27 @@ random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 1000, avg: -38152533987928128.00, stddev: 1828925617669212928.00, median 9, min -4606614955625884935, max 4611686018427387903 - -4606614955625884935..-4145699906923221320: ## 27 - -4145699906923221319..-3684784858220557704: ## 22 - -3684784858220557703..-3223869809517894088: ## 29 - -3223869809517894087..-2762954760815230472: ## 22 - -2762954760815230471..-2302039712112566856: ## 20 - -2302039712112566855..-1841124663409903240: ## 22 - -1841124663409903239..-1380209614707239624: ## 26 - -1380209614707239623.. -919294566004576008: ## 27 - -919294566004576007.. -458379517301912392: ## 24 - -458379517301912391.. 2535531400751224: ####################################################### 547 - 2535531400751225.. 463450580103414840: ## 25 - 463450580103414841.. 924365628806078456: ## 25 - 924365628806078457.. 1385280677508742072: ## 22 - 1385280677508742073.. 1846195726211405688: ### 30 - 1846195726211405689.. 2307110774914069304: ## 27 - 2307110774914069305.. 2768025823616732920: # 16 - 2768025823616732921.. 3228940872319396536: ## 23 - 3228940872319396537.. 3689855921022060152: # 19 - 3689855921022060153.. 4150770969724723768: # 18 - 4150770969724723769.. 4611686018427387384: ## 28 - 4611686018427387385.. 4611686018427387903: 1 + num: 1000, avg: 96259266356736624.00, stddev: 1858774986626273280.00, median 10, min -4602121864537469332, max 4611686018427387903 + -4602121864537469332..-4141431470389226517: # 17 + -4141431470389226516..-3680741076240983701: ## 19 + -3680741076240983700..-3220050682092740885: ## 19 + -3220050682092740884..-2759360287944498069: ### 29 + -2759360287944498068..-2298669893796255253: ## 22 + -2298669893796255252..-1837979499648012437: ## 27 + -1837979499648012436..-1377289105499769621: ### 30 + -1377289105499769620.. -916598711351526805: ### 35 + -916598711351526804.. -455908317203283989: ## 24 + -455908317203283988.. 4782076944958827: ####################################################### 519 + 4782076944958828.. 465472471093201643: ## 25 + 465472471093201644.. 926162865241444459: ## 21 + 926162865241444460.. 1386853259389687275: ## 24 + 1386853259389687276.. 1847543653537930091: ## 27 + 1847543653537930092.. 2308234047686172907: ## 25 + 2308234047686172908.. 2768924441834415723: ## 26 + 2768924441834415724.. 3229614835982658539: ### 29 + 3229614835982658540.. 3690305230130901355: ## 28 + 3690305230130901356.. 4150995624279144171: ## 24 + 4150995624279144172.. 4611686018427386987: ### 29 + 4611686018427386988.. 4611686018427387903: 1 ================================================================================ success (ran 1 tests) diff --git a/test/core/QCheck2_unit_tests.ml b/test/core/QCheck2_unit_tests.ml index 05947918..a7af7308 100644 --- a/test/core/QCheck2_unit_tests.ml +++ b/test/core/QCheck2_unit_tests.ml @@ -133,43 +133,43 @@ module Shrink = struct if ocaml_major_version < 5 then (Alcotest.(check' (list (pair int int))) - ~msg:"69,1 on repeated failure" + ~msg:"1,3 on repeated failure" ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (pair small_int small_int)) |> repeated_failure) - ~expected:[(69, 1); (0, 1); (34, 1); (51, 1); (60, 1); (64, 1); (66, 1); (67, 1); (68, 1); (69, 0)]; + ~expected:[(1, 3); (0, 3); (1, 0); (1, 1); (1, 2)]; Alcotest.(check' (list (pair int int))) - ~msg:"69,1 on repeated success" + ~msg:"1,3 on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (pair small_int small_int)) |> repeated_success) - ~expected:[(69, 1); (0, 1); (0, 0)]) + ~expected:[(1, 3); (0, 3); (0, 0)]) else (Alcotest.(check' (list (pair int int))) - ~msg:"1,29 on repeated failure" + ~msg:"2,6 on repeated failure" ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (pair small_int small_int)) |> repeated_failure) - ~expected:[(1, 29); (0, 29); (1, 0); (1, 14); (1, 21); (1, 25); (1, 27); (1, 28)]; + ~expected:[(2, 6); (0, 6); (1, 6); (2, 0); (2, 3); (2, 5)]; Alcotest.(check' (list (pair int int))) - ~msg:"1,29 on repeated success" + ~msg:"2,6 on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (pair small_int small_int)) |> repeated_success) - ~expected:[(1, 29); (0, 29); (0, 0)]) + ~expected:[(2, 6); (0, 6); (0, 0)]) let test_bind_small_int () = if ocaml_major_version < 5 then (Alcotest.(check' (list (pair int int))) - ~msg:"1,69 on repeated failure" + ~msg:"1,3 on repeated failure" ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (small_int >>= fun i -> map (fun j -> (i,j)) small_int)) |> repeated_failure) - ~expected:[(1, 69); (0, 3)(*WTF?*); (1, 0); (1, 34); (1, 51); (1, 60); (1, 64); (1, 66); (1, 67); (1, 68)]; + ~expected:[(1, 3); (0, 6)(*WTF?*); (1, 0); (1, 1); (1, 2)]; Alcotest.(check' (list (pair int int))) - ~msg:"1,69 on repeated success" + ~msg:"1,3 on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (small_int >>= fun i -> map (fun j -> (i,j)) small_int)) |> repeated_success) - ~expected:[(1, 69); (0, 3)(*WTF?*); (0, 0)]) + ~expected:[(1, 3); (0, 6)(*WTF?*); (0, 0)]) else (Alcotest.(check' (list (pair int int))) - ~msg:"29,1 on repeated failure" + ~msg:"2,6 on repeated failure" ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (small_int >>= fun i -> map (fun j -> (i,j)) small_int)) |> repeated_failure) - ~expected:[(29, 1); (0, 2)(*WTF?*); (14, 1); (21, 8)(*WTF?*); (25, 7)(*WTF?*); (27, 9)(*WTF?*); (28, 5)(*WTF?*); (29, 0)]; + ~expected:[(2, 6); (0, 6); (1, 6); (2, 0); (2, 3); (2, 5)]; Alcotest.(check' (list (pair int int))) - ~msg:"29,1 on repeated success" + ~msg:"2,6 on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (small_int >>= fun i -> map (fun j -> (i,j)) small_int)) |> repeated_success) - ~expected:[(29, 1); (0, 2)(*WTF?*); (0, 0)]) + ~expected:[(2, 6); (0, 6); (0, 0)]) let test_list_int () = if ocaml_major_version < 5 diff --git a/test/ppx_deriving_qcheck/deriver/qcheck2/test_variants.ml b/test/ppx_deriving_qcheck/deriver/qcheck2/test_variants.ml index 6ae376ca..7448e33b 100644 --- a/test/ppx_deriving_qcheck/deriver/qcheck2/test_variants.ml +++ b/test/ppx_deriving_qcheck/deriver/qcheck2/test_variants.ml @@ -16,7 +16,7 @@ let pp_colors fmt x = let eq_colors = Alcotest.of_pp pp_colors -let gen = Gen.oneofl [Red; Green; Blue] +let gen = Gen.(frequency [1,pure Red; 1,pure Green; 1,pure Blue]) let test_variants () = test_compare ~msg:"Gen.oneofl <=> deriving variants" ~eq:eq_colors gen gen_colors @@ -32,7 +32,7 @@ let pp_poly_colors fmt x = let eq_poly_colors = Alcotest.of_pp pp_poly_colors -let gen_poly : poly_colors Gen.t = Gen.oneofl [`Red; `Green; `Blue] +let gen_poly : poly_colors Gen.t = Gen.(frequency [1,pure `Red; 1,pure `Green; 1,pure `Blue]) let test_poly_variants () = test_compare ~msg:"Gen.oneofl <=> deriving variants" From 23cdc2187d23371804262ec6858d3f6adf493474 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 23 Jan 2025 19:15:55 +0100 Subject: [PATCH 285/391] Use simpler Gen.int_bound instead of Gen.int_range 0 in QCheck2 --- src/core/QCheck2.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index d2dba3ef..bff5cbce 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -503,13 +503,13 @@ module Gen = struct let (--) low high = int_range ?origin:None low high let oneof (l : 'a t list) : 'a t = - int_range 0 (List.length l - 1) >>= List.nth l + int_bound (List.length l - 1) >>= List.nth l let oneofl (l : 'a list) : 'a t = - int_range 0 (List.length l - 1) >|= List.nth l + int_bound (List.length l - 1) >|= List.nth l let oneofa (a : 'a array) : 'a t = - int_range 0 (Array.length a - 1) >|= Array.get a + int_bound (Array.length a - 1) >|= Array.get a (* NOTE: we keep this alias to not break code that uses [small_int] for sizes of strings, arrays, etc. *) From 901afb0943ef2dc58622688812800875441c21a3 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 24 Jan 2025 00:05:46 +0100 Subject: [PATCH 286/391] Fix QCheck2.Gen.list_size shrinking with RS split and copy --- src/core/QCheck2.ml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index bff5cbce..cdb86232 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -569,11 +569,13 @@ module Gen = struct (* A tail-recursive implementation over Tree.t *) let list_size (size : int t) (gen : 'a t) : 'a list t = fun st -> + let st' = RS.split st in Tree.bind (size st) @@ fun size -> + let st' = RS.copy st' in (* start new loop off from same RS *) let rec loop n acc = if n <= 0 - then acc - else (loop [@tailcall]) (n - 1) (Tree.liftA2 List.cons (gen st) acc) + then Tree.map List.rev acc + else (loop [@tailcall]) (n - 1) (Tree.liftA2 List.cons (gen st') acc) in loop size (Tree.pure []) From 0d4ddf313b1471592eb846cfd162f4d529994a65 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 24 Jan 2025 00:12:32 +0100 Subject: [PATCH 287/391] Update QCheck2 unit test wrt to list_size fix --- test/core/QCheck2_unit_tests.ml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/test/core/QCheck2_unit_tests.ml b/test/core/QCheck2_unit_tests.ml index a7af7308..27e1017c 100644 --- a/test/core/QCheck2_unit_tests.ml +++ b/test/core/QCheck2_unit_tests.ml @@ -189,18 +189,19 @@ module Shrink = struct ~expected:[ [4; 2; 9; 1; 10]; []; ]) else (Alcotest.(check' (list (list int))) - ~msg:"[4; 10; 3; 5; 2] repeated failure" + ~msg:"[9; 2; 7; 3; 8; 6] repeated failure" ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (list_size (int_bound 8) (int_bound 10))) |> repeated_failure) - ~expected:[ [4; 10; 3; 5; 2]; []; [1; 2](*WTF?*); [9; 5; 4](*WTF?*); [1; 0; 7; 0](*WTF?*); - [0; 10; 3; 5; 2]; [2; 10; 3; 5; 2]; [3; 10; 3; 5; 2]; - [4; 0; 3; 5; 2]; [4; 5; 3; 5; 2]; [4; 8; 3; 5; 2]; [4; 9; 3; 5; 2]; - [4; 10; 0; 5; 2]; [4; 10; 1; 5; 2]; [4; 10; 2; 5; 2]; - [4; 10; 3; 0; 2]; [4; 10; 3; 2; 2]; [4; 10; 3; 3; 2]; [4; 10; 3; 4; 2]; - [4; 10; 3; 5; 0]; [4; 10; 3; 5; 1]; ]; + ~expected:[ [9; 2; 7; 3; 8; 6]; []; [9; 2; 7]; [9; 2; 7; 3; 8]; + [9; 2; 7; 3; 8; 0]; [9; 2; 7; 3; 8; 3]; [9; 2; 7; 3; 8; 5]; + [9; 2; 7; 3; 0; 6]; [9; 2; 7; 3; 4; 6]; [9; 2; 7; 3; 6; 6]; [9; 2; 7; 3; 7; 6]; + [9; 2; 7; 0; 8; 6]; [9; 2; 7; 1; 8; 6]; [9; 2; 7; 2; 8; 6]; + [9; 2; 0; 3; 8; 6]; [9; 2; 3; 3; 8; 6]; [9; 2; 5; 3; 8; 6]; [9; 2; 6; 3; 8; 6]; + [9; 0; 7; 3; 8; 6]; [9; 1; 7; 3; 8; 6]; + [0; 2; 7; 3; 8; 6]; [4; 2; 7; 3; 8; 6]; [6; 2; 7; 3; 8; 6]; [7; 2; 7; 3; 8; 6]; [8; 2; 7; 3; 8; 6]; ]; Alcotest.(check' (list (list int))) - ~msg:"[4; 10; 3; 5; 2] repeated success" + ~msg:"[9; 2; 7; 3; 8; 6] repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (list_size (int_bound 8) (int_bound 10))) |> repeated_success) - ~expected:[ [4; 10; 3; 5; 2]; []; ]) + ~expected:[[9; 2; 7; 3; 8; 6]; []; ]) let test_bytes_size () = if ocaml_major_version < 5 @@ -403,7 +404,7 @@ module Check_exn = struct with (Test.Test_fail (n,[c_ex_str])) -> Alcotest.(check string) (Printf.sprintf "%s: name" name) n name; - if not (string_starts_with ~prefix:"[0; 1]" c_ex_str) + if not (string_starts_with ~prefix:"[1; 0]" c_ex_str) then Alcotest.failf "%s: counter-example prefix. Received \"%s\"" name c_ex_str From c01500fc1d7e37653205249511e40b3c09022a70 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 24 Jan 2025 13:21:14 +0100 Subject: [PATCH 288/391] Adjust QCheck2.Gen.list_size so that spine and element shrinking happens from the list front --- src/core/QCheck2.ml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index cdb86232..32d47169 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -571,13 +571,13 @@ module Gen = struct fun st -> let st' = RS.split st in Tree.bind (size st) @@ fun size -> - let st' = RS.copy st' in (* start new loop off from same RS *) - let rec loop n acc = - if n <= 0 - then Tree.map List.rev acc - else (loop [@tailcall]) (n - 1) (Tree.liftA2 List.cons (gen st') acc) + let st' = RS.copy st' in (* start each loop from same Random.State to recreate same element (prefix) *) + let rec loop n acc = (* phase 1: build a list of element trees, tail recursively *) + if n <= 0 (* phase 2: build a list shrink Tree of element trees, tail recursively *) + then List.fold_left (fun acc t -> Tree.liftA2 List.cons t acc) (Tree.pure []) acc + else (loop [@tailcall]) (n - 1) ((gen st')::acc) in - loop size (Tree.pure []) + loop size [] let list (gen : 'a t) : 'a list t = list_size nat gen From b50b5e441cd43335c0aa89ab4bfc125c3a71e0e4 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 24 Jan 2025 13:38:15 +0100 Subject: [PATCH 289/391] Update QCheck2 unit test wrt to revised list_size fix --- test/core/QCheck2_unit_tests.ml | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/test/core/QCheck2_unit_tests.ml b/test/core/QCheck2_unit_tests.ml index 27e1017c..25b8a0bb 100644 --- a/test/core/QCheck2_unit_tests.ml +++ b/test/core/QCheck2_unit_tests.ml @@ -175,29 +175,26 @@ module Shrink = struct if ocaml_major_version < 5 then (Alcotest.(check' (list (list int))) - ~msg:"[4; 2; 9; 1; 10] on repeated failure" + ~msg:"[10; 8] on repeated failure" ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (list_size (int_bound 8) (int_bound 10))) |> repeated_failure) - ~expected:[ [4; 2; 9; 1; 10]; []; [0; 5](*WTF?*); [4; 8; 9](*WTF?*); [4; 9; 10; 1](*WTF?*); - [0; 2; 9; 1; 10]; [2; 2; 9; 1; 10]; [3; 2; 9; 1; 10]; - [4; 0; 9; 1; 10]; [4; 1; 9; 1; 10]; - [4; 2; 0; 1; 10]; [4; 2; 4; 1; 10]; [4; 2; 6; 1; 10]; [4; 2; 7; 1; 10]; [4; 2; 8; 1; 10]; - [4; 2; 9; 0; 10]; - [4; 2; 9; 1; 0]; [4; 2; 9; 1; 5]; [4; 2; 9; 1; 8]; [4; 2; 9; 1; 9]; ]; + ~expected:[ [10; 8]; []; [10]; + [0; 8]; [5; 8]; [8; 8]; [9; 8]; + [10; 0]; [10; 4]; [10; 6]; [10; 7]; ]; Alcotest.(check' (list (list int))) - ~msg:"[4; 2; 9; 1; 10] on repeated success" + ~msg:"[10; 8] on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (list_size (int_bound 8) (int_bound 10))) |> repeated_success) - ~expected:[ [4; 2; 9; 1; 10]; []; ]) + ~expected:[ [10; 8]; []; ]) else (Alcotest.(check' (list (list int))) ~msg:"[9; 2; 7; 3; 8; 6] repeated failure" ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (list_size (int_bound 8) (int_bound 10))) |> repeated_failure) ~expected:[ [9; 2; 7; 3; 8; 6]; []; [9; 2; 7]; [9; 2; 7; 3; 8]; - [9; 2; 7; 3; 8; 0]; [9; 2; 7; 3; 8; 3]; [9; 2; 7; 3; 8; 5]; - [9; 2; 7; 3; 0; 6]; [9; 2; 7; 3; 4; 6]; [9; 2; 7; 3; 6; 6]; [9; 2; 7; 3; 7; 6]; - [9; 2; 7; 0; 8; 6]; [9; 2; 7; 1; 8; 6]; [9; 2; 7; 2; 8; 6]; - [9; 2; 0; 3; 8; 6]; [9; 2; 3; 3; 8; 6]; [9; 2; 5; 3; 8; 6]; [9; 2; 6; 3; 8; 6]; + [0; 2; 7; 3; 8; 6]; [4; 2; 7; 3; 8; 6]; [6; 2; 7; 3; 8; 6]; [7; 2; 7; 3; 8; 6]; [8; 2; 7; 3; 8; 6]; [9; 0; 7; 3; 8; 6]; [9; 1; 7; 3; 8; 6]; - [0; 2; 7; 3; 8; 6]; [4; 2; 7; 3; 8; 6]; [6; 2; 7; 3; 8; 6]; [7; 2; 7; 3; 8; 6]; [8; 2; 7; 3; 8; 6]; ]; + [9; 2; 0; 3; 8; 6]; [9; 2; 3; 3; 8; 6]; [9; 2; 5; 3; 8; 6]; [9; 2; 6; 3; 8; 6]; + [9; 2; 7; 0; 8; 6]; [9; 2; 7; 1; 8; 6]; [9; 2; 7; 2; 8; 6]; + [9; 2; 7; 3; 0; 6]; [9; 2; 7; 3; 4; 6]; [9; 2; 7; 3; 6; 6]; [9; 2; 7; 3; 7; 6]; + [9; 2; 7; 3; 8; 0]; [9; 2; 7; 3; 8; 3]; [9; 2; 7; 3; 8; 5]; ]; Alcotest.(check' (list (list int))) ~msg:"[9; 2; 7; 3; 8; 6] repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (list_size (int_bound 8) (int_bound 10))) |> repeated_success) @@ -404,7 +401,7 @@ module Check_exn = struct with (Test.Test_fail (n,[c_ex_str])) -> Alcotest.(check string) (Printf.sprintf "%s: name" name) n name; - if not (string_starts_with ~prefix:"[1; 0]" c_ex_str) + if not (string_starts_with ~prefix:"[0; 1]" c_ex_str) then Alcotest.failf "%s: counter-example prefix. Received \"%s\"" name c_ex_str From 3c85dee1dcdaf5fa4cd93be768cfd1840817da64 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 24 Jan 2025 14:46:47 +0100 Subject: [PATCH 290/391] Temporarily disable Function.fold_left_test as it is taking excessively long --- test/core/QCheck2_tests.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/core/QCheck2_tests.ml b/test/core/QCheck2_tests.ml index 372478eb..1594e45b 100644 --- a/test/core/QCheck2_tests.ml +++ b/test/core/QCheck2_tests.ml @@ -852,7 +852,7 @@ module Function = struct prop_foldleft_foldright; prop_foldleft_foldright_uncurry; prop_foldleft_foldright_uncurry_funlast; - fold_left_test; + (*fold_left_test;*) (* Temporarily disabled, as the underlying shrinking takes excessively long *) ] end From cfef1be6d9ff005893f95004169814019b6a86d7 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 24 Jan 2025 15:50:33 +0100 Subject: [PATCH 291/391] Update QCheck2 expect test output wrt. Gen.list_size fix --- .../QCheck2_expect_test.expected.ocaml4.32 | 298 ++++++++--------- .../QCheck2_expect_test.expected.ocaml4.64 | 298 ++++++++--------- .../QCheck2_expect_test.expected.ocaml5.32 | 300 ++++++++--------- .../QCheck2_expect_test.expected.ocaml5.64 | 302 ++++++++---------- 4 files changed, 537 insertions(+), 661 deletions(-) diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.32 b/test/core/QCheck2_expect_test.expected.ocaml4.32 index 533ca9ab..4aacd9c0 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.32 @@ -68,50 +68,22 @@ random seed: 1234 0 1 0 -[7; 1; 42; 1; 8; 5; 3; 9; 5; 38; 3; 3; 0; 1; 98; 1; 4; 13; 9; 2; 6; 9; 47; 6; 5; 8; 8; 6; 0; 9; 7; 2; 8; 6; 62; 6; 4; 31; 19; 1; 41; 60; 6; 5; 8; 1; 1; 4; 7; 7; 0; 5; 5; 71; 14; 26; 47; 5; 1; 6; 34; 9; 4; 2; 37; 3; 8; 4; 31; 6; 2; 1; 0; 7; 5; 1; 0; 15; 6; 1; 8; 13; 0; 6; 2; 4; 2; 6; 6; 1; 4; 1; 9; 79; 0; 87; 6; 8; 8; 62; 1; 4; 62; 6; 31; 1; 5; 6; 5; 9; 3; 3; 1; 79; 4; 3; 2; 67; 5; 7; 12; 70; 8; 8; 6; 1; 3; 14; 15; 1; 61; 4; 1; 4; 1; 7; 4; 4; 4; 2; 8; 8; 7; 5; 4; 27; 0; 9; 80; 25; 1; 8; 1; 3; 7; 4; 3; 5; 5; 6; 5; 5; 31; 7; 0; 3; 3; 6; 71; 76; 28; 60; 6; 2; 6; 3; 0; 4; 1; 0; 5; 7; 0; 28; 86; 4; 7; 51; 36; 0; 5; 0; 1; 4; 3; 6; 0; 1; 1; 8; 18; 4; 2; 8; 8; 1; 4; 7; 1; 0; 93; 5; 3; 0; 80; 1; 7; 7; 8; 8; 5; 7; 8; 9; 24; 4; 25; 8; 8; 5; 4; 90; 4; 6; 8; 4; 4; 0; 60; 8; 9; 7; 44; 5; 1; 2; 9; 74; 7; 7] +[16; 1; 1] [] -[9; 61; 8; 4; 69; 2; 0; 72; 4; 41; 3; 8; 75; 83; 7; 7; 3; 9; 5; 8; 4; 1; 0; 2; 1; 4; 7; 6; 2; 1; 4; 86; 3; 79; 7; 86; 52; 39; 19; 0; 4; 7; 7; 7; 0; 4; 8; 8; 0; 5; 13; 1; 5; 0; 7; 12; 64; 34; 1; 1; 85; 8; 2; 9; 76; 0; 2; 5; 76; 69; 8; 8; 0; 1; 2; 2; 4; 60; 29; 5; 9; 4; 0; 8; 3; 3; 5; 1; 35; 8; 2; 7; 23; 61; 56; 8; 1; 1; 78; 7; 5; 0; 30; 9; 3; 7; 28; 57; 98; 3; 52; 3; 82; 7; 5; 5; 6; 8; 1; 6; 8; 9; 8; 16; 0] -[] -[1; 9; 8; 28; 47; 8; 5; 6; 8; 9; 2; 5; 8; 30; 6; 8; 84; 0; 6; 7; 76; 7; 9; 1; 0; 5; 76; 95; 2; 2; 1; 45; 7; 8; 8; 1; 6; 37; 5; 6; 73; 8; 0; 85; 8; 0; 4; 5; 2; 0; 26; 59; 0; 5; 13; 4; 7; 3; 6; 8; 1; 3] -[] -[5; 0; 0; 4; 10; 2; 4; 9; 5; 73; 6; 1; 5; 5; 3; 10; 5; 31; 1; 4; 3; 8; 9; 13; 41; 20; 96; 5; 1; 2; 8] -[] -[9; 8; 73; 5; 8; 2; 1; 8; 2; 6; 4; 18; 5; 76; 3] -[] -[0; 6; 2; 8; 8; 1; 4] -[] -[5; 2; 3] -[] -[3] +[16] [] [0] -[7; 1; 42; 1; 8; 5; 3; 9; 5; 38; 3; 3; 0; 1; 98; 1; 4; 13; 9; 2; 6; 9; 47; 6; 5; 8; 8; 6; 0; 9; 7; 2; 8; 6; 62; 6; 4; 31; 19; 1; 41; 60; 6; 5; 8; 1; 1; 4; 7; 7; 0; 5; 5; 71; 14; 26; 47; 5; 1; 6; 34; 9; 4; 2; 37; 3; 8; 4; 31; 6; 2; 1; 0; 7; 5; 1; 0; 15; 6; 1; 8; 13; 0; 6; 2; 4; 2; 6; 6; 1; 4; 1; 9; 79; 0; 87; 6; 8; 8; 62; 1; 4; 62; 6; 31; 1; 5; 6; 5; 9; 3; 3; 1; 79; 4; 3; 2; 67; 5; 7; 12; 70; 8; 8; 6; 1; 3; 14; 15; 1; 61; 4; 1; 4; 1; 7; 4; 4; 4; 2; 8; 8; 7; 5; 4; 27; 0; 9; 80; 25; 1; 8; 1; 3; 7; 4; 3; 5; 5; 6; 5; 5; 31; 7; 0; 3; 3; 6; 71; 76; 28; 60; 6; 2; 6; 3; 0; 4; 1; 0; 5; 7; 0; 28; 86; 4; 7; 51; 36; 0; 5; 0; 1; 4; 3; 6; 0; 1; 1; 8; 18; 4; 2; 8; 8; 1; 4; 7; 1; 0; 93; 5; 3; 0; 80; 1; 7; 7; 8; 8; 5; 7; 8; 9; 24; 4; 25; 8; 8; 5; 4; 90; 4; 6; 8; 4; 4; 0; 60; 8; 9; 7; 44; 5; 1; 2; 9; 74; 7; 7] -[] -[9; 61; 8; 4; 69; 2; 0; 72; 4; 41; 3; 8; 75; 83; 7; 7; 3; 9; 5; 8; 4; 1; 0; 2; 1; 4; 7; 6; 2; 1; 4; 86; 3; 79; 7; 86; 52; 39; 19; 0; 4; 7; 7; 7; 0; 4; 8; 8; 0; 5; 13; 1; 5; 0; 7; 12; 64; 34; 1; 1; 85; 8; 2; 9; 76; 0; 2; 5; 76; 69; 8; 8; 0; 1; 2; 2; 4; 60; 29; 5; 9; 4; 0; 8; 3; 3; 5; 1; 35; 8; 2; 7; 23; 61; 56; 8; 1; 1; 78; 7; 5; 0; 30; 9; 3; 7; 28; 57; 98; 3; 52; 3; 82; 7; 5; 5; 6; 8; 1; 6; 8; 9; 8; 16; 0] -[] -[1; 9; 8; 28; 47; 8; 5; 6; 8; 9; 2; 5; 8; 30; 6; 8; 84; 0; 6; 7; 76; 7; 9; 1; 0; 5; 76; 95; 2; 2; 1; 45; 7; 8; 8; 1; 6; 37; 5; 6; 73; 8; 0; 85; 8; 0; 4; 5; 2; 0; 26; 59; 0; 5; 13; 4; 7; 3; 6; 8; 1; 3] -[] -[5; 0; 0; 4; 10; 2; 4; 9; 5; 73; 6; 1; 5; 5; 3; 10; 5; 31; 1; 4; 3; 8; 9; 13; 41; 20; 96; 5; 1; 2; 8] -[] -[9; 8; 73; 5; 8; 2; 1; 8; 2; 6; 4; 18; 5; 76; 3] -[] -[0; 6; 2; 8; 8; 1; 4] -[] -[5; 2; 3] -[3; 2; 7; 3; 3] +[16; 1; 1] [] -[5; 3] -[5; 3; 2] -[9; 87; 7; 0] -[0; 2; 7; 3; 3] -[0; 0; 7; 3; 3] -[0; 0; 0; 3; 3] -[0; 0; 0; 0; 3] -[0; 0; 0; 0; 0] +[16] +[16; 1] +[0; 1; 1] +[0; 0; 1] +[0; 0; 0] --- Failure -------------------------------------------------------------------- -Test should_fail_sort_id failed (9 shrink steps): +Test should_fail_sort_id failed (6 shrink steps): [1; 0] @@ -235,7 +207,7 @@ Test big bound issue59 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test long_shrink failed (3010 shrink steps): +Test long_shrink failed (2998 shrink steps): ([0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0], [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 1]) @@ -397,15 +369,15 @@ Test pairs sum to less than 128 failed (24 shrink steps): --- Failure -------------------------------------------------------------------- -Test pairs lists rev concat failed (38 shrink steps): +Test pairs lists rev concat failed (34 shrink steps): ([0], [1]) --- Failure -------------------------------------------------------------------- -Test pairs lists no overlap failed (17 shrink steps): +Test pairs lists no overlap failed (15 shrink steps): -([0], [0; 0; 0; 0; 0; 0]) +([0], [0; 0; 0; 0; 0; 0; 0; 0; 0; 0]) --- Failure -------------------------------------------------------------------- @@ -517,33 +489,33 @@ Test bind list_size constant failed (12 shrink steps): --- Failure -------------------------------------------------------------------- -Test lists are empty failed (8 shrink steps): +Test lists are empty failed (2 shrink steps): [0] --- Failure -------------------------------------------------------------------- -Test lists shorter than 10 failed (16 shrink steps): +Test lists shorter than 10 failed (12 shrink steps): [0; 0; 0; 0; 0; 0; 0; 0; 0; 0] --- Failure -------------------------------------------------------------------- -Test lists shorter than 432 failed (416 shrink steps): +Test lists shorter than 432 failed (405 shrink steps): [...] list length: 432 --- Failure -------------------------------------------------------------------- -Test lists shorter than 4332 failed (3962 shrink steps): +Test lists shorter than 4332 failed (3998 shrink steps): [...] list length: 4332 --- Failure -------------------------------------------------------------------- -Test lists have unique elems failed (11 shrink steps): +Test lists have unique elems failed (3 shrink steps): -[0; 0; 0; 0; 0] +[0; 0; 0] --- Failure -------------------------------------------------------------------- @@ -579,25 +551,25 @@ Leaf 0 Test sum list = 0 failed (0 shrink steps): -[7; 1; 42; 1; 8; 5; 3; 9; 5; 38; 3; 3; 0; 1; 98; 1; 4; 13; 9; 2; 6; 9; 47; 6; 5; 8; 8; 6; 0; 9; 7; 2; 8; 6; 62; 6; 4; 31; 19; 1; 41; 60; 6; 5; 8; 1; 1; 4; 7; 7; 0; 5; 5; 71; 14; 26; 47; 5; 1; 6; 34; 9; 4; 2; 37; 3; 8; 4; 31; 6; 2; 1; 0; 7; 5; 1; 0; 15; 6; 1; 8; 13; 0; 6; 2; 4; 2; 6; 6; 1; 4; 1; 9; 79; 0; 87; 6; 8; 8; 62; 1; 4; 62; 6; 31; 1; 5; 6; 5; 9; 3; 3; 1; 79; 4; 3; 2; 67; 5; 7; 12; 70; 8; 8; 6; 1; 3; 14; 15; 1; 61; 4; 1; 4; 1; 7; 4; 4; 4; 2; 8; 8; 7; 5; 4; 27; 0; 9; 80; 25; 1; 8; 1; 3; 7; 4; 3; 5; 5; 6; 5; 5; 31; 7; 0; 3; 3; 6; 71; 76; 28; 60; 6; 2; 6; 3; 0; 4; 1; 0; 5; 7; 0; 28; 86; 4; 7; 51; 36; 0; 5; 0; 1; 4; 3; 6; 0; 1; 1; 8; 18; 4; 2; 8; 8; 1; 4; 7; 1; 0; 93; 5; 3; 0; 80; 1; 7; 7; 8; 8; 5; 7; 8; 9; 24; 4; 25; 8; 8; 5; 4; 90; 4; 6; 8; 4; 4; 0; 60; 8; 9; 7; 44; 5; 1; 2; 9; 74; 7; 7] +[16; 1; 1] --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int failed (6 shrink steps): +Test fail_pred_map_commute_int failed (31 shrink steps): -([0; 1], {_ -> 0}, {1 -> true; _ -> false}) +([0; 0; 0; 0; 0; 0], {0 -> -1; 1 -> 0; 2 -> 0; 5 -> 0; 21 -> 0; 7 -> 0; 9 -> 0; 78 -> 0; _ -> 0}, {0 -> true; 998130433 -> false; 1 -> false; 2 -> false; 402927669 -> false; 5 -> false; 21 -> false; 7 -> false; -1041906807 -> false; 9 -> false; -1072173830 -> false; -353172948 -> false; -952635860 -> false; 78 -> false; 286212959 -> false; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int32 failed (82 shrink steps): +Test fail_pred_map_commute_int32 failed (70 shrink steps): -([0l; 0l], {-1774179912l -> 0l; 0l -> 10l; -1658413248l -> 0l; -197056364l -> 0l; _ -> 0l}, {5l -> false; 10963850l -> false; 5481925l -> false; 74l -> false; 198l -> false; 674533l -> false; 189713l -> false; 212l -> false; 79063824l -> false; 23l -> false; 1944l -> false; 0l -> false; 86l -> false; 252950l -> false; 1349067l -> false; 20465853l -> false; 567l -> false; 7195026l -> false; 17542160l -> false; 2268l -> false; 6916l -> false; 124744253l -> false; 8l -> false; 10374l -> false; 49l -> false; 15593031l -> false; 11l -> false; 141l -> false; 110666l -> false; 31186063l -> false; 95l -> false; 126475l -> false; 47l -> false; 166325670l -> false; 55333l -> false; 92l -> false; 1011800l -> false; 3597513l -> false; -1658413248l -> false; 5396270l -> false; 62372126l -> false; 221767560l -> false; -197056364l -> false; 23389547l -> false; -1774179912l -> false; 2593l -> false; 332651340l -> false; 247l -> false; 505900l -> false; 283l -> false; 8222888l -> false; 21927700l -> false; 132l -> false; 2698135l -> false; 457187395l -> false; 10l -> true; 13833l -> false; 9593369l -> false; 221332l -> false; 443535120l -> false; -1990017031l -> false; 4796684l -> false; 1296l -> false; 27666l -> false; 9l -> false; 265l -> false; 99l -> false; 83162835l -> false; 11694773l -> false; 5187l -> false; 1134l -> false; _ -> false}) +([0l; 0l; 0l; 0l; 0l; 0l], {480624048l -> 0l; -1054565120l -> 0l; 708270421l -> 0l; -1441877194l -> 0l; -239944349l -> 0l; 0l -> 1l; -973889953l -> 0l; 1395009590l -> 0l; _ -> 0l}, {-1990017031l -> false; 443535120l -> false; 480624048l -> false; -1054565120l -> false; 829558403l -> false; -1311148841l -> false; 2084431360l -> false; 708270421l -> false; 79063824l -> false; -1441877194l -> false; -239944349l -> false; 0l -> true; 457187395l -> false; 1395009590l -> false; -973889953l -> false; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int64 failed (188 shrink steps): +Test fail_pred_map_commute_int64 failed (125 shrink steps): -([0L; 0L], {-846350636327884360L -> 0L; -7122830660870113674L -> 0L; 0L -> 2L; -5852418530639587665L -> 0L; _ -> 0L}, {165975431736793371L -> false; 988622509L -> false; 359L -> false; 1019310L -> false; 2684127201758L -> false; 404L -> false; 1258954385914640095L -> false; 534L -> false; 1937L -> false; 145228502769694200L -> false; 134L -> false; 209413047969606L -> false; 1963604910111969040L -> false; 536L -> false; 134680508L -> false; 1318163345L -> false; 85701540674L -> false; 1L -> false; 1006547700659L -> false; 69512520L -> false; 213301612346L -> false; 13615172134658831L -> false; 2421L -> false; 13717L -> false; 16308967L -> false; 193638003692925600L -> false; 3562926213990806743L -> false; 1095L -> false; 111487L -> false; 975093085013L -> false; 4026190802637L -> false; 2233739178342464L -> false; 6714423391544747172L -> false; 505L -> false; 413094407878241280L -> false; 31355L -> false; 139608698646404L -> false; 339576540681650169L -> false; -7122830660870113674L -> false; 8L -> false; 67L -> false; 8154483L -> false; 3357211695772373586L -> false; 13778L -> false; 3444L -> false; 764483L -> false; 2583L -> false; 16L -> false; 3124535337L -> false; 4476282261029831448L -> false; 719L -> false; 62711L -> false; 1482933764L -> false; 1116869589171232L -> false; 2863069015209L -> false; 1678605847886186793L -> false; 472107894717990035L -> false; 228537441799L -> false; 314738596478660023L -> false; 1977245018L -> false; 1291L -> false; 7348L -> false; 1509821550989L -> false; 5726138030418L -> false; 821L -> false; 2517908771829280190L -> false; 2L -> true; 279217397292808L -> false; 4077241L -> false; 45809104243350L -> false; 14697L -> false; 108921377077270650L -> false; 139025040L -> false; 539L -> false; 15677L -> false; 5010370776616L -> false; 27230344269317662L -> false; 236053947358995017L -> false; 7838L -> false; 114268720899L -> false; 72614251384847100L -> false; 222974L -> false; 33670127L -> false; 26176630996200L -> false; 54460688538635325L -> false; 442601151298115657L -> false; 629477192957320047L -> false; 221300575649057828L -> false; 2190L -> false; 6889L -> false; 4294603522814L -> false; 1877L -> false; 1950186170027L -> false; 96819001846462800L -> false; 5368254403517L -> false; 556100162L -> false; 4467478356684928L -> false; 104706523984803L -> false; 5105689550497061L -> false; 1722L -> false; 558434794585616L -> false; 2552844775248530L -> false; 2013095401318L -> false; 0L -> false; 15782871L -> false; 8417531L -> false; 2038620L -> false; 22904552121675L -> false; 8952564522059662897L -> false; 522L -> false; 52353261992401L -> false; 121646910L -> false; 4686803006L -> false; 99985130786L -> false; 83615L -> false; 509655L -> false; 3515102255L -> false; 33L -> false; 269L -> false; 1757551127L -> false; 1887276938736L -> false; 547L -> false; 278050081L -> false; 3L -> false; 49992565393L -> false; -5852418530639587665L -> false; 6L -> false; 12859L -> false; 2502L -> false; 67340254L -> false; 741466882L -> false; 487546542506L -> false; 12626297L -> false; 12498141348L -> false; 1761458476154L -> false; 11452276060837L -> false; 471L -> false; 104268780L -> false; 182829953439L -> false; 2260L -> false; 3829267162872795L -> false; 39264946494300L -> false; 2343401503L -> false; 243773271253L -> false; 268L -> false; 530L -> false; 11757L -> false; 891897L -> false; 2636326691L -> false; 24996282696L -> false; -846350636327884360L -> false; 110650287824528914L -> false; 354080921038492526L -> false; 167231L -> false; 14730680L -> false; 41807L -> false; 10211379100994123L -> false; 57134360449L -> false; 20422758201988247L -> false; 16835063L -> false; 370733441L -> false; 445948L -> false; 130335975L -> false; 6249070674L -> false; 1251L -> false; 11022L -> false; 12L -> false; 479L -> false; 958L -> false; 121886635626L -> false; _ -> false}) +([0L; 0L; 0L; 0L; 0L; 0L], {-5912897149740583042L -> 0L; 2064264570832434420L -> 0L; 8769531915837689755L -> 0L; -1030553128493932961L -> 0L; 0L -> 1L; 6077417419721789289L -> 0L; -4529322700507305930L -> 0L; -6192815392369977003L -> 0L; _ -> 0L}, {-8367471897177334538L -> false; 8952564522059662897L -> false; -5912897149740583042L -> false; -5897649978982613650L -> false; 339576540681650169L -> false; 2064264570832434420L -> false; 1963604910111969040L -> false; 8769531915837689755L -> false; -1030553128493932961L -> false; 0L -> true; 6077417419721789289L -> false; -3575913752036838904L -> false; 3562926213990806743L -> false; -6192815392369977003L -> false; -4529322700507305930L -> false; _ -> false}) --- Failure -------------------------------------------------------------------- @@ -607,34 +579,28 @@ Test fail_pred_strings failed (2 shrink steps): --- Failure -------------------------------------------------------------------- -Test fold_left fold_right failed (169 shrink steps): +Test fold_left fold_right failed (21 shrink steps): -(0, [1], {(83, 0) -> 0; (63, 7) -> 0; (86, 93) -> 0; (3, 4) -> 0; (30, 24) -> 0; (77, 9) -> 0; (37, 7) -> 0; (6, 25) -> 0; (2, 99) -> 0; (0, 11) -> 0; (6, 9) -> 0; (4, 96) -> 0; (9, 39) -> 0; (9, 4) -> 0; (6, 8) -> 0; (9, 9) -> 0; (2, 2) -> 0; (4, 19) -> 0; (5, 26) -> 0; (5, 53) -> 0; (4, 0) -> 0; (7, 1) -> 0; (7, 8) -> 0; (4, 86) -> 0; (0, 0) -> 0; (11, 56) -> 0; (77, 4) -> 0; (27, 4) -> 0; (77, 86) -> 0; (7, 4) -> 0; (84, 7) -> 0; (47, 0) -> 0; (4, 7) -> 0; (2, 7) -> 0; (3, 84) -> 0; (77, 89) -> 0; (9, 25) -> 0; (4, 44) -> 0; (9, 3) -> 0; (6, 3) -> 0; (4, 3) -> 0; (9, 6) -> 0; (4, 1) -> 0; (2, 3) -> 0; (75, 4) -> 0; (96, 1) -> 0; (7, 2) -> 0; (25, 52) -> 0; (3, 3) -> 0; (5, 6) -> 0; (1, 3) -> 0; (46, 0) -> 0; (43, 5) -> 0; (5, 65) -> 0; (6, 4) -> 0; (3, 70) -> 0; (4, 5) -> 0; (7, 0) -> 0; (9, 7) -> 0; (2, 8) -> 0; (3, 5) -> 0; (1, 4) -> 0; (6, 5) -> 0; (53, 75) -> 0; (3, 90) -> 0; (89, 2) -> 0; (81, 0) -> 0; (4, 80) -> 0; (4, 94) -> 0; (89, 9) -> 0; (4, 6) -> 0; (63, 9) -> 0; (3, 24) -> 0; (94, 8) -> 0; (2, 0) -> 0; (9, 87) -> 0; (33, 0) -> 0; (0, 99) -> 0; (5, 2) -> 0; (8, 4) -> 0; (8, 23) -> 0; (8, 3) -> 0; (0, 4) -> 0; (0, 9) -> 0; (86, 1) -> 0; (9, 43) -> 0; (0, 94) -> 0; (0, 7) -> 0; (8, 2) -> 0; (1, 5) -> 0; (78, 3) -> 0; (57, 3) -> 0; (24, 8) -> 0; (1, 0) -> 1; (8, 8) -> 0; (7, 3) -> 0; (3, 48) -> 0; (44, 0) -> 0; (5, 1) -> 0; (93, 89) -> 0; (2, 4) -> 0; (19, 4) -> 0; (2, 47) -> 0; (1, 89) -> 0; (48, 2) -> 0; (6, 19) -> 0; (4, 47) -> 0; (6, 6) -> 0; (3, 7) -> 0; (0, 3) -> 0; (8, 1) -> 0; (0, 8) -> 0; (8, 47) -> 0; (0, 6) -> 0; (8, 77) -> 0; (6, 2) -> 0; (4, 75) -> 0; (20, 7) -> 0; (4, 83) -> 0; (78, 2) -> 0; (5, 9) -> 0; (65, 3) -> 0; (65, 84) -> 0; (96, 9) -> 0; (1, 8) -> 0; (99, 90) -> 0; (6, 7) -> 0; (39, 7) -> 0; (1, 96) -> 0; (26, 83) -> 0; (23, 6) -> 0; (9, 44) -> 0; (5, 44) -> 0; (8, 0) -> 0; (2, 6) -> 0; (3, 6) -> 0; (52, 3) -> 0; (5, 0) -> 0; (4, 52) -> 0; (0, 2) -> 0; (6, 1) -> 0; (2, 1) -> 0; (9, 0) -> 0; (0, 5) -> 0; (3, 23) -> 0; (4, 2) -> 0; (64, 7) -> 0; (8, 48) -> 0; (66, 5) -> 0; (9, 1) -> 0; (7, 9) -> 0; (2, 26) -> 0; (3, 93) -> 0; (3, 0) -> 0; (19, 9) -> 0; (88, 84) -> 0; (7, 7) -> 0; (75, 5) -> 0; (3, 9) -> 0; (47, 77) -> 0; (39, 9) -> 0; (87, 0) -> 0; (9, 47) -> 0; (9, 8) -> 0; (7, 6) -> 0; (3, 34) -> 0; (83, 20) -> 0; (4, 8) -> 0; (5, 4) -> 0; (5, 7) -> 0; (6, 0) -> 0; (1, 25) -> 0; (3, 1) -> 0; _ -> 0}) +(0, [0; 0], {(70, 3) -> 0; (3, 0) -> 0; (0, 6) -> 0; (2, 6) -> 0; (0, 90) -> 0; (3, 26) -> 0; (3, 9) -> 0; (20, 3) -> 0; (3, 2) -> 0; (2, 0) -> 0; (0, 70) -> 1; (4, 3) -> 0; (9, 6) -> 0; (6, 8) -> 0; (0, 3) -> 0; (6, 6) -> 0; (0, 7) -> 0; (0, 0) -> 70; _ -> 0}) +++ Messages ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Messages for test fold_left fold_right: -l=[1], fold_left=1, fold_right=0 +l=[0; 0], fold_left=1, fold_right=0 --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried failed (701 shrink steps): +Test fold_left fold_right uncurried failed (47 shrink steps): -({(5, 4) -> 0; (9, 6) -> 0; (37, 2) -> 0; (3, 8) -> 0; (84, 2) -> 0; (3, 7) -> 0; (2, 43) -> 0; (2, 7) -> 0; (1, 5) -> 0; (67, 9) -> 0; (5, 8) -> 0; (5, 0) -> 1; (4, 9) -> 0; (1, 3) -> 0; (3, 5) -> 0; (1, 9) -> 0; _ -> 0}, 0, [5; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0]) +({(3, 76) -> 0; (9, 3) -> 0; (5, 2) -> 0; (1, 2) -> 1; (34, 1) -> 0; (9, 6) -> 0; (7, 3) -> 0; (3, 8) -> 0; (67, 3) -> 0; (2, 24) -> 0; (1, 1) -> 0; (37, 6) -> 0; (6, 2) -> 0; (5, 8) -> 0; (5, 7) -> 0; (5, 6) -> 0; (4, 8) -> 0; (17, 3) -> 0; (3, 4) -> 0; (84, 79) -> 0; (4, 17) -> 0; (6, 1) -> 0; (7, 6) -> 0; (3, 5) -> 0; (9, 4) -> 0; (1, 9) -> 0; (2, 5) -> 0; _ -> 0}, 1, [2]) --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried fun last failed (34 shrink steps): +Test fold_left fold_right uncurried fun last failed (26 shrink steps): -(0, [1], {(3, 9) -> 0; (20, 4) -> 0; (9, 3) -> 0; (4, 48) -> 0; (8, 5) -> 0; (9, 24) -> 0; (47, 7) -> 0; (2, 99) -> 0; (6, 84) -> 0; (6, 6) -> 0; (7, 89) -> 0; (1, 0) -> 1; (47, 2) -> 0; (26, 94) -> 0; (0, 19) -> 0; (90, 5) -> 0; (9, 0) -> 0; (9, 4) -> 0; (2, 5) -> 0; (70, 7) -> 0; (1, 9) -> 0; _ -> 0}) - ---- Failure -------------------------------------------------------------------- - -Test fold_left test, fun first failed (108 shrink steps): - -({("h", 3) -> ""; ("Ph\228", 4) -> ""; ("\164~\190\161\005Be2", 3) -> ""; ("T", 4) -> ""; ("\207\244\171\128\185w\173\190\239F5{\147\191\157nQ\132T\252\253|\028(Hf\1373?\181U\137\241\019-\155u\252\243\t\206`\133\140", 89) -> ""; ("\153\247\255", 2) -> ""; ("\240`\139\219Q1\218\240$\024\176\166\0122:-Z\198\184cm\189\186xQ\143\128R\"\235\238TqA\158\224&\151y\209\180=\027\204D\188\171~\226r\253\153\249\163\"E\252\001\020y(\182A\146JE\1457\201\169\012\253\002\193;\166ze\245%\246\143\2338\161\005\161]F\153^T", 7) -> ""; ("\016S\203'a\195X\131\152", 0) -> ""; ("\243u\163\147\135", 8) -> ""; ("1n3\198\148\183\160", 1) -> ""; ("\236\255", 8) -> ""; ("\139}%\161!d\131\167)\0244=\157\130\239]\029i\178\238$*\173V\245\176\023\234\202\150\022\242\170\252l@\216\136\173\228O", 5) -> ""; ("\131\011x$\127\0261u\147j", 4) -> ""; ("\237)\173\152w\006\133\205n\026\157\216c\007\198\239\255\247", 3) -> ""; ("An\177E\018\164\215\143\136\164\215\214\nJ\212\020\180\208\031}\140\023E\245\171o\255\203\195O\204U\227BF\187\174\233\239NMu \198\011\175\136(\160(\2511\007;\022\253\216\173\026\224\242\148\238c\230\n~\180:\175a\241O-7\141\197", 4) -> ""; ("\140", 7) -> ""; ("", 5) -> "a"; ("\014\1333\194\"\220\222\252X\196hA\185\156\197\177\160\197\247K\224N\203U\172\007\148\209O,%($i\027\015\2002`", 1) -> ""; ("\167\162\212\012\145z", 2) -> ""; ("\002\241\197\142\177\162", 8) -> ""; ("/\197p\004L", 9) -> ""; ("'\214\194w#\194\189\207\210", 75) -> ""; ("\216n\128$\161f\233\226", 4) -> ""; ("u).(\174\135f\214!JG\182\252(\249E\218^f\022\250\174zm-\225\203\130Y\250\218\179j\162\180\214\189\027\024\169>Y\219\152\155\234;\2363\200\176\139\031\020/\152\012\b\191\011\153O\129\168\234\016~\175G\016\234\015\169M\169", 9) -> ""; ("w\128n", 5) -> ""; ("", 0) -> ""; ("\022\188\139?", 48) -> ""; ("\219'\188", 4) -> ""; ("", 83) -> ""; ("", 6) -> ""; ("36", 5) -> ""; ("\152\224$\234*J\244\018\181\146\171\"\138H\158\131E\r\014\236\240\024\226\147\214\000\227\022:\157N\197\171\228\250V\145a\204\189:\023\141\182y\144\229/r\200m\b!\137WX\246\017\250f\244I\214K\131\170z+\167d@\131/\166\163s\148\221\199M\224Z\012R\014", 2) -> ""; ("\136\227\237\148\181\138\017]\169\230\187w9d\201\152\019\173`\170\1837(\240\240\168\253L\208\156={\167`\023\214B\142R\142a\176\204F\173\161\214vs\1614<a\206\203~\156\242\216\128\031C\200TD\208Rf\b\"\014\128R4\232[\205\253_iR\021\128(", 23) -> ""; ("\t\132\164\254\016", 84) -> ""; ("\029", 7) -> ""; (",P", 6) -> ""; ("\016{\250\014>m\175m\204X^\137P#UZ<\215\244\028\249\226,`\018\172\193\144\235\183\150\179\133\134e\205\016", 0) -> ""; ("\163+Y\133\129\219\b\168\162]\217|$V", 19) -> ""; ("", 4) -> ""; ("", 9) -> ""; ("\2387\030Ay\" x\219\172\241\178\202\174\232\228\162\239\234\147\021T}\236\136k!\196\195\028a\019\029\188", 94) -> ""; ("\219'\188", 3) -> ""; ("\140\194\177", 5) -> ""; (" kH\148a\135\179#\255\220\139\000BW\234\228&N\199\175m}\167S\242\183\030\172\158\194\027\145\183d5k\127\"\164\024\162#\182n\252\027_V\"^j\020\019\197=\027#`H\004Y\216\197\162@\193v\204~\146\004\204p\149\022s\153\011\176\006\026o\198\169\143U\166\215\201xy\208", 4) -> ""; ("\169", 99) -> ""; ("", 24) -> ""; ("\198\168", 7) -> "a"; ("@\197\242l\146\175\130\216\1692z\178tSW\252'\249j$\195\202\014/Iw\166\020\186cr\":\224n\242c\187\141\023", 3) -> ""; ("\020\215\157", 3) -> ""; _ -> ""}, "", [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0], [5]) +(0, [0; 0], {(0, 20) -> 0; (90, 3) -> 0; (3, 9) -> 0; (8, 3) -> 0; (3, 2) -> 0; (9, 6) -> 0; (7, 3) -> 0; (6, 20) -> 0; (0, 70) -> 0; (6, 70) -> 0; (3, 0) -> 1; (0, 4) -> 0; (6, 0) -> 0; (0, 0) -> 3; (2, 0) -> 0; (26, 6) -> 0; (6, 3) -> 0; _ -> 0}) --- Failure -------------------------------------------------------------------- @@ -1101,63 +1067,63 @@ Ok _ : 7477 cases +++ Stats for list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 361.42, stddev: 1230.75, median 9, min 0, max 9974 - 0.. 498: ####################################################### 4212 - 499.. 997: ####### 578 - 998..1496: 11 - 1497..1995: 15 - 1996..2494: 11 - 2495..2993: 10 - 2994..3492: 13 - 3493..3991: 12 - 3992..4490: 7 - 4491..4989: 8 - 4990..5488: 15 - 5489..5987: 14 - 5988..6486: 12 - 6487..6985: 8 - 6986..7484: 9 - 7485..7983: 19 - 7984..8482: 14 - 8483..8981: 11 - 8982..9480: 11 - 9481..9979: 10 + num: 5000, avg: 381.73, stddev: 1276.71, median 9, min 0, max 9931 + 0.. 496: ####################################################### 4213 + 497.. 993: ###### 526 + 994..1490: 22 + 1491..1987: 14 + 1988..2484: 19 + 2485..2981: 14 + 2982..3478: 19 + 3479..3975: 15 + 3976..4472: 18 + 4473..4969: 14 + 4970..5466: 13 + 5467..5963: 11 + 5964..6460: 14 + 6461..6957: 18 + 6958..7454: 8 + 7455..7951: 15 + 7952..8448: 12 + 8449..8945: 9 + 8946..9442: 7 + 9443..9939: 19 +++ Stats for small_list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 15.79, stddev: 24.64, median 6, min 0, max 99 - 0.. 4: ###################################################### 1930 - 5.. 9: ####################################################### 1957 - 10.. 14: # 59 - 15.. 19: # 66 - 20.. 24: # 61 - 25.. 29: # 52 - 30.. 34: # 61 - 35.. 39: # 65 - 40.. 44: # 62 - 45.. 49: # 64 - 50.. 54: # 70 - 55.. 59: # 63 - 60.. 64: # 50 - 65.. 69: # 51 - 70.. 74: # 52 - 75.. 79: # 63 - 80.. 84: # 56 - 85.. 89: ## 75 - 90.. 94: ## 73 - 95.. 99: # 70 + num: 5000, avg: 16.26, stddev: 24.83, median 6, min 0, max 99 + 0.. 4: #################################################### 1868 + 5.. 9: ####################################################### 1967 + 10.. 14: # 66 + 15.. 19: # 62 + 20.. 24: # 70 + 25.. 29: # 59 + 30.. 34: # 62 + 35.. 39: # 62 + 40.. 44: ## 73 + 45.. 49: # 66 + 50.. 54: # 68 + 55.. 59: # 59 + 60.. 64: # 61 + 65.. 69: ## 75 + 70.. 74: # 56 + 75.. 79: # 64 + 80.. 84: # 46 + 85.. 89: ## 72 + 90.. 94: # 67 + 95.. 99: ## 77 +++ Stats for list_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 7.51, stddev: 1.71, median 8, min 5, max 10 - 5: ###################################################### 834 - 6: ##################################################### 825 - 7: ##################################################### 820 - 8: ###################################################### 833 - 9: ####################################################### 844 - 10: ####################################################### 844 + num: 5000, avg: 7.47, stddev: 1.70, median 7, min 5, max 10 + 5: ##################################################### 848 + 6: #################################################### 829 + 7: ####################################################### 869 + 8: ##################################################### 839 + 9: ################################################# 787 + 10: #################################################### 828 +++ Stats for list_repeat len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -1168,63 +1134,63 @@ stats len: +++ Stats for array len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 361.42, stddev: 1230.75, median 9, min 0, max 9974 - 0.. 498: ####################################################### 4212 - 499.. 997: ####### 578 - 998..1496: 11 - 1497..1995: 15 - 1996..2494: 11 - 2495..2993: 10 - 2994..3492: 13 - 3493..3991: 12 - 3992..4490: 7 - 4491..4989: 8 - 4990..5488: 15 - 5489..5987: 14 - 5988..6486: 12 - 6487..6985: 8 - 6986..7484: 9 - 7485..7983: 19 - 7984..8482: 14 - 8483..8981: 11 - 8982..9480: 11 - 9481..9979: 10 + num: 5000, avg: 381.73, stddev: 1276.71, median 9, min 0, max 9931 + 0.. 496: ####################################################### 4213 + 497.. 993: ###### 526 + 994..1490: 22 + 1491..1987: 14 + 1988..2484: 19 + 2485..2981: 14 + 2982..3478: 19 + 3479..3975: 15 + 3976..4472: 18 + 4473..4969: 14 + 4970..5466: 13 + 5467..5963: 11 + 5964..6460: 14 + 6461..6957: 18 + 6958..7454: 8 + 7455..7951: 15 + 7952..8448: 12 + 8449..8945: 9 + 8946..9442: 7 + 9443..9939: 19 +++ Stats for small_array len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 15.79, stddev: 24.64, median 6, min 0, max 99 - 0.. 4: ###################################################### 1930 - 5.. 9: ####################################################### 1957 - 10.. 14: # 59 - 15.. 19: # 66 - 20.. 24: # 61 - 25.. 29: # 52 - 30.. 34: # 61 - 35.. 39: # 65 - 40.. 44: # 62 - 45.. 49: # 64 - 50.. 54: # 70 - 55.. 59: # 63 - 60.. 64: # 50 - 65.. 69: # 51 - 70.. 74: # 52 - 75.. 79: # 63 - 80.. 84: # 56 - 85.. 89: ## 75 - 90.. 94: ## 73 - 95.. 99: # 70 + num: 5000, avg: 16.26, stddev: 24.83, median 6, min 0, max 99 + 0.. 4: #################################################### 1868 + 5.. 9: ####################################################### 1967 + 10.. 14: # 66 + 15.. 19: # 62 + 20.. 24: # 70 + 25.. 29: # 59 + 30.. 34: # 62 + 35.. 39: # 62 + 40.. 44: ## 73 + 45.. 49: # 66 + 50.. 54: # 68 + 55.. 59: # 59 + 60.. 64: # 61 + 65.. 69: ## 75 + 70.. 74: # 56 + 75.. 79: # 64 + 80.. 84: # 46 + 85.. 89: ## 72 + 90.. 94: # 67 + 95.. 99: ## 77 +++ Stats for array_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 7.51, stddev: 1.71, median 8, min 5, max 10 - 5: ###################################################### 834 - 6: ##################################################### 825 - 7: ##################################################### 820 - 8: ###################################################### 833 - 9: ####################################################### 844 - 10: ####################################################### 844 + num: 5000, avg: 7.47, stddev: 1.70, median 7, min 5, max 10 + 5: ##################################################### 848 + 6: #################################################### 829 + 7: ####################################################### 869 + 8: ##################################################### 839 + 9: ################################################# 787 + 10: #################################################### 828 +++ Stats for array_repeat len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -1672,7 +1638,7 @@ stats dist: 6.. 10: 0 ================================================================================ 1 warning(s) -failure (74 tests failed, 3 tests errored, ran 166 tests) +failure (73 tests failed, 3 tests errored, ran 165 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.64 b/test/core/QCheck2_expect_test.expected.ocaml4.64 index d8df9c73..4b245eb8 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.64 @@ -130,50 +130,22 @@ random seed: 1234 0 1 0 -[7; 1; 42; 1; 8; 5; 3; 9; 5; 38; 3; 3; 0; 1; 98; 1; 4; 13; 9; 2; 6; 9; 47; 6; 5; 8; 8; 6; 0; 9; 7; 2; 8; 6; 62; 6; 4; 31; 19; 1; 41; 60; 6; 5; 8; 1; 1; 4; 7; 7; 0; 5; 5; 71; 14; 26; 47; 5; 1; 6; 34; 9; 4; 2; 37; 3; 8; 4; 31; 6; 2; 1; 0; 7; 5; 1; 0; 15; 6; 1; 8; 13; 0; 6; 2; 4; 2; 6; 6; 1; 4; 1; 9; 79; 0; 87; 6; 8; 8; 62; 1; 4; 62; 6; 31; 1; 5; 6; 5; 9; 3; 3; 1; 79; 4; 3; 2; 67; 5; 7; 12; 70; 8; 8; 6; 1; 3; 14; 15; 1; 61; 4; 1; 4; 1; 7; 4; 4; 4; 2; 8; 8; 7; 5; 4; 27; 0; 9; 80; 25; 1; 8; 1; 3; 7; 4; 3; 5; 5; 6; 5; 5; 31; 7; 0; 3; 3; 6; 71; 76; 28; 60; 6; 2; 6; 3; 0; 4; 1; 0; 5; 7; 0; 28; 86; 4; 7; 51; 36; 0; 5; 0; 1; 4; 3; 6; 0; 1; 1; 8; 18; 4; 2; 8; 8; 1; 4; 7; 1; 0; 93; 5; 3; 0; 80; 1; 7; 7; 8; 8; 5; 7; 8; 9; 24; 4; 25; 8; 8; 5; 4; 90; 4; 6; 8; 4; 4; 0; 60; 8; 9; 7; 44; 5; 1; 2; 9; 74; 7; 7] +[16; 1; 1] [] -[9; 61; 8; 4; 69; 2; 0; 72; 4; 41; 3; 8; 75; 83; 7; 7; 3; 9; 5; 8; 4; 1; 0; 2; 1; 4; 7; 6; 2; 1; 4; 86; 3; 79; 7; 86; 52; 39; 19; 0; 4; 7; 7; 7; 0; 4; 8; 8; 0; 5; 13; 1; 5; 0; 7; 12; 64; 34; 1; 1; 85; 8; 2; 9; 76; 0; 2; 5; 76; 69; 8; 8; 0; 1; 2; 2; 4; 60; 29; 5; 9; 4; 0; 8; 3; 3; 5; 1; 35; 8; 2; 7; 23; 61; 56; 8; 1; 1; 78; 7; 5; 0; 30; 9; 3; 7; 28; 57; 98; 3; 52; 3; 82; 7; 5; 5; 6; 8; 1; 6; 8; 9; 8; 16; 0] -[] -[1; 9; 8; 28; 47; 8; 5; 6; 8; 9; 2; 5; 8; 30; 6; 8; 84; 0; 6; 7; 76; 7; 9; 1; 0; 5; 76; 95; 2; 2; 1; 45; 7; 8; 8; 1; 6; 37; 5; 6; 73; 8; 0; 85; 8; 0; 4; 5; 2; 0; 26; 59; 0; 5; 13; 4; 7; 3; 6; 8; 1; 3] -[] -[5; 0; 0; 4; 10; 2; 4; 9; 5; 73; 6; 1; 5; 5; 3; 10; 5; 31; 1; 4; 3; 8; 9; 13; 41; 20; 96; 5; 1; 2; 8] -[] -[9; 8; 73; 5; 8; 2; 1; 8; 2; 6; 4; 18; 5; 76; 3] -[] -[0; 6; 2; 8; 8; 1; 4] -[] -[5; 2; 3] -[] -[3] +[16] [] [0] -[7; 1; 42; 1; 8; 5; 3; 9; 5; 38; 3; 3; 0; 1; 98; 1; 4; 13; 9; 2; 6; 9; 47; 6; 5; 8; 8; 6; 0; 9; 7; 2; 8; 6; 62; 6; 4; 31; 19; 1; 41; 60; 6; 5; 8; 1; 1; 4; 7; 7; 0; 5; 5; 71; 14; 26; 47; 5; 1; 6; 34; 9; 4; 2; 37; 3; 8; 4; 31; 6; 2; 1; 0; 7; 5; 1; 0; 15; 6; 1; 8; 13; 0; 6; 2; 4; 2; 6; 6; 1; 4; 1; 9; 79; 0; 87; 6; 8; 8; 62; 1; 4; 62; 6; 31; 1; 5; 6; 5; 9; 3; 3; 1; 79; 4; 3; 2; 67; 5; 7; 12; 70; 8; 8; 6; 1; 3; 14; 15; 1; 61; 4; 1; 4; 1; 7; 4; 4; 4; 2; 8; 8; 7; 5; 4; 27; 0; 9; 80; 25; 1; 8; 1; 3; 7; 4; 3; 5; 5; 6; 5; 5; 31; 7; 0; 3; 3; 6; 71; 76; 28; 60; 6; 2; 6; 3; 0; 4; 1; 0; 5; 7; 0; 28; 86; 4; 7; 51; 36; 0; 5; 0; 1; 4; 3; 6; 0; 1; 1; 8; 18; 4; 2; 8; 8; 1; 4; 7; 1; 0; 93; 5; 3; 0; 80; 1; 7; 7; 8; 8; 5; 7; 8; 9; 24; 4; 25; 8; 8; 5; 4; 90; 4; 6; 8; 4; 4; 0; 60; 8; 9; 7; 44; 5; 1; 2; 9; 74; 7; 7] -[] -[9; 61; 8; 4; 69; 2; 0; 72; 4; 41; 3; 8; 75; 83; 7; 7; 3; 9; 5; 8; 4; 1; 0; 2; 1; 4; 7; 6; 2; 1; 4; 86; 3; 79; 7; 86; 52; 39; 19; 0; 4; 7; 7; 7; 0; 4; 8; 8; 0; 5; 13; 1; 5; 0; 7; 12; 64; 34; 1; 1; 85; 8; 2; 9; 76; 0; 2; 5; 76; 69; 8; 8; 0; 1; 2; 2; 4; 60; 29; 5; 9; 4; 0; 8; 3; 3; 5; 1; 35; 8; 2; 7; 23; 61; 56; 8; 1; 1; 78; 7; 5; 0; 30; 9; 3; 7; 28; 57; 98; 3; 52; 3; 82; 7; 5; 5; 6; 8; 1; 6; 8; 9; 8; 16; 0] -[] -[1; 9; 8; 28; 47; 8; 5; 6; 8; 9; 2; 5; 8; 30; 6; 8; 84; 0; 6; 7; 76; 7; 9; 1; 0; 5; 76; 95; 2; 2; 1; 45; 7; 8; 8; 1; 6; 37; 5; 6; 73; 8; 0; 85; 8; 0; 4; 5; 2; 0; 26; 59; 0; 5; 13; 4; 7; 3; 6; 8; 1; 3] -[] -[5; 0; 0; 4; 10; 2; 4; 9; 5; 73; 6; 1; 5; 5; 3; 10; 5; 31; 1; 4; 3; 8; 9; 13; 41; 20; 96; 5; 1; 2; 8] -[] -[9; 8; 73; 5; 8; 2; 1; 8; 2; 6; 4; 18; 5; 76; 3] -[] -[0; 6; 2; 8; 8; 1; 4] -[] -[5; 2; 3] -[3; 2; 7; 3; 3] +[16; 1; 1] [] -[5; 3] -[5; 3; 2] -[9; 87; 7; 0] -[0; 2; 7; 3; 3] -[0; 0; 7; 3; 3] -[0; 0; 0; 3; 3] -[0; 0; 0; 0; 3] -[0; 0; 0; 0; 0] +[16] +[16; 1] +[0; 1; 1] +[0; 0; 1] +[0; 0; 0] --- Failure -------------------------------------------------------------------- -Test should_fail_sort_id failed (9 shrink steps): +Test should_fail_sort_id failed (6 shrink steps): [1; 0] @@ -297,7 +269,7 @@ Test big bound issue59 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test long_shrink failed (3039 shrink steps): +Test long_shrink failed (3030 shrink steps): ([0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0], [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 1]) @@ -459,15 +431,15 @@ Test pairs sum to less than 128 failed (57 shrink steps): --- Failure -------------------------------------------------------------------- -Test pairs lists rev concat failed (72 shrink steps): +Test pairs lists rev concat failed (64 shrink steps): ([0], [1]) --- Failure -------------------------------------------------------------------- -Test pairs lists no overlap failed (17 shrink steps): +Test pairs lists no overlap failed (15 shrink steps): -([0], [0; 0; 0; 0; 0; 0]) +([0], [0; 0; 0; 0; 0; 0; 0; 0; 0; 0]) --- Failure -------------------------------------------------------------------- @@ -579,33 +551,33 @@ Test bind list_size constant failed (12 shrink steps): --- Failure -------------------------------------------------------------------- -Test lists are empty failed (8 shrink steps): +Test lists are empty failed (2 shrink steps): [0] --- Failure -------------------------------------------------------------------- -Test lists shorter than 10 failed (16 shrink steps): +Test lists shorter than 10 failed (12 shrink steps): [0; 0; 0; 0; 0; 0; 0; 0; 0; 0] --- Failure -------------------------------------------------------------------- -Test lists shorter than 432 failed (416 shrink steps): +Test lists shorter than 432 failed (405 shrink steps): [...] list length: 432 --- Failure -------------------------------------------------------------------- -Test lists shorter than 4332 failed (3962 shrink steps): +Test lists shorter than 4332 failed (3998 shrink steps): [...] list length: 4332 --- Failure -------------------------------------------------------------------- -Test lists have unique elems failed (11 shrink steps): +Test lists have unique elems failed (3 shrink steps): -[0; 0; 0; 0; 0] +[0; 0; 0] --- Failure -------------------------------------------------------------------- @@ -641,25 +613,25 @@ Leaf 0 Test sum list = 0 failed (0 shrink steps): -[7; 1; 42; 1; 8; 5; 3; 9; 5; 38; 3; 3; 0; 1; 98; 1; 4; 13; 9; 2; 6; 9; 47; 6; 5; 8; 8; 6; 0; 9; 7; 2; 8; 6; 62; 6; 4; 31; 19; 1; 41; 60; 6; 5; 8; 1; 1; 4; 7; 7; 0; 5; 5; 71; 14; 26; 47; 5; 1; 6; 34; 9; 4; 2; 37; 3; 8; 4; 31; 6; 2; 1; 0; 7; 5; 1; 0; 15; 6; 1; 8; 13; 0; 6; 2; 4; 2; 6; 6; 1; 4; 1; 9; 79; 0; 87; 6; 8; 8; 62; 1; 4; 62; 6; 31; 1; 5; 6; 5; 9; 3; 3; 1; 79; 4; 3; 2; 67; 5; 7; 12; 70; 8; 8; 6; 1; 3; 14; 15; 1; 61; 4; 1; 4; 1; 7; 4; 4; 4; 2; 8; 8; 7; 5; 4; 27; 0; 9; 80; 25; 1; 8; 1; 3; 7; 4; 3; 5; 5; 6; 5; 5; 31; 7; 0; 3; 3; 6; 71; 76; 28; 60; 6; 2; 6; 3; 0; 4; 1; 0; 5; 7; 0; 28; 86; 4; 7; 51; 36; 0; 5; 0; 1; 4; 3; 6; 0; 1; 1; 8; 18; 4; 2; 8; 8; 1; 4; 7; 1; 0; 93; 5; 3; 0; 80; 1; 7; 7; 8; 8; 5; 7; 8; 9; 24; 4; 25; 8; 8; 5; 4; 90; 4; 6; 8; 4; 4; 0; 60; 8; 9; 7; 44; 5; 1; 2; 9; 74; 7; 7] +[16; 1; 1] --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int failed (6 shrink steps): +Test fail_pred_map_commute_int failed (31 shrink steps): -([0; 1], {_ -> 0}, {1 -> true; _ -> false}) +([0; 0; 0; 0; 0; 0], {0 -> -1; 1 -> 0; 2 -> 0; 5 -> 0; 21 -> 0; 7 -> 0; 9 -> 0; 78 -> 0; _ -> 0}, {0 -> true; -3049580483007556080 -> false; 1 -> false; 2 -> false; -4368949366664347629 -> false; 2099003838291149429 -> false; 5 -> false; 21 -> false; 7 -> false; 9 -> false; 3703556273698913451 -> false; -4370157698609639012 -> false; -2235000253316812931 -> false; 78 -> false; 2211700024537999903 -> false; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int32 failed (82 shrink steps): +Test fail_pred_map_commute_int32 failed (70 shrink steps): -([0l; 0l], {-1774179912l -> 0l; 0l -> 10l; -1658413248l -> 0l; -197056364l -> 0l; _ -> 0l}, {5l -> false; 10963850l -> false; 5481925l -> false; 74l -> false; 198l -> false; 674533l -> false; 189713l -> false; 212l -> false; 79063824l -> false; 23l -> false; 1944l -> false; 0l -> false; 86l -> false; 252950l -> false; 1349067l -> false; 20465853l -> false; 567l -> false; 7195026l -> false; 17542160l -> false; 2268l -> false; 6916l -> false; 124744253l -> false; 8l -> false; 10374l -> false; 49l -> false; 15593031l -> false; 11l -> false; 141l -> false; 110666l -> false; 31186063l -> false; 95l -> false; 126475l -> false; 47l -> false; 166325670l -> false; 55333l -> false; 92l -> false; 1011800l -> false; 3597513l -> false; -1658413248l -> false; 5396270l -> false; 62372126l -> false; 221767560l -> false; -197056364l -> false; 23389547l -> false; -1774179912l -> false; 2593l -> false; 332651340l -> false; 247l -> false; 505900l -> false; 283l -> false; 8222888l -> false; 21927700l -> false; 132l -> false; 2698135l -> false; 457187395l -> false; 10l -> true; 13833l -> false; 9593369l -> false; 221332l -> false; 443535120l -> false; -1990017031l -> false; 4796684l -> false; 1296l -> false; 27666l -> false; 9l -> false; 265l -> false; 99l -> false; 83162835l -> false; 11694773l -> false; 5187l -> false; 1134l -> false; _ -> false}) +([0l; 0l; 0l; 0l; 0l; 0l], {480624048l -> 0l; -1054565120l -> 0l; 708270421l -> 0l; -1441877194l -> 0l; -239944349l -> 0l; 0l -> 1l; -973889953l -> 0l; 1395009590l -> 0l; _ -> 0l}, {-1990017031l -> false; 443535120l -> false; 480624048l -> false; -1054565120l -> false; 829558403l -> false; -1311148841l -> false; 2084431360l -> false; 708270421l -> false; 79063824l -> false; -1441877194l -> false; -239944349l -> false; 0l -> true; 457187395l -> false; 1395009590l -> false; -973889953l -> false; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int64 failed (188 shrink steps): +Test fail_pred_map_commute_int64 failed (125 shrink steps): -([0L; 0L], {-846350636327884360L -> 0L; -7122830660870113674L -> 0L; 0L -> 2L; -5852418530639587665L -> 0L; _ -> 0L}, {165975431736793371L -> false; 988622509L -> false; 359L -> false; 1019310L -> false; 2684127201758L -> false; 404L -> false; 1258954385914640095L -> false; 534L -> false; 1937L -> false; 145228502769694200L -> false; 134L -> false; 209413047969606L -> false; 1963604910111969040L -> false; 536L -> false; 134680508L -> false; 1318163345L -> false; 85701540674L -> false; 1L -> false; 1006547700659L -> false; 69512520L -> false; 213301612346L -> false; 13615172134658831L -> false; 2421L -> false; 13717L -> false; 16308967L -> false; 193638003692925600L -> false; 3562926213990806743L -> false; 1095L -> false; 111487L -> false; 975093085013L -> false; 4026190802637L -> false; 2233739178342464L -> false; 6714423391544747172L -> false; 505L -> false; 413094407878241280L -> false; 31355L -> false; 139608698646404L -> false; 339576540681650169L -> false; -7122830660870113674L -> false; 8L -> false; 67L -> false; 8154483L -> false; 3357211695772373586L -> false; 13778L -> false; 3444L -> false; 764483L -> false; 2583L -> false; 16L -> false; 3124535337L -> false; 4476282261029831448L -> false; 719L -> false; 62711L -> false; 1482933764L -> false; 1116869589171232L -> false; 2863069015209L -> false; 1678605847886186793L -> false; 472107894717990035L -> false; 228537441799L -> false; 314738596478660023L -> false; 1977245018L -> false; 1291L -> false; 7348L -> false; 1509821550989L -> false; 5726138030418L -> false; 821L -> false; 2517908771829280190L -> false; 2L -> true; 279217397292808L -> false; 4077241L -> false; 45809104243350L -> false; 14697L -> false; 108921377077270650L -> false; 139025040L -> false; 539L -> false; 15677L -> false; 5010370776616L -> false; 27230344269317662L -> false; 236053947358995017L -> false; 7838L -> false; 114268720899L -> false; 72614251384847100L -> false; 222974L -> false; 33670127L -> false; 26176630996200L -> false; 54460688538635325L -> false; 442601151298115657L -> false; 629477192957320047L -> false; 221300575649057828L -> false; 2190L -> false; 6889L -> false; 4294603522814L -> false; 1877L -> false; 1950186170027L -> false; 96819001846462800L -> false; 5368254403517L -> false; 556100162L -> false; 4467478356684928L -> false; 104706523984803L -> false; 5105689550497061L -> false; 1722L -> false; 558434794585616L -> false; 2552844775248530L -> false; 2013095401318L -> false; 0L -> false; 15782871L -> false; 8417531L -> false; 2038620L -> false; 22904552121675L -> false; 8952564522059662897L -> false; 522L -> false; 52353261992401L -> false; 121646910L -> false; 4686803006L -> false; 99985130786L -> false; 83615L -> false; 509655L -> false; 3515102255L -> false; 33L -> false; 269L -> false; 1757551127L -> false; 1887276938736L -> false; 547L -> false; 278050081L -> false; 3L -> false; 49992565393L -> false; -5852418530639587665L -> false; 6L -> false; 12859L -> false; 2502L -> false; 67340254L -> false; 741466882L -> false; 487546542506L -> false; 12626297L -> false; 12498141348L -> false; 1761458476154L -> false; 11452276060837L -> false; 471L -> false; 104268780L -> false; 182829953439L -> false; 2260L -> false; 3829267162872795L -> false; 39264946494300L -> false; 2343401503L -> false; 243773271253L -> false; 268L -> false; 530L -> false; 11757L -> false; 891897L -> false; 2636326691L -> false; 24996282696L -> false; -846350636327884360L -> false; 110650287824528914L -> false; 354080921038492526L -> false; 167231L -> false; 14730680L -> false; 41807L -> false; 10211379100994123L -> false; 57134360449L -> false; 20422758201988247L -> false; 16835063L -> false; 370733441L -> false; 445948L -> false; 130335975L -> false; 6249070674L -> false; 1251L -> false; 11022L -> false; 12L -> false; 479L -> false; 958L -> false; 121886635626L -> false; _ -> false}) +([0L; 0L; 0L; 0L; 0L; 0L], {-5912897149740583042L -> 0L; 2064264570832434420L -> 0L; 8769531915837689755L -> 0L; -1030553128493932961L -> 0L; 0L -> 1L; 6077417419721789289L -> 0L; -4529322700507305930L -> 0L; -6192815392369977003L -> 0L; _ -> 0L}, {-8367471897177334538L -> false; 8952564522059662897L -> false; -5912897149740583042L -> false; -5897649978982613650L -> false; 339576540681650169L -> false; 2064264570832434420L -> false; 1963604910111969040L -> false; 8769531915837689755L -> false; -1030553128493932961L -> false; 0L -> true; 6077417419721789289L -> false; -3575913752036838904L -> false; 3562926213990806743L -> false; -6192815392369977003L -> false; -4529322700507305930L -> false; _ -> false}) --- Failure -------------------------------------------------------------------- @@ -669,34 +641,28 @@ Test fail_pred_strings failed (2 shrink steps): --- Failure -------------------------------------------------------------------- -Test fold_left fold_right failed (169 shrink steps): +Test fold_left fold_right failed (21 shrink steps): -(0, [1], {(83, 0) -> 0; (63, 7) -> 0; (86, 93) -> 0; (3, 4) -> 0; (30, 24) -> 0; (77, 9) -> 0; (37, 7) -> 0; (6, 25) -> 0; (2, 99) -> 0; (0, 11) -> 0; (6, 9) -> 0; (4, 96) -> 0; (9, 39) -> 0; (9, 4) -> 0; (6, 8) -> 0; (9, 9) -> 0; (2, 2) -> 0; (4, 19) -> 0; (5, 26) -> 0; (5, 53) -> 0; (4, 0) -> 0; (7, 1) -> 0; (7, 8) -> 0; (4, 86) -> 0; (0, 0) -> 0; (11, 56) -> 0; (77, 4) -> 0; (27, 4) -> 0; (77, 86) -> 0; (7, 4) -> 0; (84, 7) -> 0; (47, 0) -> 0; (4, 7) -> 0; (2, 7) -> 0; (3, 84) -> 0; (77, 89) -> 0; (9, 25) -> 0; (4, 44) -> 0; (9, 3) -> 0; (6, 3) -> 0; (4, 3) -> 0; (9, 6) -> 0; (4, 1) -> 0; (2, 3) -> 0; (75, 4) -> 0; (96, 1) -> 0; (7, 2) -> 0; (25, 52) -> 0; (3, 3) -> 0; (5, 6) -> 0; (1, 3) -> 0; (46, 0) -> 0; (43, 5) -> 0; (5, 65) -> 0; (6, 4) -> 0; (3, 70) -> 0; (4, 5) -> 0; (7, 0) -> 0; (9, 7) -> 0; (2, 8) -> 0; (3, 5) -> 0; (1, 4) -> 0; (6, 5) -> 0; (53, 75) -> 0; (3, 90) -> 0; (89, 2) -> 0; (81, 0) -> 0; (4, 80) -> 0; (4, 94) -> 0; (89, 9) -> 0; (4, 6) -> 0; (63, 9) -> 0; (3, 24) -> 0; (94, 8) -> 0; (2, 0) -> 0; (9, 87) -> 0; (33, 0) -> 0; (0, 99) -> 0; (5, 2) -> 0; (8, 4) -> 0; (8, 23) -> 0; (8, 3) -> 0; (0, 4) -> 0; (0, 9) -> 0; (86, 1) -> 0; (9, 43) -> 0; (0, 94) -> 0; (0, 7) -> 0; (8, 2) -> 0; (1, 5) -> 0; (78, 3) -> 0; (57, 3) -> 0; (24, 8) -> 0; (1, 0) -> 1; (8, 8) -> 0; (7, 3) -> 0; (3, 48) -> 0; (44, 0) -> 0; (5, 1) -> 0; (93, 89) -> 0; (2, 4) -> 0; (19, 4) -> 0; (2, 47) -> 0; (1, 89) -> 0; (48, 2) -> 0; (6, 19) -> 0; (4, 47) -> 0; (6, 6) -> 0; (3, 7) -> 0; (0, 3) -> 0; (8, 1) -> 0; (0, 8) -> 0; (8, 47) -> 0; (0, 6) -> 0; (8, 77) -> 0; (6, 2) -> 0; (4, 75) -> 0; (20, 7) -> 0; (4, 83) -> 0; (78, 2) -> 0; (5, 9) -> 0; (65, 3) -> 0; (65, 84) -> 0; (96, 9) -> 0; (1, 8) -> 0; (99, 90) -> 0; (6, 7) -> 0; (39, 7) -> 0; (1, 96) -> 0; (26, 83) -> 0; (23, 6) -> 0; (9, 44) -> 0; (5, 44) -> 0; (8, 0) -> 0; (2, 6) -> 0; (3, 6) -> 0; (52, 3) -> 0; (5, 0) -> 0; (4, 52) -> 0; (0, 2) -> 0; (6, 1) -> 0; (2, 1) -> 0; (9, 0) -> 0; (0, 5) -> 0; (3, 23) -> 0; (4, 2) -> 0; (64, 7) -> 0; (8, 48) -> 0; (66, 5) -> 0; (9, 1) -> 0; (7, 9) -> 0; (2, 26) -> 0; (3, 93) -> 0; (3, 0) -> 0; (19, 9) -> 0; (88, 84) -> 0; (7, 7) -> 0; (75, 5) -> 0; (3, 9) -> 0; (47, 77) -> 0; (39, 9) -> 0; (87, 0) -> 0; (9, 47) -> 0; (9, 8) -> 0; (7, 6) -> 0; (3, 34) -> 0; (83, 20) -> 0; (4, 8) -> 0; (5, 4) -> 0; (5, 7) -> 0; (6, 0) -> 0; (1, 25) -> 0; (3, 1) -> 0; _ -> 0}) +(0, [0; 0], {(70, 3) -> 0; (3, 0) -> 0; (0, 6) -> 0; (2, 6) -> 0; (0, 90) -> 0; (3, 26) -> 0; (3, 9) -> 0; (20, 3) -> 0; (3, 2) -> 0; (2, 0) -> 0; (0, 70) -> 1; (4, 3) -> 0; (9, 6) -> 0; (6, 8) -> 0; (0, 3) -> 0; (6, 6) -> 0; (0, 7) -> 0; (0, 0) -> 70; _ -> 0}) +++ Messages ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Messages for test fold_left fold_right: -l=[1], fold_left=1, fold_right=0 +l=[0; 0], fold_left=1, fold_right=0 --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried failed (701 shrink steps): +Test fold_left fold_right uncurried failed (47 shrink steps): -({(5, 4) -> 0; (9, 6) -> 0; (37, 2) -> 0; (3, 8) -> 0; (84, 2) -> 0; (3, 7) -> 0; (2, 43) -> 0; (2, 7) -> 0; (1, 5) -> 0; (67, 9) -> 0; (5, 8) -> 0; (5, 0) -> 1; (4, 9) -> 0; (1, 3) -> 0; (3, 5) -> 0; (1, 9) -> 0; _ -> 0}, 0, [5; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0]) +({(3, 76) -> 0; (9, 3) -> 0; (5, 2) -> 0; (1, 2) -> 1; (34, 1) -> 0; (9, 6) -> 0; (7, 3) -> 0; (3, 8) -> 0; (67, 3) -> 0; (2, 24) -> 0; (1, 1) -> 0; (37, 6) -> 0; (6, 2) -> 0; (5, 8) -> 0; (5, 7) -> 0; (5, 6) -> 0; (4, 8) -> 0; (17, 3) -> 0; (3, 4) -> 0; (84, 79) -> 0; (4, 17) -> 0; (6, 1) -> 0; (7, 6) -> 0; (3, 5) -> 0; (9, 4) -> 0; (1, 9) -> 0; (2, 5) -> 0; _ -> 0}, 1, [2]) --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried fun last failed (34 shrink steps): +Test fold_left fold_right uncurried fun last failed (26 shrink steps): -(0, [1], {(3, 9) -> 0; (20, 4) -> 0; (9, 3) -> 0; (4, 48) -> 0; (8, 5) -> 0; (9, 24) -> 0; (47, 7) -> 0; (2, 99) -> 0; (6, 84) -> 0; (6, 6) -> 0; (7, 89) -> 0; (1, 0) -> 1; (47, 2) -> 0; (26, 94) -> 0; (0, 19) -> 0; (90, 5) -> 0; (9, 0) -> 0; (9, 4) -> 0; (2, 5) -> 0; (70, 7) -> 0; (1, 9) -> 0; _ -> 0}) - ---- Failure -------------------------------------------------------------------- - -Test fold_left test, fun first failed (108 shrink steps): - -({("h", 3) -> ""; ("Ph\228", 4) -> ""; ("\164~\190\161\005Be2", 3) -> ""; ("T", 4) -> ""; ("\207\244\171\128\185w\173\190\239F5{\147\191\157nQ\132T\252\253|\028(Hf\1373?\181U\137\241\019-\155u\252\243\t\206`\133\140", 89) -> ""; ("\153\247\255", 2) -> ""; ("\240`\139\219Q1\218\240$\024\176\166\0122:-Z\198\184cm\189\186xQ\143\128R\"\235\238TqA\158\224&\151y\209\180=\027\204D\188\171~\226r\253\153\249\163\"E\252\001\020y(\182A\146JE\1457\201\169\012\253\002\193;\166ze\245%\246\143\2338\161\005\161]F\153^T", 7) -> ""; ("\016S\203'a\195X\131\152", 0) -> ""; ("\243u\163\147\135", 8) -> ""; ("1n3\198\148\183\160", 1) -> ""; ("\236\255", 8) -> ""; ("\139}%\161!d\131\167)\0244=\157\130\239]\029i\178\238$*\173V\245\176\023\234\202\150\022\242\170\252l@\216\136\173\228O", 5) -> ""; ("\131\011x$\127\0261u\147j", 4) -> ""; ("\237)\173\152w\006\133\205n\026\157\216c\007\198\239\255\247", 3) -> ""; ("An\177E\018\164\215\143\136\164\215\214\nJ\212\020\180\208\031}\140\023E\245\171o\255\203\195O\204U\227BF\187\174\233\239NMu \198\011\175\136(\160(\2511\007;\022\253\216\173\026\224\242\148\238c\230\n~\180:\175a\241O-7\141\197", 4) -> ""; ("\140", 7) -> ""; ("", 5) -> "a"; ("\014\1333\194\"\220\222\252X\196hA\185\156\197\177\160\197\247K\224N\203U\172\007\148\209O,%($i\027\015\2002`", 1) -> ""; ("\167\162\212\012\145z", 2) -> ""; ("\002\241\197\142\177\162", 8) -> ""; ("/\197p\004L", 9) -> ""; ("'\214\194w#\194\189\207\210", 75) -> ""; ("\216n\128$\161f\233\226", 4) -> ""; ("u).(\174\135f\214!JG\182\252(\249E\218^f\022\250\174zm-\225\203\130Y\250\218\179j\162\180\214\189\027\024\169>Y\219\152\155\234;\2363\200\176\139\031\020/\152\012\b\191\011\153O\129\168\234\016~\175G\016\234\015\169M\169", 9) -> ""; ("w\128n", 5) -> ""; ("", 0) -> ""; ("\022\188\139?", 48) -> ""; ("\219'\188", 4) -> ""; ("", 83) -> ""; ("", 6) -> ""; ("36", 5) -> ""; ("\152\224$\234*J\244\018\181\146\171\"\138H\158\131E\r\014\236\240\024\226\147\214\000\227\022:\157N\197\171\228\250V\145a\204\189:\023\141\182y\144\229/r\200m\b!\137WX\246\017\250f\244I\214K\131\170z+\167d@\131/\166\163s\148\221\199M\224Z\012R\014", 2) -> ""; ("\136\227\237\148\181\138\017]\169\230\187w9d\201\152\019\173`\170\1837(\240\240\168\253L\208\156={\167`\023\214B\142R\142a\176\204F\173\161\214vs\1614<a\206\203~\156\242\216\128\031C\200TD\208Rf\b\"\014\128R4\232[\205\253_iR\021\128(", 23) -> ""; ("\t\132\164\254\016", 84) -> ""; ("\029", 7) -> ""; (",P", 6) -> ""; ("\016{\250\014>m\175m\204X^\137P#UZ<\215\244\028\249\226,`\018\172\193\144\235\183\150\179\133\134e\205\016", 0) -> ""; ("\163+Y\133\129\219\b\168\162]\217|$V", 19) -> ""; ("", 4) -> ""; ("", 9) -> ""; ("\2387\030Ay\" x\219\172\241\178\202\174\232\228\162\239\234\147\021T}\236\136k!\196\195\028a\019\029\188", 94) -> ""; ("\219'\188", 3) -> ""; ("\140\194\177", 5) -> ""; (" kH\148a\135\179#\255\220\139\000BW\234\228&N\199\175m}\167S\242\183\030\172\158\194\027\145\183d5k\127\"\164\024\162#\182n\252\027_V\"^j\020\019\197=\027#`H\004Y\216\197\162@\193v\204~\146\004\204p\149\022s\153\011\176\006\026o\198\169\143U\166\215\201xy\208", 4) -> ""; ("\169", 99) -> ""; ("", 24) -> ""; ("\198\168", 7) -> "a"; ("@\197\242l\146\175\130\216\1692z\178tSW\252'\249j$\195\202\014/Iw\166\020\186cr\":\224n\242c\187\141\023", 3) -> ""; ("\020\215\157", 3) -> ""; _ -> ""}, "", [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0], [5]) +(0, [0; 0], {(0, 20) -> 0; (90, 3) -> 0; (3, 9) -> 0; (8, 3) -> 0; (3, 2) -> 0; (9, 6) -> 0; (7, 3) -> 0; (6, 20) -> 0; (0, 70) -> 0; (6, 70) -> 0; (3, 0) -> 1; (0, 4) -> 0; (6, 0) -> 0; (0, 0) -> 3; (2, 0) -> 0; (26, 6) -> 0; (6, 3) -> 0; _ -> 0}) --- Failure -------------------------------------------------------------------- @@ -1163,63 +1129,63 @@ Ok _ : 7477 cases +++ Stats for list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 361.42, stddev: 1230.75, median 9, min 0, max 9974 - 0.. 498: ####################################################### 4212 - 499.. 997: ####### 578 - 998..1496: 11 - 1497..1995: 15 - 1996..2494: 11 - 2495..2993: 10 - 2994..3492: 13 - 3493..3991: 12 - 3992..4490: 7 - 4491..4989: 8 - 4990..5488: 15 - 5489..5987: 14 - 5988..6486: 12 - 6487..6985: 8 - 6986..7484: 9 - 7485..7983: 19 - 7984..8482: 14 - 8483..8981: 11 - 8982..9480: 11 - 9481..9979: 10 + num: 5000, avg: 381.73, stddev: 1276.71, median 9, min 0, max 9931 + 0.. 496: ####################################################### 4213 + 497.. 993: ###### 526 + 994..1490: 22 + 1491..1987: 14 + 1988..2484: 19 + 2485..2981: 14 + 2982..3478: 19 + 3479..3975: 15 + 3976..4472: 18 + 4473..4969: 14 + 4970..5466: 13 + 5467..5963: 11 + 5964..6460: 14 + 6461..6957: 18 + 6958..7454: 8 + 7455..7951: 15 + 7952..8448: 12 + 8449..8945: 9 + 8946..9442: 7 + 9443..9939: 19 +++ Stats for small_list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 15.79, stddev: 24.64, median 6, min 0, max 99 - 0.. 4: ###################################################### 1930 - 5.. 9: ####################################################### 1957 - 10.. 14: # 59 - 15.. 19: # 66 - 20.. 24: # 61 - 25.. 29: # 52 - 30.. 34: # 61 - 35.. 39: # 65 - 40.. 44: # 62 - 45.. 49: # 64 - 50.. 54: # 70 - 55.. 59: # 63 - 60.. 64: # 50 - 65.. 69: # 51 - 70.. 74: # 52 - 75.. 79: # 63 - 80.. 84: # 56 - 85.. 89: ## 75 - 90.. 94: ## 73 - 95.. 99: # 70 + num: 5000, avg: 16.26, stddev: 24.83, median 6, min 0, max 99 + 0.. 4: #################################################### 1868 + 5.. 9: ####################################################### 1967 + 10.. 14: # 66 + 15.. 19: # 62 + 20.. 24: # 70 + 25.. 29: # 59 + 30.. 34: # 62 + 35.. 39: # 62 + 40.. 44: ## 73 + 45.. 49: # 66 + 50.. 54: # 68 + 55.. 59: # 59 + 60.. 64: # 61 + 65.. 69: ## 75 + 70.. 74: # 56 + 75.. 79: # 64 + 80.. 84: # 46 + 85.. 89: ## 72 + 90.. 94: # 67 + 95.. 99: ## 77 +++ Stats for list_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 7.51, stddev: 1.71, median 8, min 5, max 10 - 5: ###################################################### 834 - 6: ##################################################### 825 - 7: ##################################################### 820 - 8: ###################################################### 833 - 9: ####################################################### 844 - 10: ####################################################### 844 + num: 5000, avg: 7.47, stddev: 1.70, median 7, min 5, max 10 + 5: ##################################################### 848 + 6: #################################################### 829 + 7: ####################################################### 869 + 8: ##################################################### 839 + 9: ################################################# 787 + 10: #################################################### 828 +++ Stats for list_repeat len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -1230,63 +1196,63 @@ stats len: +++ Stats for array len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 361.42, stddev: 1230.75, median 9, min 0, max 9974 - 0.. 498: ####################################################### 4212 - 499.. 997: ####### 578 - 998..1496: 11 - 1497..1995: 15 - 1996..2494: 11 - 2495..2993: 10 - 2994..3492: 13 - 3493..3991: 12 - 3992..4490: 7 - 4491..4989: 8 - 4990..5488: 15 - 5489..5987: 14 - 5988..6486: 12 - 6487..6985: 8 - 6986..7484: 9 - 7485..7983: 19 - 7984..8482: 14 - 8483..8981: 11 - 8982..9480: 11 - 9481..9979: 10 + num: 5000, avg: 381.73, stddev: 1276.71, median 9, min 0, max 9931 + 0.. 496: ####################################################### 4213 + 497.. 993: ###### 526 + 994..1490: 22 + 1491..1987: 14 + 1988..2484: 19 + 2485..2981: 14 + 2982..3478: 19 + 3479..3975: 15 + 3976..4472: 18 + 4473..4969: 14 + 4970..5466: 13 + 5467..5963: 11 + 5964..6460: 14 + 6461..6957: 18 + 6958..7454: 8 + 7455..7951: 15 + 7952..8448: 12 + 8449..8945: 9 + 8946..9442: 7 + 9443..9939: 19 +++ Stats for small_array len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 15.79, stddev: 24.64, median 6, min 0, max 99 - 0.. 4: ###################################################### 1930 - 5.. 9: ####################################################### 1957 - 10.. 14: # 59 - 15.. 19: # 66 - 20.. 24: # 61 - 25.. 29: # 52 - 30.. 34: # 61 - 35.. 39: # 65 - 40.. 44: # 62 - 45.. 49: # 64 - 50.. 54: # 70 - 55.. 59: # 63 - 60.. 64: # 50 - 65.. 69: # 51 - 70.. 74: # 52 - 75.. 79: # 63 - 80.. 84: # 56 - 85.. 89: ## 75 - 90.. 94: ## 73 - 95.. 99: # 70 + num: 5000, avg: 16.26, stddev: 24.83, median 6, min 0, max 99 + 0.. 4: #################################################### 1868 + 5.. 9: ####################################################### 1967 + 10.. 14: # 66 + 15.. 19: # 62 + 20.. 24: # 70 + 25.. 29: # 59 + 30.. 34: # 62 + 35.. 39: # 62 + 40.. 44: ## 73 + 45.. 49: # 66 + 50.. 54: # 68 + 55.. 59: # 59 + 60.. 64: # 61 + 65.. 69: ## 75 + 70.. 74: # 56 + 75.. 79: # 64 + 80.. 84: # 46 + 85.. 89: ## 72 + 90.. 94: # 67 + 95.. 99: ## 77 +++ Stats for array_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 7.51, stddev: 1.71, median 8, min 5, max 10 - 5: ###################################################### 834 - 6: ##################################################### 825 - 7: ##################################################### 820 - 8: ###################################################### 833 - 9: ####################################################### 844 - 10: ####################################################### 844 + num: 5000, avg: 7.47, stddev: 1.70, median 7, min 5, max 10 + 5: ##################################################### 848 + 6: #################################################### 829 + 7: ####################################################### 869 + 8: ##################################################### 839 + 9: ################################################# 787 + 10: #################################################### 828 +++ Stats for array_repeat len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -1734,7 +1700,7 @@ stats dist: 6.. 10: 0 ================================================================================ 1 warning(s) -failure (74 tests failed, 3 tests errored, ran 166 tests) +failure (73 tests failed, 3 tests errored, ran 165 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.32 b/test/core/QCheck2_expect_test.expected.ocaml5.32 index 92bac37c..18bd2ce1 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.32 @@ -67,53 +67,31 @@ random seed: 1234 0 1 0 -[46; 2; 22; 4; 4; 2; 6; 5; 88; 24; 7; 9; 9; 2; 5; 1; 55; 8; 45; 1; 96; 0; 1; 2; 7; 4; 1; 5; 95; 6; 8; 6; 4; 0; 5; 5; 22; 87; 2; 1; 1; 0; 2; 2; 9; 5; 9; 3; 7; 59; 7; 96; 6; 5; 1; 3; 9; 9; 65; 6; 7; 7; 2; 5; 0; 0; 70; 5; 5; 2; 1; 57; 9; 7; 8; 10; 9; 7; 9; 75; 73; 80; 7; 9; 4; 3; 16; 5; 79; 1; 8; 6; 2; 3; 4; 9; 2; 8; 4; 6; 50; 2; 1; 5; 9; 5; 4; 3; 56; 6; 5; 9; 4; 1; 47; 1; 2; 5; 2; 0; 7; 31; 55; 6; 7; 4; 7; 8; 8; 2; 4; 40; 4; 6; 9; 3; 59; 5; 1; 0; 2; 6; 90; 1; 6; 81; 0; 1; 3; 7; 2; 4; 5; 4; 7; 3; 62; 0; 1; 6; 7; 5; 97; 83; 41; 7; 2; 6; 3; 0; 4; 8; 99; 8; 6; 0; 7; 9; 7; 1; 55; 30; 25; 3; 4; 7; 1; 6; 80; 8; 0; 4; 21; 3; 5; 9; 27; 10; 60; 47; 54; 6; 5; 8; 1; 5; 9; 65; 9; 5; 7; 7; 6; 48; 9; 5; 6; 4; 9; 7; 1; 2; 71; 6; 9; 2; 7; 8; 14; 59; 71; 30; 7; 3; 5; 4; 6; 7; 3; 6; 9; 8; 2; 38; 6; 6; 7; 1; 5; 2; 43; 5; 2; 9; 3; 0; 3; 2; 7; 71; 26; 3; 9; 11; 5; 1; 5; 2; 53; 46; 4; 6; 7; 67; 1; 0; 34; 0; 48; 5; 5; 0; 7; 49; 92; 8; 3; 0; 67; 1; 5; 2; 9; 5; 9; 3; 1; 4; 8; 0; 3; 6; 46; 58; 1; 54; 77; 0; 96; 1; 6; 2; 8; 22; 3; 9; 2; 6; 25; 49; 9; 6; 3; 8; 5; 9; 54; 1; 7; 5; 6; 5; 1; 7; 8; 23; 4; 6; 4; 2; 5; 8; 4; 7; 4] +[0; 1; 80; 0; 9; 2; 3] [] -[7; 79; 86; 1; 70; 98; 1; 4; 7; 9; 5; 8; 0; 1; 2; 0; 6; 0; 37; 6; 8; 26; 6; 8; 8; 98; 6; 8; 1; 6; 2; 4; 4; 7; 26; 1; 77; 2; 9; 9; 81; 8; 9; 4; 0; 86; 9; 3; 7; 0; 54; 2; 4; 1; 6; 4; 55; 5; 0; 9; 2; 1; 3; 8; 7; 1; 1; 3; 92; 1; 3; 4; 5; 2; 8; 51; 2; 94; 6; 82; 0; 11; 86; 1; 36; 31; 3; 2; 3; 8; 2; 8; 14; 26; 89; 1; 6; 0; 9; 5; 6; 7; 1; 6; 1; 6; 4; 7; 8; 8; 4; 1; 6; 3; 1; 5; 0; 6; 0; 5; 0; 4; 3; 49; 5; 8; 37; 8; 38; 0; 1; 8; 59; 5; 0; 7; 37; 87; 9; 3; 1; 5; 59; 8; 7; 6; 26; 4; 8; 8; 8; 9; 3; 2; 6; 64; 6; 7; 2; 8; 5; 2; 94; 26; 98; 3; 29; 2; 1; 72; 2; 49] -[] -[8; 13; 1; 18; 0; 69; 15; 2; 5; 78; 7; 32; 8; 36; 7; 3; 0; 9; 1; 1; 1; 29; 3; 8; 7; 2; 1; 8; 7; 8; 22; 5; 49; 5; 0; 1; 8; 5; 6; 7; 5; 1; 9; 73; 55; 2; 4; 7; 3; 4; 2; 27; 0; 6; 9; 1; 7; 8; 5; 12; 5; 8; 9; 1; 95; 1; 0; 1; 4; 8; 6; 7; 0; 8; 2; 3; 7; 3; 9; 0; 86; 96; 72; 3; 4; 25] -[] -[4; 3; 6; 5; 0; 0; 9; 7; 0; 6; 5; 3; 0; 24; 5; 6; 86; 9; 9; 0; 7; 2; 6; 6; 3; 45; 6; 1; 17; 1; 2; 2; 3; 0; 4; 1; 8; 2; 6; 9; 5; 0; 2] -[] -[9; 7; 62; 0; 73; 0; 8; 94; 0; 6; 50; 9; 83; 0; 5; 40; 6; 1; 6; 6; 6] -[] -[6; 5; 2; 54; 33; 9; 1; 1; 1; 61] -[] -[5; 7; 0; 65; 0] -[] -[2; 7] -[] -[6] +[0; 1; 80] [] [0] -[46; 2; 22; 4; 4; 2; 6; 5; 88; 24; 7; 9; 9; 2; 5; 1; 55; 8; 45; 1; 96; 0; 1; 2; 7; 4; 1; 5; 95; 6; 8; 6; 4; 0; 5; 5; 22; 87; 2; 1; 1; 0; 2; 2; 9; 5; 9; 3; 7; 59; 7; 96; 6; 5; 1; 3; 9; 9; 65; 6; 7; 7; 2; 5; 0; 0; 70; 5; 5; 2; 1; 57; 9; 7; 8; 10; 9; 7; 9; 75; 73; 80; 7; 9; 4; 3; 16; 5; 79; 1; 8; 6; 2; 3; 4; 9; 2; 8; 4; 6; 50; 2; 1; 5; 9; 5; 4; 3; 56; 6; 5; 9; 4; 1; 47; 1; 2; 5; 2; 0; 7; 31; 55; 6; 7; 4; 7; 8; 8; 2; 4; 40; 4; 6; 9; 3; 59; 5; 1; 0; 2; 6; 90; 1; 6; 81; 0; 1; 3; 7; 2; 4; 5; 4; 7; 3; 62; 0; 1; 6; 7; 5; 97; 83; 41; 7; 2; 6; 3; 0; 4; 8; 99; 8; 6; 0; 7; 9; 7; 1; 55; 30; 25; 3; 4; 7; 1; 6; 80; 8; 0; 4; 21; 3; 5; 9; 27; 10; 60; 47; 54; 6; 5; 8; 1; 5; 9; 65; 9; 5; 7; 7; 6; 48; 9; 5; 6; 4; 9; 7; 1; 2; 71; 6; 9; 2; 7; 8; 14; 59; 71; 30; 7; 3; 5; 4; 6; 7; 3; 6; 9; 8; 2; 38; 6; 6; 7; 1; 5; 2; 43; 5; 2; 9; 3; 0; 3; 2; 7; 71; 26; 3; 9; 11; 5; 1; 5; 2; 53; 46; 4; 6; 7; 67; 1; 0; 34; 0; 48; 5; 5; 0; 7; 49; 92; 8; 3; 0; 67; 1; 5; 2; 9; 5; 9; 3; 1; 4; 8; 0; 3; 6; 46; 58; 1; 54; 77; 0; 96; 1; 6; 2; 8; 22; 3; 9; 2; 6; 25; 49; 9; 6; 3; 8; 5; 9; 54; 1; 7; 5; 6; 5; 1; 7; 8; 23; 4; 6; 4; 2; 5; 8; 4; 7; 4] -[] -[7; 79; 86; 1; 70; 98; 1; 4; 7; 9; 5; 8; 0; 1; 2; 0; 6; 0; 37; 6; 8; 26; 6; 8; 8; 98; 6; 8; 1; 6; 2; 4; 4; 7; 26; 1; 77; 2; 9; 9; 81; 8; 9; 4; 0; 86; 9; 3; 7; 0; 54; 2; 4; 1; 6; 4; 55; 5; 0; 9; 2; 1; 3; 8; 7; 1; 1; 3; 92; 1; 3; 4; 5; 2; 8; 51; 2; 94; 6; 82; 0; 11; 86; 1; 36; 31; 3; 2; 3; 8; 2; 8; 14; 26; 89; 1; 6; 0; 9; 5; 6; 7; 1; 6; 1; 6; 4; 7; 8; 8; 4; 1; 6; 3; 1; 5; 0; 6; 0; 5; 0; 4; 3; 49; 5; 8; 37; 8; 38; 0; 1; 8; 59; 5; 0; 7; 37; 87; 9; 3; 1; 5; 59; 8; 7; 6; 26; 4; 8; 8; 8; 9; 3; 2; 6; 64; 6; 7; 2; 8; 5; 2; 94; 26; 98; 3; 29; 2; 1; 72; 2; 49] -[] -[8; 13; 1; 18; 0; 69; 15; 2; 5; 78; 7; 32; 8; 36; 7; 3; 0; 9; 1; 1; 1; 29; 3; 8; 7; 2; 1; 8; 7; 8; 22; 5; 49; 5; 0; 1; 8; 5; 6; 7; 5; 1; 9; 73; 55; 2; 4; 7; 3; 4; 2; 27; 0; 6; 9; 1; 7; 8; 5; 12; 5; 8; 9; 1; 95; 1; 0; 1; 4; 8; 6; 7; 0; 8; 2; 3; 7; 3; 9; 0; 86; 96; 72; 3; 4; 25] -[] -[4; 3; 6; 5; 0; 0; 9; 7; 0; 6; 5; 3; 0; 24; 5; 6; 86; 9; 9; 0; 7; 2; 6; 6; 3; 45; 6; 1; 17; 1; 2; 2; 3; 0; 4; 1; 8; 2; 6; 9; 5; 0; 2] -[] -[9; 7; 62; 0; 73; 0; 8; 94; 0; 6; 50; 9; 83; 0; 5; 40; 6; 1; 6; 6; 6] [] -[6; 5; 2; 54; 33; 9; 1; 1; 1; 61] +[0; 1; 80; 0; 9; 2; 3] [] -[5; 7; 0; 65; 0] +[0; 1; 80] +[0; 1; 80; 0; 9] [] -[2; 7] -[4; 6; 6] +[0; 1] +[0; 1; 80] +[0; 1; 80; 0] [] -[7] -[6; 41] -[0; 6; 6] -[0; 0; 6] -[0; 0; 0] +[0; 1] +[0; 1; 80] +[0; 0; 80; 0] +[0; 0; 0; 0] --- Failure -------------------------------------------------------------------- -Test should_fail_sort_id failed (11 shrink steps): +Test should_fail_sort_id failed (9 shrink steps): -[1; 0] +[0; 0; 1; 0] === Error ====================================================================== @@ -235,7 +213,7 @@ Test big bound issue59 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test long_shrink failed (3034 shrink steps): +Test long_shrink failed (3081 shrink steps): ([0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0], [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 1]) @@ -403,9 +381,9 @@ Test pairs lists rev concat failed (46 shrink steps): --- Failure -------------------------------------------------------------------- -Test pairs lists no overlap failed (18 shrink steps): +Test pairs lists no overlap failed (35 shrink steps): -([0], [0; 0; 0; 0]) +([0], [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0]) --- Failure -------------------------------------------------------------------- @@ -517,33 +495,33 @@ Test bind list_size constant failed (12 shrink steps): --- Failure -------------------------------------------------------------------- -Test lists are empty failed (9 shrink steps): +Test lists are empty failed (2 shrink steps): [0] --- Failure -------------------------------------------------------------------- -Test lists shorter than 10 failed (15 shrink steps): +Test lists shorter than 10 failed (13 shrink steps): [0; 0; 0; 0; 0; 0; 0; 0; 0; 0] --- Failure -------------------------------------------------------------------- -Test lists shorter than 432 failed (415 shrink steps): +Test lists shorter than 432 failed (418 shrink steps): [...] list length: 432 --- Failure -------------------------------------------------------------------- -Test lists shorter than 4332 failed (4017 shrink steps): +Test lists shorter than 4332 failed (4005 shrink steps): [...] list length: 4332 --- Failure -------------------------------------------------------------------- -Test lists have unique elems failed (10 shrink steps): +Test lists have unique elems failed (4 shrink steps): -[0; 0; 0] +[0; 0; 0; 0] --- Failure -------------------------------------------------------------------- @@ -579,25 +557,25 @@ Leaf 0 Test sum list = 0 failed (0 shrink steps): -[46; 2; 22; 4; 4; 2; 6; 5; 88; 24; 7; 9; 9; 2; 5; 1; 55; 8; 45; 1; 96; 0; 1; 2; 7; 4; 1; 5; 95; 6; 8; 6; 4; 0; 5; 5; 22; 87; 2; 1; 1; 0; 2; 2; 9; 5; 9; 3; 7; 59; 7; 96; 6; 5; 1; 3; 9; 9; 65; 6; 7; 7; 2; 5; 0; 0; 70; 5; 5; 2; 1; 57; 9; 7; 8; 10; 9; 7; 9; 75; 73; 80; 7; 9; 4; 3; 16; 5; 79; 1; 8; 6; 2; 3; 4; 9; 2; 8; 4; 6; 50; 2; 1; 5; 9; 5; 4; 3; 56; 6; 5; 9; 4; 1; 47; 1; 2; 5; 2; 0; 7; 31; 55; 6; 7; 4; 7; 8; 8; 2; 4; 40; 4; 6; 9; 3; 59; 5; 1; 0; 2; 6; 90; 1; 6; 81; 0; 1; 3; 7; 2; 4; 5; 4; 7; 3; 62; 0; 1; 6; 7; 5; 97; 83; 41; 7; 2; 6; 3; 0; 4; 8; 99; 8; 6; 0; 7; 9; 7; 1; 55; 30; 25; 3; 4; 7; 1; 6; 80; 8; 0; 4; 21; 3; 5; 9; 27; 10; 60; 47; 54; 6; 5; 8; 1; 5; 9; 65; 9; 5; 7; 7; 6; 48; 9; 5; 6; 4; 9; 7; 1; 2; 71; 6; 9; 2; 7; 8; 14; 59; 71; 30; 7; 3; 5; 4; 6; 7; 3; 6; 9; 8; 2; 38; 6; 6; 7; 1; 5; 2; 43; 5; 2; 9; 3; 0; 3; 2; 7; 71; 26; 3; 9; 11; 5; 1; 5; 2; 53; 46; 4; 6; 7; 67; 1; 0; 34; 0; 48; 5; 5; 0; 7; 49; 92; 8; 3; 0; 67; 1; 5; 2; 9; 5; 9; 3; 1; 4; 8; 0; 3; 6; 46; 58; 1; 54; 77; 0; 96; 1; 6; 2; 8; 22; 3; 9; 2; 6; 25; 49; 9; 6; 3; 8; 5; 9; 54; 1; 7; 5; 6; 5; 1; 7; 8; 23; 4; 6; 4; 2; 5; 8; 4; 7; 4] +[0; 1; 80; 0; 9; 2; 3] --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int failed (78 shrink steps): +Test fail_pred_map_commute_int failed (91 shrink steps): -([0; 0], {0 -> 1; 1 -> 0; 2 -> 0; 4 -> 0; 5 -> 0; 54 -> 0; 6 -> 0; 23 -> 0; 7 -> 0; 8 -> 0; _ -> 0}, {1 -> true; 2 -> false; 68467171 -> false; 4 -> false; 5 -> false; 6 -> false; 23 -> false; 7 -> false; -368608536 -> false; 1001723384 -> false; 8 -> false; 679324297 -> false; 40674345 -> false; -425026694 -> false; 369726925 -> false; _ -> false}) +([0; 0], {0 -> 74; 5 -> 0; 26 -> 0; _ -> 0}, {0 -> false; 189249 -> false; 66 -> false; 9642498 -> false; 132 -> false; 339662148 -> false; 5 -> false; 21831 -> false; 12190023 -> false; 31049 -> false; 260053833 -> false; 679324297 -> false; 74 -> true; 17142220 -> false; 141 -> false; 24380046 -> false; 148602190 -> false; 47312 -> false; 5457 -> false; 659154 -> false; 1364 -> false; 126166 -> false; 1230422 -> false; 5624790 -> false; 88 -> false; 20376 -> false; 504665 -> false; 12856665 -> false; 26 -> false; 20699 -> false; 35484 -> false; 297204380 -> false; 48760093 -> false; 94 -> false; 671 -> false; 94624 -> false; 169831074 -> false; 99 -> false; 10915 -> false; 15524 -> false; 130026916 -> false; 165 -> false; 1318309 -> false; 8571110 -> false; 2728 -> false; 23656 -> false; 40674345 -> false; 2812395 -> false; 18285035 -> false; 252332 -> false; 6428332 -> false; 11249581 -> false; 15999405 -> false; 1007 -> false; 1153520 -> false; 13713776 -> false; 49 -> false; 177 -> false; 1009330 -> false; 254746611 -> false; 865140 -> false; 1406197 -> false; 9142517 -> false; 222903285 -> false; 23286 -> false; 41398 -> false; 195040374 -> false; 503 -> false; 1054647 -> false; 576760 -> false; 1001723384 -> false; 17465 -> false; 703098 -> false; 251 -> false; 11643 -> false; 988731 -> false; 97520187 -> false; 188 -> false; 125 -> false; 2046 -> false; 1343 -> false; 1151 -> false; 767 -> false; 1535 -> false; 1023 -> false; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int32 failed (64 shrink steps): +Test fail_pred_map_commute_int32 failed (91 shrink steps): -([0l; 1l], {_ -> 0l}, {2105244496l -> false; 1056359910l -> false; 1364327540l -> false; 1697200981l -> false; 749208472l -> false; -624253901l -> false; -1587859886l -> false; -1229314055l -> false; 79025834l -> false; 954563801l -> false; -1524569688l -> false; -101011561l -> false; -438671296l -> false; 922489845l -> false; -2089504257l -> false; -790819552l -> false; 140774641l -> false; -1966380908l -> false; 269604126l -> false; 1145293881l -> false; 0l -> true; -1777382617l -> false; 1447762681l -> false; 641593092l -> false; -2082304932l -> false; 2143531570l -> false; 263164458l -> false; 162807677l -> false; 901965649l -> false; -1354301954l -> false; 1073036012l -> false; _ -> false}) +([0l; 0l], {-2051366210l -> 0l; 1992866105l -> 0l; 0l -> 99l; _ -> 0l}, {251l -> false; 251274l -> false; 335032l -> false; -2051366210l -> false; 1340129l -> false; 28986l -> false; 1337l -> false; 875186l -> false; 1867064l -> false; 167l -> false; 12802725l -> false; 258962793l -> false; 668l -> false; 3623l -> false; 7246l -> false; 7468256l -> false; 54966l -> false; 64740698l -> false; 1527l -> false; 8535150l -> false; 0l -> false; 394609971l -> false; 12138880l -> false; 47114l -> false; 1633681l -> false; 933532l -> false; 18208320l -> false; 129481396l -> false; 345283724l -> false; 1056359910l -> false; 1992866105l -> false; 66l -> false; 3734128l -> false; 22760400l -> false; 219l -> false; 125637l -> false; 295957478l -> false; 17070300l -> false; 1782l -> false; 1018l -> false; 88l -> false; 21243040l -> false; 41225l -> false; 31409l -> false; 1400298l -> false; 16185174l -> false; 334l -> false; 62818l -> false; 1531576l -> false; 2037l -> false; 172641862l -> false; 14493l -> false; 176l -> false; 32370349l -> false; 1358l -> false; 11380200l -> false; 117l -> false; 1312779l -> false; 30918l -> false; 27054l -> false; 225491412l -> false; 132l -> false; 23189l -> false; 765788l -> false; 188l -> false; 27483l -> false; 1148682l -> false; 450982824l -> false; 891l -> false; 167516l -> false; 79025834l -> false; 670064l -> false; 125l -> false; 14936513l -> false; 235l -> false; 2717l -> false; 99l -> true; 1750373l -> false; 24277761l -> false; 197304985l -> false; 20612l -> false; 1811l -> false; 15459l -> false; 338237118l -> false; 901965649l -> false; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int64 failed (123 shrink steps): +Test fail_pred_map_commute_int64 failed (201 shrink steps): -([0L; 1L], {_ -> 0L}, {-7504258977828779808L -> false; -7093694681182419557L -> false; 3873912968074562848L -> false; 3217825886573894393L -> false; -382865800631504453L -> false; 4099820307503616554L -> false; 699253650458194431L -> false; 8654311839195390489L -> false; -8943431579568790477L -> false; 4918999763344690417L -> false; 2839624487026504606L -> false; -4429540254266880362L -> false; -3212627688888080436L -> false; 8536762249180422736L -> false; 5859742167437376336L -> false; -2190382103531982729L -> false; 4537031266334529194L -> false; 5862395135921190459L -> false; 7824925950931903538L -> false; 0L -> true; 1211095228675665833L -> false; -4111062701435455992L -> false; 3962063715808702212L -> false; 4471203044432927526L -> false; -8445541690265748756L -> false; -6819806278200462828L -> false; -1884078868316734635L -> false; 1157940906807060904L -> false; 9206397994034200062L -> false; -5279863662566198154L -> false; -7633800208299937897L -> false; _ -> false}) +([0L; 0L], {-8810550782076602055L -> 0L; 2193919536756226345L -> 0L; 0L -> 1L; _ -> 0L}, {99979597015665302L -> false; 1468801460202L -> false; 15L -> false; 1952082L -> false; 284805883781L -> false; 720593L -> false; 422076469410L -> false; 735847988098523L -> false; 866701437833153609L -> false; 4537031266334529194L -> false; 1041110L -> false; 1L -> true; 101861769836880L -> false; 21L -> false; 59110L -> false; 210173L -> false; 12691630L -> false; 86L -> false; 23362982654L -> false; 963900958258L -> false; 1733402875666307218L -> false; 304L -> false; 1137545637156014112L -> false; 325492438607L -> false; 241450121094828L -> false; 5045814775532730L -> false; 1561665L -> false; 3844430305167794L -> false; 960790L -> false; 1032751026705L -> false; 976041L -> false; 990515928952175553L -> false; 488020L -> false; 2937602920405L -> false; 118838731476360L -> false; 51722L -> false; 8761118495L -> false; 90543795410560L -> false; 826200821364L -> false; 206957246652710L -> false; 2235910448L -> false; 2943391952394092L -> false; 2193919536756226345L -> false; 6345815L -> false; 57L -> false; 290461226260L -> false; 101533043L -> false; 32805805270765177L -> false; 1044L -> false; 1516727516208018816L -> false; 1485773893428263330L -> false; 142193204644501764L -> false; 29555L -> false; 480395L -> false; 1471695976197046L -> false; 580922452521L -> false; 78814L -> false; 203066086L -> false; 118221L -> false; 1586453L -> false; 174056645L -> false; 551885991073892L -> false; 37492348880874488L -> false; 464151052L -> false; 10221304911L -> false; 7176269902979883L -> false; 10L -> false; 1392L -> false; 44333L -> false; 31150643538L -> false; 840692L -> false; 49989798507832651L -> false; 76L -> false; 2395618337L -> false; 4100725658845647L -> false; -8810550782076602055L -> false; 1916494670L -> false; 5766645457751691L -> false; 11314L -> false; 1103771982147785L -> false; 7688860610335589L -> false; 7425L -> false; 379741178375L -> false; 774563270028L -> false; 116037763L -> false; 1277663113L -> false; 114L -> false; 854035L -> false; 6714520960926L -> false; 7957950768506L -> false; 1981031857904351106L -> false; 15575321769L -> false; 5840745663L -> false; 8952694614569L -> false; 45257L -> false; 2475472282L -> false; 609L -> false; 8201451317691294L -> false; 232075526L -> false; 381230359467L -> false; 1218L -> false; 11681491327L -> false; 93314290547954282L -> false; 74984697761748977L -> false; 1300052156749730414L -> false; 275942995536946L -> false; 696L -> false; 1856L -> false; 5110652455L -> false; 387281635014L -> false; 152L -> false; 1821943L -> false; 120725060547414L -> false; 7833607787747L -> false; 16971L -> false; 217845919695L -> false; 5886783904788185L -> false; 53322451741688161L -> false; 0L -> false; 3712L -> false; 56238523321311732L -> false; 758363758104009408L -> false; 5875205840810L -> false; 4476347307284L -> false; 3916803893873L -> false; 326768879543L -> false; 43L -> false; 9900L -> false; 428884154400L -> false; 6151088488268471L -> false; 16402902635382588L -> false; 7L -> false; 71096602322250882L -> false; 25383260L -> false; 435691839390L -> false; 6727753034043640L -> false; 38792L -> false; 1189840L -> false; 420346L -> false; 79983677612532242L -> false; 3L -> false; 928L -> false; 25861L -> false; 15915901537012L -> false; 928302105L -> false; 31831803074025L -> false; 106644903483376323L -> false; 1101601095152L -> false; 22628L -> false; 915038L -> false; 50766521L -> false; 734400730101L -> false; 284386409289003528L -> false; 2082220L -> false; 3873912968074562848L -> false; 945539L -> false; 63663606148050L -> false; 732030L -> false; 11936926152759L -> false; 550800547576L -> false; 408461099429L -> false; 137971497768473L -> false; 67907846557920L -> false; 135815693115840L -> false; 3172907L -> false; 105086L -> false; 3363876517021820L -> false; 249205148308L -> false; 1784760L -> false; 213604412835L -> false; 1237736141L -> false; 189870589187L -> false; 516375513352L -> false; 65611610541530354L -> false; 568772818578007056L -> false; 2379680L -> false; 618868070L -> false; 62301287077L -> false; 433989918143L -> false; 19800L -> false; 3962063715808702212L -> false; 157629L -> false; 124602574154L -> false; 181087590821121L -> false; 2555326227L -> false; 142402941890L -> false; 5968463076379L -> false; 127327212296100L -> false; 4950L -> false; 216994959071L -> false; 432287996895L -> false; _ -> false}) --- Failure -------------------------------------------------------------------- @@ -607,34 +585,28 @@ Test fail_pred_strings failed (1 shrink steps): --- Failure -------------------------------------------------------------------- -Test fold_left fold_right failed (104 shrink steps): +Test fold_left fold_right failed (149 shrink steps): -(0, [1], {(8, 7) -> 0; (96, 0) -> 0; (79, 32) -> 0; (1, 0) -> 1; (7, 3) -> 0; (4, 48) -> 0; (5, 52) -> 0; (5, 1) -> 0; (4, 78) -> 0; (3, 2) -> 0; (85, 30) -> 0; (36, 1) -> 0; (59, 17) -> 0; (5, 61) -> 0; (3, 44) -> 0; (1, 18) -> 0; (1, 7) -> 0; (9, 4) -> 0; (2, 2) -> 0; (6, 8) -> 0; (6, 6) -> 0; (43, 4) -> 0; (3, 7) -> 0; (0, 3) -> 0; (4, 0) -> 0; (8, 1) -> 0; (30, 0) -> 0; (0, 8) -> 0; (7, 78) -> 0; (9, 52) -> 0; (5, 89) -> 0; (49, 7) -> 0; (97, 2) -> 0; (0, 0) -> 0; (4, 7) -> 0; (0, 6) -> 0; (65, 4) -> 0; (35, 7) -> 0; (6, 2) -> 0; (19, 5) -> 0; (87, 82) -> 0; (7, 61) -> 0; (4, 3) -> 0; (4, 9) -> 0; (6, 3) -> 0; (9, 64) -> 0; (2, 3) -> 0; (8, 13) -> 0; (5, 6) -> 0; (8, 64) -> 0; (8, 0) -> 0; (20, 6) -> 0; (2, 6) -> 0; (3, 6) -> 0; (5, 0) -> 0; (38, 3) -> 0; (0, 2) -> 0; (6, 1) -> 0; (63, 8) -> 0; (27, 5) -> 0; (2, 1) -> 0; (0, 5) -> 0; (9, 0) -> 0; (9, 5) -> 0; (4, 4) -> 0; (6, 5) -> 0; (21, 1) -> 0; (48, 50) -> 0; (77, 7) -> 0; (9, 1) -> 0; (52, 8) -> 0; (13, 40) -> 0; (3, 0) -> 0; (5, 3) -> 0; (1, 1) -> 0; (2, 31) -> 0; (2, 0) -> 0; (69, 31) -> 0; (7, 42) -> 0; (7, 89) -> 0; (7, 6) -> 0; (5, 2) -> 0; (8, 4) -> 0; (83, 37) -> 0; (8, 3) -> 0; (5, 4) -> 0; (35, 3) -> 0; (96, 8) -> 0; (1, 5) -> 0; (2, 15) -> 0; _ -> 0}) +(0, [1], {(55, 3) -> 0; (3, 4) -> 0; (42, 7) -> 0; (89, 6) -> 0; (1, 9) -> 0; (6, 9) -> 0; (5, 61) -> 0; (1, 7) -> 0; (2, 57) -> 0; (57, 1) -> 0; (47, 1) -> 0; (9, 4) -> 0; (5, 92) -> 0; (6, 8) -> 0; (4, 0) -> 0; (25, 32) -> 0; (96, 6) -> 0; (7, 1) -> 0; (2, 9) -> 0; (3, 50) -> 0; (0, 0) -> 0; (7, 4) -> 0; (4, 7) -> 0; (2, 65) -> 0; (13, 5) -> 0; (61, 4) -> 0; (8, 6) -> 0; (82, 8) -> 0; (4, 44) -> 0; (9, 3) -> 0; (4, 3) -> 0; (25, 8) -> 0; (1, 2) -> 0; (6, 3) -> 0; (4, 1) -> 0; (1, 55) -> 0; (40, 0) -> 0; (5, 13) -> 0; (5, 73) -> 0; (7, 2) -> 0; (3, 3) -> 0; (8, 64) -> 0; (6, 4) -> 0; (46, 0) -> 0; (4, 39) -> 0; (7, 0) -> 0; (4, 5) -> 0; (9, 7) -> 0; (28, 0) -> 0; (47, 15) -> 0; (11, 8) -> 0; (3, 5) -> 0; (1, 4) -> 0; (9, 13) -> 0; (25, 43) -> 0; (6, 5) -> 0; (4, 4) -> 0; (0, 1) -> 1; (9, 89) -> 0; (43, 6) -> 0; (7, 40) -> 0; (5, 8) -> 0; (4, 6) -> 0; (1, 1) -> 0; (5, 72) -> 0; (92, 5) -> 0; (57, 6) -> 0; (48, 7) -> 0; (2, 0) -> 0; (21, 52) -> 0; (5, 2) -> 0; (8, 4) -> 0; (21, 15) -> 0; (0, 9) -> 0; (6, 43) -> 0; (8, 3) -> 0; (0, 4) -> 0; (21, 0) -> 0; (21, 8) -> 0; (0, 21) -> 0; (2, 15) -> 0; (57, 3) -> 0; (8, 7) -> 0; (7, 3) -> 0; (1, 0) -> 0; (2, 16) -> 0; (5, 1) -> 0; (4, 78) -> 0; (2, 4) -> 0; (8, 46) -> 0; (32, 0) -> 0; (2, 47) -> 0; (3, 17) -> 0; (50, 5) -> 0; (0, 3) -> 0; (3, 7) -> 0; (6, 6) -> 0; (59, 5) -> 0; (8, 1) -> 0; (0, 8) -> 0; (5, 32) -> 0; (3, 21) -> 0; (0, 6) -> 0; (3, 46) -> 0; (64, 8) -> 0; (9, 2) -> 0; (67, 0) -> 0; (3, 51) -> 0; (5, 94) -> 0; (6, 2) -> 0; (43, 7) -> 0; (54, 21) -> 0; (4, 9) -> 0; (17, 5) -> 0; (1, 8) -> 0; (6, 7) -> 0; (3, 8) -> 0; (41, 55) -> 0; (3, 6) -> 0; (5, 0) -> 0; (6, 1) -> 0; (0, 2) -> 0; (2, 1) -> 0; (0, 5) -> 0; (21, 6) -> 0; (4, 2) -> 0; (64, 4) -> 0; (9, 1) -> 0; (9, 31) -> 0; (5, 57) -> 0; (3, 0) -> 0; (7, 7) -> 0; (2, 64) -> 0; (3, 9) -> 0; (7, 96) -> 0; (32, 7) -> 0; (8, 10) -> 0; (9, 47) -> 0; (4, 8) -> 0; (31, 92) -> 0; (0, 32) -> 0; (37, 2) -> 0; (5, 4) -> 0; (18, 8) -> 0; (8, 30) -> 0; (6, 0) -> 0; (8, 9) -> 0; (5, 64) -> 0; (8, 96) -> 0; (3, 1) -> 0; (7, 21) -> 0; _ -> 0}) +++ Messages ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Messages for test fold_left fold_right: -l=[1], fold_left=1, fold_right=0 +l=[1], fold_left=0, fold_right=1 --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried failed (481 shrink steps): +Test fold_left fold_right uncurried failed (165 shrink steps): -({(3, 9) -> 0; (5, 2) -> 0; (96, 4) -> 0; (9, 6) -> 0; (8, 6) -> 0; (98, 74) -> 0; (7, 20) -> 0; (8, 0) -> 0; (3, 8) -> 0; (4, 0) -> 0; (7, 2) -> 0; (4, 7) -> 0; (0, 5) -> 0; (6, 75) -> 0; (2, 2) -> 0; (6, 0) -> 0; (8, 4) -> 0; (0, 1) -> 1; (80, 4) -> 0; (89, 0) -> 0; (49, 85) -> 0; (2, 0) -> 0; (6, 1) -> 0; (3, 5) -> 0; _ -> 0}, 0, [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 1]) +({(53, 0) -> 0; (1, 91) -> 0; (5, 93) -> 0; (4, 80) -> 0; (50, 2) -> 0; (0, 7) -> 0; (83, 8) -> 0; (4, 45) -> 0; (28, 73) -> 0; (8, 2) -> 0; (7, 0) -> 0; (0, 0) -> 0; (1, 7) -> 0; (4, 6) -> 0; (8, 1) -> 0; (3, 5) -> 0; (8, 8) -> 0; (9, 3) -> 0; (3, 9) -> 0; (74, 0) -> 0; (5, 4) -> 0; (3, 52) -> 0; (6, 13) -> 0; (9, 22) -> 0; (83, 42) -> 0; (0, 99) -> 0; (26, 7) -> 0; (6, 14) -> 0; (4, 7) -> 0; (1, 1) -> 0; (0, 5) -> 0; (1, 5) -> 0; (5, 8) -> 0; (44, 8) -> 0; (2, 4) -> 0; (8, 12) -> 0; (4, 3) -> 0; (3, 6) -> 0; (8, 81) -> 0; (1, 2) -> 0; (2, 1) -> 0; (6, 5) -> 0; (9, 9) -> 0; (9, 38) -> 0; (7, 79) -> 0; (25, 4) -> 0; (2, 6) -> 0; (7, 94) -> 0; (5, 3) -> 0; (76, 49) -> 0; (36, 9) -> 0; (3, 84) -> 0; (1, 23) -> 0; (1, 6) -> 0; (0, 6) -> 0; (44, 2) -> 0; (83, 3) -> 0; (5, 18) -> 0; (3, 1) -> 0; (46, 7) -> 0; (24, 9) -> 0; (22, 5) -> 0; (5, 5) -> 0; (7, 4) -> 0; (36, 92) -> 0; (5, 14) -> 0; (6, 2) -> 0; (96, 5) -> 0; (1, 0) -> 0; (8, 4) -> 0; (5, 0) -> 0; (7, 5) -> 0; (9, 8) -> 0; (0, 19) -> 0; (0, 32) -> 0; (1, 33) -> 0; (6, 1) -> 0; (2, 82) -> 0; (8, 74) -> 0; (9, 6) -> 0; (8, 6) -> 0; (64, 2) -> 0; (3, 8) -> 0; (32, 56) -> 0; (6, 74) -> 0; (7, 1) -> 0; (6, 6) -> 0; (8, 98) -> 0; (4, 97) -> 0; (6, 72) -> 0; (0, 9) -> 0; (4, 8) -> 0; (2, 92) -> 0; (4, 23) -> 0; (3, 95) -> 0; (4, 61) -> 0; (0, 85) -> 0; (10, 92) -> 0; (89, 6) -> 0; (8, 3) -> 0; (32, 6) -> 0; (3, 2) -> 0; (9, 21) -> 0; (58, 6) -> 0; (3, 10) -> 0; (6, 9) -> 0; (8, 9) -> 0; (7, 8) -> 0; (23, 9) -> 0; (4, 9) -> 0; (23, 68) -> 0; (0, 1) -> 0; (6, 85) -> 0; (2, 0) -> 0; (7, 6) -> 0; (6, 3) -> 0; (0, 96) -> 0; (77, 8) -> 0; (9, 15) -> 0; (77, 0) -> 0; (0, 8) -> 0; (4, 2) -> 0; (8, 7) -> 0; (87, 7) -> 0; (3, 0) -> 0; (90, 46) -> 0; (7, 9) -> 0; (6, 4) -> 0; (6, 0) -> 1; (96, 71) -> 0; (76, 0) -> 0; (74, 3) -> 0; (1, 3) -> 0; (7, 71) -> 0; (7, 99) -> 0; (6, 7) -> 0; (9, 4) -> 0; (1, 8) -> 0; (4, 5) -> 0; (82, 4) -> 0; (5, 9) -> 0; (3, 3) -> 0; (0, 4) -> 0; (2, 3) -> 0; (44, 4) -> 0; (5, 7) -> 0; (5, 6) -> 0; (4, 4) -> 0; (4, 83) -> 0; (6, 49) -> 0; (1, 9) -> 0; (7, 7) -> 0; _ -> 0}, 0, [6]) --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried fun last failed (30 shrink steps): +Test fold_left fold_right uncurried fun last failed (23 shrink steps): -(0, [1], {(7, 2) -> 0; (8, 7) -> 0; (0, 7) -> 0; (0, 5) -> 0; (4, 8) -> 0; (50, 4) -> 0; (5, 64) -> 0; (0, 1) -> 1; (32, 49) -> 0; (8, 8) -> 0; _ -> 0}) - ---- Failure -------------------------------------------------------------------- - -Test fold_left test, fun first failed (19 shrink steps): - -({("\022/\026D\153\138", 2) -> ""; ("Y", 4) -> ""; ("yc\144x\186\136\219\157\227", 6) -> ""; ("^\127\023\014*\023c\018", 2) -> ""; ("\022MlqC", 2) -> ""; ("\205)\019\136", 4) -> ""; ("l\186\218\222!\214E", 2) -> ""; ("\249)\003\207\189\129\145Sd\186X\238\179\",3GTId\005\223\134\211%#N\2128fD\190\251\b\169\155v\223\023\157", 6) -> ""; ("\173\188C\247%\150k=", 2) -> "a"; (";", 2) -> ""; _ -> ""}, "a", [], [0]) +(0, [1], {(8, 3) -> 0; (5, 9) -> 0; (8, 0) -> 0; (0, 8) -> 0; (0, 7) -> 0; (50, 57) -> 0; (8, 47) -> 0; (32, 4) -> 0; (4, 21) -> 0; (0, 4) -> 0; (1, 0) -> 1; (7, 5) -> 0; _ -> 0}) --- Failure -------------------------------------------------------------------- @@ -1101,63 +1073,63 @@ Ok _ : 7531 cases +++ Stats for list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 344.34, stddev: 1211.86, median 9, min 0, max 9901 - 0.. 495: ####################################################### 4276 - 496.. 991: ###### 509 - 992..1487: 19 - 1488..1983: 10 - 1984..2479: 13 - 2480..2975: 13 - 2976..3471: 9 - 3472..3967: 13 - 3968..4463: 15 - 4464..4959: 8 - 4960..5455: 11 - 5456..5951: 17 - 5952..6447: 9 - 6448..6943: 9 - 6944..7439: 12 - 7440..7935: 8 - 7936..8431: 8 - 8432..8927: 15 - 8928..9423: 13 - 9424..9919: 13 + num: 5000, avg: 373.39, stddev: 1294.83, median 9, min 0, max 9936 + 0.. 496: ####################################################### 4268 + 497.. 993: ###### 482 + 994..1490: 26 + 1491..1987: 14 + 1988..2484: 11 + 2485..2981: 12 + 2982..3478: 17 + 3479..3975: 16 + 3976..4472: 11 + 4473..4969: 7 + 4970..5466: 14 + 5467..5963: 10 + 5964..6460: 19 + 6461..6957: 17 + 6958..7454: 9 + 7455..7951: 12 + 7952..8448: 19 + 8449..8945: 7 + 8946..9442: 14 + 9443..9939: 15 +++ Stats for small_list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 15.62, stddev: 24.13, median 6, min 0, max 99 - 0.. 4: ##################################################### 1920 - 5.. 9: ####################################################### 1958 - 10.. 14: # 69 - 15.. 19: # 68 - 20.. 24: # 58 - 25.. 29: # 61 - 30.. 34: # 65 - 35.. 39: # 51 - 40.. 44: ## 78 - 45.. 49: # 54 - 50.. 54: # 59 - 55.. 59: # 66 - 60.. 64: # 66 - 65.. 69: # 49 - 70.. 74: # 66 - 75.. 79: ## 76 - 80.. 84: # 60 - 85.. 89: # 63 - 90.. 94: # 61 - 95.. 99: # 52 + num: 5000, avg: 15.50, stddev: 24.07, median 6, min 0, max 99 + 0.. 4: ##################################################### 1927 + 5.. 9: ####################################################### 1974 + 10.. 14: # 58 + 15.. 19: # 55 + 20.. 24: # 59 + 25.. 29: # 59 + 30.. 34: # 61 + 35.. 39: # 58 + 40.. 44: # 70 + 45.. 49: # 65 + 50.. 54: # 61 + 55.. 59: # 62 + 60.. 64: # 54 + 65.. 69: ## 81 + 70.. 74: # 62 + 75.. 79: # 58 + 80.. 84: # 67 + 85.. 89: # 55 + 90.. 94: # 59 + 95.. 99: # 55 +++ Stats for list_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 7.48, stddev: 1.71, median 7, min 5, max 10 - 5: ##################################################### 845 - 6: ###################################################### 857 - 7: #################################################### 830 - 8: ################################################## 790 - 9: ####################################################### 862 - 10: #################################################### 816 + num: 5000, avg: 7.52, stddev: 1.71, median 7, min 5, max 10 + 5: ################################################# 799 + 6: #################################################### 846 + 7: ###################################################### 874 + 8: ################################################### 824 + 9: ################################################ 774 + 10: ####################################################### 883 +++ Stats for list_repeat len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -1168,63 +1140,63 @@ stats len: +++ Stats for array len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 344.34, stddev: 1211.86, median 9, min 0, max 9901 - 0.. 495: ####################################################### 4276 - 496.. 991: ###### 509 - 992..1487: 19 - 1488..1983: 10 - 1984..2479: 13 - 2480..2975: 13 - 2976..3471: 9 - 3472..3967: 13 - 3968..4463: 15 - 4464..4959: 8 - 4960..5455: 11 - 5456..5951: 17 - 5952..6447: 9 - 6448..6943: 9 - 6944..7439: 12 - 7440..7935: 8 - 7936..8431: 8 - 8432..8927: 15 - 8928..9423: 13 - 9424..9919: 13 + num: 5000, avg: 373.39, stddev: 1294.83, median 9, min 0, max 9936 + 0.. 496: ####################################################### 4268 + 497.. 993: ###### 482 + 994..1490: 26 + 1491..1987: 14 + 1988..2484: 11 + 2485..2981: 12 + 2982..3478: 17 + 3479..3975: 16 + 3976..4472: 11 + 4473..4969: 7 + 4970..5466: 14 + 5467..5963: 10 + 5964..6460: 19 + 6461..6957: 17 + 6958..7454: 9 + 7455..7951: 12 + 7952..8448: 19 + 8449..8945: 7 + 8946..9442: 14 + 9443..9939: 15 +++ Stats for small_array len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 15.62, stddev: 24.13, median 6, min 0, max 99 - 0.. 4: ##################################################### 1920 - 5.. 9: ####################################################### 1958 - 10.. 14: # 69 - 15.. 19: # 68 - 20.. 24: # 58 - 25.. 29: # 61 - 30.. 34: # 65 - 35.. 39: # 51 - 40.. 44: ## 78 - 45.. 49: # 54 - 50.. 54: # 59 - 55.. 59: # 66 - 60.. 64: # 66 - 65.. 69: # 49 - 70.. 74: # 66 - 75.. 79: ## 76 - 80.. 84: # 60 - 85.. 89: # 63 - 90.. 94: # 61 - 95.. 99: # 52 + num: 5000, avg: 15.50, stddev: 24.07, median 6, min 0, max 99 + 0.. 4: ##################################################### 1927 + 5.. 9: ####################################################### 1974 + 10.. 14: # 58 + 15.. 19: # 55 + 20.. 24: # 59 + 25.. 29: # 59 + 30.. 34: # 61 + 35.. 39: # 58 + 40.. 44: # 70 + 45.. 49: # 65 + 50.. 54: # 61 + 55.. 59: # 62 + 60.. 64: # 54 + 65.. 69: ## 81 + 70.. 74: # 62 + 75.. 79: # 58 + 80.. 84: # 67 + 85.. 89: # 55 + 90.. 94: # 59 + 95.. 99: # 55 +++ Stats for array_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 7.48, stddev: 1.71, median 7, min 5, max 10 - 5: ##################################################### 845 - 6: ###################################################### 857 - 7: #################################################### 830 - 8: ################################################## 790 - 9: ####################################################### 862 - 10: #################################################### 816 + num: 5000, avg: 7.52, stddev: 1.71, median 7, min 5, max 10 + 5: ################################################# 799 + 6: #################################################### 846 + 7: ###################################################### 874 + 8: ################################################### 824 + 9: ################################################ 774 + 10: ####################################################### 883 +++ Stats for array_repeat len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -1673,7 +1645,7 @@ stats dist: -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (74 tests failed, 3 tests errored, ran 166 tests) +failure (73 tests failed, 3 tests errored, ran 165 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.64 b/test/core/QCheck2_expect_test.expected.ocaml5.64 index a31f0fd2..8f2de4fc 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.64 @@ -129,53 +129,31 @@ random seed: 1234 0 1 0 -[46; 2; 22; 4; 4; 2; 6; 5; 88; 24; 7; 9; 9; 2; 5; 1; 55; 8; 45; 1; 96; 0; 1; 2; 7; 4; 1; 5; 95; 6; 8; 6; 4; 0; 5; 5; 22; 87; 2; 1; 1; 0; 2; 2; 9; 5; 9; 3; 7; 59; 7; 96; 6; 5; 1; 3; 9; 9; 65; 6; 7; 7; 2; 5; 0; 0; 70; 5; 5; 2; 1; 57; 9; 7; 8; 10; 9; 7; 9; 75; 73; 80; 7; 9; 4; 3; 16; 5; 79; 1; 8; 6; 2; 3; 4; 9; 2; 8; 4; 6; 50; 2; 1; 5; 9; 5; 4; 3; 56; 6; 5; 9; 4; 1; 47; 1; 2; 5; 2; 0; 7; 31; 55; 6; 7; 4; 7; 8; 8; 2; 4; 40; 4; 6; 9; 3; 59; 5; 1; 0; 2; 6; 90; 1; 6; 81; 0; 1; 3; 7; 2; 4; 5; 4; 7; 3; 62; 0; 1; 6; 7; 5; 97; 83; 41; 7; 2; 6; 3; 0; 4; 8; 99; 8; 6; 0; 7; 9; 7; 1; 55; 30; 25; 3; 4; 7; 1; 6; 80; 8; 0; 4; 21; 3; 5; 9; 27; 10; 60; 47; 54; 6; 5; 8; 1; 5; 9; 65; 9; 5; 7; 7; 6; 48; 9; 5; 6; 4; 9; 7; 1; 2; 71; 6; 9; 2; 7; 8; 14; 59; 71; 30; 7; 3; 5; 4; 6; 7; 3; 6; 9; 8; 2; 38; 6; 6; 7; 1; 5; 2; 43; 5; 2; 9; 3; 0; 3; 2; 7; 71; 26; 3; 9; 11; 5; 1; 5; 2; 53; 46; 4; 6; 7; 67; 1; 0; 34; 0; 48; 5; 5; 0; 7; 49; 92; 8; 3; 0; 67; 1; 5; 2; 9; 5; 9; 3; 1; 4; 8; 0; 3; 6; 46; 58; 1; 54; 77; 0; 96; 1; 6; 2; 8; 22; 3; 9; 2; 6; 25; 49; 9; 6; 3; 8; 5; 9; 54; 1; 7; 5; 6; 5; 1; 7; 8; 23; 4; 6; 4; 2; 5; 8; 4; 7; 4] +[0; 1; 80; 0; 9; 2; 3] [] -[7; 79; 86; 1; 70; 98; 1; 4; 7; 9; 5; 8; 0; 1; 2; 0; 6; 0; 37; 6; 8; 26; 6; 8; 8; 98; 6; 8; 1; 6; 2; 4; 4; 7; 26; 1; 77; 2; 9; 9; 81; 8; 9; 4; 0; 86; 9; 3; 7; 0; 54; 2; 4; 1; 6; 4; 55; 5; 0; 9; 2; 1; 3; 8; 7; 1; 1; 3; 92; 1; 3; 4; 5; 2; 8; 51; 2; 94; 6; 82; 0; 11; 86; 1; 36; 31; 3; 2; 3; 8; 2; 8; 14; 26; 89; 1; 6; 0; 9; 5; 6; 7; 1; 6; 1; 6; 4; 7; 8; 8; 4; 1; 6; 3; 1; 5; 0; 6; 0; 5; 0; 4; 3; 49; 5; 8; 37; 8; 38; 0; 1; 8; 59; 5; 0; 7; 37; 87; 9; 3; 1; 5; 59; 8; 7; 6; 26; 4; 8; 8; 8; 9; 3; 2; 6; 64; 6; 7; 2; 8; 5; 2; 94; 26; 98; 3; 29; 2; 1; 72; 2; 49] -[] -[8; 13; 1; 18; 0; 69; 15; 2; 5; 78; 7; 32; 8; 36; 7; 3; 0; 9; 1; 1; 1; 29; 3; 8; 7; 2; 1; 8; 7; 8; 22; 5; 49; 5; 0; 1; 8; 5; 6; 7; 5; 1; 9; 73; 55; 2; 4; 7; 3; 4; 2; 27; 0; 6; 9; 1; 7; 8; 5; 12; 5; 8; 9; 1; 95; 1; 0; 1; 4; 8; 6; 7; 0; 8; 2; 3; 7; 3; 9; 0; 86; 96; 72; 3; 4; 25] -[] -[4; 3; 6; 5; 0; 0; 9; 7; 0; 6; 5; 3; 0; 24; 5; 6; 86; 9; 9; 0; 7; 2; 6; 6; 3; 45; 6; 1; 17; 1; 2; 2; 3; 0; 4; 1; 8; 2; 6; 9; 5; 0; 2] -[] -[9; 7; 62; 0; 73; 0; 8; 94; 0; 6; 50; 9; 83; 0; 5; 40; 6; 1; 6; 6; 6] -[] -[6; 5; 2; 54; 33; 9; 1; 1; 1; 61] -[] -[5; 7; 0; 65; 0] -[] -[2; 7] -[] -[6] +[0; 1; 80] [] [0] -[46; 2; 22; 4; 4; 2; 6; 5; 88; 24; 7; 9; 9; 2; 5; 1; 55; 8; 45; 1; 96; 0; 1; 2; 7; 4; 1; 5; 95; 6; 8; 6; 4; 0; 5; 5; 22; 87; 2; 1; 1; 0; 2; 2; 9; 5; 9; 3; 7; 59; 7; 96; 6; 5; 1; 3; 9; 9; 65; 6; 7; 7; 2; 5; 0; 0; 70; 5; 5; 2; 1; 57; 9; 7; 8; 10; 9; 7; 9; 75; 73; 80; 7; 9; 4; 3; 16; 5; 79; 1; 8; 6; 2; 3; 4; 9; 2; 8; 4; 6; 50; 2; 1; 5; 9; 5; 4; 3; 56; 6; 5; 9; 4; 1; 47; 1; 2; 5; 2; 0; 7; 31; 55; 6; 7; 4; 7; 8; 8; 2; 4; 40; 4; 6; 9; 3; 59; 5; 1; 0; 2; 6; 90; 1; 6; 81; 0; 1; 3; 7; 2; 4; 5; 4; 7; 3; 62; 0; 1; 6; 7; 5; 97; 83; 41; 7; 2; 6; 3; 0; 4; 8; 99; 8; 6; 0; 7; 9; 7; 1; 55; 30; 25; 3; 4; 7; 1; 6; 80; 8; 0; 4; 21; 3; 5; 9; 27; 10; 60; 47; 54; 6; 5; 8; 1; 5; 9; 65; 9; 5; 7; 7; 6; 48; 9; 5; 6; 4; 9; 7; 1; 2; 71; 6; 9; 2; 7; 8; 14; 59; 71; 30; 7; 3; 5; 4; 6; 7; 3; 6; 9; 8; 2; 38; 6; 6; 7; 1; 5; 2; 43; 5; 2; 9; 3; 0; 3; 2; 7; 71; 26; 3; 9; 11; 5; 1; 5; 2; 53; 46; 4; 6; 7; 67; 1; 0; 34; 0; 48; 5; 5; 0; 7; 49; 92; 8; 3; 0; 67; 1; 5; 2; 9; 5; 9; 3; 1; 4; 8; 0; 3; 6; 46; 58; 1; 54; 77; 0; 96; 1; 6; 2; 8; 22; 3; 9; 2; 6; 25; 49; 9; 6; 3; 8; 5; 9; 54; 1; 7; 5; 6; 5; 1; 7; 8; 23; 4; 6; 4; 2; 5; 8; 4; 7; 4] -[] -[7; 79; 86; 1; 70; 98; 1; 4; 7; 9; 5; 8; 0; 1; 2; 0; 6; 0; 37; 6; 8; 26; 6; 8; 8; 98; 6; 8; 1; 6; 2; 4; 4; 7; 26; 1; 77; 2; 9; 9; 81; 8; 9; 4; 0; 86; 9; 3; 7; 0; 54; 2; 4; 1; 6; 4; 55; 5; 0; 9; 2; 1; 3; 8; 7; 1; 1; 3; 92; 1; 3; 4; 5; 2; 8; 51; 2; 94; 6; 82; 0; 11; 86; 1; 36; 31; 3; 2; 3; 8; 2; 8; 14; 26; 89; 1; 6; 0; 9; 5; 6; 7; 1; 6; 1; 6; 4; 7; 8; 8; 4; 1; 6; 3; 1; 5; 0; 6; 0; 5; 0; 4; 3; 49; 5; 8; 37; 8; 38; 0; 1; 8; 59; 5; 0; 7; 37; 87; 9; 3; 1; 5; 59; 8; 7; 6; 26; 4; 8; 8; 8; 9; 3; 2; 6; 64; 6; 7; 2; 8; 5; 2; 94; 26; 98; 3; 29; 2; 1; 72; 2; 49] -[] -[8; 13; 1; 18; 0; 69; 15; 2; 5; 78; 7; 32; 8; 36; 7; 3; 0; 9; 1; 1; 1; 29; 3; 8; 7; 2; 1; 8; 7; 8; 22; 5; 49; 5; 0; 1; 8; 5; 6; 7; 5; 1; 9; 73; 55; 2; 4; 7; 3; 4; 2; 27; 0; 6; 9; 1; 7; 8; 5; 12; 5; 8; 9; 1; 95; 1; 0; 1; 4; 8; 6; 7; 0; 8; 2; 3; 7; 3; 9; 0; 86; 96; 72; 3; 4; 25] -[] -[4; 3; 6; 5; 0; 0; 9; 7; 0; 6; 5; 3; 0; 24; 5; 6; 86; 9; 9; 0; 7; 2; 6; 6; 3; 45; 6; 1; 17; 1; 2; 2; 3; 0; 4; 1; 8; 2; 6; 9; 5; 0; 2] -[] -[9; 7; 62; 0; 73; 0; 8; 94; 0; 6; 50; 9; 83; 0; 5; 40; 6; 1; 6; 6; 6] [] -[6; 5; 2; 54; 33; 9; 1; 1; 1; 61] +[0; 1; 80; 0; 9; 2; 3] [] -[5; 7; 0; 65; 0] +[0; 1; 80] +[0; 1; 80; 0; 9] [] -[2; 7] -[4; 6; 6] +[0; 1] +[0; 1; 80] +[0; 1; 80; 0] [] -[7] -[6; 41] -[0; 6; 6] -[0; 0; 6] -[0; 0; 0] +[0; 1] +[0; 1; 80] +[0; 0; 80; 0] +[0; 0; 0; 0] --- Failure -------------------------------------------------------------------- -Test should_fail_sort_id failed (11 shrink steps): +Test should_fail_sort_id failed (9 shrink steps): -[1; 0] +[0; 0; 1; 0] === Error ====================================================================== @@ -297,7 +275,7 @@ Test big bound issue59 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test long_shrink failed (3067 shrink steps): +Test long_shrink failed (3113 shrink steps): ([0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0], [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 1]) @@ -459,15 +437,15 @@ Test pairs sum to less than 128 failed (57 shrink steps): --- Failure -------------------------------------------------------------------- -Test pairs lists rev concat failed (76 shrink steps): +Test pairs lists rev concat failed (78 shrink steps): ([0], [1]) --- Failure -------------------------------------------------------------------- -Test pairs lists no overlap failed (18 shrink steps): +Test pairs lists no overlap failed (35 shrink steps): -([0], [0; 0; 0; 0]) +([0], [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0]) --- Failure -------------------------------------------------------------------- @@ -579,33 +557,33 @@ Test bind list_size constant failed (12 shrink steps): --- Failure -------------------------------------------------------------------- -Test lists are empty failed (9 shrink steps): +Test lists are empty failed (2 shrink steps): [0] --- Failure -------------------------------------------------------------------- -Test lists shorter than 10 failed (15 shrink steps): +Test lists shorter than 10 failed (13 shrink steps): [0; 0; 0; 0; 0; 0; 0; 0; 0; 0] --- Failure -------------------------------------------------------------------- -Test lists shorter than 432 failed (415 shrink steps): +Test lists shorter than 432 failed (418 shrink steps): [...] list length: 432 --- Failure -------------------------------------------------------------------- -Test lists shorter than 4332 failed (4017 shrink steps): +Test lists shorter than 4332 failed (4005 shrink steps): [...] list length: 4332 --- Failure -------------------------------------------------------------------- -Test lists have unique elems failed (10 shrink steps): +Test lists have unique elems failed (4 shrink steps): -[0; 0; 0] +[0; 0; 0; 0] --- Failure -------------------------------------------------------------------- @@ -641,25 +619,25 @@ Leaf 0 Test sum list = 0 failed (0 shrink steps): -[46; 2; 22; 4; 4; 2; 6; 5; 88; 24; 7; 9; 9; 2; 5; 1; 55; 8; 45; 1; 96; 0; 1; 2; 7; 4; 1; 5; 95; 6; 8; 6; 4; 0; 5; 5; 22; 87; 2; 1; 1; 0; 2; 2; 9; 5; 9; 3; 7; 59; 7; 96; 6; 5; 1; 3; 9; 9; 65; 6; 7; 7; 2; 5; 0; 0; 70; 5; 5; 2; 1; 57; 9; 7; 8; 10; 9; 7; 9; 75; 73; 80; 7; 9; 4; 3; 16; 5; 79; 1; 8; 6; 2; 3; 4; 9; 2; 8; 4; 6; 50; 2; 1; 5; 9; 5; 4; 3; 56; 6; 5; 9; 4; 1; 47; 1; 2; 5; 2; 0; 7; 31; 55; 6; 7; 4; 7; 8; 8; 2; 4; 40; 4; 6; 9; 3; 59; 5; 1; 0; 2; 6; 90; 1; 6; 81; 0; 1; 3; 7; 2; 4; 5; 4; 7; 3; 62; 0; 1; 6; 7; 5; 97; 83; 41; 7; 2; 6; 3; 0; 4; 8; 99; 8; 6; 0; 7; 9; 7; 1; 55; 30; 25; 3; 4; 7; 1; 6; 80; 8; 0; 4; 21; 3; 5; 9; 27; 10; 60; 47; 54; 6; 5; 8; 1; 5; 9; 65; 9; 5; 7; 7; 6; 48; 9; 5; 6; 4; 9; 7; 1; 2; 71; 6; 9; 2; 7; 8; 14; 59; 71; 30; 7; 3; 5; 4; 6; 7; 3; 6; 9; 8; 2; 38; 6; 6; 7; 1; 5; 2; 43; 5; 2; 9; 3; 0; 3; 2; 7; 71; 26; 3; 9; 11; 5; 1; 5; 2; 53; 46; 4; 6; 7; 67; 1; 0; 34; 0; 48; 5; 5; 0; 7; 49; 92; 8; 3; 0; 67; 1; 5; 2; 9; 5; 9; 3; 1; 4; 8; 0; 3; 6; 46; 58; 1; 54; 77; 0; 96; 1; 6; 2; 8; 22; 3; 9; 2; 6; 25; 49; 9; 6; 3; 8; 5; 9; 54; 1; 7; 5; 6; 5; 1; 7; 8; 23; 4; 6; 4; 2; 5; 8; 4; 7; 4] +[0; 1; 80; 0; 9; 2; 3] --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int failed (126 shrink steps): +Test fail_pred_map_commute_int failed (200 shrink steps): -([0; 0], {0 -> 1; 1 -> 0; 2 -> 0; 4 -> 0; 5 -> 0; 54 -> 0; 6 -> 0; 23 -> 0; 7 -> 0; 8 -> 0; _ -> 0}, {1 -> true; 2 -> false; 1937055216023938291 -> false; 4 -> false; 5 -> false; 6 -> false; 23 -> false; 7 -> false; 8 -> false; 1902342822135566409 -> false; 428248039555175850 -> false; -3503595968806948661 -> false; -1248855469987920965 -> false; 4114456028088165916 -> false; 1562088908592064063 -> false; _ -> false}) +([0; 0], {0 -> 1; 5 -> 0; 26 -> 0; _ -> 0}, {25868127433904000 -> false; 22172680657632000 -> false; 14781787105088000 -> false; 0 -> false; 1 -> true; 580232960935041 -> false; 29563574210176001 -> false; 56143987586 -> false; 3 -> false; 74858650115 -> false; 1160465921870083 -> false; 1326246767851523 -> false; 4 -> false; 11652 -> false; 217159411844 -> false; 112287975173 -> false; 169092480261 -> false; 1989370151777285 -> false; 5 -> false; 6 -> false; 2320931843740166 -> false; 2652493535703046 -> false; 149717300231 -> false; 8 -> false; 23305 -> false; 4605561481 -> false; 24562994569 -> false; 434318823689 -> false; 975983242 -> false; 2647276639626 -> false; 1250955 -> false; 512560423131771020 -> false; 71395852615053 -> false; 390522227148016015 -> false; 16 -> false; 1544244706448 -> false; 12550052217489 -> false; 274 -> false; 46610 -> false; 49125989138 -> false; 9211122963 -> false; 150304426899 -> false; 26773444730644 -> false; 22 -> false; 2501910 -> false; 192407 -> false; 615704 -> false; 26 -> false; 411 -> false; 2014933147 -> false; 171105485979 -> false; 21022986105014045 -> false; 30 -> false; 40160167095966 -> false; 112122592560074910 -> false; 1951 -> false; 781044454296032031 -> false; 33 -> false; 3088489412897 -> false; 6690 -> false; 243995810 -> false; 81595260131490 -> false; 25100104434979 -> false; 597987160320399523 -> false; 548 -> false; 98251978276 -> false; 3137513054372 -> false; 503733286 -> false; 20391 -> false; 28030648140018727 -> false; 1515710591830312 -> false; 53546889461289 -> false; 428248039555175850 -> false; 19709049473450667 -> false; 5003820 -> false; 31534479157521068 -> false; 45 -> false; 703662 -> false; 82863 -> false; 384815 -> false; 161040457392 -> false; 217587360350640 -> false; 20015281 -> false; 17842 -> false; 378802 -> false; 2829326438083250 -> false; 372789 -> false; 579091764918 -> false; 1463 -> false; 4029866295 -> false; 755599929 -> false; 3529702186169 -> false; 42045972210028091 -> false; 683413897509028027 -> false; 60 -> false; 331452 -> false; 360764 -> false; 91498428 -> false; 229035317180 -> false; 2273565887745468 -> false; 15293 -> false; 95194470153405 -> false; 224245185120149821 -> false; 3902 -> false; 166408472638 -> false; 1562088908592064063 -> false; 290116480467520 -> false; 12934063716952000 -> false; 62147 -> false; 881533251 -> false; 84215981379 -> false; 2302780740 -> false; 12281497284 -> false; 625477 -> false; 80061125 -> false; 487991621 -> false; 17478 -> false; 284102 -> false; 325739117766 -> false; 50200208869958 -> false; 35697926307526 -> false; 944499912 -> false; 6275026108744 -> false; 336713 -> false; 820939 -> false; 68623821 -> false; 1007466573 -> false; 85552742989 -> false; 171776487885 -> false; 56061296280037455 -> false; 3031421183660625 -> false; 298993580160199761 -> false; 10195 -> false; 41431 -> false; 39418098946901335 -> false; 585783340722024023 -> false; 10007640 -> false; 2316367059672 -> false; 108793680175320 -> false; 8921 -> false; 189401 -> false; 128832365913 -> false; 731 -> false; 289545882459 -> false; 1764851093084 -> false; 341706948754514013 -> false; 165726 -> false; 769630 -> false; 45749214 -> false; 114517658590 -> false; 47597235076702 -> false; 480 -> false; 435174720701280 -> false; 6467031858476000 -> false; 31073 -> false; 40030562 -> false; 6140748642 -> false; 288611 -> false; 46853528278627 -> false; 410469 -> false; 3454171110 -> false; 85888243942 -> false; 380028970727 -> false; 938216 -> false; 170434484073 -> false; 4460 -> false; 1158183529836 -> false; 54396840087660 -> false; 365 -> false; 2927 -> false; 240 -> false; 3233515929238000 -> false; 718321 -> false; 365993715 -> false; 36790225683774579 -> false; 1937055216023938291 -> false; 469108 -> false; 128329114484 -> false; 2425136946928500 -> false; 4706269581558 -> false; 120 -> false; 407173897208 -> false; 1616757964619000 -> false; 182996857 -> false; 305380422906 -> false; 448490370240299642 -> false; 2353134790779 -> false; 203586948604 -> false; 7805 -> false; 152690211453 -> false; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int32 failed (64 shrink steps): +Test fail_pred_map_commute_int32 failed (91 shrink steps): -([0l; 1l], {_ -> 0l}, {2105244496l -> false; 1056359910l -> false; 1364327540l -> false; 1697200981l -> false; 749208472l -> false; -624253901l -> false; -1587859886l -> false; -1229314055l -> false; 79025834l -> false; 954563801l -> false; -1524569688l -> false; -101011561l -> false; -438671296l -> false; 922489845l -> false; -2089504257l -> false; -790819552l -> false; 140774641l -> false; -1966380908l -> false; 269604126l -> false; 1145293881l -> false; 0l -> true; -1777382617l -> false; 1447762681l -> false; 641593092l -> false; -2082304932l -> false; 2143531570l -> false; 263164458l -> false; 162807677l -> false; 901965649l -> false; -1354301954l -> false; 1073036012l -> false; _ -> false}) +([0l; 0l], {-2051366210l -> 0l; 1992866105l -> 0l; 0l -> 99l; _ -> 0l}, {251l -> false; 251274l -> false; 335032l -> false; -2051366210l -> false; 1340129l -> false; 28986l -> false; 1337l -> false; 875186l -> false; 1867064l -> false; 167l -> false; 12802725l -> false; 258962793l -> false; 668l -> false; 3623l -> false; 7246l -> false; 7468256l -> false; 54966l -> false; 64740698l -> false; 1527l -> false; 8535150l -> false; 0l -> false; 394609971l -> false; 12138880l -> false; 47114l -> false; 1633681l -> false; 933532l -> false; 18208320l -> false; 129481396l -> false; 345283724l -> false; 1056359910l -> false; 1992866105l -> false; 66l -> false; 3734128l -> false; 22760400l -> false; 219l -> false; 125637l -> false; 295957478l -> false; 17070300l -> false; 1782l -> false; 1018l -> false; 88l -> false; 21243040l -> false; 41225l -> false; 31409l -> false; 1400298l -> false; 16185174l -> false; 334l -> false; 62818l -> false; 1531576l -> false; 2037l -> false; 172641862l -> false; 14493l -> false; 176l -> false; 32370349l -> false; 1358l -> false; 11380200l -> false; 117l -> false; 1312779l -> false; 30918l -> false; 27054l -> false; 225491412l -> false; 132l -> false; 23189l -> false; 765788l -> false; 188l -> false; 27483l -> false; 1148682l -> false; 450982824l -> false; 891l -> false; 167516l -> false; 79025834l -> false; 670064l -> false; 125l -> false; 14936513l -> false; 235l -> false; 2717l -> false; 99l -> true; 1750373l -> false; 24277761l -> false; 197304985l -> false; 20612l -> false; 1811l -> false; 15459l -> false; 338237118l -> false; 901965649l -> false; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int64 failed (123 shrink steps): +Test fail_pred_map_commute_int64 failed (201 shrink steps): -([0L; 1L], {_ -> 0L}, {-7504258977828779808L -> false; -7093694681182419557L -> false; 3873912968074562848L -> false; 3217825886573894393L -> false; -382865800631504453L -> false; 4099820307503616554L -> false; 699253650458194431L -> false; 8654311839195390489L -> false; -8943431579568790477L -> false; 4918999763344690417L -> false; 2839624487026504606L -> false; -4429540254266880362L -> false; -3212627688888080436L -> false; 8536762249180422736L -> false; 5859742167437376336L -> false; -2190382103531982729L -> false; 4537031266334529194L -> false; 5862395135921190459L -> false; 7824925950931903538L -> false; 0L -> true; 1211095228675665833L -> false; -4111062701435455992L -> false; 3962063715808702212L -> false; 4471203044432927526L -> false; -8445541690265748756L -> false; -6819806278200462828L -> false; -1884078868316734635L -> false; 1157940906807060904L -> false; 9206397994034200062L -> false; -5279863662566198154L -> false; -7633800208299937897L -> false; _ -> false}) +([0L; 0L], {-8810550782076602055L -> 0L; 2193919536756226345L -> 0L; 0L -> 1L; _ -> 0L}, {99979597015665302L -> false; 1468801460202L -> false; 15L -> false; 1952082L -> false; 284805883781L -> false; 720593L -> false; 422076469410L -> false; 735847988098523L -> false; 866701437833153609L -> false; 4537031266334529194L -> false; 1041110L -> false; 1L -> true; 101861769836880L -> false; 21L -> false; 59110L -> false; 210173L -> false; 12691630L -> false; 86L -> false; 23362982654L -> false; 963900958258L -> false; 1733402875666307218L -> false; 304L -> false; 1137545637156014112L -> false; 325492438607L -> false; 241450121094828L -> false; 5045814775532730L -> false; 1561665L -> false; 3844430305167794L -> false; 960790L -> false; 1032751026705L -> false; 976041L -> false; 990515928952175553L -> false; 488020L -> false; 2937602920405L -> false; 118838731476360L -> false; 51722L -> false; 8761118495L -> false; 90543795410560L -> false; 826200821364L -> false; 206957246652710L -> false; 2235910448L -> false; 2943391952394092L -> false; 2193919536756226345L -> false; 6345815L -> false; 57L -> false; 290461226260L -> false; 101533043L -> false; 32805805270765177L -> false; 1044L -> false; 1516727516208018816L -> false; 1485773893428263330L -> false; 142193204644501764L -> false; 29555L -> false; 480395L -> false; 1471695976197046L -> false; 580922452521L -> false; 78814L -> false; 203066086L -> false; 118221L -> false; 1586453L -> false; 174056645L -> false; 551885991073892L -> false; 37492348880874488L -> false; 464151052L -> false; 10221304911L -> false; 7176269902979883L -> false; 10L -> false; 1392L -> false; 44333L -> false; 31150643538L -> false; 840692L -> false; 49989798507832651L -> false; 76L -> false; 2395618337L -> false; 4100725658845647L -> false; -8810550782076602055L -> false; 1916494670L -> false; 5766645457751691L -> false; 11314L -> false; 1103771982147785L -> false; 7688860610335589L -> false; 7425L -> false; 379741178375L -> false; 774563270028L -> false; 116037763L -> false; 1277663113L -> false; 114L -> false; 854035L -> false; 6714520960926L -> false; 7957950768506L -> false; 1981031857904351106L -> false; 15575321769L -> false; 5840745663L -> false; 8952694614569L -> false; 45257L -> false; 2475472282L -> false; 609L -> false; 8201451317691294L -> false; 232075526L -> false; 381230359467L -> false; 1218L -> false; 11681491327L -> false; 93314290547954282L -> false; 74984697761748977L -> false; 1300052156749730414L -> false; 275942995536946L -> false; 696L -> false; 1856L -> false; 5110652455L -> false; 387281635014L -> false; 152L -> false; 1821943L -> false; 120725060547414L -> false; 7833607787747L -> false; 16971L -> false; 217845919695L -> false; 5886783904788185L -> false; 53322451741688161L -> false; 0L -> false; 3712L -> false; 56238523321311732L -> false; 758363758104009408L -> false; 5875205840810L -> false; 4476347307284L -> false; 3916803893873L -> false; 326768879543L -> false; 43L -> false; 9900L -> false; 428884154400L -> false; 6151088488268471L -> false; 16402902635382588L -> false; 7L -> false; 71096602322250882L -> false; 25383260L -> false; 435691839390L -> false; 6727753034043640L -> false; 38792L -> false; 1189840L -> false; 420346L -> false; 79983677612532242L -> false; 3L -> false; 928L -> false; 25861L -> false; 15915901537012L -> false; 928302105L -> false; 31831803074025L -> false; 106644903483376323L -> false; 1101601095152L -> false; 22628L -> false; 915038L -> false; 50766521L -> false; 734400730101L -> false; 284386409289003528L -> false; 2082220L -> false; 3873912968074562848L -> false; 945539L -> false; 63663606148050L -> false; 732030L -> false; 11936926152759L -> false; 550800547576L -> false; 408461099429L -> false; 137971497768473L -> false; 67907846557920L -> false; 135815693115840L -> false; 3172907L -> false; 105086L -> false; 3363876517021820L -> false; 249205148308L -> false; 1784760L -> false; 213604412835L -> false; 1237736141L -> false; 189870589187L -> false; 516375513352L -> false; 65611610541530354L -> false; 568772818578007056L -> false; 2379680L -> false; 618868070L -> false; 62301287077L -> false; 433989918143L -> false; 19800L -> false; 3962063715808702212L -> false; 157629L -> false; 124602574154L -> false; 181087590821121L -> false; 2555326227L -> false; 142402941890L -> false; 5968463076379L -> false; 127327212296100L -> false; 4950L -> false; 216994959071L -> false; 432287996895L -> false; _ -> false}) --- Failure -------------------------------------------------------------------- @@ -669,34 +647,28 @@ Test fail_pred_strings failed (1 shrink steps): --- Failure -------------------------------------------------------------------- -Test fold_left fold_right failed (104 shrink steps): +Test fold_left fold_right failed (149 shrink steps): -(0, [1], {(8, 7) -> 0; (96, 0) -> 0; (79, 32) -> 0; (1, 0) -> 1; (7, 3) -> 0; (4, 48) -> 0; (5, 52) -> 0; (5, 1) -> 0; (4, 78) -> 0; (3, 2) -> 0; (85, 30) -> 0; (36, 1) -> 0; (59, 17) -> 0; (5, 61) -> 0; (3, 44) -> 0; (1, 18) -> 0; (1, 7) -> 0; (9, 4) -> 0; (2, 2) -> 0; (6, 8) -> 0; (6, 6) -> 0; (43, 4) -> 0; (3, 7) -> 0; (0, 3) -> 0; (4, 0) -> 0; (8, 1) -> 0; (30, 0) -> 0; (0, 8) -> 0; (7, 78) -> 0; (9, 52) -> 0; (5, 89) -> 0; (49, 7) -> 0; (97, 2) -> 0; (0, 0) -> 0; (4, 7) -> 0; (0, 6) -> 0; (65, 4) -> 0; (35, 7) -> 0; (6, 2) -> 0; (19, 5) -> 0; (87, 82) -> 0; (7, 61) -> 0; (4, 3) -> 0; (4, 9) -> 0; (6, 3) -> 0; (9, 64) -> 0; (2, 3) -> 0; (8, 13) -> 0; (5, 6) -> 0; (8, 64) -> 0; (8, 0) -> 0; (20, 6) -> 0; (2, 6) -> 0; (3, 6) -> 0; (5, 0) -> 0; (38, 3) -> 0; (0, 2) -> 0; (6, 1) -> 0; (63, 8) -> 0; (27, 5) -> 0; (2, 1) -> 0; (0, 5) -> 0; (9, 0) -> 0; (9, 5) -> 0; (4, 4) -> 0; (6, 5) -> 0; (21, 1) -> 0; (48, 50) -> 0; (77, 7) -> 0; (9, 1) -> 0; (52, 8) -> 0; (13, 40) -> 0; (3, 0) -> 0; (5, 3) -> 0; (1, 1) -> 0; (2, 31) -> 0; (2, 0) -> 0; (69, 31) -> 0; (7, 42) -> 0; (7, 89) -> 0; (7, 6) -> 0; (5, 2) -> 0; (8, 4) -> 0; (83, 37) -> 0; (8, 3) -> 0; (5, 4) -> 0; (35, 3) -> 0; (96, 8) -> 0; (1, 5) -> 0; (2, 15) -> 0; _ -> 0}) +(0, [1], {(55, 3) -> 0; (3, 4) -> 0; (42, 7) -> 0; (89, 6) -> 0; (1, 9) -> 0; (6, 9) -> 0; (5, 61) -> 0; (1, 7) -> 0; (2, 57) -> 0; (57, 1) -> 0; (47, 1) -> 0; (9, 4) -> 0; (5, 92) -> 0; (6, 8) -> 0; (4, 0) -> 0; (25, 32) -> 0; (96, 6) -> 0; (7, 1) -> 0; (2, 9) -> 0; (3, 50) -> 0; (0, 0) -> 0; (7, 4) -> 0; (4, 7) -> 0; (2, 65) -> 0; (13, 5) -> 0; (61, 4) -> 0; (8, 6) -> 0; (82, 8) -> 0; (4, 44) -> 0; (9, 3) -> 0; (4, 3) -> 0; (25, 8) -> 0; (1, 2) -> 0; (6, 3) -> 0; (4, 1) -> 0; (1, 55) -> 0; (40, 0) -> 0; (5, 13) -> 0; (5, 73) -> 0; (7, 2) -> 0; (3, 3) -> 0; (8, 64) -> 0; (6, 4) -> 0; (46, 0) -> 0; (4, 39) -> 0; (7, 0) -> 0; (4, 5) -> 0; (9, 7) -> 0; (28, 0) -> 0; (47, 15) -> 0; (11, 8) -> 0; (3, 5) -> 0; (1, 4) -> 0; (9, 13) -> 0; (25, 43) -> 0; (6, 5) -> 0; (4, 4) -> 0; (0, 1) -> 1; (9, 89) -> 0; (43, 6) -> 0; (7, 40) -> 0; (5, 8) -> 0; (4, 6) -> 0; (1, 1) -> 0; (5, 72) -> 0; (92, 5) -> 0; (57, 6) -> 0; (48, 7) -> 0; (2, 0) -> 0; (21, 52) -> 0; (5, 2) -> 0; (8, 4) -> 0; (21, 15) -> 0; (0, 9) -> 0; (6, 43) -> 0; (8, 3) -> 0; (0, 4) -> 0; (21, 0) -> 0; (21, 8) -> 0; (0, 21) -> 0; (2, 15) -> 0; (57, 3) -> 0; (8, 7) -> 0; (7, 3) -> 0; (1, 0) -> 0; (2, 16) -> 0; (5, 1) -> 0; (4, 78) -> 0; (2, 4) -> 0; (8, 46) -> 0; (32, 0) -> 0; (2, 47) -> 0; (3, 17) -> 0; (50, 5) -> 0; (0, 3) -> 0; (3, 7) -> 0; (6, 6) -> 0; (59, 5) -> 0; (8, 1) -> 0; (0, 8) -> 0; (5, 32) -> 0; (3, 21) -> 0; (0, 6) -> 0; (3, 46) -> 0; (64, 8) -> 0; (9, 2) -> 0; (67, 0) -> 0; (3, 51) -> 0; (5, 94) -> 0; (6, 2) -> 0; (43, 7) -> 0; (54, 21) -> 0; (4, 9) -> 0; (17, 5) -> 0; (1, 8) -> 0; (6, 7) -> 0; (3, 8) -> 0; (41, 55) -> 0; (3, 6) -> 0; (5, 0) -> 0; (6, 1) -> 0; (0, 2) -> 0; (2, 1) -> 0; (0, 5) -> 0; (21, 6) -> 0; (4, 2) -> 0; (64, 4) -> 0; (9, 1) -> 0; (9, 31) -> 0; (5, 57) -> 0; (3, 0) -> 0; (7, 7) -> 0; (2, 64) -> 0; (3, 9) -> 0; (7, 96) -> 0; (32, 7) -> 0; (8, 10) -> 0; (9, 47) -> 0; (4, 8) -> 0; (31, 92) -> 0; (0, 32) -> 0; (37, 2) -> 0; (5, 4) -> 0; (18, 8) -> 0; (8, 30) -> 0; (6, 0) -> 0; (8, 9) -> 0; (5, 64) -> 0; (8, 96) -> 0; (3, 1) -> 0; (7, 21) -> 0; _ -> 0}) +++ Messages ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Messages for test fold_left fold_right: -l=[1], fold_left=1, fold_right=0 +l=[1], fold_left=0, fold_right=1 --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried failed (481 shrink steps): +Test fold_left fold_right uncurried failed (165 shrink steps): -({(3, 9) -> 0; (5, 2) -> 0; (96, 4) -> 0; (9, 6) -> 0; (8, 6) -> 0; (98, 74) -> 0; (7, 20) -> 0; (8, 0) -> 0; (3, 8) -> 0; (4, 0) -> 0; (7, 2) -> 0; (4, 7) -> 0; (0, 5) -> 0; (6, 75) -> 0; (2, 2) -> 0; (6, 0) -> 0; (8, 4) -> 0; (0, 1) -> 1; (80, 4) -> 0; (89, 0) -> 0; (49, 85) -> 0; (2, 0) -> 0; (6, 1) -> 0; (3, 5) -> 0; _ -> 0}, 0, [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 1]) +({(53, 0) -> 0; (1, 91) -> 0; (5, 93) -> 0; (4, 80) -> 0; (50, 2) -> 0; (0, 7) -> 0; (83, 8) -> 0; (4, 45) -> 0; (28, 73) -> 0; (8, 2) -> 0; (7, 0) -> 0; (0, 0) -> 0; (1, 7) -> 0; (4, 6) -> 0; (8, 1) -> 0; (3, 5) -> 0; (8, 8) -> 0; (9, 3) -> 0; (3, 9) -> 0; (74, 0) -> 0; (5, 4) -> 0; (3, 52) -> 0; (6, 13) -> 0; (9, 22) -> 0; (83, 42) -> 0; (0, 99) -> 0; (26, 7) -> 0; (6, 14) -> 0; (4, 7) -> 0; (1, 1) -> 0; (0, 5) -> 0; (1, 5) -> 0; (5, 8) -> 0; (44, 8) -> 0; (2, 4) -> 0; (8, 12) -> 0; (4, 3) -> 0; (3, 6) -> 0; (8, 81) -> 0; (1, 2) -> 0; (2, 1) -> 0; (6, 5) -> 0; (9, 9) -> 0; (9, 38) -> 0; (7, 79) -> 0; (25, 4) -> 0; (2, 6) -> 0; (7, 94) -> 0; (5, 3) -> 0; (76, 49) -> 0; (36, 9) -> 0; (3, 84) -> 0; (1, 23) -> 0; (1, 6) -> 0; (0, 6) -> 0; (44, 2) -> 0; (83, 3) -> 0; (5, 18) -> 0; (3, 1) -> 0; (46, 7) -> 0; (24, 9) -> 0; (22, 5) -> 0; (5, 5) -> 0; (7, 4) -> 0; (36, 92) -> 0; (5, 14) -> 0; (6, 2) -> 0; (96, 5) -> 0; (1, 0) -> 0; (8, 4) -> 0; (5, 0) -> 0; (7, 5) -> 0; (9, 8) -> 0; (0, 19) -> 0; (0, 32) -> 0; (1, 33) -> 0; (6, 1) -> 0; (2, 82) -> 0; (8, 74) -> 0; (9, 6) -> 0; (8, 6) -> 0; (64, 2) -> 0; (3, 8) -> 0; (32, 56) -> 0; (6, 74) -> 0; (7, 1) -> 0; (6, 6) -> 0; (8, 98) -> 0; (4, 97) -> 0; (6, 72) -> 0; (0, 9) -> 0; (4, 8) -> 0; (2, 92) -> 0; (4, 23) -> 0; (3, 95) -> 0; (4, 61) -> 0; (0, 85) -> 0; (10, 92) -> 0; (89, 6) -> 0; (8, 3) -> 0; (32, 6) -> 0; (3, 2) -> 0; (9, 21) -> 0; (58, 6) -> 0; (3, 10) -> 0; (6, 9) -> 0; (8, 9) -> 0; (7, 8) -> 0; (23, 9) -> 0; (4, 9) -> 0; (23, 68) -> 0; (0, 1) -> 0; (6, 85) -> 0; (2, 0) -> 0; (7, 6) -> 0; (6, 3) -> 0; (0, 96) -> 0; (77, 8) -> 0; (9, 15) -> 0; (77, 0) -> 0; (0, 8) -> 0; (4, 2) -> 0; (8, 7) -> 0; (87, 7) -> 0; (3, 0) -> 0; (90, 46) -> 0; (7, 9) -> 0; (6, 4) -> 0; (6, 0) -> 1; (96, 71) -> 0; (76, 0) -> 0; (74, 3) -> 0; (1, 3) -> 0; (7, 71) -> 0; (7, 99) -> 0; (6, 7) -> 0; (9, 4) -> 0; (1, 8) -> 0; (4, 5) -> 0; (82, 4) -> 0; (5, 9) -> 0; (3, 3) -> 0; (0, 4) -> 0; (2, 3) -> 0; (44, 4) -> 0; (5, 7) -> 0; (5, 6) -> 0; (4, 4) -> 0; (4, 83) -> 0; (6, 49) -> 0; (1, 9) -> 0; (7, 7) -> 0; _ -> 0}, 0, [6]) --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried fun last failed (30 shrink steps): +Test fold_left fold_right uncurried fun last failed (23 shrink steps): -(0, [1], {(7, 2) -> 0; (8, 7) -> 0; (0, 7) -> 0; (0, 5) -> 0; (4, 8) -> 0; (50, 4) -> 0; (5, 64) -> 0; (0, 1) -> 1; (32, 49) -> 0; (8, 8) -> 0; _ -> 0}) - ---- Failure -------------------------------------------------------------------- - -Test fold_left test, fun first failed (19 shrink steps): - -({("\022/\026D\153\138", 2) -> ""; ("Y", 4) -> ""; ("yc\144x\186\136\219\157\227", 6) -> ""; ("^\127\023\014*\023c\018", 2) -> ""; ("\022MlqC", 2) -> ""; ("\205)\019\136", 4) -> ""; ("l\186\218\222!\214E", 2) -> ""; ("\249)\003\207\189\129\145Sd\186X\238\179\",3GTId\005\223\134\211%#N\2128fD\190\251\b\169\155v\223\023\157", 6) -> ""; ("\173\188C\247%\150k=", 2) -> "a"; (";", 2) -> ""; _ -> ""}, "a", [], [0]) +(0, [1], {(8, 3) -> 0; (5, 9) -> 0; (8, 0) -> 0; (0, 8) -> 0; (0, 7) -> 0; (50, 57) -> 0; (8, 47) -> 0; (32, 4) -> 0; (4, 21) -> 0; (0, 4) -> 0; (1, 0) -> 1; (7, 5) -> 0; _ -> 0}) --- Failure -------------------------------------------------------------------- @@ -1163,63 +1135,63 @@ Ok _ : 7531 cases +++ Stats for list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 344.34, stddev: 1211.86, median 9, min 0, max 9901 - 0.. 495: ####################################################### 4276 - 496.. 991: ###### 509 - 992..1487: 19 - 1488..1983: 10 - 1984..2479: 13 - 2480..2975: 13 - 2976..3471: 9 - 3472..3967: 13 - 3968..4463: 15 - 4464..4959: 8 - 4960..5455: 11 - 5456..5951: 17 - 5952..6447: 9 - 6448..6943: 9 - 6944..7439: 12 - 7440..7935: 8 - 7936..8431: 8 - 8432..8927: 15 - 8928..9423: 13 - 9424..9919: 13 + num: 5000, avg: 373.39, stddev: 1294.83, median 9, min 0, max 9936 + 0.. 496: ####################################################### 4268 + 497.. 993: ###### 482 + 994..1490: 26 + 1491..1987: 14 + 1988..2484: 11 + 2485..2981: 12 + 2982..3478: 17 + 3479..3975: 16 + 3976..4472: 11 + 4473..4969: 7 + 4970..5466: 14 + 5467..5963: 10 + 5964..6460: 19 + 6461..6957: 17 + 6958..7454: 9 + 7455..7951: 12 + 7952..8448: 19 + 8449..8945: 7 + 8946..9442: 14 + 9443..9939: 15 +++ Stats for small_list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 15.62, stddev: 24.13, median 6, min 0, max 99 - 0.. 4: ##################################################### 1920 - 5.. 9: ####################################################### 1958 - 10.. 14: # 69 - 15.. 19: # 68 - 20.. 24: # 58 - 25.. 29: # 61 - 30.. 34: # 65 - 35.. 39: # 51 - 40.. 44: ## 78 - 45.. 49: # 54 - 50.. 54: # 59 - 55.. 59: # 66 - 60.. 64: # 66 - 65.. 69: # 49 - 70.. 74: # 66 - 75.. 79: ## 76 - 80.. 84: # 60 - 85.. 89: # 63 - 90.. 94: # 61 - 95.. 99: # 52 + num: 5000, avg: 15.50, stddev: 24.07, median 6, min 0, max 99 + 0.. 4: ##################################################### 1927 + 5.. 9: ####################################################### 1974 + 10.. 14: # 58 + 15.. 19: # 55 + 20.. 24: # 59 + 25.. 29: # 59 + 30.. 34: # 61 + 35.. 39: # 58 + 40.. 44: # 70 + 45.. 49: # 65 + 50.. 54: # 61 + 55.. 59: # 62 + 60.. 64: # 54 + 65.. 69: ## 81 + 70.. 74: # 62 + 75.. 79: # 58 + 80.. 84: # 67 + 85.. 89: # 55 + 90.. 94: # 59 + 95.. 99: # 55 +++ Stats for list_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 7.48, stddev: 1.71, median 7, min 5, max 10 - 5: ##################################################### 845 - 6: ###################################################### 857 - 7: #################################################### 830 - 8: ################################################## 790 - 9: ####################################################### 862 - 10: #################################################### 816 + num: 5000, avg: 7.52, stddev: 1.71, median 7, min 5, max 10 + 5: ################################################# 799 + 6: #################################################### 846 + 7: ###################################################### 874 + 8: ################################################### 824 + 9: ################################################ 774 + 10: ####################################################### 883 +++ Stats for list_repeat len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -1230,63 +1202,63 @@ stats len: +++ Stats for array len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 344.34, stddev: 1211.86, median 9, min 0, max 9901 - 0.. 495: ####################################################### 4276 - 496.. 991: ###### 509 - 992..1487: 19 - 1488..1983: 10 - 1984..2479: 13 - 2480..2975: 13 - 2976..3471: 9 - 3472..3967: 13 - 3968..4463: 15 - 4464..4959: 8 - 4960..5455: 11 - 5456..5951: 17 - 5952..6447: 9 - 6448..6943: 9 - 6944..7439: 12 - 7440..7935: 8 - 7936..8431: 8 - 8432..8927: 15 - 8928..9423: 13 - 9424..9919: 13 + num: 5000, avg: 373.39, stddev: 1294.83, median 9, min 0, max 9936 + 0.. 496: ####################################################### 4268 + 497.. 993: ###### 482 + 994..1490: 26 + 1491..1987: 14 + 1988..2484: 11 + 2485..2981: 12 + 2982..3478: 17 + 3479..3975: 16 + 3976..4472: 11 + 4473..4969: 7 + 4970..5466: 14 + 5467..5963: 10 + 5964..6460: 19 + 6461..6957: 17 + 6958..7454: 9 + 7455..7951: 12 + 7952..8448: 19 + 8449..8945: 7 + 8946..9442: 14 + 9443..9939: 15 +++ Stats for small_array len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 15.62, stddev: 24.13, median 6, min 0, max 99 - 0.. 4: ##################################################### 1920 - 5.. 9: ####################################################### 1958 - 10.. 14: # 69 - 15.. 19: # 68 - 20.. 24: # 58 - 25.. 29: # 61 - 30.. 34: # 65 - 35.. 39: # 51 - 40.. 44: ## 78 - 45.. 49: # 54 - 50.. 54: # 59 - 55.. 59: # 66 - 60.. 64: # 66 - 65.. 69: # 49 - 70.. 74: # 66 - 75.. 79: ## 76 - 80.. 84: # 60 - 85.. 89: # 63 - 90.. 94: # 61 - 95.. 99: # 52 + num: 5000, avg: 15.50, stddev: 24.07, median 6, min 0, max 99 + 0.. 4: ##################################################### 1927 + 5.. 9: ####################################################### 1974 + 10.. 14: # 58 + 15.. 19: # 55 + 20.. 24: # 59 + 25.. 29: # 59 + 30.. 34: # 61 + 35.. 39: # 58 + 40.. 44: # 70 + 45.. 49: # 65 + 50.. 54: # 61 + 55.. 59: # 62 + 60.. 64: # 54 + 65.. 69: ## 81 + 70.. 74: # 62 + 75.. 79: # 58 + 80.. 84: # 67 + 85.. 89: # 55 + 90.. 94: # 59 + 95.. 99: # 55 +++ Stats for array_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 7.48, stddev: 1.71, median 7, min 5, max 10 - 5: ##################################################### 845 - 6: ###################################################### 857 - 7: #################################################### 830 - 8: ################################################## 790 - 9: ####################################################### 862 - 10: #################################################### 816 + num: 5000, avg: 7.52, stddev: 1.71, median 7, min 5, max 10 + 5: ################################################# 799 + 6: #################################################### 846 + 7: ###################################################### 874 + 8: ################################################### 824 + 9: ################################################ 774 + 10: ####################################################### 883 +++ Stats for array_repeat len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -1735,7 +1707,7 @@ stats dist: -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (74 tests failed, 3 tests errored, ran 166 tests) +failure (73 tests failed, 3 tests errored, ran 165 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ From 85566a7ece0dbcd5d32312eb0234cc1d38e1eebc Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 24 Jan 2025 16:06:53 +0100 Subject: [PATCH 292/391] Fix QCheck2.Gen.bytes_size shrinking with RS split and copy --- src/core/QCheck2.ml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index 32d47169..68ad1375 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -695,12 +695,14 @@ module Gen = struct let bytes_size ?(gen = char) (size : int t) : bytes t = fun st -> let open Tree in + let st' = RS.split st in size st >>= fun size -> (* Adding char shrinks to a mutable list is expensive: ~20-30% cost increase *) (* Adding char shrinks to a mutable lazy list is less expensive: ~15% cost increase *) + let st' = RS.copy st' in (* start char generation from same Random.State to recreate same char prefix (when size shrinking) *) let char_trees_rev = ref [] in let bytes = Bytes.init size (fun _ -> - let char_tree = gen st in + let char_tree = gen st' in char_trees_rev := char_tree :: !char_trees_rev ; (* Performance: return the root right now, the heavy processing of shrinks can wait until/if there is a need to shrink *) root char_tree) in From fef1b4caf79da5353cd1e408ecef8b56913173e0 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 24 Jan 2025 16:33:50 +0100 Subject: [PATCH 293/391] Update QCheck2 unit and expect tests wrt to revised bytes_size fix --- .../QCheck2_expect_test.expected.ocaml4.32 | 394 +++++++++--------- .../QCheck2_expect_test.expected.ocaml4.64 | 394 +++++++++--------- .../QCheck2_expect_test.expected.ocaml5.32 | 392 ++++++++--------- .../QCheck2_expect_test.expected.ocaml5.64 | 392 ++++++++--------- test/core/QCheck2_unit_tests.ml | 33 +- 5 files changed, 802 insertions(+), 803 deletions(-) diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.32 b/test/core/QCheck2_expect_test.expected.ocaml4.32 index 4aacd9c0..91d8f42f 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.32 @@ -279,51 +279,51 @@ Test printable never produces less than '5 failed (1 shrink steps): --- Failure -------------------------------------------------------------------- -Test bytes are empty failed (8 shrink steps): +Test bytes are empty failed (2 shrink steps): "a" --- Failure -------------------------------------------------------------------- -Test bytes never has a \000 char failed (22 shrink steps): +Test bytes never has a \000 char failed (198 shrink steps): -"aaaaaa\000aaaaaaaaaaaaaaaa" +"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\000" --- Failure -------------------------------------------------------------------- -Test bytes never has a \255 char failed (59 shrink steps): +Test bytes never has a \255 char failed (20 shrink steps): -"aaaaaaaaaaaaaaaaaaaaaaaaaa\255aaaaaaaaaaaaaaaaaaaaaaaa" +"aaaaaaaaaaaaaaaaa\255" --- Failure -------------------------------------------------------------------- -Test bytes have unique chars failed (18 shrink steps): +Test bytes have unique chars failed (28 shrink steps): -"aaaaaaaaaaaaa" +"aaaaaaaaaaaaaaaaaaaaaaaaaaa" --- Failure -------------------------------------------------------------------- -Test strings are empty failed (8 shrink steps): +Test strings are empty failed (2 shrink steps): "a" --- Failure -------------------------------------------------------------------- -Test string never has a \000 char failed (22 shrink steps): +Test string never has a \000 char failed (198 shrink steps): -"aaaaaa\000aaaaaaaaaaaaaaaa" +"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\000" --- Failure -------------------------------------------------------------------- -Test string never has a \255 char failed (59 shrink steps): +Test string never has a \255 char failed (20 shrink steps): -"aaaaaaaaaaaaaaaaaaaaaaaaaa\255aaaaaaaaaaaaaaaaaaaaaaaa" +"aaaaaaaaaaaaaaaaa\255" --- Failure -------------------------------------------------------------------- -Test strings have unique chars failed (18 shrink steps): +Test strings have unique chars failed (28 shrink steps): -"aaaaaaaaaaaaa" +"aaaaaaaaaaaaaaaaaaaaaaaaaaa" --- Failure -------------------------------------------------------------------- @@ -531,7 +531,7 @@ None --- Failure -------------------------------------------------------------------- -Test (int,string) result are Ok failed (0 shrink steps): +Test (int,string) result are Ok failed (1 shrink steps): Error ("") @@ -705,224 +705,224 @@ stats depth: +++ Stats for bytes_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 7.49, stddev: 1.70, median 7, min 5, max 10 - 5: ##################################################### 837 - 6: ##################################################### 826 - 7: ###################################################### 843 - 8: ####################################################### 855 - 9: #################################################### 813 - 10: ##################################################### 826 + num: 5000, avg: 7.47, stddev: 1.70, median 7, min 5, max 10 + 5: ##################################################### 848 + 6: #################################################### 829 + 7: ####################################################### 869 + 8: ##################################################### 839 + 9: ################################################# 787 + 10: #################################################### 828 +++ Stats for bytes len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 384.53, stddev: 1330.61, median 9, min 0, max 9969 - 0.. 498: ####################################################### 4246 - 499.. 997: ###### 518 - 998..1496: 21 - 1497..1995: 10 - 1996..2494: 11 - 2495..2993: 10 - 2994..3492: 13 - 3493..3991: 13 - 3992..4490: 5 - 4491..4989: 10 - 4990..5488: 19 - 5489..5987: 9 - 5988..6486: 10 - 6487..6985: 12 - 6986..7484: 17 - 7485..7983: 16 - 7984..8482: 16 - 8483..8981: 16 - 8982..9480: 16 - 9481..9979: 12 + num: 5000, avg: 381.73, stddev: 1276.71, median 9, min 0, max 9931 + 0.. 496: ####################################################### 4213 + 497.. 993: ###### 526 + 994..1490: 22 + 1491..1987: 14 + 1988..2484: 19 + 2485..2981: 14 + 2982..3478: 19 + 3479..3975: 15 + 3976..4472: 18 + 4473..4969: 14 + 4970..5466: 13 + 5467..5963: 11 + 5964..6460: 14 + 6461..6957: 18 + 6958..7454: 8 + 7455..7951: 15 + 7952..8448: 12 + 8449..8945: 9 + 8946..9442: 7 + 9443..9939: 19 +++ Stats for bytes_of len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 363.14, stddev: 1245.80, median 9, min 0, max 9986 - 0.. 499: ####################################################### 4270 - 500.. 999: ###### 493 - 1000.. 1499: 16 - 1500.. 1999: 11 - 2000.. 2499: 15 - 2500.. 2999: 17 - 3000.. 3499: 11 - 3500.. 3999: 19 - 4000.. 4499: 14 - 4500.. 4999: 10 - 5000.. 5499: 16 - 5500.. 5999: 11 - 6000.. 6499: 15 - 6500.. 6999: 13 - 7000.. 7499: 12 - 7500.. 7999: 16 - 8000.. 8499: 11 - 8500.. 8999: 4 - 9000.. 9499: 13 - 9500.. 9999: 13 + num: 5000, avg: 381.73, stddev: 1276.71, median 9, min 0, max 9931 + 0.. 496: ####################################################### 4213 + 497.. 993: ###### 526 + 994..1490: 22 + 1491..1987: 14 + 1988..2484: 19 + 2485..2981: 14 + 2982..3478: 19 + 3479..3975: 15 + 3976..4472: 18 + 4473..4969: 14 + 4970..5466: 13 + 5467..5963: 11 + 5964..6460: 14 + 6461..6957: 18 + 6958..7454: 8 + 7455..7951: 15 + 7952..8448: 12 + 8449..8945: 9 + 8946..9442: 7 + 9443..9939: 19 +++ Stats for bytes_printable len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 384.53, stddev: 1330.61, median 9, min 0, max 9969 - 0.. 498: ####################################################### 4246 - 499.. 997: ###### 518 - 998..1496: 21 - 1497..1995: 10 - 1996..2494: 11 - 2495..2993: 10 - 2994..3492: 13 - 3493..3991: 13 - 3992..4490: 5 - 4491..4989: 10 - 4990..5488: 19 - 5489..5987: 9 - 5988..6486: 10 - 6487..6985: 12 - 6986..7484: 17 - 7485..7983: 16 - 7984..8482: 16 - 8483..8981: 16 - 8982..9480: 16 - 9481..9979: 12 + num: 5000, avg: 381.73, stddev: 1276.71, median 9, min 0, max 9931 + 0.. 496: ####################################################### 4213 + 497.. 993: ###### 526 + 994..1490: 22 + 1491..1987: 14 + 1988..2484: 19 + 2485..2981: 14 + 2982..3478: 19 + 3479..3975: 15 + 3976..4472: 18 + 4473..4969: 14 + 4970..5466: 13 + 5467..5963: 11 + 5964..6460: 14 + 6461..6957: 18 + 6958..7454: 8 + 7455..7951: 15 + 7952..8448: 12 + 8449..8945: 9 + 8946..9442: 7 + 9443..9939: 19 +++ Stats for bytes_small len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 15.57, stddev: 24.36, median 6, min 0, max 99 - 0.. 4: #################################################### 1925 - 5.. 9: ####################################################### 2005 - 10.. 14: # 52 - 15.. 19: # 50 - 20.. 24: # 55 - 25.. 29: # 56 - 30.. 34: # 55 - 35.. 39: # 49 - 40.. 44: # 65 - 45.. 49: # 65 - 50.. 54: # 55 - 55.. 59: # 68 + num: 5000, avg: 16.26, stddev: 24.83, median 6, min 0, max 99 + 0.. 4: #################################################### 1868 + 5.. 9: ####################################################### 1967 + 10.. 14: # 66 + 15.. 19: # 62 + 20.. 24: # 70 + 25.. 29: # 59 + 30.. 34: # 62 + 35.. 39: # 62 + 40.. 44: ## 73 + 45.. 49: # 66 + 50.. 54: # 68 + 55.. 59: # 59 60.. 64: # 61 - 65.. 69: # 65 - 70.. 74: # 57 - 75.. 79: # 66 - 80.. 84: # 65 - 85.. 89: # 64 - 90.. 94: # 60 - 95.. 99: # 62 + 65.. 69: ## 75 + 70.. 74: # 56 + 75.. 79: # 64 + 80.. 84: # 46 + 85.. 89: ## 72 + 90.. 94: # 67 + 95.. 99: ## 77 +++ Stats for string_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 7.49, stddev: 1.70, median 7, min 5, max 10 - 5: ##################################################### 837 - 6: ##################################################### 826 - 7: ###################################################### 843 - 8: ####################################################### 855 - 9: #################################################### 813 - 10: ##################################################### 826 + num: 5000, avg: 7.47, stddev: 1.70, median 7, min 5, max 10 + 5: ##################################################### 848 + 6: #################################################### 829 + 7: ####################################################### 869 + 8: ##################################################### 839 + 9: ################################################# 787 + 10: #################################################### 828 +++ Stats for string len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 384.53, stddev: 1330.61, median 9, min 0, max 9969 - 0.. 498: ####################################################### 4246 - 499.. 997: ###### 518 - 998..1496: 21 - 1497..1995: 10 - 1996..2494: 11 - 2495..2993: 10 - 2994..3492: 13 - 3493..3991: 13 - 3992..4490: 5 - 4491..4989: 10 - 4990..5488: 19 - 5489..5987: 9 - 5988..6486: 10 - 6487..6985: 12 - 6986..7484: 17 - 7485..7983: 16 - 7984..8482: 16 - 8483..8981: 16 - 8982..9480: 16 - 9481..9979: 12 + num: 5000, avg: 381.73, stddev: 1276.71, median 9, min 0, max 9931 + 0.. 496: ####################################################### 4213 + 497.. 993: ###### 526 + 994..1490: 22 + 1491..1987: 14 + 1988..2484: 19 + 2485..2981: 14 + 2982..3478: 19 + 3479..3975: 15 + 3976..4472: 18 + 4473..4969: 14 + 4970..5466: 13 + 5467..5963: 11 + 5964..6460: 14 + 6461..6957: 18 + 6958..7454: 8 + 7455..7951: 15 + 7952..8448: 12 + 8449..8945: 9 + 8946..9442: 7 + 9443..9939: 19 +++ Stats for string_of len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 363.14, stddev: 1245.80, median 9, min 0, max 9986 - 0.. 499: ####################################################### 4270 - 500.. 999: ###### 493 - 1000.. 1499: 16 - 1500.. 1999: 11 - 2000.. 2499: 15 - 2500.. 2999: 17 - 3000.. 3499: 11 - 3500.. 3999: 19 - 4000.. 4499: 14 - 4500.. 4999: 10 - 5000.. 5499: 16 - 5500.. 5999: 11 - 6000.. 6499: 15 - 6500.. 6999: 13 - 7000.. 7499: 12 - 7500.. 7999: 16 - 8000.. 8499: 11 - 8500.. 8999: 4 - 9000.. 9499: 13 - 9500.. 9999: 13 + num: 5000, avg: 381.73, stddev: 1276.71, median 9, min 0, max 9931 + 0.. 496: ####################################################### 4213 + 497.. 993: ###### 526 + 994..1490: 22 + 1491..1987: 14 + 1988..2484: 19 + 2485..2981: 14 + 2982..3478: 19 + 3479..3975: 15 + 3976..4472: 18 + 4473..4969: 14 + 4970..5466: 13 + 5467..5963: 11 + 5964..6460: 14 + 6461..6957: 18 + 6958..7454: 8 + 7455..7951: 15 + 7952..8448: 12 + 8449..8945: 9 + 8946..9442: 7 + 9443..9939: 19 +++ Stats for string_printable len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 384.53, stddev: 1330.61, median 9, min 0, max 9969 - 0.. 498: ####################################################### 4246 - 499.. 997: ###### 518 - 998..1496: 21 - 1497..1995: 10 - 1996..2494: 11 - 2495..2993: 10 - 2994..3492: 13 - 3493..3991: 13 - 3992..4490: 5 - 4491..4989: 10 - 4990..5488: 19 - 5489..5987: 9 - 5988..6486: 10 - 6487..6985: 12 - 6986..7484: 17 - 7485..7983: 16 - 7984..8482: 16 - 8483..8981: 16 - 8982..9480: 16 - 9481..9979: 12 + num: 5000, avg: 381.73, stddev: 1276.71, median 9, min 0, max 9931 + 0.. 496: ####################################################### 4213 + 497.. 993: ###### 526 + 994..1490: 22 + 1491..1987: 14 + 1988..2484: 19 + 2485..2981: 14 + 2982..3478: 19 + 3479..3975: 15 + 3976..4472: 18 + 4473..4969: 14 + 4970..5466: 13 + 5467..5963: 11 + 5964..6460: 14 + 6461..6957: 18 + 6958..7454: 8 + 7455..7951: 15 + 7952..8448: 12 + 8449..8945: 9 + 8946..9442: 7 + 9443..9939: 19 +++ Stats for small_string len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 15.57, stddev: 24.36, median 6, min 0, max 99 - 0.. 4: #################################################### 1925 - 5.. 9: ####################################################### 2005 - 10.. 14: # 52 - 15.. 19: # 50 - 20.. 24: # 55 - 25.. 29: # 56 - 30.. 34: # 55 - 35.. 39: # 49 - 40.. 44: # 65 - 45.. 49: # 65 - 50.. 54: # 55 - 55.. 59: # 68 + num: 5000, avg: 16.26, stddev: 24.83, median 6, min 0, max 99 + 0.. 4: #################################################### 1868 + 5.. 9: ####################################################### 1967 + 10.. 14: # 66 + 15.. 19: # 62 + 20.. 24: # 70 + 25.. 29: # 59 + 30.. 34: # 62 + 35.. 39: # 62 + 40.. 44: ## 73 + 45.. 49: # 66 + 50.. 54: # 68 + 55.. 59: # 59 60.. 64: # 61 - 65.. 69: # 65 - 70.. 74: # 57 - 75.. 79: # 66 - 80.. 84: # 65 - 85.. 89: # 64 - 90.. 94: # 60 - 95.. 99: # 62 + 65.. 69: ## 75 + 70.. 74: # 56 + 75.. 79: # 64 + 80.. 84: # 46 + 85.. 89: ## 72 + 90.. 94: # 67 + 95.. 99: ## 77 +++ Stats for pair dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -1061,8 +1061,8 @@ Some _: 8511 cases Collect results for test result dist: -Error _: 2523 cases -Ok _ : 7477 cases +Error _: 2531 cases +Ok _ : 7469 cases +++ Stats for list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.64 b/test/core/QCheck2_expect_test.expected.ocaml4.64 index 4b245eb8..5e5ee75a 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.64 @@ -341,51 +341,51 @@ Test printable never produces less than '5 failed (1 shrink steps): --- Failure -------------------------------------------------------------------- -Test bytes are empty failed (8 shrink steps): +Test bytes are empty failed (2 shrink steps): "a" --- Failure -------------------------------------------------------------------- -Test bytes never has a \000 char failed (22 shrink steps): +Test bytes never has a \000 char failed (198 shrink steps): -"aaaaaa\000aaaaaaaaaaaaaaaa" +"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\000" --- Failure -------------------------------------------------------------------- -Test bytes never has a \255 char failed (59 shrink steps): +Test bytes never has a \255 char failed (20 shrink steps): -"aaaaaaaaaaaaaaaaaaaaaaaaaa\255aaaaaaaaaaaaaaaaaaaaaaaa" +"aaaaaaaaaaaaaaaaa\255" --- Failure -------------------------------------------------------------------- -Test bytes have unique chars failed (18 shrink steps): +Test bytes have unique chars failed (28 shrink steps): -"aaaaaaaaaaaaa" +"aaaaaaaaaaaaaaaaaaaaaaaaaaa" --- Failure -------------------------------------------------------------------- -Test strings are empty failed (8 shrink steps): +Test strings are empty failed (2 shrink steps): "a" --- Failure -------------------------------------------------------------------- -Test string never has a \000 char failed (22 shrink steps): +Test string never has a \000 char failed (198 shrink steps): -"aaaaaa\000aaaaaaaaaaaaaaaa" +"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\000" --- Failure -------------------------------------------------------------------- -Test string never has a \255 char failed (59 shrink steps): +Test string never has a \255 char failed (20 shrink steps): -"aaaaaaaaaaaaaaaaaaaaaaaaaa\255aaaaaaaaaaaaaaaaaaaaaaaa" +"aaaaaaaaaaaaaaaaa\255" --- Failure -------------------------------------------------------------------- -Test strings have unique chars failed (18 shrink steps): +Test strings have unique chars failed (28 shrink steps): -"aaaaaaaaaaaaa" +"aaaaaaaaaaaaaaaaaaaaaaaaaaa" --- Failure -------------------------------------------------------------------- @@ -593,7 +593,7 @@ None --- Failure -------------------------------------------------------------------- -Test (int,string) result are Ok failed (0 shrink steps): +Test (int,string) result are Ok failed (1 shrink steps): Error ("") @@ -767,224 +767,224 @@ stats depth: +++ Stats for bytes_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 7.49, stddev: 1.70, median 7, min 5, max 10 - 5: ##################################################### 837 - 6: ##################################################### 826 - 7: ###################################################### 843 - 8: ####################################################### 855 - 9: #################################################### 813 - 10: ##################################################### 826 + num: 5000, avg: 7.47, stddev: 1.70, median 7, min 5, max 10 + 5: ##################################################### 848 + 6: #################################################### 829 + 7: ####################################################### 869 + 8: ##################################################### 839 + 9: ################################################# 787 + 10: #################################################### 828 +++ Stats for bytes len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 384.53, stddev: 1330.61, median 9, min 0, max 9969 - 0.. 498: ####################################################### 4246 - 499.. 997: ###### 518 - 998..1496: 21 - 1497..1995: 10 - 1996..2494: 11 - 2495..2993: 10 - 2994..3492: 13 - 3493..3991: 13 - 3992..4490: 5 - 4491..4989: 10 - 4990..5488: 19 - 5489..5987: 9 - 5988..6486: 10 - 6487..6985: 12 - 6986..7484: 17 - 7485..7983: 16 - 7984..8482: 16 - 8483..8981: 16 - 8982..9480: 16 - 9481..9979: 12 + num: 5000, avg: 381.73, stddev: 1276.71, median 9, min 0, max 9931 + 0.. 496: ####################################################### 4213 + 497.. 993: ###### 526 + 994..1490: 22 + 1491..1987: 14 + 1988..2484: 19 + 2485..2981: 14 + 2982..3478: 19 + 3479..3975: 15 + 3976..4472: 18 + 4473..4969: 14 + 4970..5466: 13 + 5467..5963: 11 + 5964..6460: 14 + 6461..6957: 18 + 6958..7454: 8 + 7455..7951: 15 + 7952..8448: 12 + 8449..8945: 9 + 8946..9442: 7 + 9443..9939: 19 +++ Stats for bytes_of len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 363.14, stddev: 1245.80, median 9, min 0, max 9986 - 0.. 499: ####################################################### 4270 - 500.. 999: ###### 493 - 1000.. 1499: 16 - 1500.. 1999: 11 - 2000.. 2499: 15 - 2500.. 2999: 17 - 3000.. 3499: 11 - 3500.. 3999: 19 - 4000.. 4499: 14 - 4500.. 4999: 10 - 5000.. 5499: 16 - 5500.. 5999: 11 - 6000.. 6499: 15 - 6500.. 6999: 13 - 7000.. 7499: 12 - 7500.. 7999: 16 - 8000.. 8499: 11 - 8500.. 8999: 4 - 9000.. 9499: 13 - 9500.. 9999: 13 + num: 5000, avg: 381.73, stddev: 1276.71, median 9, min 0, max 9931 + 0.. 496: ####################################################### 4213 + 497.. 993: ###### 526 + 994..1490: 22 + 1491..1987: 14 + 1988..2484: 19 + 2485..2981: 14 + 2982..3478: 19 + 3479..3975: 15 + 3976..4472: 18 + 4473..4969: 14 + 4970..5466: 13 + 5467..5963: 11 + 5964..6460: 14 + 6461..6957: 18 + 6958..7454: 8 + 7455..7951: 15 + 7952..8448: 12 + 8449..8945: 9 + 8946..9442: 7 + 9443..9939: 19 +++ Stats for bytes_printable len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 384.53, stddev: 1330.61, median 9, min 0, max 9969 - 0.. 498: ####################################################### 4246 - 499.. 997: ###### 518 - 998..1496: 21 - 1497..1995: 10 - 1996..2494: 11 - 2495..2993: 10 - 2994..3492: 13 - 3493..3991: 13 - 3992..4490: 5 - 4491..4989: 10 - 4990..5488: 19 - 5489..5987: 9 - 5988..6486: 10 - 6487..6985: 12 - 6986..7484: 17 - 7485..7983: 16 - 7984..8482: 16 - 8483..8981: 16 - 8982..9480: 16 - 9481..9979: 12 + num: 5000, avg: 381.73, stddev: 1276.71, median 9, min 0, max 9931 + 0.. 496: ####################################################### 4213 + 497.. 993: ###### 526 + 994..1490: 22 + 1491..1987: 14 + 1988..2484: 19 + 2485..2981: 14 + 2982..3478: 19 + 3479..3975: 15 + 3976..4472: 18 + 4473..4969: 14 + 4970..5466: 13 + 5467..5963: 11 + 5964..6460: 14 + 6461..6957: 18 + 6958..7454: 8 + 7455..7951: 15 + 7952..8448: 12 + 8449..8945: 9 + 8946..9442: 7 + 9443..9939: 19 +++ Stats for bytes_small len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 15.57, stddev: 24.36, median 6, min 0, max 99 - 0.. 4: #################################################### 1925 - 5.. 9: ####################################################### 2005 - 10.. 14: # 52 - 15.. 19: # 50 - 20.. 24: # 55 - 25.. 29: # 56 - 30.. 34: # 55 - 35.. 39: # 49 - 40.. 44: # 65 - 45.. 49: # 65 - 50.. 54: # 55 - 55.. 59: # 68 + num: 5000, avg: 16.26, stddev: 24.83, median 6, min 0, max 99 + 0.. 4: #################################################### 1868 + 5.. 9: ####################################################### 1967 + 10.. 14: # 66 + 15.. 19: # 62 + 20.. 24: # 70 + 25.. 29: # 59 + 30.. 34: # 62 + 35.. 39: # 62 + 40.. 44: ## 73 + 45.. 49: # 66 + 50.. 54: # 68 + 55.. 59: # 59 60.. 64: # 61 - 65.. 69: # 65 - 70.. 74: # 57 - 75.. 79: # 66 - 80.. 84: # 65 - 85.. 89: # 64 - 90.. 94: # 60 - 95.. 99: # 62 + 65.. 69: ## 75 + 70.. 74: # 56 + 75.. 79: # 64 + 80.. 84: # 46 + 85.. 89: ## 72 + 90.. 94: # 67 + 95.. 99: ## 77 +++ Stats for string_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 7.49, stddev: 1.70, median 7, min 5, max 10 - 5: ##################################################### 837 - 6: ##################################################### 826 - 7: ###################################################### 843 - 8: ####################################################### 855 - 9: #################################################### 813 - 10: ##################################################### 826 + num: 5000, avg: 7.47, stddev: 1.70, median 7, min 5, max 10 + 5: ##################################################### 848 + 6: #################################################### 829 + 7: ####################################################### 869 + 8: ##################################################### 839 + 9: ################################################# 787 + 10: #################################################### 828 +++ Stats for string len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 384.53, stddev: 1330.61, median 9, min 0, max 9969 - 0.. 498: ####################################################### 4246 - 499.. 997: ###### 518 - 998..1496: 21 - 1497..1995: 10 - 1996..2494: 11 - 2495..2993: 10 - 2994..3492: 13 - 3493..3991: 13 - 3992..4490: 5 - 4491..4989: 10 - 4990..5488: 19 - 5489..5987: 9 - 5988..6486: 10 - 6487..6985: 12 - 6986..7484: 17 - 7485..7983: 16 - 7984..8482: 16 - 8483..8981: 16 - 8982..9480: 16 - 9481..9979: 12 + num: 5000, avg: 381.73, stddev: 1276.71, median 9, min 0, max 9931 + 0.. 496: ####################################################### 4213 + 497.. 993: ###### 526 + 994..1490: 22 + 1491..1987: 14 + 1988..2484: 19 + 2485..2981: 14 + 2982..3478: 19 + 3479..3975: 15 + 3976..4472: 18 + 4473..4969: 14 + 4970..5466: 13 + 5467..5963: 11 + 5964..6460: 14 + 6461..6957: 18 + 6958..7454: 8 + 7455..7951: 15 + 7952..8448: 12 + 8449..8945: 9 + 8946..9442: 7 + 9443..9939: 19 +++ Stats for string_of len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 363.14, stddev: 1245.80, median 9, min 0, max 9986 - 0.. 499: ####################################################### 4270 - 500.. 999: ###### 493 - 1000.. 1499: 16 - 1500.. 1999: 11 - 2000.. 2499: 15 - 2500.. 2999: 17 - 3000.. 3499: 11 - 3500.. 3999: 19 - 4000.. 4499: 14 - 4500.. 4999: 10 - 5000.. 5499: 16 - 5500.. 5999: 11 - 6000.. 6499: 15 - 6500.. 6999: 13 - 7000.. 7499: 12 - 7500.. 7999: 16 - 8000.. 8499: 11 - 8500.. 8999: 4 - 9000.. 9499: 13 - 9500.. 9999: 13 + num: 5000, avg: 381.73, stddev: 1276.71, median 9, min 0, max 9931 + 0.. 496: ####################################################### 4213 + 497.. 993: ###### 526 + 994..1490: 22 + 1491..1987: 14 + 1988..2484: 19 + 2485..2981: 14 + 2982..3478: 19 + 3479..3975: 15 + 3976..4472: 18 + 4473..4969: 14 + 4970..5466: 13 + 5467..5963: 11 + 5964..6460: 14 + 6461..6957: 18 + 6958..7454: 8 + 7455..7951: 15 + 7952..8448: 12 + 8449..8945: 9 + 8946..9442: 7 + 9443..9939: 19 +++ Stats for string_printable len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 384.53, stddev: 1330.61, median 9, min 0, max 9969 - 0.. 498: ####################################################### 4246 - 499.. 997: ###### 518 - 998..1496: 21 - 1497..1995: 10 - 1996..2494: 11 - 2495..2993: 10 - 2994..3492: 13 - 3493..3991: 13 - 3992..4490: 5 - 4491..4989: 10 - 4990..5488: 19 - 5489..5987: 9 - 5988..6486: 10 - 6487..6985: 12 - 6986..7484: 17 - 7485..7983: 16 - 7984..8482: 16 - 8483..8981: 16 - 8982..9480: 16 - 9481..9979: 12 + num: 5000, avg: 381.73, stddev: 1276.71, median 9, min 0, max 9931 + 0.. 496: ####################################################### 4213 + 497.. 993: ###### 526 + 994..1490: 22 + 1491..1987: 14 + 1988..2484: 19 + 2485..2981: 14 + 2982..3478: 19 + 3479..3975: 15 + 3976..4472: 18 + 4473..4969: 14 + 4970..5466: 13 + 5467..5963: 11 + 5964..6460: 14 + 6461..6957: 18 + 6958..7454: 8 + 7455..7951: 15 + 7952..8448: 12 + 8449..8945: 9 + 8946..9442: 7 + 9443..9939: 19 +++ Stats for small_string len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 15.57, stddev: 24.36, median 6, min 0, max 99 - 0.. 4: #################################################### 1925 - 5.. 9: ####################################################### 2005 - 10.. 14: # 52 - 15.. 19: # 50 - 20.. 24: # 55 - 25.. 29: # 56 - 30.. 34: # 55 - 35.. 39: # 49 - 40.. 44: # 65 - 45.. 49: # 65 - 50.. 54: # 55 - 55.. 59: # 68 + num: 5000, avg: 16.26, stddev: 24.83, median 6, min 0, max 99 + 0.. 4: #################################################### 1868 + 5.. 9: ####################################################### 1967 + 10.. 14: # 66 + 15.. 19: # 62 + 20.. 24: # 70 + 25.. 29: # 59 + 30.. 34: # 62 + 35.. 39: # 62 + 40.. 44: ## 73 + 45.. 49: # 66 + 50.. 54: # 68 + 55.. 59: # 59 60.. 64: # 61 - 65.. 69: # 65 - 70.. 74: # 57 - 75.. 79: # 66 - 80.. 84: # 65 - 85.. 89: # 64 - 90.. 94: # 60 - 95.. 99: # 62 + 65.. 69: ## 75 + 70.. 74: # 56 + 75.. 79: # 64 + 80.. 84: # 46 + 85.. 89: ## 72 + 90.. 94: # 67 + 95.. 99: ## 77 +++ Stats for pair dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -1123,8 +1123,8 @@ Some _: 8511 cases Collect results for test result dist: -Error _: 2523 cases -Ok _ : 7477 cases +Error _: 2531 cases +Ok _ : 7469 cases +++ Stats for list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.32 b/test/core/QCheck2_expect_test.expected.ocaml5.32 index 18bd2ce1..9b559669 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.32 @@ -285,51 +285,51 @@ Test printable never produces less than '5 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test bytes are empty failed (9 shrink steps): +Test bytes are empty failed (3 shrink steps): "a" --- Failure -------------------------------------------------------------------- -Test bytes never has a \000 char failed (55 shrink steps): +Test bytes never has a \000 char failed (19 shrink steps): -"aaaaaaaaaaaaaaa\000aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +"aaaaaaaaaaaaaaa\000" --- Failure -------------------------------------------------------------------- -Test bytes never has a \255 char failed (75 shrink steps): +Test bytes never has a \255 char failed (27 shrink steps): -"aaaaaaa\255aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +"aaaaaaaaaaaaaaaaaaaaaaaaa\255" --- Failure -------------------------------------------------------------------- -Test bytes have unique chars failed (14 shrink steps): +Test bytes have unique chars failed (32 shrink steps): -"aaaaaaa" +"aaaaaaaaaaaaaaaaaaaaaaaaaaaa" --- Failure -------------------------------------------------------------------- -Test strings are empty failed (9 shrink steps): +Test strings are empty failed (3 shrink steps): "a" --- Failure -------------------------------------------------------------------- -Test string never has a \000 char failed (55 shrink steps): +Test string never has a \000 char failed (19 shrink steps): -"aaaaaaaaaaaaaaa\000aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +"aaaaaaaaaaaaaaa\000" --- Failure -------------------------------------------------------------------- -Test string never has a \255 char failed (75 shrink steps): +Test string never has a \255 char failed (27 shrink steps): -"aaaaaaa\255aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +"aaaaaaaaaaaaaaaaaaaaaaaaa\255" --- Failure -------------------------------------------------------------------- -Test strings have unique chars failed (14 shrink steps): +Test strings have unique chars failed (32 shrink steps): -"aaaaaaa" +"aaaaaaaaaaaaaaaaaaaaaaaaaaaa" --- Failure -------------------------------------------------------------------- @@ -711,224 +711,224 @@ stats depth: +++ Stats for bytes_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 7.51, stddev: 1.69, median 8, min 5, max 10 - 5: ################################################## 817 - 6: ################################################# 797 - 7: ####################################################### 885 - 8: ################################################### 834 - 9: ###################################################### 877 - 10: ################################################# 790 + num: 5000, avg: 7.52, stddev: 1.71, median 7, min 5, max 10 + 5: ################################################# 799 + 6: #################################################### 846 + 7: ###################################################### 874 + 8: ################################################### 824 + 9: ################################################ 774 + 10: ####################################################### 883 +++ Stats for bytes len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 370.05, stddev: 1282.91, median 9, min 0, max 9947 - 0.. 497: ####################################################### 4270 - 498.. 995: ###### 497 - 996..1493: 17 - 1494..1991: 9 - 1992..2489: 13 - 2490..2987: 13 - 2988..3485: 9 - 3486..3983: 14 - 3984..4481: 14 - 4482..4979: 17 - 4980..5477: 9 - 5478..5975: 10 - 5976..6473: 15 - 6474..6971: 16 - 6972..7469: 16 - 7470..7967: 9 - 7968..8465: 12 - 8466..8963: 15 - 8964..9461: 9 - 9462..9959: 16 + num: 5000, avg: 373.39, stddev: 1294.83, median 9, min 0, max 9936 + 0.. 496: ####################################################### 4268 + 497.. 993: ###### 482 + 994..1490: 26 + 1491..1987: 14 + 1988..2484: 11 + 2485..2981: 12 + 2982..3478: 17 + 3479..3975: 16 + 3976..4472: 11 + 4473..4969: 7 + 4970..5466: 14 + 5467..5963: 10 + 5964..6460: 19 + 6461..6957: 17 + 6958..7454: 9 + 7455..7951: 12 + 7952..8448: 19 + 8449..8945: 7 + 8946..9442: 14 + 9443..9939: 15 +++ Stats for bytes_of len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 359.22, stddev: 1249.46, median 9, min 0, max 9958 - 0.. 497: ####################################################### 4275 - 498.. 995: ###### 479 - 996..1493: 22 - 1494..1991: 12 - 1992..2489: 21 - 2490..2987: 16 - 2988..3485: 13 - 3486..3983: 17 - 3984..4481: 14 - 4482..4979: 14 - 4980..5477: 8 - 5478..5975: 14 - 5976..6473: 13 - 6474..6971: 9 - 6972..7469: 7 - 7470..7967: 17 - 7968..8465: 13 - 8466..8963: 15 - 8964..9461: 10 - 9462..9959: 11 + num: 5000, avg: 373.39, stddev: 1294.83, median 9, min 0, max 9936 + 0.. 496: ####################################################### 4268 + 497.. 993: ###### 482 + 994..1490: 26 + 1491..1987: 14 + 1988..2484: 11 + 2485..2981: 12 + 2982..3478: 17 + 3479..3975: 16 + 3976..4472: 11 + 4473..4969: 7 + 4970..5466: 14 + 5467..5963: 10 + 5964..6460: 19 + 6461..6957: 17 + 6958..7454: 9 + 7455..7951: 12 + 7952..8448: 19 + 8449..8945: 7 + 8946..9442: 14 + 9443..9939: 15 +++ Stats for bytes_printable len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 370.05, stddev: 1282.91, median 9, min 0, max 9947 - 0.. 497: ####################################################### 4270 - 498.. 995: ###### 497 - 996..1493: 17 - 1494..1991: 9 - 1992..2489: 13 - 2490..2987: 13 - 2988..3485: 9 - 3486..3983: 14 - 3984..4481: 14 - 4482..4979: 17 - 4980..5477: 9 - 5478..5975: 10 - 5976..6473: 15 - 6474..6971: 16 - 6972..7469: 16 - 7470..7967: 9 - 7968..8465: 12 - 8466..8963: 15 - 8964..9461: 9 - 9462..9959: 16 + num: 5000, avg: 373.39, stddev: 1294.83, median 9, min 0, max 9936 + 0.. 496: ####################################################### 4268 + 497.. 993: ###### 482 + 994..1490: 26 + 1491..1987: 14 + 1988..2484: 11 + 2485..2981: 12 + 2982..3478: 17 + 3479..3975: 16 + 3976..4472: 11 + 4473..4969: 7 + 4970..5466: 14 + 5467..5963: 10 + 5964..6460: 19 + 6461..6957: 17 + 6958..7454: 9 + 7455..7951: 12 + 7952..8448: 19 + 8449..8945: 7 + 8946..9442: 14 + 9443..9939: 15 +++ Stats for bytes_small len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 15.99, stddev: 24.58, median 6, min 0, max 99 - 0.. 4: ###################################################### 1920 - 5.. 9: ####################################################### 1929 - 10.. 14: # 69 - 15.. 19: # 62 - 20.. 24: # 63 + num: 5000, avg: 15.50, stddev: 24.07, median 6, min 0, max 99 + 0.. 4: ##################################################### 1927 + 5.. 9: ####################################################### 1974 + 10.. 14: # 58 + 15.. 19: # 55 + 20.. 24: # 59 25.. 29: # 59 - 30.. 34: # 68 - 35.. 39: # 62 - 40.. 44: # 57 - 45.. 49: ## 83 - 50.. 54: # 59 - 55.. 59: ## 80 - 60.. 64: # 48 - 65.. 69: # 53 - 70.. 74: # 61 - 75.. 79: # 66 - 80.. 84: # 61 - 85.. 89: ## 72 - 90.. 94: # 66 - 95.. 99: # 62 + 30.. 34: # 61 + 35.. 39: # 58 + 40.. 44: # 70 + 45.. 49: # 65 + 50.. 54: # 61 + 55.. 59: # 62 + 60.. 64: # 54 + 65.. 69: ## 81 + 70.. 74: # 62 + 75.. 79: # 58 + 80.. 84: # 67 + 85.. 89: # 55 + 90.. 94: # 59 + 95.. 99: # 55 +++ Stats for string_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 7.51, stddev: 1.69, median 8, min 5, max 10 - 5: ################################################## 817 - 6: ################################################# 797 - 7: ####################################################### 885 - 8: ################################################### 834 - 9: ###################################################### 877 - 10: ################################################# 790 + num: 5000, avg: 7.52, stddev: 1.71, median 7, min 5, max 10 + 5: ################################################# 799 + 6: #################################################### 846 + 7: ###################################################### 874 + 8: ################################################### 824 + 9: ################################################ 774 + 10: ####################################################### 883 +++ Stats for string len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 370.05, stddev: 1282.91, median 9, min 0, max 9947 - 0.. 497: ####################################################### 4270 - 498.. 995: ###### 497 - 996..1493: 17 - 1494..1991: 9 - 1992..2489: 13 - 2490..2987: 13 - 2988..3485: 9 - 3486..3983: 14 - 3984..4481: 14 - 4482..4979: 17 - 4980..5477: 9 - 5478..5975: 10 - 5976..6473: 15 - 6474..6971: 16 - 6972..7469: 16 - 7470..7967: 9 - 7968..8465: 12 - 8466..8963: 15 - 8964..9461: 9 - 9462..9959: 16 + num: 5000, avg: 373.39, stddev: 1294.83, median 9, min 0, max 9936 + 0.. 496: ####################################################### 4268 + 497.. 993: ###### 482 + 994..1490: 26 + 1491..1987: 14 + 1988..2484: 11 + 2485..2981: 12 + 2982..3478: 17 + 3479..3975: 16 + 3976..4472: 11 + 4473..4969: 7 + 4970..5466: 14 + 5467..5963: 10 + 5964..6460: 19 + 6461..6957: 17 + 6958..7454: 9 + 7455..7951: 12 + 7952..8448: 19 + 8449..8945: 7 + 8946..9442: 14 + 9443..9939: 15 +++ Stats for string_of len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 359.22, stddev: 1249.46, median 9, min 0, max 9958 - 0.. 497: ####################################################### 4275 - 498.. 995: ###### 479 - 996..1493: 22 - 1494..1991: 12 - 1992..2489: 21 - 2490..2987: 16 - 2988..3485: 13 - 3486..3983: 17 - 3984..4481: 14 - 4482..4979: 14 - 4980..5477: 8 - 5478..5975: 14 - 5976..6473: 13 - 6474..6971: 9 - 6972..7469: 7 - 7470..7967: 17 - 7968..8465: 13 - 8466..8963: 15 - 8964..9461: 10 - 9462..9959: 11 + num: 5000, avg: 373.39, stddev: 1294.83, median 9, min 0, max 9936 + 0.. 496: ####################################################### 4268 + 497.. 993: ###### 482 + 994..1490: 26 + 1491..1987: 14 + 1988..2484: 11 + 2485..2981: 12 + 2982..3478: 17 + 3479..3975: 16 + 3976..4472: 11 + 4473..4969: 7 + 4970..5466: 14 + 5467..5963: 10 + 5964..6460: 19 + 6461..6957: 17 + 6958..7454: 9 + 7455..7951: 12 + 7952..8448: 19 + 8449..8945: 7 + 8946..9442: 14 + 9443..9939: 15 +++ Stats for string_printable len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 370.05, stddev: 1282.91, median 9, min 0, max 9947 - 0.. 497: ####################################################### 4270 - 498.. 995: ###### 497 - 996..1493: 17 - 1494..1991: 9 - 1992..2489: 13 - 2490..2987: 13 - 2988..3485: 9 - 3486..3983: 14 - 3984..4481: 14 - 4482..4979: 17 - 4980..5477: 9 - 5478..5975: 10 - 5976..6473: 15 - 6474..6971: 16 - 6972..7469: 16 - 7470..7967: 9 - 7968..8465: 12 - 8466..8963: 15 - 8964..9461: 9 - 9462..9959: 16 + num: 5000, avg: 373.39, stddev: 1294.83, median 9, min 0, max 9936 + 0.. 496: ####################################################### 4268 + 497.. 993: ###### 482 + 994..1490: 26 + 1491..1987: 14 + 1988..2484: 11 + 2485..2981: 12 + 2982..3478: 17 + 3479..3975: 16 + 3976..4472: 11 + 4473..4969: 7 + 4970..5466: 14 + 5467..5963: 10 + 5964..6460: 19 + 6461..6957: 17 + 6958..7454: 9 + 7455..7951: 12 + 7952..8448: 19 + 8449..8945: 7 + 8946..9442: 14 + 9443..9939: 15 +++ Stats for small_string len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 15.99, stddev: 24.58, median 6, min 0, max 99 - 0.. 4: ###################################################### 1920 - 5.. 9: ####################################################### 1929 - 10.. 14: # 69 - 15.. 19: # 62 - 20.. 24: # 63 + num: 5000, avg: 15.50, stddev: 24.07, median 6, min 0, max 99 + 0.. 4: ##################################################### 1927 + 5.. 9: ####################################################### 1974 + 10.. 14: # 58 + 15.. 19: # 55 + 20.. 24: # 59 25.. 29: # 59 - 30.. 34: # 68 - 35.. 39: # 62 - 40.. 44: # 57 - 45.. 49: ## 83 - 50.. 54: # 59 - 55.. 59: ## 80 - 60.. 64: # 48 - 65.. 69: # 53 - 70.. 74: # 61 - 75.. 79: # 66 - 80.. 84: # 61 - 85.. 89: ## 72 - 90.. 94: # 66 - 95.. 99: # 62 + 30.. 34: # 61 + 35.. 39: # 58 + 40.. 44: # 70 + 45.. 49: # 65 + 50.. 54: # 61 + 55.. 59: # 62 + 60.. 64: # 54 + 65.. 69: ## 81 + 70.. 74: # 62 + 75.. 79: # 58 + 80.. 84: # 67 + 85.. 89: # 55 + 90.. 94: # 59 + 95.. 99: # 55 +++ Stats for pair dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -1067,8 +1067,8 @@ Some _: 8519 cases Collect results for test result dist: -Error _: 2469 cases -Ok _ : 7531 cases +Error _: 2475 cases +Ok _ : 7525 cases +++ Stats for list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.64 b/test/core/QCheck2_expect_test.expected.ocaml5.64 index 8f2de4fc..c33b2364 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.64 @@ -347,51 +347,51 @@ Test printable never produces less than '5 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test bytes are empty failed (9 shrink steps): +Test bytes are empty failed (3 shrink steps): "a" --- Failure -------------------------------------------------------------------- -Test bytes never has a \000 char failed (55 shrink steps): +Test bytes never has a \000 char failed (19 shrink steps): -"aaaaaaaaaaaaaaa\000aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +"aaaaaaaaaaaaaaa\000" --- Failure -------------------------------------------------------------------- -Test bytes never has a \255 char failed (75 shrink steps): +Test bytes never has a \255 char failed (27 shrink steps): -"aaaaaaa\255aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +"aaaaaaaaaaaaaaaaaaaaaaaaa\255" --- Failure -------------------------------------------------------------------- -Test bytes have unique chars failed (14 shrink steps): +Test bytes have unique chars failed (32 shrink steps): -"aaaaaaa" +"aaaaaaaaaaaaaaaaaaaaaaaaaaaa" --- Failure -------------------------------------------------------------------- -Test strings are empty failed (9 shrink steps): +Test strings are empty failed (3 shrink steps): "a" --- Failure -------------------------------------------------------------------- -Test string never has a \000 char failed (55 shrink steps): +Test string never has a \000 char failed (19 shrink steps): -"aaaaaaaaaaaaaaa\000aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +"aaaaaaaaaaaaaaa\000" --- Failure -------------------------------------------------------------------- -Test string never has a \255 char failed (75 shrink steps): +Test string never has a \255 char failed (27 shrink steps): -"aaaaaaa\255aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +"aaaaaaaaaaaaaaaaaaaaaaaaa\255" --- Failure -------------------------------------------------------------------- -Test strings have unique chars failed (14 shrink steps): +Test strings have unique chars failed (32 shrink steps): -"aaaaaaa" +"aaaaaaaaaaaaaaaaaaaaaaaaaaaa" --- Failure -------------------------------------------------------------------- @@ -773,224 +773,224 @@ stats depth: +++ Stats for bytes_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 7.51, stddev: 1.69, median 8, min 5, max 10 - 5: ################################################## 817 - 6: ################################################# 797 - 7: ####################################################### 885 - 8: ################################################### 834 - 9: ###################################################### 877 - 10: ################################################# 790 + num: 5000, avg: 7.52, stddev: 1.71, median 7, min 5, max 10 + 5: ################################################# 799 + 6: #################################################### 846 + 7: ###################################################### 874 + 8: ################################################### 824 + 9: ################################################ 774 + 10: ####################################################### 883 +++ Stats for bytes len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 370.05, stddev: 1282.91, median 9, min 0, max 9947 - 0.. 497: ####################################################### 4270 - 498.. 995: ###### 497 - 996..1493: 17 - 1494..1991: 9 - 1992..2489: 13 - 2490..2987: 13 - 2988..3485: 9 - 3486..3983: 14 - 3984..4481: 14 - 4482..4979: 17 - 4980..5477: 9 - 5478..5975: 10 - 5976..6473: 15 - 6474..6971: 16 - 6972..7469: 16 - 7470..7967: 9 - 7968..8465: 12 - 8466..8963: 15 - 8964..9461: 9 - 9462..9959: 16 + num: 5000, avg: 373.39, stddev: 1294.83, median 9, min 0, max 9936 + 0.. 496: ####################################################### 4268 + 497.. 993: ###### 482 + 994..1490: 26 + 1491..1987: 14 + 1988..2484: 11 + 2485..2981: 12 + 2982..3478: 17 + 3479..3975: 16 + 3976..4472: 11 + 4473..4969: 7 + 4970..5466: 14 + 5467..5963: 10 + 5964..6460: 19 + 6461..6957: 17 + 6958..7454: 9 + 7455..7951: 12 + 7952..8448: 19 + 8449..8945: 7 + 8946..9442: 14 + 9443..9939: 15 +++ Stats for bytes_of len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 359.22, stddev: 1249.46, median 9, min 0, max 9958 - 0.. 497: ####################################################### 4275 - 498.. 995: ###### 479 - 996..1493: 22 - 1494..1991: 12 - 1992..2489: 21 - 2490..2987: 16 - 2988..3485: 13 - 3486..3983: 17 - 3984..4481: 14 - 4482..4979: 14 - 4980..5477: 8 - 5478..5975: 14 - 5976..6473: 13 - 6474..6971: 9 - 6972..7469: 7 - 7470..7967: 17 - 7968..8465: 13 - 8466..8963: 15 - 8964..9461: 10 - 9462..9959: 11 + num: 5000, avg: 373.39, stddev: 1294.83, median 9, min 0, max 9936 + 0.. 496: ####################################################### 4268 + 497.. 993: ###### 482 + 994..1490: 26 + 1491..1987: 14 + 1988..2484: 11 + 2485..2981: 12 + 2982..3478: 17 + 3479..3975: 16 + 3976..4472: 11 + 4473..4969: 7 + 4970..5466: 14 + 5467..5963: 10 + 5964..6460: 19 + 6461..6957: 17 + 6958..7454: 9 + 7455..7951: 12 + 7952..8448: 19 + 8449..8945: 7 + 8946..9442: 14 + 9443..9939: 15 +++ Stats for bytes_printable len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 370.05, stddev: 1282.91, median 9, min 0, max 9947 - 0.. 497: ####################################################### 4270 - 498.. 995: ###### 497 - 996..1493: 17 - 1494..1991: 9 - 1992..2489: 13 - 2490..2987: 13 - 2988..3485: 9 - 3486..3983: 14 - 3984..4481: 14 - 4482..4979: 17 - 4980..5477: 9 - 5478..5975: 10 - 5976..6473: 15 - 6474..6971: 16 - 6972..7469: 16 - 7470..7967: 9 - 7968..8465: 12 - 8466..8963: 15 - 8964..9461: 9 - 9462..9959: 16 + num: 5000, avg: 373.39, stddev: 1294.83, median 9, min 0, max 9936 + 0.. 496: ####################################################### 4268 + 497.. 993: ###### 482 + 994..1490: 26 + 1491..1987: 14 + 1988..2484: 11 + 2485..2981: 12 + 2982..3478: 17 + 3479..3975: 16 + 3976..4472: 11 + 4473..4969: 7 + 4970..5466: 14 + 5467..5963: 10 + 5964..6460: 19 + 6461..6957: 17 + 6958..7454: 9 + 7455..7951: 12 + 7952..8448: 19 + 8449..8945: 7 + 8946..9442: 14 + 9443..9939: 15 +++ Stats for bytes_small len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 15.99, stddev: 24.58, median 6, min 0, max 99 - 0.. 4: ###################################################### 1920 - 5.. 9: ####################################################### 1929 - 10.. 14: # 69 - 15.. 19: # 62 - 20.. 24: # 63 + num: 5000, avg: 15.50, stddev: 24.07, median 6, min 0, max 99 + 0.. 4: ##################################################### 1927 + 5.. 9: ####################################################### 1974 + 10.. 14: # 58 + 15.. 19: # 55 + 20.. 24: # 59 25.. 29: # 59 - 30.. 34: # 68 - 35.. 39: # 62 - 40.. 44: # 57 - 45.. 49: ## 83 - 50.. 54: # 59 - 55.. 59: ## 80 - 60.. 64: # 48 - 65.. 69: # 53 - 70.. 74: # 61 - 75.. 79: # 66 - 80.. 84: # 61 - 85.. 89: ## 72 - 90.. 94: # 66 - 95.. 99: # 62 + 30.. 34: # 61 + 35.. 39: # 58 + 40.. 44: # 70 + 45.. 49: # 65 + 50.. 54: # 61 + 55.. 59: # 62 + 60.. 64: # 54 + 65.. 69: ## 81 + 70.. 74: # 62 + 75.. 79: # 58 + 80.. 84: # 67 + 85.. 89: # 55 + 90.. 94: # 59 + 95.. 99: # 55 +++ Stats for string_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 7.51, stddev: 1.69, median 8, min 5, max 10 - 5: ################################################## 817 - 6: ################################################# 797 - 7: ####################################################### 885 - 8: ################################################### 834 - 9: ###################################################### 877 - 10: ################################################# 790 + num: 5000, avg: 7.52, stddev: 1.71, median 7, min 5, max 10 + 5: ################################################# 799 + 6: #################################################### 846 + 7: ###################################################### 874 + 8: ################################################### 824 + 9: ################################################ 774 + 10: ####################################################### 883 +++ Stats for string len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 370.05, stddev: 1282.91, median 9, min 0, max 9947 - 0.. 497: ####################################################### 4270 - 498.. 995: ###### 497 - 996..1493: 17 - 1494..1991: 9 - 1992..2489: 13 - 2490..2987: 13 - 2988..3485: 9 - 3486..3983: 14 - 3984..4481: 14 - 4482..4979: 17 - 4980..5477: 9 - 5478..5975: 10 - 5976..6473: 15 - 6474..6971: 16 - 6972..7469: 16 - 7470..7967: 9 - 7968..8465: 12 - 8466..8963: 15 - 8964..9461: 9 - 9462..9959: 16 + num: 5000, avg: 373.39, stddev: 1294.83, median 9, min 0, max 9936 + 0.. 496: ####################################################### 4268 + 497.. 993: ###### 482 + 994..1490: 26 + 1491..1987: 14 + 1988..2484: 11 + 2485..2981: 12 + 2982..3478: 17 + 3479..3975: 16 + 3976..4472: 11 + 4473..4969: 7 + 4970..5466: 14 + 5467..5963: 10 + 5964..6460: 19 + 6461..6957: 17 + 6958..7454: 9 + 7455..7951: 12 + 7952..8448: 19 + 8449..8945: 7 + 8946..9442: 14 + 9443..9939: 15 +++ Stats for string_of len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 359.22, stddev: 1249.46, median 9, min 0, max 9958 - 0.. 497: ####################################################### 4275 - 498.. 995: ###### 479 - 996..1493: 22 - 1494..1991: 12 - 1992..2489: 21 - 2490..2987: 16 - 2988..3485: 13 - 3486..3983: 17 - 3984..4481: 14 - 4482..4979: 14 - 4980..5477: 8 - 5478..5975: 14 - 5976..6473: 13 - 6474..6971: 9 - 6972..7469: 7 - 7470..7967: 17 - 7968..8465: 13 - 8466..8963: 15 - 8964..9461: 10 - 9462..9959: 11 + num: 5000, avg: 373.39, stddev: 1294.83, median 9, min 0, max 9936 + 0.. 496: ####################################################### 4268 + 497.. 993: ###### 482 + 994..1490: 26 + 1491..1987: 14 + 1988..2484: 11 + 2485..2981: 12 + 2982..3478: 17 + 3479..3975: 16 + 3976..4472: 11 + 4473..4969: 7 + 4970..5466: 14 + 5467..5963: 10 + 5964..6460: 19 + 6461..6957: 17 + 6958..7454: 9 + 7455..7951: 12 + 7952..8448: 19 + 8449..8945: 7 + 8946..9442: 14 + 9443..9939: 15 +++ Stats for string_printable len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 370.05, stddev: 1282.91, median 9, min 0, max 9947 - 0.. 497: ####################################################### 4270 - 498.. 995: ###### 497 - 996..1493: 17 - 1494..1991: 9 - 1992..2489: 13 - 2490..2987: 13 - 2988..3485: 9 - 3486..3983: 14 - 3984..4481: 14 - 4482..4979: 17 - 4980..5477: 9 - 5478..5975: 10 - 5976..6473: 15 - 6474..6971: 16 - 6972..7469: 16 - 7470..7967: 9 - 7968..8465: 12 - 8466..8963: 15 - 8964..9461: 9 - 9462..9959: 16 + num: 5000, avg: 373.39, stddev: 1294.83, median 9, min 0, max 9936 + 0.. 496: ####################################################### 4268 + 497.. 993: ###### 482 + 994..1490: 26 + 1491..1987: 14 + 1988..2484: 11 + 2485..2981: 12 + 2982..3478: 17 + 3479..3975: 16 + 3976..4472: 11 + 4473..4969: 7 + 4970..5466: 14 + 5467..5963: 10 + 5964..6460: 19 + 6461..6957: 17 + 6958..7454: 9 + 7455..7951: 12 + 7952..8448: 19 + 8449..8945: 7 + 8946..9442: 14 + 9443..9939: 15 +++ Stats for small_string len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 15.99, stddev: 24.58, median 6, min 0, max 99 - 0.. 4: ###################################################### 1920 - 5.. 9: ####################################################### 1929 - 10.. 14: # 69 - 15.. 19: # 62 - 20.. 24: # 63 + num: 5000, avg: 15.50, stddev: 24.07, median 6, min 0, max 99 + 0.. 4: ##################################################### 1927 + 5.. 9: ####################################################### 1974 + 10.. 14: # 58 + 15.. 19: # 55 + 20.. 24: # 59 25.. 29: # 59 - 30.. 34: # 68 - 35.. 39: # 62 - 40.. 44: # 57 - 45.. 49: ## 83 - 50.. 54: # 59 - 55.. 59: ## 80 - 60.. 64: # 48 - 65.. 69: # 53 - 70.. 74: # 61 - 75.. 79: # 66 - 80.. 84: # 61 - 85.. 89: ## 72 - 90.. 94: # 66 - 95.. 99: # 62 + 30.. 34: # 61 + 35.. 39: # 58 + 40.. 44: # 70 + 45.. 49: # 65 + 50.. 54: # 61 + 55.. 59: # 62 + 60.. 64: # 54 + 65.. 69: ## 81 + 70.. 74: # 62 + 75.. 79: # 58 + 80.. 84: # 67 + 85.. 89: # 55 + 90.. 94: # 59 + 95.. 99: # 55 +++ Stats for pair dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -1129,8 +1129,8 @@ Some _: 8519 cases Collect results for test result dist: -Error _: 2469 cases -Ok _ : 7531 cases +Error _: 2475 cases +Ok _ : 7525 cases +++ Stats for list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_unit_tests.ml b/test/core/QCheck2_unit_tests.ml index 25b8a0bb..16d3d6e5 100644 --- a/test/core/QCheck2_unit_tests.ml +++ b/test/core/QCheck2_unit_tests.ml @@ -204,33 +204,32 @@ module Shrink = struct if ocaml_major_version < 5 then (Alcotest.(check' (list bytes)) - ~msg:"\")]}XS\" on repeated failure" + ~msg:"\"_!\" on repeated failure" ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (bytes_size ~gen:printable (int_bound 8))) |> repeated_failure) ~expected:(List.map String.to_bytes - [ ")]}XS"; ""; "&3"(*WTF?*); "\n'n"(*WTF?*); "< *S"(*WTF?*); - "a]}XS"; "r]}XS"; " ]}XS"; "$]}XS"; "&]}XS"; "']}XS"; "(]}XS"; - ")a}XS"; ")1}XS"; ")G}XS"; ")R}XS"; ")W}XS"; ")Z}XS"; ")[}XS"; ")\\}XS"; - ")]aXS"; ")]4XS"; ")]KXS"; ")]WXS"; ")]]XS"; ")]`XS"; ")]{XS"; ")]|XS"; - ")]}aS"; ")]}/S"; ")]}DS"; ")]}NS"; ")]}SS"; ")]}VS"; ")]}WS"; - ")]}Xa"; ")]}X,"; ")]}X?"; ")]}XI"; ")]}XN"; ")]}XP"; ")]}XQ"; ")]}XR"; ]); + [ "_!"; ""; "_"; + "a!"; "2!"; "H!"; "S!"; "Y!"; "\\!"; "]!"; "^!"; + "_a"; "_n"; "_u"; "_x"; "_z"; "_ "; ] ); Alcotest.(check' (list bytes)) - ~msg:"\")]}XS\" on repeated success" + ~msg:"\"_!\" on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (bytes_size ~gen:printable (int_bound 8))) |> repeated_success) - ~expected:(List.map String.to_bytes [")]}XS"; ""])) + ~expected:(List.map String.to_bytes ["_!"; ""])) else (Alcotest.(check' (list bytes)) - ~msg:"\"[PjjX\" on repeated failure" + ~msg:"\"Ns<>W\\\" on repeated failure" ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (bytes_size ~gen:printable (int_bound 8))) |> repeated_failure) ~expected:(List.map String.to_bytes - [ "[PjjX"; ""; "Y1"(*WTF?*); "6\"U"(*WTF?*); "9ff%"(*WTF?*); - "aPjjX"; "0PjjX"; "EPjjX"; "PPjjX"; "UPjjX"; "XPjjX"; "YPjjX"; "ZPjjX"; - "[ajjX"; "[+jjX"; "[>jjX"; "[GjjX"; "[LjjX"; "[NjjX"; "[OjjX"; - "[PajX"; "[PejX"; "[PgjX"; "[PhjX"; "[PijX"; "[PjaX"; "[PjeX"; "[PjgX"; "[PjhX"; "[PjiX"; - "[Pjja"; "[Pjj/"; "[PjjD"; "[PjjN"; "[PjjS"; "[PjjV"; "[PjjW"; ] ); + ["Ns<>W\\"; ""; "Ns<"; "Ns<>W"; + "as<>W\\"; "*s<>W\\"; "<s<>W\\"; "Es<>W\\"; "Js<>W\\"; "Ls<>W\\"; "Ms<>W\\"; + "Na<>W\\"; "Nj<>W\\"; "No<>W\\"; "Nq<>W\\"; "Nr<>W\\"; + "Nsa>W\\"; "Ns!>W\\"; "Ns/>W\\"; "Ns6>W\\"; "Ns9>W\\"; "Ns;>W\\"; + "Ns<aW\\"; "Ns<\"W\\"; "Ns<0W\\"; "Ns<7W\\"; "Ns<;W\\"; "Ns<=W\\"; + "Ns<>a\\"; "Ns<>.\\"; "Ns<>B\\"; "Ns<>L\\"; "Ns<>Q\\"; "Ns<>T\\"; "Ns<>U\\"; "Ns<>V\\"; + "Ns<>Wa"; "Ns<>W1"; "Ns<>WG"; "Ns<>WR"; "Ns<>WW"; "Ns<>WZ"; "Ns<>W["; ] ); Alcotest.(check' (list bytes)) - ~msg:"\"[PjjX\" on repeated success" + ~msg:"\"Ns<>W\\\" on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (bytes_size ~gen:printable (int_bound 8))) |> repeated_success) - ~expected:(List.map String.to_bytes ["[PjjX"; ""; ])) + ~expected:(List.map String.to_bytes ["Ns<>W\\"; ""; ])) let tests = ("Shrink", Alcotest.[ test_case "int_towards" `Quick test_int_towards; From 907e527e21f930de6d5e82c75355a94003fde361 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 27 Jan 2025 10:31:51 +0100 Subject: [PATCH 294/391] Add OCaml4 split hack warning --- src/core/QCheck.ml | 4 ++++ src/core/QCheck2.ml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/core/QCheck.ml b/src/core/QCheck.ml index fee38d13..130ae481 100644 --- a/src/core/QCheck.ml +++ b/src/core/QCheck.ml @@ -11,6 +11,10 @@ let poly_compare=compare module RS = struct (* Poor man's splitter for version < 5.0 *) (* This definition is shadowed by the [include] on OCaml >=5.0 *) + (* For the record, this is a hack: + Seeding a child RNG based on the output of a parent RNG + does not create an independent RNG. As an added bonus, + performance is bad. *) let split rs = let bits = Random.State.bits rs in let rs' = Random.State.make [|bits|] in diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index 68ad1375..185db470 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -12,6 +12,10 @@ let poly_compare=compare module RS = struct (* Poor man's splitter for version < 5.0 *) (* This definition is shadowed by the [include] on OCaml >=5.0 *) + (* For the record, this is a hack: + Seeding a child RNG based on the output of a parent RNG + does not create an independent RNG. As an added bonus, + performance is bad. *) let split rs = let bits = Random.State.bits rs in let rs' = Random.State.make [|bits|] in From dc28260644b590cbeba228cbc737b2cbde2c88b9 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 27 Jan 2025 10:47:04 +0100 Subject: [PATCH 295/391] Add a QCheck2 shrinker note to the documentation --- src/core/QCheck2.mli | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index 463470ac..6abb4788 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -2008,6 +2008,10 @@ val find_example_gen : QCheck2 is a major release and as such, there are (as few as possible) breaking changes, as well as functional changes you should be aware of. + The QCheck2 shrinkers haven't been battle tested as much as the + QCheck ones, and furthermore implement different reduction algorithms. + Please report if you encounter any issues porting tests from QCheck to QCheck2. + {2 Minimal changes} Most of your QCheck (v1) code should be able to compile and run the first time you upgrade From 4cde3fa62e7dc4cca3bbae49a2b98c39a7685536 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 27 Jan 2025 11:23:23 +0100 Subject: [PATCH 296/391] Fix Gen.bind by adding copy, to ensure RHS is started from same RS state --- src/core/QCheck2.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index 185db470..420b316e 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -279,7 +279,7 @@ module Gen = struct let bind (gen : 'a t) (f : 'a -> ('b t)) : 'b t = fun st -> let st' = RS.split st in let gentree = gen st in - Tree.bind gentree (fun a -> f a st') + Tree.bind gentree (fun a -> f a (RS.copy st')) let (>>=) = bind From e3fef2c49a0754d8cb5f845b8145f4a8e4b3813a Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 27 Jan 2025 11:50:29 +0100 Subject: [PATCH 297/391] Update QCheck2 unit and expect tests wrt to fixed Gen.bind --- .../QCheck2_expect_test.expected.ocaml4.32 | 58 ++++---- .../QCheck2_expect_test.expected.ocaml4.64 | 126 +++++++++--------- .../QCheck2_expect_test.expected.ocaml5.32 | 14 +- .../QCheck2_expect_test.expected.ocaml5.64 | 12 +- test/core/QCheck2_unit_tests.ml | 4 +- 5 files changed, 106 insertions(+), 108 deletions(-) diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.32 b/test/core/QCheck2_expect_test.expected.ocaml4.32 index 91d8f42f..ad20d985 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.32 @@ -8,63 +8,63 @@ random seed: 1234 (2,fun,16) (6,fun,1) (9,fun,7) (0,fun,9) (60,fun,7) (7,fun,2) (3,fun,9) (54,fun,4) (4,fun,3) (2,fun,0) (2,fun,16) (6,fun,1) (9,fun,7) (0,fun,9) (60,fun,7) (7,fun,2) (3,fun,9) (54,fun,4) (4,fun,3) (2,fun,0) -693587245 -882325444 +693587244 0 -441162722 +346793622 0 -220581361 +173396811 0 -110290680 +86698405 0 -55145340 +43349202 0 -27572670 +21674601 0 -13786335 +10837300 0 -6893167 +5418650 0 -3446583 +2709325 0 -1723291 +1354662 0 -861645 +677331 0 -430822 +338665 0 -215411 +169332 0 -107705 +84666 0 -53852 +42333 0 -26926 +21166 0 -13463 +10583 0 -6731 +5291 0 -3365 +2645 0 -1682 +1322 0 -841 +661 0 -420 +330 0 -210 +165 0 -105 +82 0 -52 +41 0 -26 +20 0 -13 +10 0 -6 +5 0 -3 +2 0 1 0 diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.64 b/test/core/QCheck2_expect_test.expected.ocaml4.64 index 5e5ee75a..690cedcf 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.64 @@ -8,121 +8,119 @@ random seed: 1234 (2,fun,16) (6,fun,1) (9,fun,7) (0,fun,9) (60,fun,7) (7,fun,2) (3,fun,9) (54,fun,4) (4,fun,3) (2,fun,0) (2,fun,16) (6,fun,1) (9,fun,7) (0,fun,9) (60,fun,7) (7,fun,2) (3,fun,9) (54,fun,4) (4,fun,3) (2,fun,0) -947389732205813673 -1824404893930668959 +947389732205813672 0 -912202446965334479 +473694866102906836 0 -456101223482667239 +236847433051453418 0 -228050611741333619 +118423716525726709 0 -114025305870666809 +59211858262863354 0 -57012652935333404 +29605929131431677 0 -28506326467666702 +14802964565715838 0 -14253163233833351 +7401482282857919 0 -7126581616916675 +3700741141428959 0 -3563290808458337 +1850370570714479 0 -1781645404229168 +925185285357239 0 -890822702114584 +462592642678619 0 -445411351057292 +231296321339309 0 -222705675528646 +115648160669654 0 -111352837764323 +57824080334827 0 -55676418882161 +28912040167413 0 -27838209441080 +14456020083706 0 -13919104720540 +7228010041853 0 -6959552360270 +3614005020926 0 -3479776180135 +1807002510463 0 -1739888090067 +903501255231 0 -869944045033 +451750627615 0 -434972022516 +225875313807 0 -217486011258 +112937656903 0 -108743005629 +56468828451 0 -54371502814 +28234414225 0 -27185751407 +14117207112 0 -13592875703 +7058603556 0 -6796437851 +3529301778 0 -3398218925 +1764650889 0 -1699109462 +882325444 0 -849554731 +441162722 0 -424777365 +220581361 0 -212388682 +110290680 0 -106194341 +55145340 0 -53097170 +27572670 0 -26548585 +13786335 0 -13274292 +6893167 0 -6637146 +3446583 0 -3318573 +1723291 0 -1659286 +861645 0 -829643 +430822 0 -414821 +215411 0 -207410 +107705 0 -103705 +53852 0 -51852 +26926 0 -25926 +13463 0 -12963 +6731 0 -6481 +3365 0 -3240 +1682 0 -1620 +841 0 -810 +420 0 -405 +210 0 -202 +105 0 -101 +52 0 -50 +26 0 -25 -0 -12 +13 0 6 0 @@ -281,7 +279,7 @@ Test ints arent 0 mod 3 failed (76 shrink steps): --- Failure -------------------------------------------------------------------- -Test ints are 0 failed (61 shrink steps): +Test ints are 0 failed (60 shrink steps): 1 @@ -395,7 +393,7 @@ Test pairs have different components failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test pairs have same components failed (63 shrink steps): +Test pairs have same components failed (61 shrink steps): (0, 1) @@ -407,7 +405,7 @@ Test pairs have a zero component failed (120 shrink steps): --- Failure -------------------------------------------------------------------- -Test pairs are (0,0) failed (63 shrink steps): +Test pairs are (0,0) failed (61 shrink steps): (0, 1) @@ -473,7 +471,7 @@ Test quadruples have pair-wise different components failed (4 shrink steps): --- Failure -------------------------------------------------------------------- -Test quadruples have same components failed (124 shrink steps): +Test quadruples have same components failed (122 shrink steps): (0, 1, 0, 1) @@ -485,7 +483,7 @@ Test quadruples are ordered failed (5 shrink steps): --- Failure -------------------------------------------------------------------- -Test quadruples are ordered reversely failed (126 shrink steps): +Test quadruples are ordered reversely failed (124 shrink steps): (0, 0, 0, 1) diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.32 b/test/core/QCheck2_expect_test.expected.ocaml5.32 index 9b559669..e1ffcdfc 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.32 @@ -339,19 +339,19 @@ Test pairs have different components failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test pairs have same components failed (28 shrink steps): +Test pairs have same components failed (31 shrink steps): (0, 1) --- Failure -------------------------------------------------------------------- -Test pairs have a zero component failed (55 shrink steps): +Test pairs have a zero component failed (58 shrink steps): (1, 1) --- Failure -------------------------------------------------------------------- -Test pairs are (0,0) failed (28 shrink steps): +Test pairs are (0,0) failed (31 shrink steps): (0, 1) @@ -405,7 +405,7 @@ Test triples are ordered failed (4 shrink steps): --- Failure -------------------------------------------------------------------- -Test triples are ordered reversely failed (59 shrink steps): +Test triples are ordered reversely failed (62 shrink steps): (0, 0, 1) @@ -417,7 +417,7 @@ Test quadruples have pair-wise different components failed (4 shrink steps): --- Failure -------------------------------------------------------------------- -Test quadruples have same components failed (60 shrink steps): +Test quadruples have same components failed (63 shrink steps): (0, 1, 0, 1) @@ -429,7 +429,7 @@ Test quadruples are ordered failed (6 shrink steps): --- Failure -------------------------------------------------------------------- -Test quadruples are ordered reversely failed (61 shrink steps): +Test quadruples are ordered reversely failed (64 shrink steps): (0, 0, 0, 1) @@ -549,7 +549,7 @@ Ok (0) --- Failure -------------------------------------------------------------------- -Test tree contains only 42 failed (2 shrink steps): +Test tree contains only 42 failed (1 shrink steps): Leaf 0 diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.64 b/test/core/QCheck2_expect_test.expected.ocaml5.64 index c33b2364..2cb9d9de 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.64 @@ -401,19 +401,19 @@ Test pairs have different components failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test pairs have same components failed (62 shrink steps): +Test pairs have same components failed (63 shrink steps): (0, 1) --- Failure -------------------------------------------------------------------- -Test pairs have a zero component failed (122 shrink steps): +Test pairs have a zero component failed (123 shrink steps): (1, 1) --- Failure -------------------------------------------------------------------- -Test pairs are (0,0) failed (62 shrink steps): +Test pairs are (0,0) failed (63 shrink steps): (0, 1) @@ -455,7 +455,7 @@ Test triples have pair-wise different components failed (3 shrink steps): --- Failure -------------------------------------------------------------------- -Test triples have same components failed (64 shrink steps): +Test triples have same components failed (63 shrink steps): (0, 1, 0) @@ -479,7 +479,7 @@ Test quadruples have pair-wise different components failed (4 shrink steps): --- Failure -------------------------------------------------------------------- -Test quadruples have same components failed (126 shrink steps): +Test quadruples have same components failed (127 shrink steps): (0, 1, 0, 1) @@ -611,7 +611,7 @@ Ok (0) --- Failure -------------------------------------------------------------------- -Test tree contains only 42 failed (2 shrink steps): +Test tree contains only 42 failed (1 shrink steps): Leaf 0 diff --git a/test/core/QCheck2_unit_tests.ml b/test/core/QCheck2_unit_tests.ml index 16d3d6e5..09292bfb 100644 --- a/test/core/QCheck2_unit_tests.ml +++ b/test/core/QCheck2_unit_tests.ml @@ -156,11 +156,11 @@ module Shrink = struct (Alcotest.(check' (list (pair int int))) ~msg:"1,3 on repeated failure" ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (small_int >>= fun i -> map (fun j -> (i,j)) small_int)) |> repeated_failure) - ~expected:[(1, 3); (0, 6)(*WTF?*); (1, 0); (1, 1); (1, 2)]; + ~expected:[(1, 3); (0, 3); (1, 0); (1, 1); (1, 2)]; Alcotest.(check' (list (pair int int))) ~msg:"1,3 on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (small_int >>= fun i -> map (fun j -> (i,j)) small_int)) |> repeated_success) - ~expected:[(1, 3); (0, 6)(*WTF?*); (0, 0)]) + ~expected:[(1, 3); (0, 3); (0, 0)]) else (Alcotest.(check' (list (pair int int))) ~msg:"2,6 on repeated failure" From c4a9963f9f3c105f7d927f8f621f70e9d74eac71 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 27 Jan 2025 12:51:38 +0100 Subject: [PATCH 298/391] Replace String.to_bytes with Bytes.of_string to compile on 4.12 and earlier --- test/core/QCheck2_unit_tests.ml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/core/QCheck2_unit_tests.ml b/test/core/QCheck2_unit_tests.ml index 09292bfb..51a80b83 100644 --- a/test/core/QCheck2_unit_tests.ml +++ b/test/core/QCheck2_unit_tests.ml @@ -206,19 +206,19 @@ module Shrink = struct (Alcotest.(check' (list bytes)) ~msg:"\"_!\" on repeated failure" ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (bytes_size ~gen:printable (int_bound 8))) |> repeated_failure) - ~expected:(List.map String.to_bytes + ~expected:(List.map Bytes.of_string [ "_!"; ""; "_"; "a!"; "2!"; "H!"; "S!"; "Y!"; "\\!"; "]!"; "^!"; "_a"; "_n"; "_u"; "_x"; "_z"; "_ "; ] ); Alcotest.(check' (list bytes)) ~msg:"\"_!\" on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (bytes_size ~gen:printable (int_bound 8))) |> repeated_success) - ~expected:(List.map String.to_bytes ["_!"; ""])) + ~expected:(List.map Bytes.of_string ["_!"; ""])) else (Alcotest.(check' (list bytes)) ~msg:"\"Ns<>W\\\" on repeated failure" ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (bytes_size ~gen:printable (int_bound 8))) |> repeated_failure) - ~expected:(List.map String.to_bytes + ~expected:(List.map Bytes.of_string ["Ns<>W\\"; ""; "Ns<"; "Ns<>W"; "as<>W\\"; "*s<>W\\"; "<s<>W\\"; "Es<>W\\"; "Js<>W\\"; "Ls<>W\\"; "Ms<>W\\"; "Na<>W\\"; "Nj<>W\\"; "No<>W\\"; "Nq<>W\\"; "Nr<>W\\"; @@ -229,7 +229,7 @@ module Shrink = struct Alcotest.(check' (list bytes)) ~msg:"\"Ns<>W\\\" on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (bytes_size ~gen:printable (int_bound 8))) |> repeated_success) - ~expected:(List.map String.to_bytes ["Ns<>W\\"; ""; ])) + ~expected:(List.map Bytes.of_string ["Ns<>W\\"; ""; ])) let tests = ("Shrink", Alcotest.[ test_case "int_towards" `Quick test_int_towards; From e3a6b6eb00db13d446c6531c07f10132c7870bd1 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 29 Jan 2025 12:23:37 +0100 Subject: [PATCH 299/391] Add CHANGELOG entry --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fcbeee6e..5ec6d4c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## NEXT RELEASE +- Use `split` and `copy` in `Random.State` underlying `QCheck2` to + avoid non-deterministic shrinking behaviour - Add missing documentation strings for `QCheck.{Print,Iter,Shrink,Gen}` and `QCheck2.Gen`. - Add `result` combinators to `QCheck`, `QCheck.{Gen,Print,Shrink,Observable}`, and `QCheck2.{Gen,Print,Observable}`. From bfa76eeff313f1c3c36f522755f031228e3036eb Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 29 Jan 2025 20:12:40 +0100 Subject: [PATCH 300/391] Add QCheck2.Gen.list shrink unit test --- test/core/QCheck2_unit_tests.ml | 35 +++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/test/core/QCheck2_unit_tests.ml b/test/core/QCheck2_unit_tests.ml index 51a80b83..fcf2434b 100644 --- a/test/core/QCheck2_unit_tests.ml +++ b/test/core/QCheck2_unit_tests.ml @@ -171,7 +171,7 @@ module Shrink = struct ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (small_int >>= fun i -> map (fun j -> (i,j)) small_int)) |> repeated_success) ~expected:[(2, 6); (0, 6); (0, 0)]) - let test_list_int () = + let test_list_size_int () = if ocaml_major_version < 5 then (Alcotest.(check' (list (list int))) @@ -200,6 +200,36 @@ module Shrink = struct ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (list_size (int_bound 8) (int_bound 10))) |> repeated_success) ~expected:[[9; 2; 7; 3; 8; 6]; []; ]) + let test_list_int () = + if ocaml_major_version < 5 + then + (Alcotest.(check' (list (list int))) + ~msg:"[5; 9; 4; 10] on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) (list (int_bound 10))) |> repeated_failure) + ~expected:[ [5; 9; 4; 10]; []; [5; 9]; [5; 9; 4]; + [0; 9; 4; 10]; [2; 9; 4; 10]; [3; 9; 4; 10]; [4; 9; 4; 10]; + [5; 0; 4; 10]; [5; 4; 4; 10]; [5; 6; 4; 10]; [5; 7; 4; 10]; [5; 8; 4; 10]; + [5; 9; 0; 10]; [5; 9; 2; 10]; [5; 9; 3; 10]; + [5; 9; 4; 0]; [5; 9; 4; 5]; [5; 9; 4; 8]; [5; 9; 4; 9]; ]; + Alcotest.(check' (list (list int))) + ~msg:"[5; 9; 4; 10] on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) (list (int_bound 10))) |> repeated_success) + ~expected:[ [5; 9; 4; 10]; []; ]) + else + (Alcotest.(check' (list (list int))) + ~msg:"[1; 10; 10; 7; 3] on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3347) (list (int_bound 10))) |> repeated_failure) + ~expected:[ [1; 10; 10; 7; 3]; []; [1; 10]; [1; 10; 10]; [1; 10; 10; 7]; + [0; 10; 10; 7; 3]; + [1; 0; 10; 7; 3]; [1; 5; 10; 7; 3]; [1; 8; 10; 7; 3]; [1; 9; 10; 7; 3]; + [1; 10; 0; 7; 3]; [1; 10; 5; 7; 3]; [1; 10; 8; 7; 3]; [1; 10; 9; 7; 3]; + [1; 10; 10; 0; 3]; [1; 10; 10; 3; 3]; [1; 10; 10; 5; 3]; [1; 10; 10; 6; 3]; + [1; 10; 10; 7; 0]; [1; 10; 10; 7; 1]; [1; 10; 10; 7; 2]; ]; + Alcotest.(check' (list (list int))) + ~msg:"[1; 10; 10; 7; 3] on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3347) (list (int_bound 10))) |> repeated_success) + ~expected:[ [1; 10; 10; 7; 3]; []; ]) + let test_bytes_size () = if ocaml_major_version < 5 then @@ -241,7 +271,8 @@ module Shrink = struct test_case "Gen.printable tree" `Quick test_char_printable; test_case "Gen.(pair small_int small_int) tree" `Quick test_pair_small_int; test_case "Gen.bind small_int tree" `Quick test_bind_small_int; - test_case "Gen.list_size int" `Quick test_list_int; + test_case "Gen.list_size int" `Quick test_list_size_int; + test_case "Gen.list int" `Quick test_list_int; test_case "Gen.bytes_size" `Quick test_bytes_size; ]) end From 346b42121ae5f243d429730ae88d0907970e8df9 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 29 Jan 2025 17:45:10 +0100 Subject: [PATCH 301/391] First attempt at improving QCheck2.Gen.list shrinker --- src/core/QCheck2.ml | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index 420b316e..4b126a55 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -583,7 +583,50 @@ module Gen = struct in loop size [] - let list (gen : 'a t) : 'a list t = list_size nat gen + let rec split l len acc = match len,l with + | _,[] + | 0,_ -> List.rev acc, l + | _,x::xs -> split xs (len-1) (x::acc) + + let rec build_shrink_tree (l : 'a Tree.t list) : 'a list Tree.t Seq.t = match l with + | [] -> Seq.empty + | [_] -> + fun () -> Seq.cons (Tree.Tree ([], Seq.empty)) (* only empty list to try *) + (Tree.children (Tree.sequence_list l)) () (* otherwise, reduce element(s) *) + | _::_ -> + fun () -> + let len = List.length l in + let xs,ys = split l ((1 + len) / 2) [] in + let xs_roots = List.map Tree.root xs in + let ys_roots = List.map Tree.root ys in + Seq.cons (Tree.Tree (xs_roots, build_shrink_tree xs)) (* try first half *) + (Seq.cons (Tree.Tree (ys_roots, build_shrink_tree ys)) (* then second half *) + (if len >= 4 + then + let rest = List.tl l in + let rest_roots = List.map Tree.root rest in + (Seq.cons (Tree.Tree (rest_roots, build_shrink_tree rest)) (* drop head *) + (Seq.cons (Tree.Tree (xs_roots@(List.tl ys_roots), build_shrink_tree (xs@(List.tl ys)))) (* drop ys head *) + (Tree.children (Tree.sequence_list l)) (* at bottom: reduce elements *) + )) + else + (Tree.children (Tree.sequence_list l)) + )) () + + let list (gen : 'a t) : 'a list t = fun st -> + let st' = RS.split st in + let size = Tree.root (nat st) in + (*Tree.bind (nat st) @@ fun size ->*) + let st' = RS.copy st' in (* start each loop from same Random.State to recreate same element (prefix) *) + let rec loop n acc = (* phase 1: build a list of element trees, tail recursively *) + if n <= 0 (* phase 2: build a list shrink Tree of element trees, tail recursively *) + then + let l = List.rev acc in + (*let l = List.map Tree.root l in*) + Tree.Tree (List.map Tree.root l, build_shrink_tree l) + else (loop [@tailcall]) (n - 1) ((gen st')::acc) + in + loop size [] let list_repeat (n : int) (gen : 'a t) : 'a list t = list_size (pure n) gen From 7df8b3733112a2984b7b097daa154fb52fbc5f00 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 29 Jan 2025 20:16:00 +0100 Subject: [PATCH 302/391] Update QCheck2.Gen.list shrink unit test output --- test/core/QCheck2_unit_tests.ml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/core/QCheck2_unit_tests.ml b/test/core/QCheck2_unit_tests.ml index fcf2434b..3e3bec01 100644 --- a/test/core/QCheck2_unit_tests.ml +++ b/test/core/QCheck2_unit_tests.ml @@ -206,7 +206,7 @@ module Shrink = struct (Alcotest.(check' (list (list int))) ~msg:"[5; 9; 4; 10] on repeated failure" ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) (list (int_bound 10))) |> repeated_failure) - ~expected:[ [5; 9; 4; 10]; []; [5; 9]; [5; 9; 4]; + ~expected:[ [5; 9; 4; 10]; [5; 9]; [4; 10]; [9; 4; 10]; [5; 9; 10]; [0; 9; 4; 10]; [2; 9; 4; 10]; [3; 9; 4; 10]; [4; 9; 4; 10]; [5; 0; 4; 10]; [5; 4; 4; 10]; [5; 6; 4; 10]; [5; 7; 4; 10]; [5; 8; 4; 10]; [5; 9; 0; 10]; [5; 9; 2; 10]; [5; 9; 3; 10]; @@ -214,12 +214,12 @@ module Shrink = struct Alcotest.(check' (list (list int))) ~msg:"[5; 9; 4; 10] on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) (list (int_bound 10))) |> repeated_success) - ~expected:[ [5; 9; 4; 10]; []; ]) + ~expected:[ [5; 9; 4; 10]; [5; 9]; [5]; []; ]) else (Alcotest.(check' (list (list int))) ~msg:"[1; 10; 10; 7; 3] on repeated failure" ~actual:(Gen.(generate_tree ~rand:(rand_init 3347) (list (int_bound 10))) |> repeated_failure) - ~expected:[ [1; 10; 10; 7; 3]; []; [1; 10]; [1; 10; 10]; [1; 10; 10; 7]; + ~expected:[ [1; 10; 10; 7; 3]; [1; 10; 10]; [7; 3]; [10; 10; 7; 3]; [1; 10; 10; 3]; [0; 10; 10; 7; 3]; [1; 0; 10; 7; 3]; [1; 5; 10; 7; 3]; [1; 8; 10; 7; 3]; [1; 9; 10; 7; 3]; [1; 10; 0; 7; 3]; [1; 10; 5; 7; 3]; [1; 10; 8; 7; 3]; [1; 10; 9; 7; 3]; @@ -228,7 +228,7 @@ module Shrink = struct Alcotest.(check' (list (list int))) ~msg:"[1; 10; 10; 7; 3] on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3347) (list (int_bound 10))) |> repeated_success) - ~expected:[ [1; 10; 10; 7; 3]; []; ]) + ~expected:[ [1; 10; 10; 7; 3]; [1; 10; 10]; [1; 10]; [1]; []; ]) let test_bytes_size () = if ocaml_major_version < 5 From bc81669e4f25fb5464a16ea5017b35a0d049aab5 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 29 Jan 2025 20:44:48 +0100 Subject: [PATCH 303/391] Update QCheck2 expect test output wrt Gen.list shrinker improvement --- .../QCheck2_expect_test.expected.ocaml4.32 | 27 ++++++------ .../QCheck2_expect_test.expected.ocaml4.64 | 27 ++++++------ .../QCheck2_expect_test.expected.ocaml5.32 | 43 ++++++++----------- .../QCheck2_expect_test.expected.ocaml5.64 | 43 ++++++++----------- 4 files changed, 64 insertions(+), 76 deletions(-) diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.32 b/test/core/QCheck2_expect_test.expected.ocaml4.32 index ad20d985..d1094132 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.32 @@ -69,14 +69,13 @@ random seed: 1234 1 0 [16; 1; 1] -[] +[16; 1] [16] [] [0] [16; 1; 1] -[] -[16] [16; 1] +[1] [0; 1; 1] [0; 0; 1] [0; 0; 0] @@ -369,15 +368,15 @@ Test pairs sum to less than 128 failed (24 shrink steps): --- Failure -------------------------------------------------------------------- -Test pairs lists rev concat failed (34 shrink steps): +Test pairs lists rev concat failed (35 shrink steps): ([0], [1]) --- Failure -------------------------------------------------------------------- -Test pairs lists no overlap failed (15 shrink steps): +Test pairs lists no overlap failed (6 shrink steps): -([0], [0; 0; 0; 0; 0; 0; 0; 0; 0; 0]) +([1], [1]) --- Failure -------------------------------------------------------------------- @@ -489,13 +488,13 @@ Test bind list_size constant failed (12 shrink steps): --- Failure -------------------------------------------------------------------- -Test lists are empty failed (2 shrink steps): +Test lists are empty failed (3 shrink steps): [0] --- Failure -------------------------------------------------------------------- -Test lists shorter than 10 failed (12 shrink steps): +Test lists shorter than 10 failed (16 shrink steps): [0; 0; 0; 0; 0; 0; 0; 0; 0; 0] @@ -579,28 +578,28 @@ Test fail_pred_strings failed (2 shrink steps): --- Failure -------------------------------------------------------------------- -Test fold_left fold_right failed (21 shrink steps): +Test fold_left fold_right failed (23 shrink steps): -(0, [0; 0], {(70, 3) -> 0; (3, 0) -> 0; (0, 6) -> 0; (2, 6) -> 0; (0, 90) -> 0; (3, 26) -> 0; (3, 9) -> 0; (20, 3) -> 0; (3, 2) -> 0; (2, 0) -> 0; (0, 70) -> 1; (4, 3) -> 0; (9, 6) -> 0; (6, 8) -> 0; (0, 3) -> 0; (6, 6) -> 0; (0, 7) -> 0; (0, 0) -> 70; _ -> 0}) +(0, [1], {(70, 3) -> 0; (1, 0) -> 1; (3, 0) -> 0; (0, 6) -> 0; (2, 6) -> 0; (0, 90) -> 0; (3, 26) -> 0; (3, 9) -> 0; (20, 3) -> 0; (3, 2) -> 0; (2, 0) -> 0; (4, 3) -> 0; (9, 6) -> 0; (6, 8) -> 0; (0, 3) -> 0; (6, 6) -> 0; (0, 7) -> 0; (0, 0) -> 0; _ -> 0}) +++ Messages ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Messages for test fold_left fold_right: -l=[0; 0], fold_left=1, fold_right=0 +l=[1], fold_left=1, fold_right=0 --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried failed (47 shrink steps): +Test fold_left fold_right uncurried failed (45 shrink steps): ({(3, 76) -> 0; (9, 3) -> 0; (5, 2) -> 0; (1, 2) -> 1; (34, 1) -> 0; (9, 6) -> 0; (7, 3) -> 0; (3, 8) -> 0; (67, 3) -> 0; (2, 24) -> 0; (1, 1) -> 0; (37, 6) -> 0; (6, 2) -> 0; (5, 8) -> 0; (5, 7) -> 0; (5, 6) -> 0; (4, 8) -> 0; (17, 3) -> 0; (3, 4) -> 0; (84, 79) -> 0; (4, 17) -> 0; (6, 1) -> 0; (7, 6) -> 0; (3, 5) -> 0; (9, 4) -> 0; (1, 9) -> 0; (2, 5) -> 0; _ -> 0}, 1, [2]) --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried fun last failed (26 shrink steps): +Test fold_left fold_right uncurried fun last failed (23 shrink steps): -(0, [0; 0], {(0, 20) -> 0; (90, 3) -> 0; (3, 9) -> 0; (8, 3) -> 0; (3, 2) -> 0; (9, 6) -> 0; (7, 3) -> 0; (6, 20) -> 0; (0, 70) -> 0; (6, 70) -> 0; (3, 0) -> 1; (0, 4) -> 0; (6, 0) -> 0; (0, 0) -> 3; (2, 0) -> 0; (26, 6) -> 0; (6, 3) -> 0; _ -> 0}) +(0, [1], {(0, 20) -> 0; (90, 3) -> 0; (3, 9) -> 0; (8, 3) -> 0; (3, 2) -> 0; (9, 6) -> 0; (7, 3) -> 0; (6, 20) -> 0; (0, 3) -> 0; (0, 70) -> 0; (6, 70) -> 0; (3, 0) -> 0; (0, 4) -> 0; (0, 0) -> 0; (0, 1) -> 1; (2, 0) -> 0; (26, 6) -> 0; (6, 3) -> 0; _ -> 0}) --- Failure -------------------------------------------------------------------- diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.64 b/test/core/QCheck2_expect_test.expected.ocaml4.64 index 690cedcf..54910708 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.64 @@ -129,14 +129,13 @@ random seed: 1234 1 0 [16; 1; 1] -[] +[16; 1] [16] [] [0] [16; 1; 1] -[] -[16] [16; 1] +[1] [0; 1; 1] [0; 0; 1] [0; 0; 0] @@ -429,15 +428,15 @@ Test pairs sum to less than 128 failed (57 shrink steps): --- Failure -------------------------------------------------------------------- -Test pairs lists rev concat failed (64 shrink steps): +Test pairs lists rev concat failed (65 shrink steps): ([0], [1]) --- Failure -------------------------------------------------------------------- -Test pairs lists no overlap failed (15 shrink steps): +Test pairs lists no overlap failed (6 shrink steps): -([0], [0; 0; 0; 0; 0; 0; 0; 0; 0; 0]) +([1], [1]) --- Failure -------------------------------------------------------------------- @@ -549,13 +548,13 @@ Test bind list_size constant failed (12 shrink steps): --- Failure -------------------------------------------------------------------- -Test lists are empty failed (2 shrink steps): +Test lists are empty failed (3 shrink steps): [0] --- Failure -------------------------------------------------------------------- -Test lists shorter than 10 failed (12 shrink steps): +Test lists shorter than 10 failed (16 shrink steps): [0; 0; 0; 0; 0; 0; 0; 0; 0; 0] @@ -639,28 +638,28 @@ Test fail_pred_strings failed (2 shrink steps): --- Failure -------------------------------------------------------------------- -Test fold_left fold_right failed (21 shrink steps): +Test fold_left fold_right failed (23 shrink steps): -(0, [0; 0], {(70, 3) -> 0; (3, 0) -> 0; (0, 6) -> 0; (2, 6) -> 0; (0, 90) -> 0; (3, 26) -> 0; (3, 9) -> 0; (20, 3) -> 0; (3, 2) -> 0; (2, 0) -> 0; (0, 70) -> 1; (4, 3) -> 0; (9, 6) -> 0; (6, 8) -> 0; (0, 3) -> 0; (6, 6) -> 0; (0, 7) -> 0; (0, 0) -> 70; _ -> 0}) +(0, [1], {(70, 3) -> 0; (1, 0) -> 1; (3, 0) -> 0; (0, 6) -> 0; (2, 6) -> 0; (0, 90) -> 0; (3, 26) -> 0; (3, 9) -> 0; (20, 3) -> 0; (3, 2) -> 0; (2, 0) -> 0; (4, 3) -> 0; (9, 6) -> 0; (6, 8) -> 0; (0, 3) -> 0; (6, 6) -> 0; (0, 7) -> 0; (0, 0) -> 0; _ -> 0}) +++ Messages ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Messages for test fold_left fold_right: -l=[0; 0], fold_left=1, fold_right=0 +l=[1], fold_left=1, fold_right=0 --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried failed (47 shrink steps): +Test fold_left fold_right uncurried failed (45 shrink steps): ({(3, 76) -> 0; (9, 3) -> 0; (5, 2) -> 0; (1, 2) -> 1; (34, 1) -> 0; (9, 6) -> 0; (7, 3) -> 0; (3, 8) -> 0; (67, 3) -> 0; (2, 24) -> 0; (1, 1) -> 0; (37, 6) -> 0; (6, 2) -> 0; (5, 8) -> 0; (5, 7) -> 0; (5, 6) -> 0; (4, 8) -> 0; (17, 3) -> 0; (3, 4) -> 0; (84, 79) -> 0; (4, 17) -> 0; (6, 1) -> 0; (7, 6) -> 0; (3, 5) -> 0; (9, 4) -> 0; (1, 9) -> 0; (2, 5) -> 0; _ -> 0}, 1, [2]) --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried fun last failed (26 shrink steps): +Test fold_left fold_right uncurried fun last failed (23 shrink steps): -(0, [0; 0], {(0, 20) -> 0; (90, 3) -> 0; (3, 9) -> 0; (8, 3) -> 0; (3, 2) -> 0; (9, 6) -> 0; (7, 3) -> 0; (6, 20) -> 0; (0, 70) -> 0; (6, 70) -> 0; (3, 0) -> 1; (0, 4) -> 0; (6, 0) -> 0; (0, 0) -> 3; (2, 0) -> 0; (26, 6) -> 0; (6, 3) -> 0; _ -> 0}) +(0, [1], {(0, 20) -> 0; (90, 3) -> 0; (3, 9) -> 0; (8, 3) -> 0; (3, 2) -> 0; (9, 6) -> 0; (7, 3) -> 0; (6, 20) -> 0; (0, 3) -> 0; (0, 70) -> 0; (6, 70) -> 0; (3, 0) -> 0; (0, 4) -> 0; (0, 0) -> 0; (0, 1) -> 1; (2, 0) -> 0; (26, 6) -> 0; (6, 3) -> 0; _ -> 0}) --- Failure -------------------------------------------------------------------- diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.32 b/test/core/QCheck2_expect_test.expected.ocaml5.32 index e1ffcdfc..60448c1b 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.32 @@ -68,24 +68,19 @@ random seed: 1234 1 0 [0; 1; 80; 0; 9; 2; 3] -[] -[0; 1; 80] -[] +[0; 1; 80; 0] +[0; 1] [0] [] [0; 1; 80; 0; 9; 2; 3] -[] -[0; 1; 80] -[0; 1; 80; 0; 9] -[] -[0; 1] -[0; 1; 80] [0; 1; 80; 0] -[] [0; 1] -[0; 1; 80] -[0; 0; 80; 0] -[0; 0; 0; 0] +[80; 0] +[1; 80; 0] +[0; 1; 0] +[0; 1] +[0] +[0; 0; 0] --- Failure -------------------------------------------------------------------- @@ -375,15 +370,15 @@ Test pairs sum to less than 128 failed (25 shrink steps): --- Failure -------------------------------------------------------------------- -Test pairs lists rev concat failed (46 shrink steps): +Test pairs lists rev concat failed (47 shrink steps): ([0], [1]) --- Failure -------------------------------------------------------------------- -Test pairs lists no overlap failed (35 shrink steps): +Test pairs lists no overlap failed (17 shrink steps): -([0], [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0]) +([0], [0]) --- Failure -------------------------------------------------------------------- @@ -495,13 +490,13 @@ Test bind list_size constant failed (12 shrink steps): --- Failure -------------------------------------------------------------------- -Test lists are empty failed (2 shrink steps): +Test lists are empty failed (3 shrink steps): [0] --- Failure -------------------------------------------------------------------- -Test lists shorter than 10 failed (13 shrink steps): +Test lists shorter than 10 failed (15 shrink steps): [0; 0; 0; 0; 0; 0; 0; 0; 0; 0] @@ -519,9 +514,9 @@ Test lists shorter than 4332 failed (4005 shrink steps): --- Failure -------------------------------------------------------------------- -Test lists have unique elems failed (4 shrink steps): +Test lists have unique elems failed (3 shrink steps): -[0; 0; 0; 0] +[0; 0; 0] --- Failure -------------------------------------------------------------------- @@ -585,9 +580,9 @@ Test fail_pred_strings failed (1 shrink steps): --- Failure -------------------------------------------------------------------- -Test fold_left fold_right failed (149 shrink steps): +Test fold_left fold_right failed (152 shrink steps): -(0, [1], {(55, 3) -> 0; (3, 4) -> 0; (42, 7) -> 0; (89, 6) -> 0; (1, 9) -> 0; (6, 9) -> 0; (5, 61) -> 0; (1, 7) -> 0; (2, 57) -> 0; (57, 1) -> 0; (47, 1) -> 0; (9, 4) -> 0; (5, 92) -> 0; (6, 8) -> 0; (4, 0) -> 0; (25, 32) -> 0; (96, 6) -> 0; (7, 1) -> 0; (2, 9) -> 0; (3, 50) -> 0; (0, 0) -> 0; (7, 4) -> 0; (4, 7) -> 0; (2, 65) -> 0; (13, 5) -> 0; (61, 4) -> 0; (8, 6) -> 0; (82, 8) -> 0; (4, 44) -> 0; (9, 3) -> 0; (4, 3) -> 0; (25, 8) -> 0; (1, 2) -> 0; (6, 3) -> 0; (4, 1) -> 0; (1, 55) -> 0; (40, 0) -> 0; (5, 13) -> 0; (5, 73) -> 0; (7, 2) -> 0; (3, 3) -> 0; (8, 64) -> 0; (6, 4) -> 0; (46, 0) -> 0; (4, 39) -> 0; (7, 0) -> 0; (4, 5) -> 0; (9, 7) -> 0; (28, 0) -> 0; (47, 15) -> 0; (11, 8) -> 0; (3, 5) -> 0; (1, 4) -> 0; (9, 13) -> 0; (25, 43) -> 0; (6, 5) -> 0; (4, 4) -> 0; (0, 1) -> 1; (9, 89) -> 0; (43, 6) -> 0; (7, 40) -> 0; (5, 8) -> 0; (4, 6) -> 0; (1, 1) -> 0; (5, 72) -> 0; (92, 5) -> 0; (57, 6) -> 0; (48, 7) -> 0; (2, 0) -> 0; (21, 52) -> 0; (5, 2) -> 0; (8, 4) -> 0; (21, 15) -> 0; (0, 9) -> 0; (6, 43) -> 0; (8, 3) -> 0; (0, 4) -> 0; (21, 0) -> 0; (21, 8) -> 0; (0, 21) -> 0; (2, 15) -> 0; (57, 3) -> 0; (8, 7) -> 0; (7, 3) -> 0; (1, 0) -> 0; (2, 16) -> 0; (5, 1) -> 0; (4, 78) -> 0; (2, 4) -> 0; (8, 46) -> 0; (32, 0) -> 0; (2, 47) -> 0; (3, 17) -> 0; (50, 5) -> 0; (0, 3) -> 0; (3, 7) -> 0; (6, 6) -> 0; (59, 5) -> 0; (8, 1) -> 0; (0, 8) -> 0; (5, 32) -> 0; (3, 21) -> 0; (0, 6) -> 0; (3, 46) -> 0; (64, 8) -> 0; (9, 2) -> 0; (67, 0) -> 0; (3, 51) -> 0; (5, 94) -> 0; (6, 2) -> 0; (43, 7) -> 0; (54, 21) -> 0; (4, 9) -> 0; (17, 5) -> 0; (1, 8) -> 0; (6, 7) -> 0; (3, 8) -> 0; (41, 55) -> 0; (3, 6) -> 0; (5, 0) -> 0; (6, 1) -> 0; (0, 2) -> 0; (2, 1) -> 0; (0, 5) -> 0; (21, 6) -> 0; (4, 2) -> 0; (64, 4) -> 0; (9, 1) -> 0; (9, 31) -> 0; (5, 57) -> 0; (3, 0) -> 0; (7, 7) -> 0; (2, 64) -> 0; (3, 9) -> 0; (7, 96) -> 0; (32, 7) -> 0; (8, 10) -> 0; (9, 47) -> 0; (4, 8) -> 0; (31, 92) -> 0; (0, 32) -> 0; (37, 2) -> 0; (5, 4) -> 0; (18, 8) -> 0; (8, 30) -> 0; (6, 0) -> 0; (8, 9) -> 0; (5, 64) -> 0; (8, 96) -> 0; (3, 1) -> 0; (7, 21) -> 0; _ -> 0}) +(0, [1], {(55, 3) -> 0; (3, 4) -> 0; (42, 7) -> 0; (89, 6) -> 0; (1, 9) -> 0; (6, 9) -> 0; (5, 61) -> 0; (1, 7) -> 0; (2, 57) -> 0; (57, 1) -> 0; (47, 1) -> 0; (9, 4) -> 0; (5, 92) -> 0; (6, 8) -> 0; (4, 0) -> 0; (25, 32) -> 0; (96, 6) -> 0; (7, 1) -> 0; (2, 9) -> 0; (3, 50) -> 0; (0, 0) -> 0; (7, 4) -> 0; (4, 7) -> 0; (2, 65) -> 0; (13, 5) -> 0; (61, 4) -> 0; (8, 6) -> 0; (82, 8) -> 0; (4, 44) -> 0; (9, 3) -> 0; (4, 3) -> 0; (25, 8) -> 0; (1, 2) -> 0; (6, 3) -> 0; (4, 1) -> 0; (1, 55) -> 0; (40, 0) -> 0; (5, 13) -> 0; (5, 73) -> 0; (7, 2) -> 0; (3, 3) -> 0; (8, 64) -> 0; (6, 4) -> 0; (46, 0) -> 0; (4, 39) -> 0; (7, 0) -> 0; (4, 5) -> 0; (9, 7) -> 0; (28, 0) -> 0; (47, 15) -> 0; (11, 8) -> 0; (3, 5) -> 0; (1, 4) -> 0; (9, 13) -> 0; (25, 43) -> 0; (6, 5) -> 0; (4, 4) -> 0; (0, 1) -> 1; (9, 89) -> 0; (43, 6) -> 0; (7, 40) -> 0; (5, 8) -> 0; (4, 6) -> 0; (1, 1) -> 0; (5, 72) -> 0; (92, 5) -> 0; (57, 6) -> 0; (48, 7) -> 0; (2, 0) -> 0; (21, 52) -> 0; (5, 2) -> 0; (8, 4) -> 0; (21, 15) -> 0; (0, 9) -> 0; (6, 43) -> 0; (8, 3) -> 0; (0, 4) -> 0; (21, 0) -> 0; (21, 8) -> 0; (0, 21) -> 0; (2, 15) -> 0; (57, 3) -> 0; (8, 7) -> 0; (7, 3) -> 0; (1, 0) -> 0; (2, 16) -> 0; (5, 1) -> 0; (4, 78) -> 0; (2, 4) -> 0; (8, 46) -> 0; (32, 0) -> 0; (2, 47) -> 0; (3, 17) -> 0; (50, 5) -> 0; (0, 3) -> 0; (3, 7) -> 0; (6, 6) -> 0; (59, 5) -> 0; (8, 1) -> 0; (0, 8) -> 0; (5, 32) -> 0; (3, 21) -> 0; (0, 6) -> 0; (3, 46) -> 0; (64, 8) -> 0; (9, 2) -> 0; (67, 0) -> 0; (3, 51) -> 0; (5, 94) -> 0; (6, 2) -> 0; (43, 7) -> 0; (54, 21) -> 0; (4, 9) -> 0; (17, 5) -> 0; (1, 8) -> 0; (6, 7) -> 0; (3, 8) -> 0; (41, 55) -> 0; (3, 6) -> 0; (5, 0) -> 0; (6, 1) -> 0; (0, 2) -> 0; (2, 1) -> 0; (0, 5) -> 0; (21, 6) -> 0; (4, 2) -> 0; (64, 4) -> 0; (57, 0) -> 0; (9, 1) -> 0; (9, 31) -> 0; (5, 57) -> 0; (3, 0) -> 0; (7, 7) -> 0; (2, 64) -> 0; (3, 9) -> 0; (7, 96) -> 0; (32, 7) -> 0; (8, 10) -> 0; (9, 47) -> 0; (4, 8) -> 0; (31, 92) -> 0; (0, 32) -> 0; (37, 2) -> 0; (5, 4) -> 0; (18, 8) -> 0; (8, 30) -> 0; (6, 0) -> 0; (8, 9) -> 0; (5, 64) -> 0; (8, 96) -> 0; (3, 1) -> 0; (7, 21) -> 0; _ -> 0}) +++ Messages ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -598,13 +593,13 @@ l=[1], fold_left=0, fold_right=1 --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried failed (165 shrink steps): +Test fold_left fold_right uncurried failed (166 shrink steps): ({(53, 0) -> 0; (1, 91) -> 0; (5, 93) -> 0; (4, 80) -> 0; (50, 2) -> 0; (0, 7) -> 0; (83, 8) -> 0; (4, 45) -> 0; (28, 73) -> 0; (8, 2) -> 0; (7, 0) -> 0; (0, 0) -> 0; (1, 7) -> 0; (4, 6) -> 0; (8, 1) -> 0; (3, 5) -> 0; (8, 8) -> 0; (9, 3) -> 0; (3, 9) -> 0; (74, 0) -> 0; (5, 4) -> 0; (3, 52) -> 0; (6, 13) -> 0; (9, 22) -> 0; (83, 42) -> 0; (0, 99) -> 0; (26, 7) -> 0; (6, 14) -> 0; (4, 7) -> 0; (1, 1) -> 0; (0, 5) -> 0; (1, 5) -> 0; (5, 8) -> 0; (44, 8) -> 0; (2, 4) -> 0; (8, 12) -> 0; (4, 3) -> 0; (3, 6) -> 0; (8, 81) -> 0; (1, 2) -> 0; (2, 1) -> 0; (6, 5) -> 0; (9, 9) -> 0; (9, 38) -> 0; (7, 79) -> 0; (25, 4) -> 0; (2, 6) -> 0; (7, 94) -> 0; (5, 3) -> 0; (76, 49) -> 0; (36, 9) -> 0; (3, 84) -> 0; (1, 23) -> 0; (1, 6) -> 0; (0, 6) -> 0; (44, 2) -> 0; (83, 3) -> 0; (5, 18) -> 0; (3, 1) -> 0; (46, 7) -> 0; (24, 9) -> 0; (22, 5) -> 0; (5, 5) -> 0; (7, 4) -> 0; (36, 92) -> 0; (5, 14) -> 0; (6, 2) -> 0; (96, 5) -> 0; (1, 0) -> 0; (8, 4) -> 0; (5, 0) -> 0; (7, 5) -> 0; (9, 8) -> 0; (0, 19) -> 0; (0, 32) -> 0; (1, 33) -> 0; (6, 1) -> 0; (2, 82) -> 0; (8, 74) -> 0; (9, 6) -> 0; (8, 6) -> 0; (64, 2) -> 0; (3, 8) -> 0; (32, 56) -> 0; (6, 74) -> 0; (7, 1) -> 0; (6, 6) -> 0; (8, 98) -> 0; (4, 97) -> 0; (6, 72) -> 0; (0, 9) -> 0; (4, 8) -> 0; (2, 92) -> 0; (4, 23) -> 0; (3, 95) -> 0; (4, 61) -> 0; (0, 85) -> 0; (10, 92) -> 0; (89, 6) -> 0; (8, 3) -> 0; (32, 6) -> 0; (3, 2) -> 0; (9, 21) -> 0; (58, 6) -> 0; (3, 10) -> 0; (6, 9) -> 0; (8, 9) -> 0; (7, 8) -> 0; (23, 9) -> 0; (4, 9) -> 0; (23, 68) -> 0; (0, 1) -> 0; (6, 85) -> 0; (2, 0) -> 0; (7, 6) -> 0; (6, 3) -> 0; (0, 96) -> 0; (77, 8) -> 0; (9, 15) -> 0; (77, 0) -> 0; (0, 8) -> 0; (4, 2) -> 0; (8, 7) -> 0; (87, 7) -> 0; (3, 0) -> 0; (90, 46) -> 0; (7, 9) -> 0; (6, 4) -> 0; (6, 0) -> 1; (96, 71) -> 0; (76, 0) -> 0; (74, 3) -> 0; (1, 3) -> 0; (7, 71) -> 0; (7, 99) -> 0; (6, 7) -> 0; (9, 4) -> 0; (1, 8) -> 0; (4, 5) -> 0; (82, 4) -> 0; (5, 9) -> 0; (3, 3) -> 0; (0, 4) -> 0; (2, 3) -> 0; (44, 4) -> 0; (5, 7) -> 0; (5, 6) -> 0; (4, 4) -> 0; (4, 83) -> 0; (6, 49) -> 0; (1, 9) -> 0; (7, 7) -> 0; _ -> 0}, 0, [6]) --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried fun last failed (23 shrink steps): +Test fold_left fold_right uncurried fun last failed (27 shrink steps): (0, [1], {(8, 3) -> 0; (5, 9) -> 0; (8, 0) -> 0; (0, 8) -> 0; (0, 7) -> 0; (50, 57) -> 0; (8, 47) -> 0; (32, 4) -> 0; (4, 21) -> 0; (0, 4) -> 0; (1, 0) -> 1; (7, 5) -> 0; _ -> 0}) diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.64 b/test/core/QCheck2_expect_test.expected.ocaml5.64 index 2cb9d9de..57d49c14 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.64 @@ -130,24 +130,19 @@ random seed: 1234 1 0 [0; 1; 80; 0; 9; 2; 3] -[] -[0; 1; 80] -[] +[0; 1; 80; 0] +[0; 1] [0] [] [0; 1; 80; 0; 9; 2; 3] -[] -[0; 1; 80] -[0; 1; 80; 0; 9] -[] -[0; 1] -[0; 1; 80] [0; 1; 80; 0] -[] [0; 1] -[0; 1; 80] -[0; 0; 80; 0] -[0; 0; 0; 0] +[80; 0] +[1; 80; 0] +[0; 1; 0] +[0; 1] +[0] +[0; 0; 0] --- Failure -------------------------------------------------------------------- @@ -437,15 +432,15 @@ Test pairs sum to less than 128 failed (57 shrink steps): --- Failure -------------------------------------------------------------------- -Test pairs lists rev concat failed (78 shrink steps): +Test pairs lists rev concat failed (79 shrink steps): ([0], [1]) --- Failure -------------------------------------------------------------------- -Test pairs lists no overlap failed (35 shrink steps): +Test pairs lists no overlap failed (17 shrink steps): -([0], [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0]) +([0], [0]) --- Failure -------------------------------------------------------------------- @@ -557,13 +552,13 @@ Test bind list_size constant failed (12 shrink steps): --- Failure -------------------------------------------------------------------- -Test lists are empty failed (2 shrink steps): +Test lists are empty failed (3 shrink steps): [0] --- Failure -------------------------------------------------------------------- -Test lists shorter than 10 failed (13 shrink steps): +Test lists shorter than 10 failed (15 shrink steps): [0; 0; 0; 0; 0; 0; 0; 0; 0; 0] @@ -581,9 +576,9 @@ Test lists shorter than 4332 failed (4005 shrink steps): --- Failure -------------------------------------------------------------------- -Test lists have unique elems failed (4 shrink steps): +Test lists have unique elems failed (3 shrink steps): -[0; 0; 0; 0] +[0; 0; 0] --- Failure -------------------------------------------------------------------- @@ -647,9 +642,9 @@ Test fail_pred_strings failed (1 shrink steps): --- Failure -------------------------------------------------------------------- -Test fold_left fold_right failed (149 shrink steps): +Test fold_left fold_right failed (152 shrink steps): -(0, [1], {(55, 3) -> 0; (3, 4) -> 0; (42, 7) -> 0; (89, 6) -> 0; (1, 9) -> 0; (6, 9) -> 0; (5, 61) -> 0; (1, 7) -> 0; (2, 57) -> 0; (57, 1) -> 0; (47, 1) -> 0; (9, 4) -> 0; (5, 92) -> 0; (6, 8) -> 0; (4, 0) -> 0; (25, 32) -> 0; (96, 6) -> 0; (7, 1) -> 0; (2, 9) -> 0; (3, 50) -> 0; (0, 0) -> 0; (7, 4) -> 0; (4, 7) -> 0; (2, 65) -> 0; (13, 5) -> 0; (61, 4) -> 0; (8, 6) -> 0; (82, 8) -> 0; (4, 44) -> 0; (9, 3) -> 0; (4, 3) -> 0; (25, 8) -> 0; (1, 2) -> 0; (6, 3) -> 0; (4, 1) -> 0; (1, 55) -> 0; (40, 0) -> 0; (5, 13) -> 0; (5, 73) -> 0; (7, 2) -> 0; (3, 3) -> 0; (8, 64) -> 0; (6, 4) -> 0; (46, 0) -> 0; (4, 39) -> 0; (7, 0) -> 0; (4, 5) -> 0; (9, 7) -> 0; (28, 0) -> 0; (47, 15) -> 0; (11, 8) -> 0; (3, 5) -> 0; (1, 4) -> 0; (9, 13) -> 0; (25, 43) -> 0; (6, 5) -> 0; (4, 4) -> 0; (0, 1) -> 1; (9, 89) -> 0; (43, 6) -> 0; (7, 40) -> 0; (5, 8) -> 0; (4, 6) -> 0; (1, 1) -> 0; (5, 72) -> 0; (92, 5) -> 0; (57, 6) -> 0; (48, 7) -> 0; (2, 0) -> 0; (21, 52) -> 0; (5, 2) -> 0; (8, 4) -> 0; (21, 15) -> 0; (0, 9) -> 0; (6, 43) -> 0; (8, 3) -> 0; (0, 4) -> 0; (21, 0) -> 0; (21, 8) -> 0; (0, 21) -> 0; (2, 15) -> 0; (57, 3) -> 0; (8, 7) -> 0; (7, 3) -> 0; (1, 0) -> 0; (2, 16) -> 0; (5, 1) -> 0; (4, 78) -> 0; (2, 4) -> 0; (8, 46) -> 0; (32, 0) -> 0; (2, 47) -> 0; (3, 17) -> 0; (50, 5) -> 0; (0, 3) -> 0; (3, 7) -> 0; (6, 6) -> 0; (59, 5) -> 0; (8, 1) -> 0; (0, 8) -> 0; (5, 32) -> 0; (3, 21) -> 0; (0, 6) -> 0; (3, 46) -> 0; (64, 8) -> 0; (9, 2) -> 0; (67, 0) -> 0; (3, 51) -> 0; (5, 94) -> 0; (6, 2) -> 0; (43, 7) -> 0; (54, 21) -> 0; (4, 9) -> 0; (17, 5) -> 0; (1, 8) -> 0; (6, 7) -> 0; (3, 8) -> 0; (41, 55) -> 0; (3, 6) -> 0; (5, 0) -> 0; (6, 1) -> 0; (0, 2) -> 0; (2, 1) -> 0; (0, 5) -> 0; (21, 6) -> 0; (4, 2) -> 0; (64, 4) -> 0; (9, 1) -> 0; (9, 31) -> 0; (5, 57) -> 0; (3, 0) -> 0; (7, 7) -> 0; (2, 64) -> 0; (3, 9) -> 0; (7, 96) -> 0; (32, 7) -> 0; (8, 10) -> 0; (9, 47) -> 0; (4, 8) -> 0; (31, 92) -> 0; (0, 32) -> 0; (37, 2) -> 0; (5, 4) -> 0; (18, 8) -> 0; (8, 30) -> 0; (6, 0) -> 0; (8, 9) -> 0; (5, 64) -> 0; (8, 96) -> 0; (3, 1) -> 0; (7, 21) -> 0; _ -> 0}) +(0, [1], {(55, 3) -> 0; (3, 4) -> 0; (42, 7) -> 0; (89, 6) -> 0; (1, 9) -> 0; (6, 9) -> 0; (5, 61) -> 0; (1, 7) -> 0; (2, 57) -> 0; (57, 1) -> 0; (47, 1) -> 0; (9, 4) -> 0; (5, 92) -> 0; (6, 8) -> 0; (4, 0) -> 0; (25, 32) -> 0; (96, 6) -> 0; (7, 1) -> 0; (2, 9) -> 0; (3, 50) -> 0; (0, 0) -> 0; (7, 4) -> 0; (4, 7) -> 0; (2, 65) -> 0; (13, 5) -> 0; (61, 4) -> 0; (8, 6) -> 0; (82, 8) -> 0; (4, 44) -> 0; (9, 3) -> 0; (4, 3) -> 0; (25, 8) -> 0; (1, 2) -> 0; (6, 3) -> 0; (4, 1) -> 0; (1, 55) -> 0; (40, 0) -> 0; (5, 13) -> 0; (5, 73) -> 0; (7, 2) -> 0; (3, 3) -> 0; (8, 64) -> 0; (6, 4) -> 0; (46, 0) -> 0; (4, 39) -> 0; (7, 0) -> 0; (4, 5) -> 0; (9, 7) -> 0; (28, 0) -> 0; (47, 15) -> 0; (11, 8) -> 0; (3, 5) -> 0; (1, 4) -> 0; (9, 13) -> 0; (25, 43) -> 0; (6, 5) -> 0; (4, 4) -> 0; (0, 1) -> 1; (9, 89) -> 0; (43, 6) -> 0; (7, 40) -> 0; (5, 8) -> 0; (4, 6) -> 0; (1, 1) -> 0; (5, 72) -> 0; (92, 5) -> 0; (57, 6) -> 0; (48, 7) -> 0; (2, 0) -> 0; (21, 52) -> 0; (5, 2) -> 0; (8, 4) -> 0; (21, 15) -> 0; (0, 9) -> 0; (6, 43) -> 0; (8, 3) -> 0; (0, 4) -> 0; (21, 0) -> 0; (21, 8) -> 0; (0, 21) -> 0; (2, 15) -> 0; (57, 3) -> 0; (8, 7) -> 0; (7, 3) -> 0; (1, 0) -> 0; (2, 16) -> 0; (5, 1) -> 0; (4, 78) -> 0; (2, 4) -> 0; (8, 46) -> 0; (32, 0) -> 0; (2, 47) -> 0; (3, 17) -> 0; (50, 5) -> 0; (0, 3) -> 0; (3, 7) -> 0; (6, 6) -> 0; (59, 5) -> 0; (8, 1) -> 0; (0, 8) -> 0; (5, 32) -> 0; (3, 21) -> 0; (0, 6) -> 0; (3, 46) -> 0; (64, 8) -> 0; (9, 2) -> 0; (67, 0) -> 0; (3, 51) -> 0; (5, 94) -> 0; (6, 2) -> 0; (43, 7) -> 0; (54, 21) -> 0; (4, 9) -> 0; (17, 5) -> 0; (1, 8) -> 0; (6, 7) -> 0; (3, 8) -> 0; (41, 55) -> 0; (3, 6) -> 0; (5, 0) -> 0; (6, 1) -> 0; (0, 2) -> 0; (2, 1) -> 0; (0, 5) -> 0; (21, 6) -> 0; (4, 2) -> 0; (64, 4) -> 0; (57, 0) -> 0; (9, 1) -> 0; (9, 31) -> 0; (5, 57) -> 0; (3, 0) -> 0; (7, 7) -> 0; (2, 64) -> 0; (3, 9) -> 0; (7, 96) -> 0; (32, 7) -> 0; (8, 10) -> 0; (9, 47) -> 0; (4, 8) -> 0; (31, 92) -> 0; (0, 32) -> 0; (37, 2) -> 0; (5, 4) -> 0; (18, 8) -> 0; (8, 30) -> 0; (6, 0) -> 0; (8, 9) -> 0; (5, 64) -> 0; (8, 96) -> 0; (3, 1) -> 0; (7, 21) -> 0; _ -> 0}) +++ Messages ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -660,13 +655,13 @@ l=[1], fold_left=0, fold_right=1 --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried failed (165 shrink steps): +Test fold_left fold_right uncurried failed (166 shrink steps): ({(53, 0) -> 0; (1, 91) -> 0; (5, 93) -> 0; (4, 80) -> 0; (50, 2) -> 0; (0, 7) -> 0; (83, 8) -> 0; (4, 45) -> 0; (28, 73) -> 0; (8, 2) -> 0; (7, 0) -> 0; (0, 0) -> 0; (1, 7) -> 0; (4, 6) -> 0; (8, 1) -> 0; (3, 5) -> 0; (8, 8) -> 0; (9, 3) -> 0; (3, 9) -> 0; (74, 0) -> 0; (5, 4) -> 0; (3, 52) -> 0; (6, 13) -> 0; (9, 22) -> 0; (83, 42) -> 0; (0, 99) -> 0; (26, 7) -> 0; (6, 14) -> 0; (4, 7) -> 0; (1, 1) -> 0; (0, 5) -> 0; (1, 5) -> 0; (5, 8) -> 0; (44, 8) -> 0; (2, 4) -> 0; (8, 12) -> 0; (4, 3) -> 0; (3, 6) -> 0; (8, 81) -> 0; (1, 2) -> 0; (2, 1) -> 0; (6, 5) -> 0; (9, 9) -> 0; (9, 38) -> 0; (7, 79) -> 0; (25, 4) -> 0; (2, 6) -> 0; (7, 94) -> 0; (5, 3) -> 0; (76, 49) -> 0; (36, 9) -> 0; (3, 84) -> 0; (1, 23) -> 0; (1, 6) -> 0; (0, 6) -> 0; (44, 2) -> 0; (83, 3) -> 0; (5, 18) -> 0; (3, 1) -> 0; (46, 7) -> 0; (24, 9) -> 0; (22, 5) -> 0; (5, 5) -> 0; (7, 4) -> 0; (36, 92) -> 0; (5, 14) -> 0; (6, 2) -> 0; (96, 5) -> 0; (1, 0) -> 0; (8, 4) -> 0; (5, 0) -> 0; (7, 5) -> 0; (9, 8) -> 0; (0, 19) -> 0; (0, 32) -> 0; (1, 33) -> 0; (6, 1) -> 0; (2, 82) -> 0; (8, 74) -> 0; (9, 6) -> 0; (8, 6) -> 0; (64, 2) -> 0; (3, 8) -> 0; (32, 56) -> 0; (6, 74) -> 0; (7, 1) -> 0; (6, 6) -> 0; (8, 98) -> 0; (4, 97) -> 0; (6, 72) -> 0; (0, 9) -> 0; (4, 8) -> 0; (2, 92) -> 0; (4, 23) -> 0; (3, 95) -> 0; (4, 61) -> 0; (0, 85) -> 0; (10, 92) -> 0; (89, 6) -> 0; (8, 3) -> 0; (32, 6) -> 0; (3, 2) -> 0; (9, 21) -> 0; (58, 6) -> 0; (3, 10) -> 0; (6, 9) -> 0; (8, 9) -> 0; (7, 8) -> 0; (23, 9) -> 0; (4, 9) -> 0; (23, 68) -> 0; (0, 1) -> 0; (6, 85) -> 0; (2, 0) -> 0; (7, 6) -> 0; (6, 3) -> 0; (0, 96) -> 0; (77, 8) -> 0; (9, 15) -> 0; (77, 0) -> 0; (0, 8) -> 0; (4, 2) -> 0; (8, 7) -> 0; (87, 7) -> 0; (3, 0) -> 0; (90, 46) -> 0; (7, 9) -> 0; (6, 4) -> 0; (6, 0) -> 1; (96, 71) -> 0; (76, 0) -> 0; (74, 3) -> 0; (1, 3) -> 0; (7, 71) -> 0; (7, 99) -> 0; (6, 7) -> 0; (9, 4) -> 0; (1, 8) -> 0; (4, 5) -> 0; (82, 4) -> 0; (5, 9) -> 0; (3, 3) -> 0; (0, 4) -> 0; (2, 3) -> 0; (44, 4) -> 0; (5, 7) -> 0; (5, 6) -> 0; (4, 4) -> 0; (4, 83) -> 0; (6, 49) -> 0; (1, 9) -> 0; (7, 7) -> 0; _ -> 0}, 0, [6]) --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried fun last failed (23 shrink steps): +Test fold_left fold_right uncurried fun last failed (27 shrink steps): (0, [1], {(8, 3) -> 0; (5, 9) -> 0; (8, 0) -> 0; (0, 8) -> 0; (0, 7) -> 0; (50, 57) -> 0; (8, 47) -> 0; (32, 4) -> 0; (4, 21) -> 0; (0, 4) -> 0; (1, 0) -> 1; (7, 5) -> 0; _ -> 0}) From 17de40a545efbffe9a16cd45611437f294b51cb6 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 30 Jan 2025 12:07:22 +0100 Subject: [PATCH 304/391] Move helper functions and polish QCheck2.Gen.list shrinker --- src/core/QCheck2.ml | 64 ++++++++++++++++++++++----------------------- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index 4b126a55..0b13ca90 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -52,6 +52,11 @@ let _opt_sum a b = match a, b with let sum_int = List.fold_left (+) 0 +let rec list_split l len acc = match len,l with + | _,[] + | 0,_ -> List.rev acc, l + | _,x::xs -> list_split xs (len-1) (x::acc) + exception Failed_precondition (* raised if precondition is false *) @@ -239,6 +244,31 @@ module Tree = struct let rec applicative_take (n : int) (l : 'a t list) : 'a list t = match (n, l) with | (0, _) | (_, []) -> pure [] | (n, (tree :: trees)) -> liftA2 List.cons tree (applicative_take (pred n) trees) + + let rec build_list_shrink_tree (l : 'a t list) : 'a list t Seq.t = match l with + | [] -> Seq.empty + | [_] -> + fun () -> Seq.cons (Tree ([], Seq.empty)) (* [x] leaves only empty list to try *) + (children (sequence_list l)) () (* otherwise, reduce element(s) *) + | _::_ -> + fun () -> + let len = List.length l in + let xs,ys = list_split l ((1 + len) / 2) [] in + let xs_roots = List.map root xs in + let ys_roots = List.map root ys in + (* Try reducing a list [1;2;3;4] in halves: [1;2] and [3;4] *) + Seq.cons (Tree (xs_roots, build_list_shrink_tree xs)) + (Seq.cons (Tree (ys_roots, build_list_shrink_tree ys)) + (fun () -> + (if len >= 4 + then (* Try dropping an element from either half: [2;3;4] and [1;2;4] *) + let rest = List.tl l in + let rest_roots = List.map root rest in + (Seq.cons (Tree (rest_roots, build_list_shrink_tree rest)) + (Seq.cons (Tree (xs_roots@(List.tl ys_roots), build_list_shrink_tree (xs@(List.tl ys)))) + (children (sequence_list l)))) (* at bottom: reduce elements *) + else + children (sequence_list l)) ())) () end module Gen = struct @@ -583,47 +613,15 @@ module Gen = struct in loop size [] - let rec split l len acc = match len,l with - | _,[] - | 0,_ -> List.rev acc, l - | _,x::xs -> split xs (len-1) (x::acc) - - let rec build_shrink_tree (l : 'a Tree.t list) : 'a list Tree.t Seq.t = match l with - | [] -> Seq.empty - | [_] -> - fun () -> Seq.cons (Tree.Tree ([], Seq.empty)) (* only empty list to try *) - (Tree.children (Tree.sequence_list l)) () (* otherwise, reduce element(s) *) - | _::_ -> - fun () -> - let len = List.length l in - let xs,ys = split l ((1 + len) / 2) [] in - let xs_roots = List.map Tree.root xs in - let ys_roots = List.map Tree.root ys in - Seq.cons (Tree.Tree (xs_roots, build_shrink_tree xs)) (* try first half *) - (Seq.cons (Tree.Tree (ys_roots, build_shrink_tree ys)) (* then second half *) - (if len >= 4 - then - let rest = List.tl l in - let rest_roots = List.map Tree.root rest in - (Seq.cons (Tree.Tree (rest_roots, build_shrink_tree rest)) (* drop head *) - (Seq.cons (Tree.Tree (xs_roots@(List.tl ys_roots), build_shrink_tree (xs@(List.tl ys)))) (* drop ys head *) - (Tree.children (Tree.sequence_list l)) (* at bottom: reduce elements *) - )) - else - (Tree.children (Tree.sequence_list l)) - )) () - let list (gen : 'a t) : 'a list t = fun st -> let st' = RS.split st in let size = Tree.root (nat st) in - (*Tree.bind (nat st) @@ fun size ->*) let st' = RS.copy st' in (* start each loop from same Random.State to recreate same element (prefix) *) let rec loop n acc = (* phase 1: build a list of element trees, tail recursively *) if n <= 0 (* phase 2: build a list shrink Tree of element trees, tail recursively *) then let l = List.rev acc in - (*let l = List.map Tree.root l in*) - Tree.Tree (List.map Tree.root l, build_shrink_tree l) + Tree.Tree (List.map Tree.root l, Tree.build_list_shrink_tree l) else (loop [@tailcall]) (n - 1) ((gen st')::acc) in loop size [] From ef3946bf6b5ab0c62915dc1d2f50e9184e0b4b7f Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 30 Jan 2025 17:22:56 +0100 Subject: [PATCH 305/391] Add shrink unit tests of QCheck2.Gen.{array_size,array,bytes,string_size,string} --- test/core/QCheck2_unit_tests.ml | 155 ++++++++++++++++++++++++++++++++ 1 file changed, 155 insertions(+) diff --git a/test/core/QCheck2_unit_tests.ml b/test/core/QCheck2_unit_tests.ml index 3e3bec01..51872ebf 100644 --- a/test/core/QCheck2_unit_tests.ml +++ b/test/core/QCheck2_unit_tests.ml @@ -230,6 +230,65 @@ module Shrink = struct ~actual:(Gen.(generate_tree ~rand:(rand_init 3347) (list (int_bound 10))) |> repeated_success) ~expected:[ [1; 10; 10; 7; 3]; [1; 10; 10]; [1; 10]; [1]; []; ]) + let test_array_size_int () = + if ocaml_major_version < 5 + then + (Alcotest.(check' (list (array int))) + ~msg:"[|10; 8|] on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (array_size (int_bound 8) (int_bound 10))) |> repeated_failure) + ~expected:[ [|10; 8|]; [||]; [|10|]; + [|0; 8|]; [|5; 8|]; [|8; 8|]; [|9; 8|]; + [|10; 0|]; [|10; 4|]; [|10; 6|]; [|10; 7|]; ]; + Alcotest.(check' (list (array int))) + ~msg:"[|10; 8|] on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (array_size (int_bound 8) (int_bound 10))) |> repeated_success) + ~expected:[ [|10; 8|]; [| |]; ]) + else + (Alcotest.(check' (list (array int))) + ~msg:"[|9; 2; 7; 3; 8; 6|] repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (array_size (int_bound 8) (int_bound 10))) |> repeated_failure) + ~expected:[ [|9; 2; 7; 3; 8; 6|]; [||]; [|9; 2; 7|]; [|9; 2; 7; 3; 8|]; + [|0; 2; 7; 3; 8; 6|]; [|4; 2; 7; 3; 8; 6|]; [|6; 2; 7; 3; 8; 6|]; [|7; 2; 7; 3; 8; 6|]; [|8; 2; 7; 3; 8; 6|]; + [|9; 0; 7; 3; 8; 6|]; [|9; 1; 7; 3; 8; 6|]; + [|9; 2; 0; 3; 8; 6|]; [|9; 2; 3; 3; 8; 6|]; [|9; 2; 5; 3; 8; 6|]; [|9; 2; 6; 3; 8; 6|]; + [|9; 2; 7; 0; 8; 6|]; [|9; 2; 7; 1; 8; 6|]; [|9; 2; 7; 2; 8; 6|]; + [|9; 2; 7; 3; 0; 6|]; [|9; 2; 7; 3; 4; 6|]; [|9; 2; 7; 3; 6; 6|]; [|9; 2; 7; 3; 7; 6|]; + [|9; 2; 7; 3; 8; 0|]; [|9; 2; 7; 3; 8; 3|]; [|9; 2; 7; 3; 8; 5|]; ]; + Alcotest.(check' (list (array int))) + ~msg:"[|9; 2; 7; 3; 8; 6|] repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (array_size (int_bound 8) (int_bound 10))) |> repeated_success) + ~expected:[[|9; 2; 7; 3; 8; 6|]; [| |]; ]) + + let test_array_int () = + if ocaml_major_version < 5 + then + (Alcotest.(check' (list (array int))) + ~msg:"[|5; 9; 4; 10|] on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) (array (int_bound 10))) |> repeated_failure) + ~expected:[ [|5; 9; 4; 10|]; [|5; 9|]; [|4; 10|]; [|9; 4; 10|]; [|5; 9; 10|]; + [|0; 9; 4; 10|]; [|2; 9; 4; 10|]; [|3; 9; 4; 10|]; [|4; 9; 4; 10|]; + [|5; 0; 4; 10|]; [|5; 4; 4; 10|]; [|5; 6; 4; 10|]; [|5; 7; 4; 10|]; [|5; 8; 4; 10|]; + [|5; 9; 0; 10|]; [|5; 9; 2; 10|]; [|5; 9; 3; 10|]; + [|5; 9; 4; 0|]; [|5; 9; 4; 5|]; [|5; 9; 4; 8|]; [|5; 9; 4; 9|]; ]; + Alcotest.(check' (list (array int))) + ~msg:"[|5; 9; 4; 10|] on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) (array (int_bound 10))) |> repeated_success) + ~expected:[ [|5; 9; 4; 10|]; [|5; 9|]; [|5|]; [||]; ]) + else + (Alcotest.(check' (list (array int))) + ~msg:"[|1; 10; 10; 7; 3|] on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3347) (array (int_bound 10))) |> repeated_failure) + ~expected:[ [|1; 10; 10; 7; 3|]; [|1; 10; 10|]; [|7; 3|]; [|10; 10; 7; 3|]; [|1; 10; 10; 3|]; + [|0; 10; 10; 7; 3|]; + [|1; 0; 10; 7; 3|]; [|1; 5; 10; 7; 3|]; [|1; 8; 10; 7; 3|]; [|1; 9; 10; 7; 3|]; + [|1; 10; 0; 7; 3|]; [|1; 10; 5; 7; 3|]; [|1; 10; 8; 7; 3|]; [|1; 10; 9; 7; 3|]; + [|1; 10; 10; 0; 3|]; [|1; 10; 10; 3; 3|]; [|1; 10; 10; 5; 3|]; [|1; 10; 10; 6; 3|]; + [|1; 10; 10; 7; 0|]; [|1; 10; 10; 7; 1|]; [|1; 10; 10; 7; 2|]; ]; + Alcotest.(check' (list (array int))) + ~msg:"[|1; 10; 10; 7; 3|] on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3347) (array (int_bound 10))) |> repeated_success) + ~expected:[ [|1; 10; 10; 7; 3|]; [|1; 10; 10|]; [|1; 10|]; [|1|]; [||]; ]) + let test_bytes_size () = if ocaml_major_version < 5 then @@ -261,6 +320,97 @@ module Shrink = struct ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (bytes_size ~gen:printable (int_bound 8))) |> repeated_success) ~expected:(List.map Bytes.of_string ["Ns<>W\\"; ""; ])) + let test_bytes () = + if ocaml_major_version < 5 + then + (Alcotest.(check' (list bytes)) + ~msg:"\"u\238\154I\" on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) bytes) |> repeated_failure) + ~expected:(List.map Bytes.of_string + [ "u\238\154I"; ""; "u\238"; "u\238\154"; + "a\238\154I"; "k\238\154I"; "p\238\154I"; "r\238\154I"; "s\238\154I"; "t\238\154I"; + "ua\154I"; "u\168\154I"; "u\203\154I"; "u\221\154I"; "u\230\154I"; "u\234\154I"; "u\236\154I"; "u\237\154I"; + "u\238aI"; "u\238~I"; "u\238\140I"; "u\238\147I"; "u\238\151I"; "u\238\153I"; + "u\238\154a"; "u\238\154U"; "u\238\154O"; "u\238\154L"; "u\238\154J"; ] ); + Alcotest.(check' (list bytes)) + ~msg:"\"u\238\154I\" on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) bytes) |> repeated_success) + ~expected:(List.map Bytes.of_string ["u\238\154I"; ""; ])) + else + (Alcotest.(check' (list bytes)) + ~msg:"\"\253NS\173\" on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3349) bytes) |> repeated_failure) + ~expected:(List.map Bytes.of_string + [ "\253NS\173"; ""; "\253N"; "\253NS"; "aNS\173"; + "\175NS\173"; "\214NS\173"; "\233NS\173"; "\243NS\173"; "\248NS\173"; "\250NS\173"; "\251NS\173"; "\252NS\173"; + "\253aS\173"; "\253XS\173"; "\253SS\173"; "\253QS\173"; "\253PS\173"; "\253OS\173"; + "\253Na\173"; "\253NZ\173"; "\253NV\173"; "\253NT\173"; + "\253NSa"; "\253NS\135"; "\253NS\154"; "\253NS\163"; "\253NS\168"; "\253NS\170"; "\253NS\171"; "\253NS\172"; ] ); + Alcotest.(check' (list bytes)) + ~msg:"\"\253NS\173\" on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3349) bytes) |> repeated_success) + ~expected:(List.map Bytes.of_string [ "\253NS\173"; ""; ])) + + let test_string_size () = + if ocaml_major_version < 5 + then + (Alcotest.(check' (list string)) + ~msg:"\";T /\" on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) (string_size ~gen:printable (int_bound 8))) |> repeated_failure) + ~expected:[ ";T /"; ""; ";T"; ";T "; + "aT /"; " T /"; "-T /"; "4T /"; "7T /"; "9T /"; ":T /"; + ";a /"; ";- /"; ";A /"; ";K /"; ";P /"; ";R /"; ";S /"; + ";Ta/"; ";Tn/"; ";Tu/"; ";Tx/"; ";Tz/"; + ";T a"; ";T u"; ";T $"; ";T )"; ";T ,"; ";T -"; ";T ."; ]; + Alcotest.(check' (list string)) + ~msg:"\";T /\" on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) (string_size ~gen:printable (int_bound 8))) |> repeated_success) + ~expected:[ ";T /"; ""; ]) + else + (Alcotest.(check' (list string)) + ~msg:"\"Ns<>W\\\" on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (string_size ~gen:printable (int_bound 8))) |> repeated_failure) + ~expected:["Ns<>W\\"; ""; "Ns<"; "Ns<>W"; "as<>W\\"; "*s<>W\\"; + "<s<>W\\"; "Es<>W\\"; "Js<>W\\"; "Ls<>W\\"; "Ms<>W\\"; + "Na<>W\\"; "Nj<>W\\"; "No<>W\\"; "Nq<>W\\"; "Nr<>W\\"; + "Nsa>W\\"; "Ns!>W\\"; "Ns/>W\\"; "Ns6>W\\"; "Ns9>W\\"; "Ns;>W\\"; + "Ns<aW\\"; "Ns<\"W\\"; "Ns<0W\\"; "Ns<7W\\"; "Ns<;W\\"; "Ns<=W\\"; + "Ns<>a\\"; "Ns<>.\\"; "Ns<>B\\"; "Ns<>L\\"; "Ns<>Q\\"; "Ns<>T\\"; "Ns<>U\\"; "Ns<>V\\"; + "Ns<>Wa"; "Ns<>W1"; "Ns<>WG"; "Ns<>WR"; "Ns<>WW"; "Ns<>WZ"; "Ns<>W["; ]; + Alcotest.(check' (list string)) + ~msg:"\"Ns<>W\\\" on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (string_size ~gen:printable (int_bound 8))) |> repeated_success) + ~expected:[ "Ns<>W\\"; ""; ]) + + let test_string () = + if ocaml_major_version < 5 + then + (Alcotest.(check' (list string)) + ~msg:"\"u\238\154I\" on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) string) |> repeated_failure) + ~expected:[ "u\238\154I"; ""; "u\238"; "u\238\154"; + "a\238\154I"; "k\238\154I"; "p\238\154I"; "r\238\154I"; "s\238\154I"; "t\238\154I"; + "ua\154I"; "u\168\154I"; "u\203\154I"; "u\221\154I"; "u\230\154I"; "u\234\154I"; "u\236\154I"; "u\237\154I"; + "u\238aI"; "u\238~I"; "u\238\140I"; "u\238\147I"; "u\238\151I"; "u\238\153I"; + "u\238\154a"; "u\238\154U"; "u\238\154O"; "u\238\154L"; "u\238\154J"; ]; + Alcotest.(check' (list string)) + ~msg:"\"u\238\154I\" on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) string) |> repeated_success) + ~expected:[ "u\238\154I"; ""; ]) + else + (Alcotest.(check' (list string)) + ~msg:"\"\253NS\173\" on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3349) string) |> repeated_failure) + ~expected:[ "\253NS\173"; ""; "\253N"; "\253NS"; + "aNS\173"; "\175NS\173"; "\214NS\173"; "\233NS\173"; "\243NS\173"; "\248NS\173"; "\250NS\173"; "\251NS\173"; "\252NS\173"; + "\253aS\173"; "\253XS\173"; "\253SS\173"; "\253QS\173"; "\253PS\173"; "\253OS\173"; + "\253Na\173"; "\253NZ\173"; "\253NV\173"; "\253NT\173"; + "\253NSa"; "\253NS\135"; "\253NS\154"; "\253NS\163"; "\253NS\168"; "\253NS\170"; "\253NS\171"; "\253NS\172"]; + Alcotest.(check' (list string)) + ~msg:"\"\253NS\173\" on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3349) string) |> repeated_success) + ~expected:[ "\253NS\173"; ""; ]) + let tests = ("Shrink", Alcotest.[ test_case "int_towards" `Quick test_int_towards; test_case "int32_towards" `Quick test_int32_towards; @@ -273,7 +423,12 @@ module Shrink = struct test_case "Gen.bind small_int tree" `Quick test_bind_small_int; test_case "Gen.list_size int" `Quick test_list_size_int; test_case "Gen.list int" `Quick test_list_int; + test_case "Gen.array_size int" `Quick test_array_size_int; + test_case "Gen.array int" `Quick test_array_int; test_case "Gen.bytes_size" `Quick test_bytes_size; + test_case "Gen.bytes" `Quick test_bytes; + test_case "Gen.string_size" `Quick test_string_size; + test_case "Gen.string" `Quick test_string; ]) end From 3923d1481925698dfa7bdf4bd7e3068bfb7946ab Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 31 Jan 2025 17:12:44 +0100 Subject: [PATCH 306/391] Add unit shrink tests of QCheck2.Gen.{small_list,array_small,bytes_small,string_small} --- test/core/QCheck2_unit_tests.ml | 124 ++++++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) diff --git a/test/core/QCheck2_unit_tests.ml b/test/core/QCheck2_unit_tests.ml index 51872ebf..5d7334ec 100644 --- a/test/core/QCheck2_unit_tests.ml +++ b/test/core/QCheck2_unit_tests.ml @@ -230,6 +230,36 @@ module Shrink = struct ~actual:(Gen.(generate_tree ~rand:(rand_init 3347) (list (int_bound 10))) |> repeated_success) ~expected:[ [1; 10; 10; 7; 3]; [1; 10; 10]; [1; 10]; [1]; []; ]) + let test_small_list_int () = + if ocaml_major_version < 5 + then + (Alcotest.(check' (list (list int))) + ~msg:"[5; 9; 4; 10] on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) (small_list (int_bound 10))) |> repeated_failure) + ~expected:[ [5; 9; 4; 10]; []; [5; 9]; [5; 9; 4]; + [0; 9; 4; 10]; [2; 9; 4; 10]; [3; 9; 4; 10]; [4; 9; 4; 10]; + [5; 0; 4; 10]; [5; 4; 4; 10]; [5; 6; 4; 10]; [5; 7; 4; 10]; [5; 8; 4; 10]; + [5; 9; 0; 10]; [5; 9; 2; 10]; [5; 9; 3; 10]; + [5; 9; 4; 0]; [5; 9; 4; 5]; [5; 9; 4; 8]; [5; 9; 4; 9]; ]; + Alcotest.(check' (list (list int))) + ~msg:"[5; 9; 4; 10] on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) (small_list (int_bound 10))) |> repeated_success) + ~expected:[ [5; 9; 4; 10]; []; ]) + else + (Alcotest.(check' (list (list int))) + ~msg:"[1; 10; 10; 7; 3] on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3347) (small_list (int_bound 10))) |> repeated_failure) + ~expected:[ [1; 10; 10; 7; 3]; []; [1; 10]; [1; 10; 10]; [1; 10; 10; 7]; + [0; 10; 10; 7; 3]; + [1; 0; 10; 7; 3]; [1; 5; 10; 7; 3]; [1; 8; 10; 7; 3]; [1; 9; 10; 7; 3]; + [1; 10; 0; 7; 3]; [1; 10; 5; 7; 3]; [1; 10; 8; 7; 3]; [1; 10; 9; 7; 3]; + [1; 10; 10; 0; 3]; [1; 10; 10; 3; 3]; [1; 10; 10; 5; 3]; [1; 10; 10; 6; 3]; + [1; 10; 10; 7; 0]; [1; 10; 10; 7; 1]; [1; 10; 10; 7; 2]; ]; + Alcotest.(check' (list (list int))) + ~msg:"[1; 10; 10; 7; 3] on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3347) (small_list (int_bound 10))) |> repeated_success) + ~expected:[ [1; 10; 10; 7; 3]; []; ]) + let test_array_size_int () = if ocaml_major_version < 5 then @@ -289,6 +319,36 @@ module Shrink = struct ~actual:(Gen.(generate_tree ~rand:(rand_init 3347) (array (int_bound 10))) |> repeated_success) ~expected:[ [|1; 10; 10; 7; 3|]; [|1; 10; 10|]; [|1; 10|]; [|1|]; [||]; ]) + let test_small_array_int () = + if ocaml_major_version < 5 + then + (Alcotest.(check' (list (array int))) + ~msg:"[|5; 9; 4; 10|] on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) (small_array (int_bound 10))) |> repeated_failure) + ~expected:[ [|5; 9; 4; 10|]; [||]; [|5; 9|]; [|5; 9; 4|]; + [|0; 9; 4; 10|]; [|2; 9; 4; 10|]; [|3; 9; 4; 10|]; [|4; 9; 4; 10|]; + [|5; 0; 4; 10|]; [|5; 4; 4; 10|]; [|5; 6; 4; 10|]; [|5; 7; 4; 10|]; [|5; 8; 4; 10|]; + [|5; 9; 0; 10|]; [|5; 9; 2; 10|]; [|5; 9; 3; 10|]; + [|5; 9; 4; 0|]; [|5; 9; 4; 5|]; [|5; 9; 4; 8|]; [|5; 9; 4; 9|]; ]; + Alcotest.(check' (list (array int))) + ~msg:"[|5; 9; 4; 10|] on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) (small_array (int_bound 10))) |> repeated_success) + ~expected:[ [|5; 9; 4; 10|]; [||]; ]) + else + (Alcotest.(check' (list (array int))) + ~msg:"[|1; 10; 10; 7; 3|] on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3347) (small_array (int_bound 10))) |> repeated_failure) + ~expected:[ [|1; 10; 10; 7; 3|]; [||]; [|1; 10|]; [|1; 10; 10|]; [|1; 10; 10; 7|]; + [|0; 10; 10; 7; 3|]; + [|1; 0; 10; 7; 3|]; [|1; 5; 10; 7; 3|]; [|1; 8; 10; 7; 3|]; [|1; 9; 10; 7; 3|]; + [|1; 10; 0; 7; 3|]; [|1; 10; 5; 7; 3|]; [|1; 10; 8; 7; 3|]; [|1; 10; 9; 7; 3|]; + [|1; 10; 10; 0; 3|]; [|1; 10; 10; 3; 3|]; [|1; 10; 10; 5; 3|]; [|1; 10; 10; 6; 3|]; + [|1; 10; 10; 7; 0|]; [|1; 10; 10; 7; 1|]; [|1; 10; 10; 7; 2|]; ]; + Alcotest.(check' (list (array int))) + ~msg:"[|1; 10; 10; 7; 3|] on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3347) (small_array (int_bound 10))) |> repeated_success) + ~expected:[ [|1; 10; 10; 7; 3|]; [||]; ]) + let test_bytes_size () = if ocaml_major_version < 5 then @@ -351,6 +411,37 @@ module Shrink = struct ~actual:(Gen.(generate_tree ~rand:(rand_init 3349) bytes) |> repeated_success) ~expected:(List.map Bytes.of_string [ "\253NS\173"; ""; ])) + let test_bytes_small () = + if ocaml_major_version < 5 + then + (Alcotest.(check' (list bytes)) + ~msg:"\"u\238\154I\" on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) bytes_small) |> repeated_failure) + ~expected:(List.map Bytes.of_string + [ "u\238\154I"; ""; "u\238"; "u\238\154"; + "a\238\154I"; "k\238\154I"; "p\238\154I"; "r\238\154I"; "s\238\154I"; "t\238\154I"; + "ua\154I"; "u\168\154I"; "u\203\154I"; "u\221\154I"; "u\230\154I"; "u\234\154I"; "u\236\154I"; "u\237\154I"; + "u\238aI"; "u\238~I"; "u\238\140I"; "u\238\147I"; "u\238\151I"; "u\238\153I"; + "u\238\154a"; "u\238\154U"; "u\238\154O"; "u\238\154L"; "u\238\154J"; ] ); + Alcotest.(check' (list bytes)) + ~msg:"\"u\238\154I\" on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) bytes_small) |> repeated_success) + ~expected:(List.map Bytes.of_string ["u\238\154I"; ""; ])) + else + (Alcotest.(check' (list bytes)) + ~msg:"\"\253NS\173\" on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3349) bytes_small) |> repeated_failure) + ~expected:(List.map Bytes.of_string + [ "\253NS\173"; ""; "\253N"; "\253NS"; "aNS\173"; + "\175NS\173"; "\214NS\173"; "\233NS\173"; "\243NS\173"; "\248NS\173"; "\250NS\173"; "\251NS\173"; "\252NS\173"; + "\253aS\173"; "\253XS\173"; "\253SS\173"; "\253QS\173"; "\253PS\173"; "\253OS\173"; + "\253Na\173"; "\253NZ\173"; "\253NV\173"; "\253NT\173"; + "\253NSa"; "\253NS\135"; "\253NS\154"; "\253NS\163"; "\253NS\168"; "\253NS\170"; "\253NS\171"; "\253NS\172"; ] ); + Alcotest.(check' (list bytes)) + ~msg:"\"\253NS\173\" on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3349) bytes_small) |> repeated_success) + ~expected:(List.map Bytes.of_string [ "\253NS\173"; ""; ])) + let test_string_size () = if ocaml_major_version < 5 then @@ -411,6 +502,35 @@ module Shrink = struct ~actual:(Gen.(generate_tree ~rand:(rand_init 3349) string) |> repeated_success) ~expected:[ "\253NS\173"; ""; ]) + let test_string_small () = + if ocaml_major_version < 5 + then + (Alcotest.(check' (list string)) + ~msg:"\"u\238\154I\" on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) string_small) |> repeated_failure) + ~expected:[ "u\238\154I"; ""; "u\238"; "u\238\154"; + "a\238\154I"; "k\238\154I"; "p\238\154I"; "r\238\154I"; "s\238\154I"; "t\238\154I"; + "ua\154I"; "u\168\154I"; "u\203\154I"; "u\221\154I"; "u\230\154I"; "u\234\154I"; "u\236\154I"; "u\237\154I"; + "u\238aI"; "u\238~I"; "u\238\140I"; "u\238\147I"; "u\238\151I"; "u\238\153I"; + "u\238\154a"; "u\238\154U"; "u\238\154O"; "u\238\154L"; "u\238\154J"; ]; + Alcotest.(check' (list string)) + ~msg:"\"u\238\154I\" on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) string_small) |> repeated_success) + ~expected:[ "u\238\154I"; ""; ]) + else + (Alcotest.(check' (list string)) + ~msg:"\"\253NS\173\" on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3349) string_small) |> repeated_failure) + ~expected:[ "\253NS\173"; ""; "\253N"; "\253NS"; + "aNS\173"; "\175NS\173"; "\214NS\173"; "\233NS\173"; "\243NS\173"; "\248NS\173"; "\250NS\173"; "\251NS\173"; "\252NS\173"; + "\253aS\173"; "\253XS\173"; "\253SS\173"; "\253QS\173"; "\253PS\173"; "\253OS\173"; + "\253Na\173"; "\253NZ\173"; "\253NV\173"; "\253NT\173"; + "\253NSa"; "\253NS\135"; "\253NS\154"; "\253NS\163"; "\253NS\168"; "\253NS\170"; "\253NS\171"; "\253NS\172"]; + Alcotest.(check' (list string)) + ~msg:"\"\253NS\173\" on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3349) string_small) |> repeated_success) + ~expected:[ "\253NS\173"; ""; ]) + let tests = ("Shrink", Alcotest.[ test_case "int_towards" `Quick test_int_towards; test_case "int32_towards" `Quick test_int32_towards; @@ -423,12 +543,16 @@ module Shrink = struct test_case "Gen.bind small_int tree" `Quick test_bind_small_int; test_case "Gen.list_size int" `Quick test_list_size_int; test_case "Gen.list int" `Quick test_list_int; + test_case "Gen.small_list int" `Quick test_small_list_int; test_case "Gen.array_size int" `Quick test_array_size_int; test_case "Gen.array int" `Quick test_array_int; + test_case "Gen.array_small int" `Quick test_small_array_int; test_case "Gen.bytes_size" `Quick test_bytes_size; test_case "Gen.bytes" `Quick test_bytes; + test_case "Gen.bytes_small" `Quick test_bytes_small; test_case "Gen.string_size" `Quick test_string_size; test_case "Gen.string" `Quick test_string; + test_case "Gen.string_small" `Quick test_string_small; ]) end From 2c9c68ec497987b10582900b6981bb56afb3191b Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 31 Jan 2025 17:32:04 +0100 Subject: [PATCH 307/391] Factor Gen.list into a separate function for reuse on both nat and small_nat sizes --- src/core/QCheck2.ml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index 0b13ca90..3d6750b7 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -613,9 +613,11 @@ module Gen = struct in loop size [] - let list (gen : 'a t) : 'a list t = fun st -> + (** [list_ignore_size_tree] is a helper applying its own size shrinking heuristic, + and thus using only the root of [size]'s output shrink [Tree]. *) + let list_ignore_size_tree (size : int t) (gen : 'a t) : 'a list t = fun st -> let st' = RS.split st in - let size = Tree.root (nat st) in + let size = Tree.root (size st) in let st' = RS.copy st' in (* start each loop from same Random.State to recreate same element (prefix) *) let rec loop n acc = (* phase 1: build a list of element trees, tail recursively *) if n <= 0 (* phase 2: build a list shrink Tree of element trees, tail recursively *) @@ -626,6 +628,8 @@ module Gen = struct in loop size [] + let list (gen : 'a t) : 'a list t = list_ignore_size_tree nat gen + let list_repeat (n : int) (gen : 'a t) : 'a list t = list_size (pure n) gen let array_size (size : int t) (gen : 'a t) : 'a array t = From 85d73be26687baa079a799388142f16ef4595548 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 31 Jan 2025 17:53:26 +0100 Subject: [PATCH 308/391] Utilize QCheck2.Gen.list(_ignore_size_tree) to improve bytes*, string*, and small_{list,array} shrinkers --- src/core/QCheck2.ml | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index 3d6750b7..18ecf80c 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -770,31 +770,45 @@ module Gen = struct let string_size ?(gen = char) (size : int t) : string t = bytes_size ~gen size >|= Bytes.unsafe_to_string - let bytes : bytes t = bytes_size nat + let bytes_of_char_list cs = + let b = Buffer.create (List.length cs) in + List.iter (fun c -> Buffer.add_char b c) cs; + let bytes = Buffer.to_bytes b in + Buffer.clear b; + bytes - let bytes_of gen = bytes_size ~gen nat + let bytes : bytes t = list char >|= bytes_of_char_list - let bytes_printable = bytes_size ~gen:printable nat + let bytes_of gen = list gen >|= bytes_of_char_list - let bytes_small st = bytes_size small_nat st + let bytes_printable = list printable >|= bytes_of_char_list - let bytes_small_of gen st = bytes_size ~gen small_nat st + let bytes_small = list_ignore_size_tree small_nat char >|= bytes_of_char_list - let string : string t = string_size nat + let bytes_small_of gen = list_ignore_size_tree small_nat gen >|= bytes_of_char_list - let string_of gen = string_size ~gen nat + let string_of_char_list cs = + let b = Buffer.create (List.length cs) in + List.iter (fun c -> Buffer.add_char b c) cs; + let str = Buffer.contents b in + Buffer.clear b; + str - let string_printable = string_size ~gen:printable nat + let string : string t = list char >|= string_of_char_list - let string_small st = string_size small_nat st + let string_of gen = list gen >|= string_of_char_list - let string_small_of gen st = string_size ~gen small_nat st + let string_printable = list printable >|= string_of_char_list + + let string_small = list_ignore_size_tree small_nat char >|= string_of_char_list + + let string_small_of gen = list_ignore_size_tree small_nat gen >|= string_of_char_list let small_string ?(gen=char) = string_small_of gen - let small_list gen = list_size small_nat gen + let small_list gen = list_ignore_size_tree small_nat gen - let small_array gen = array_size small_nat gen + let small_array gen = list_ignore_size_tree small_nat gen >|= Array.of_list let join (gen : 'a t t) : 'a t = gen >>= Fun.id From bbde3fc24bd3b5a0df5f0d35a6ff290f63c54c6b Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 31 Jan 2025 18:12:48 +0100 Subject: [PATCH 309/391] QCheck2.Gen.{bytes*,string*,small*} shrink unit test output --- test/core/QCheck2_unit_tests.ml | 52 ++++++++++++++++----------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/test/core/QCheck2_unit_tests.ml b/test/core/QCheck2_unit_tests.ml index 5d7334ec..f6c5db49 100644 --- a/test/core/QCheck2_unit_tests.ml +++ b/test/core/QCheck2_unit_tests.ml @@ -236,7 +236,7 @@ module Shrink = struct (Alcotest.(check' (list (list int))) ~msg:"[5; 9; 4; 10] on repeated failure" ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) (small_list (int_bound 10))) |> repeated_failure) - ~expected:[ [5; 9; 4; 10]; []; [5; 9]; [5; 9; 4]; + ~expected:[ [5; 9; 4; 10]; [5; 9]; [4; 10]; [9; 4; 10]; [5; 9; 10]; [0; 9; 4; 10]; [2; 9; 4; 10]; [3; 9; 4; 10]; [4; 9; 4; 10]; [5; 0; 4; 10]; [5; 4; 4; 10]; [5; 6; 4; 10]; [5; 7; 4; 10]; [5; 8; 4; 10]; [5; 9; 0; 10]; [5; 9; 2; 10]; [5; 9; 3; 10]; @@ -244,12 +244,12 @@ module Shrink = struct Alcotest.(check' (list (list int))) ~msg:"[5; 9; 4; 10] on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) (small_list (int_bound 10))) |> repeated_success) - ~expected:[ [5; 9; 4; 10]; []; ]) + ~expected:[ [5; 9; 4; 10]; [5; 9]; [5]; []; ]) else (Alcotest.(check' (list (list int))) ~msg:"[1; 10; 10; 7; 3] on repeated failure" ~actual:(Gen.(generate_tree ~rand:(rand_init 3347) (small_list (int_bound 10))) |> repeated_failure) - ~expected:[ [1; 10; 10; 7; 3]; []; [1; 10]; [1; 10; 10]; [1; 10; 10; 7]; + ~expected:[ [1; 10; 10; 7; 3]; [1; 10; 10]; [7; 3]; [10; 10; 7; 3]; [1; 10; 10; 3]; [0; 10; 10; 7; 3]; [1; 0; 10; 7; 3]; [1; 5; 10; 7; 3]; [1; 8; 10; 7; 3]; [1; 9; 10; 7; 3]; [1; 10; 0; 7; 3]; [1; 10; 5; 7; 3]; [1; 10; 8; 7; 3]; [1; 10; 9; 7; 3]; @@ -258,7 +258,7 @@ module Shrink = struct Alcotest.(check' (list (list int))) ~msg:"[1; 10; 10; 7; 3] on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3347) (small_list (int_bound 10))) |> repeated_success) - ~expected:[ [1; 10; 10; 7; 3]; []; ]) + ~expected:[ [1; 10; 10; 7; 3]; [1; 10; 10]; [1; 10]; [1]; []; ]) let test_array_size_int () = if ocaml_major_version < 5 @@ -325,7 +325,7 @@ module Shrink = struct (Alcotest.(check' (list (array int))) ~msg:"[|5; 9; 4; 10|] on repeated failure" ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) (small_array (int_bound 10))) |> repeated_failure) - ~expected:[ [|5; 9; 4; 10|]; [||]; [|5; 9|]; [|5; 9; 4|]; + ~expected:[ [|5; 9; 4; 10|]; [|5; 9|]; [|4; 10|]; [|9; 4; 10|]; [|5; 9; 10|]; [|0; 9; 4; 10|]; [|2; 9; 4; 10|]; [|3; 9; 4; 10|]; [|4; 9; 4; 10|]; [|5; 0; 4; 10|]; [|5; 4; 4; 10|]; [|5; 6; 4; 10|]; [|5; 7; 4; 10|]; [|5; 8; 4; 10|]; [|5; 9; 0; 10|]; [|5; 9; 2; 10|]; [|5; 9; 3; 10|]; @@ -333,12 +333,12 @@ module Shrink = struct Alcotest.(check' (list (array int))) ~msg:"[|5; 9; 4; 10|] on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) (small_array (int_bound 10))) |> repeated_success) - ~expected:[ [|5; 9; 4; 10|]; [||]; ]) + ~expected:[ [|5; 9; 4; 10|]; [|5; 9|]; [|5|]; [||]; ]) else (Alcotest.(check' (list (array int))) ~msg:"[|1; 10; 10; 7; 3|] on repeated failure" ~actual:(Gen.(generate_tree ~rand:(rand_init 3347) (small_array (int_bound 10))) |> repeated_failure) - ~expected:[ [|1; 10; 10; 7; 3|]; [||]; [|1; 10|]; [|1; 10; 10|]; [|1; 10; 10; 7|]; + ~expected:[ [|1; 10; 10; 7; 3|]; [|1; 10; 10|]; [|7; 3|]; [|10; 10; 7; 3|]; [|1; 10; 10; 3|]; [|0; 10; 10; 7; 3|]; [|1; 0; 10; 7; 3|]; [|1; 5; 10; 7; 3|]; [|1; 8; 10; 7; 3|]; [|1; 9; 10; 7; 3|]; [|1; 10; 0; 7; 3|]; [|1; 10; 5; 7; 3|]; [|1; 10; 8; 7; 3|]; [|1; 10; 9; 7; 3|]; @@ -347,7 +347,7 @@ module Shrink = struct Alcotest.(check' (list (array int))) ~msg:"[|1; 10; 10; 7; 3|] on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3347) (small_array (int_bound 10))) |> repeated_success) - ~expected:[ [|1; 10; 10; 7; 3|]; [||]; ]) + ~expected:[ [|1; 10; 10; 7; 3|]; [|1; 10; 10|]; [|1; 10|]; [|1|]; [||]; ]) let test_bytes_size () = if ocaml_major_version < 5 @@ -387,7 +387,7 @@ module Shrink = struct ~msg:"\"u\238\154I\" on repeated failure" ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) bytes) |> repeated_failure) ~expected:(List.map Bytes.of_string - [ "u\238\154I"; ""; "u\238"; "u\238\154"; + [ "u\238\154I"; "u\238"; "\154I"; "\238\154I"; "u\238I"; "a\238\154I"; "k\238\154I"; "p\238\154I"; "r\238\154I"; "s\238\154I"; "t\238\154I"; "ua\154I"; "u\168\154I"; "u\203\154I"; "u\221\154I"; "u\230\154I"; "u\234\154I"; "u\236\154I"; "u\237\154I"; "u\238aI"; "u\238~I"; "u\238\140I"; "u\238\147I"; "u\238\151I"; "u\238\153I"; @@ -395,21 +395,21 @@ module Shrink = struct Alcotest.(check' (list bytes)) ~msg:"\"u\238\154I\" on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) bytes) |> repeated_success) - ~expected:(List.map Bytes.of_string ["u\238\154I"; ""; ])) + ~expected:(List.map Bytes.of_string ["u\238\154I"; "u\238"; "u"; ""; ])) else (Alcotest.(check' (list bytes)) ~msg:"\"\253NS\173\" on repeated failure" ~actual:(Gen.(generate_tree ~rand:(rand_init 3349) bytes) |> repeated_failure) ~expected:(List.map Bytes.of_string - [ "\253NS\173"; ""; "\253N"; "\253NS"; "aNS\173"; - "\175NS\173"; "\214NS\173"; "\233NS\173"; "\243NS\173"; "\248NS\173"; "\250NS\173"; "\251NS\173"; "\252NS\173"; + [ "\253NS\173"; "\253N"; "S\173"; "NS\173"; "\253N\173"; + "aNS\173"; "\175NS\173"; "\214NS\173"; "\233NS\173"; "\243NS\173"; "\248NS\173"; "\250NS\173"; "\251NS\173"; "\252NS\173"; "\253aS\173"; "\253XS\173"; "\253SS\173"; "\253QS\173"; "\253PS\173"; "\253OS\173"; "\253Na\173"; "\253NZ\173"; "\253NV\173"; "\253NT\173"; "\253NSa"; "\253NS\135"; "\253NS\154"; "\253NS\163"; "\253NS\168"; "\253NS\170"; "\253NS\171"; "\253NS\172"; ] ); Alcotest.(check' (list bytes)) ~msg:"\"\253NS\173\" on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3349) bytes) |> repeated_success) - ~expected:(List.map Bytes.of_string [ "\253NS\173"; ""; ])) + ~expected:(List.map Bytes.of_string [ "\253NS\173"; "\253N"; "\253"; ""; ])) let test_bytes_small () = if ocaml_major_version < 5 @@ -418,7 +418,7 @@ module Shrink = struct ~msg:"\"u\238\154I\" on repeated failure" ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) bytes_small) |> repeated_failure) ~expected:(List.map Bytes.of_string - [ "u\238\154I"; ""; "u\238"; "u\238\154"; + [ "u\238\154I"; "u\238"; "\154I"; "\238\154I"; "u\238I"; "a\238\154I"; "k\238\154I"; "p\238\154I"; "r\238\154I"; "s\238\154I"; "t\238\154I"; "ua\154I"; "u\168\154I"; "u\203\154I"; "u\221\154I"; "u\230\154I"; "u\234\154I"; "u\236\154I"; "u\237\154I"; "u\238aI"; "u\238~I"; "u\238\140I"; "u\238\147I"; "u\238\151I"; "u\238\153I"; @@ -426,21 +426,21 @@ module Shrink = struct Alcotest.(check' (list bytes)) ~msg:"\"u\238\154I\" on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) bytes_small) |> repeated_success) - ~expected:(List.map Bytes.of_string ["u\238\154I"; ""; ])) + ~expected:(List.map Bytes.of_string ["u\238\154I"; "u\238"; "u"; ""; ])) else (Alcotest.(check' (list bytes)) ~msg:"\"\253NS\173\" on repeated failure" ~actual:(Gen.(generate_tree ~rand:(rand_init 3349) bytes_small) |> repeated_failure) ~expected:(List.map Bytes.of_string - [ "\253NS\173"; ""; "\253N"; "\253NS"; "aNS\173"; - "\175NS\173"; "\214NS\173"; "\233NS\173"; "\243NS\173"; "\248NS\173"; "\250NS\173"; "\251NS\173"; "\252NS\173"; + [ "\253NS\173"; "\253N"; "S\173"; "NS\173"; "\253N\173"; + "aNS\173"; "\175NS\173"; "\214NS\173"; "\233NS\173"; "\243NS\173"; "\248NS\173"; "\250NS\173"; "\251NS\173"; "\252NS\173"; "\253aS\173"; "\253XS\173"; "\253SS\173"; "\253QS\173"; "\253PS\173"; "\253OS\173"; "\253Na\173"; "\253NZ\173"; "\253NV\173"; "\253NT\173"; "\253NSa"; "\253NS\135"; "\253NS\154"; "\253NS\163"; "\253NS\168"; "\253NS\170"; "\253NS\171"; "\253NS\172"; ] ); Alcotest.(check' (list bytes)) ~msg:"\"\253NS\173\" on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3349) bytes_small) |> repeated_success) - ~expected:(List.map Bytes.of_string [ "\253NS\173"; ""; ])) + ~expected:(List.map Bytes.of_string [ "\253NS\173"; "\253N"; "\253"; ""; ])) let test_string_size () = if ocaml_major_version < 5 @@ -479,7 +479,7 @@ module Shrink = struct (Alcotest.(check' (list string)) ~msg:"\"u\238\154I\" on repeated failure" ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) string) |> repeated_failure) - ~expected:[ "u\238\154I"; ""; "u\238"; "u\238\154"; + ~expected:[ "u\238\154I"; "u\238"; "\154I"; "\238\154I"; "u\238I"; "a\238\154I"; "k\238\154I"; "p\238\154I"; "r\238\154I"; "s\238\154I"; "t\238\154I"; "ua\154I"; "u\168\154I"; "u\203\154I"; "u\221\154I"; "u\230\154I"; "u\234\154I"; "u\236\154I"; "u\237\154I"; "u\238aI"; "u\238~I"; "u\238\140I"; "u\238\147I"; "u\238\151I"; "u\238\153I"; @@ -487,12 +487,12 @@ module Shrink = struct Alcotest.(check' (list string)) ~msg:"\"u\238\154I\" on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) string) |> repeated_success) - ~expected:[ "u\238\154I"; ""; ]) + ~expected:[ "u\238\154I"; "u\238"; "u"; ""; ]) else (Alcotest.(check' (list string)) ~msg:"\"\253NS\173\" on repeated failure" ~actual:(Gen.(generate_tree ~rand:(rand_init 3349) string) |> repeated_failure) - ~expected:[ "\253NS\173"; ""; "\253N"; "\253NS"; + ~expected:[ "\253NS\173"; "\253N"; "S\173"; "NS\173"; "\253N\173"; "aNS\173"; "\175NS\173"; "\214NS\173"; "\233NS\173"; "\243NS\173"; "\248NS\173"; "\250NS\173"; "\251NS\173"; "\252NS\173"; "\253aS\173"; "\253XS\173"; "\253SS\173"; "\253QS\173"; "\253PS\173"; "\253OS\173"; "\253Na\173"; "\253NZ\173"; "\253NV\173"; "\253NT\173"; @@ -500,7 +500,7 @@ module Shrink = struct Alcotest.(check' (list string)) ~msg:"\"\253NS\173\" on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3349) string) |> repeated_success) - ~expected:[ "\253NS\173"; ""; ]) + ~expected:[ "\253NS\173"; "\253N"; "\253"; ""; ]) let test_string_small () = if ocaml_major_version < 5 @@ -508,7 +508,7 @@ module Shrink = struct (Alcotest.(check' (list string)) ~msg:"\"u\238\154I\" on repeated failure" ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) string_small) |> repeated_failure) - ~expected:[ "u\238\154I"; ""; "u\238"; "u\238\154"; + ~expected:[ "u\238\154I"; "u\238"; "\154I"; "\238\154I"; "u\238I"; "a\238\154I"; "k\238\154I"; "p\238\154I"; "r\238\154I"; "s\238\154I"; "t\238\154I"; "ua\154I"; "u\168\154I"; "u\203\154I"; "u\221\154I"; "u\230\154I"; "u\234\154I"; "u\236\154I"; "u\237\154I"; "u\238aI"; "u\238~I"; "u\238\140I"; "u\238\147I"; "u\238\151I"; "u\238\153I"; @@ -516,12 +516,12 @@ module Shrink = struct Alcotest.(check' (list string)) ~msg:"\"u\238\154I\" on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) string_small) |> repeated_success) - ~expected:[ "u\238\154I"; ""; ]) + ~expected:[ "u\238\154I"; "u\238"; "u"; ""; ]) else (Alcotest.(check' (list string)) ~msg:"\"\253NS\173\" on repeated failure" ~actual:(Gen.(generate_tree ~rand:(rand_init 3349) string_small) |> repeated_failure) - ~expected:[ "\253NS\173"; ""; "\253N"; "\253NS"; + ~expected:[ "\253NS\173"; "\253N"; "S\173"; "NS\173"; "\253N\173"; "aNS\173"; "\175NS\173"; "\214NS\173"; "\233NS\173"; "\243NS\173"; "\248NS\173"; "\250NS\173"; "\251NS\173"; "\252NS\173"; "\253aS\173"; "\253XS\173"; "\253SS\173"; "\253QS\173"; "\253PS\173"; "\253OS\173"; "\253Na\173"; "\253NZ\173"; "\253NV\173"; "\253NT\173"; @@ -529,7 +529,7 @@ module Shrink = struct Alcotest.(check' (list string)) ~msg:"\"\253NS\173\" on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3349) string_small) |> repeated_success) - ~expected:[ "\253NS\173"; ""; ]) + ~expected:[ "\253NS\173"; "\253N"; "\253"; ""; ]) let tests = ("Shrink", Alcotest.[ test_case "int_towards" `Quick test_int_towards; From 340428704e98b41dbd5e1194285f373284898195 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 31 Jan 2025 18:52:15 +0100 Subject: [PATCH 310/391] Update QCheck2 expect test output wrt QCheck2.Gen.{bytes*,string*,small*} improvements --- .../QCheck2_expect_test.expected.ocaml4.32 | 42 +++++++++---------- .../QCheck2_expect_test.expected.ocaml4.64 | 42 +++++++++---------- .../QCheck2_expect_test.expected.ocaml5.32 | 40 +++++++++--------- .../QCheck2_expect_test.expected.ocaml5.64 | 40 +++++++++--------- 4 files changed, 82 insertions(+), 82 deletions(-) diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.32 b/test/core/QCheck2_expect_test.expected.ocaml4.32 index d1094132..1e5b7880 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.32 @@ -278,51 +278,51 @@ Test printable never produces less than '5 failed (1 shrink steps): --- Failure -------------------------------------------------------------------- -Test bytes are empty failed (2 shrink steps): +Test bytes are empty failed (3 shrink steps): "a" --- Failure -------------------------------------------------------------------- -Test bytes never has a \000 char failed (198 shrink steps): +Test bytes never has a \000 char failed (9 shrink steps): -"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\000" +"\000" --- Failure -------------------------------------------------------------------- -Test bytes never has a \255 char failed (20 shrink steps): +Test bytes never has a \255 char failed (5 shrink steps): -"aaaaaaaaaaaaaaaaa\255" +"\255" --- Failure -------------------------------------------------------------------- -Test bytes have unique chars failed (28 shrink steps): +Test bytes have unique chars failed (31 shrink steps): -"aaaaaaaaaaaaaaaaaaaaaaaaaaa" +"aaaaaaaaaaa" --- Failure -------------------------------------------------------------------- -Test strings are empty failed (2 shrink steps): +Test strings are empty failed (3 shrink steps): "a" --- Failure -------------------------------------------------------------------- -Test string never has a \000 char failed (198 shrink steps): +Test string never has a \000 char failed (9 shrink steps): -"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\000" +"\000" --- Failure -------------------------------------------------------------------- -Test string never has a \255 char failed (20 shrink steps): +Test string never has a \255 char failed (5 shrink steps): -"aaaaaaaaaaaaaaaaa\255" +"\255" --- Failure -------------------------------------------------------------------- -Test strings have unique chars failed (28 shrink steps): +Test strings have unique chars failed (31 shrink steps): -"aaaaaaaaaaaaaaaaaaaaaaaaaaa" +"aaaaaaaaaaa" --- Failure -------------------------------------------------------------------- @@ -530,7 +530,7 @@ None --- Failure -------------------------------------------------------------------- -Test (int,string) result are Ok failed (1 shrink steps): +Test (int,string) result are Ok failed (2 shrink steps): Error ("") @@ -554,21 +554,21 @@ Test sum list = 0 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int failed (31 shrink steps): +Test fail_pred_map_commute_int failed (28 shrink steps): -([0; 0; 0; 0; 0; 0], {0 -> -1; 1 -> 0; 2 -> 0; 5 -> 0; 21 -> 0; 7 -> 0; 9 -> 0; 78 -> 0; _ -> 0}, {0 -> true; 998130433 -> false; 1 -> false; 2 -> false; 402927669 -> false; 5 -> false; 21 -> false; 7 -> false; -1041906807 -> false; 9 -> false; -1072173830 -> false; -353172948 -> false; -952635860 -> false; 78 -> false; 286212959 -> false; _ -> false}) +([0], {0 -> -1; 1 -> 0; 2 -> 0; 5 -> 0; 21 -> 0; 7 -> 0; 9 -> 0; 78 -> 0; _ -> 0}, {0 -> true; 998130433 -> false; 1 -> false; 2 -> false; 402927669 -> false; 5 -> false; 21 -> false; 7 -> false; -1041906807 -> false; 9 -> false; -1072173830 -> false; -353172948 -> false; -952635860 -> false; 78 -> false; 286212959 -> false; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int32 failed (70 shrink steps): +Test fail_pred_map_commute_int32 failed (67 shrink steps): -([0l; 0l; 0l; 0l; 0l; 0l], {480624048l -> 0l; -1054565120l -> 0l; 708270421l -> 0l; -1441877194l -> 0l; -239944349l -> 0l; 0l -> 1l; -973889953l -> 0l; 1395009590l -> 0l; _ -> 0l}, {-1990017031l -> false; 443535120l -> false; 480624048l -> false; -1054565120l -> false; 829558403l -> false; -1311148841l -> false; 2084431360l -> false; 708270421l -> false; 79063824l -> false; -1441877194l -> false; -239944349l -> false; 0l -> true; 457187395l -> false; 1395009590l -> false; -973889953l -> false; _ -> false}) +([0l], {480624048l -> 0l; -1054565120l -> 0l; 708270421l -> 0l; -1441877194l -> 0l; -239944349l -> 0l; 0l -> 1l; -973889953l -> 0l; 1395009590l -> 0l; _ -> 0l}, {-1990017031l -> false; 443535120l -> false; 480624048l -> false; -1054565120l -> false; 829558403l -> false; -1311148841l -> false; 2084431360l -> false; 708270421l -> false; 79063824l -> false; -1441877194l -> false; -239944349l -> false; 0l -> true; 457187395l -> false; 1395009590l -> false; -973889953l -> false; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int64 failed (125 shrink steps): +Test fail_pred_map_commute_int64 failed (122 shrink steps): -([0L; 0L; 0L; 0L; 0L; 0L], {-5912897149740583042L -> 0L; 2064264570832434420L -> 0L; 8769531915837689755L -> 0L; -1030553128493932961L -> 0L; 0L -> 1L; 6077417419721789289L -> 0L; -4529322700507305930L -> 0L; -6192815392369977003L -> 0L; _ -> 0L}, {-8367471897177334538L -> false; 8952564522059662897L -> false; -5912897149740583042L -> false; -5897649978982613650L -> false; 339576540681650169L -> false; 2064264570832434420L -> false; 1963604910111969040L -> false; 8769531915837689755L -> false; -1030553128493932961L -> false; 0L -> true; 6077417419721789289L -> false; -3575913752036838904L -> false; 3562926213990806743L -> false; -6192815392369977003L -> false; -4529322700507305930L -> false; _ -> false}) +([0L], {-5912897149740583042L -> 0L; 2064264570832434420L -> 0L; 8769531915837689755L -> 0L; -1030553128493932961L -> 0L; 0L -> 1L; 6077417419721789289L -> 0L; -4529322700507305930L -> 0L; -6192815392369977003L -> 0L; _ -> 0L}, {-8367471897177334538L -> false; 8952564522059662897L -> false; -5912897149740583042L -> false; -5897649978982613650L -> false; 339576540681650169L -> false; 2064264570832434420L -> false; 1963604910111969040L -> false; 8769531915837689755L -> false; -1030553128493932961L -> false; 0L -> true; 6077417419721789289L -> false; -3575913752036838904L -> false; 3562926213990806743L -> false; -6192815392369977003L -> false; -4529322700507305930L -> false; _ -> false}) --- Failure -------------------------------------------------------------------- diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.64 b/test/core/QCheck2_expect_test.expected.ocaml4.64 index 54910708..c5959e29 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.64 @@ -338,51 +338,51 @@ Test printable never produces less than '5 failed (1 shrink steps): --- Failure -------------------------------------------------------------------- -Test bytes are empty failed (2 shrink steps): +Test bytes are empty failed (3 shrink steps): "a" --- Failure -------------------------------------------------------------------- -Test bytes never has a \000 char failed (198 shrink steps): +Test bytes never has a \000 char failed (9 shrink steps): -"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\000" +"\000" --- Failure -------------------------------------------------------------------- -Test bytes never has a \255 char failed (20 shrink steps): +Test bytes never has a \255 char failed (5 shrink steps): -"aaaaaaaaaaaaaaaaa\255" +"\255" --- Failure -------------------------------------------------------------------- -Test bytes have unique chars failed (28 shrink steps): +Test bytes have unique chars failed (31 shrink steps): -"aaaaaaaaaaaaaaaaaaaaaaaaaaa" +"aaaaaaaaaaa" --- Failure -------------------------------------------------------------------- -Test strings are empty failed (2 shrink steps): +Test strings are empty failed (3 shrink steps): "a" --- Failure -------------------------------------------------------------------- -Test string never has a \000 char failed (198 shrink steps): +Test string never has a \000 char failed (9 shrink steps): -"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\000" +"\000" --- Failure -------------------------------------------------------------------- -Test string never has a \255 char failed (20 shrink steps): +Test string never has a \255 char failed (5 shrink steps): -"aaaaaaaaaaaaaaaaa\255" +"\255" --- Failure -------------------------------------------------------------------- -Test strings have unique chars failed (28 shrink steps): +Test strings have unique chars failed (31 shrink steps): -"aaaaaaaaaaaaaaaaaaaaaaaaaaa" +"aaaaaaaaaaa" --- Failure -------------------------------------------------------------------- @@ -590,7 +590,7 @@ None --- Failure -------------------------------------------------------------------- -Test (int,string) result are Ok failed (1 shrink steps): +Test (int,string) result are Ok failed (2 shrink steps): Error ("") @@ -614,21 +614,21 @@ Test sum list = 0 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int failed (31 shrink steps): +Test fail_pred_map_commute_int failed (28 shrink steps): -([0; 0; 0; 0; 0; 0], {0 -> -1; 1 -> 0; 2 -> 0; 5 -> 0; 21 -> 0; 7 -> 0; 9 -> 0; 78 -> 0; _ -> 0}, {0 -> true; -3049580483007556080 -> false; 1 -> false; 2 -> false; -4368949366664347629 -> false; 2099003838291149429 -> false; 5 -> false; 21 -> false; 7 -> false; 9 -> false; 3703556273698913451 -> false; -4370157698609639012 -> false; -2235000253316812931 -> false; 78 -> false; 2211700024537999903 -> false; _ -> false}) +([0], {0 -> -1; 1 -> 0; 2 -> 0; 5 -> 0; 21 -> 0; 7 -> 0; 9 -> 0; 78 -> 0; _ -> 0}, {0 -> true; -3049580483007556080 -> false; 1 -> false; 2 -> false; -4368949366664347629 -> false; 2099003838291149429 -> false; 5 -> false; 21 -> false; 7 -> false; 9 -> false; 3703556273698913451 -> false; -4370157698609639012 -> false; -2235000253316812931 -> false; 78 -> false; 2211700024537999903 -> false; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int32 failed (70 shrink steps): +Test fail_pred_map_commute_int32 failed (67 shrink steps): -([0l; 0l; 0l; 0l; 0l; 0l], {480624048l -> 0l; -1054565120l -> 0l; 708270421l -> 0l; -1441877194l -> 0l; -239944349l -> 0l; 0l -> 1l; -973889953l -> 0l; 1395009590l -> 0l; _ -> 0l}, {-1990017031l -> false; 443535120l -> false; 480624048l -> false; -1054565120l -> false; 829558403l -> false; -1311148841l -> false; 2084431360l -> false; 708270421l -> false; 79063824l -> false; -1441877194l -> false; -239944349l -> false; 0l -> true; 457187395l -> false; 1395009590l -> false; -973889953l -> false; _ -> false}) +([0l], {480624048l -> 0l; -1054565120l -> 0l; 708270421l -> 0l; -1441877194l -> 0l; -239944349l -> 0l; 0l -> 1l; -973889953l -> 0l; 1395009590l -> 0l; _ -> 0l}, {-1990017031l -> false; 443535120l -> false; 480624048l -> false; -1054565120l -> false; 829558403l -> false; -1311148841l -> false; 2084431360l -> false; 708270421l -> false; 79063824l -> false; -1441877194l -> false; -239944349l -> false; 0l -> true; 457187395l -> false; 1395009590l -> false; -973889953l -> false; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int64 failed (125 shrink steps): +Test fail_pred_map_commute_int64 failed (122 shrink steps): -([0L; 0L; 0L; 0L; 0L; 0L], {-5912897149740583042L -> 0L; 2064264570832434420L -> 0L; 8769531915837689755L -> 0L; -1030553128493932961L -> 0L; 0L -> 1L; 6077417419721789289L -> 0L; -4529322700507305930L -> 0L; -6192815392369977003L -> 0L; _ -> 0L}, {-8367471897177334538L -> false; 8952564522059662897L -> false; -5912897149740583042L -> false; -5897649978982613650L -> false; 339576540681650169L -> false; 2064264570832434420L -> false; 1963604910111969040L -> false; 8769531915837689755L -> false; -1030553128493932961L -> false; 0L -> true; 6077417419721789289L -> false; -3575913752036838904L -> false; 3562926213990806743L -> false; -6192815392369977003L -> false; -4529322700507305930L -> false; _ -> false}) +([0L], {-5912897149740583042L -> 0L; 2064264570832434420L -> 0L; 8769531915837689755L -> 0L; -1030553128493932961L -> 0L; 0L -> 1L; 6077417419721789289L -> 0L; -4529322700507305930L -> 0L; -6192815392369977003L -> 0L; _ -> 0L}, {-8367471897177334538L -> false; 8952564522059662897L -> false; -5912897149740583042L -> false; -5897649978982613650L -> false; 339576540681650169L -> false; 2064264570832434420L -> false; 1963604910111969040L -> false; 8769531915837689755L -> false; -1030553128493932961L -> false; 0L -> true; 6077417419721789289L -> false; -3575913752036838904L -> false; 3562926213990806743L -> false; -6192815392369977003L -> false; -4529322700507305930L -> false; _ -> false}) --- Failure -------------------------------------------------------------------- diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.32 b/test/core/QCheck2_expect_test.expected.ocaml5.32 index 60448c1b..be611aa1 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.32 @@ -84,9 +84,9 @@ random seed: 1234 --- Failure -------------------------------------------------------------------- -Test should_fail_sort_id failed (9 shrink steps): +Test should_fail_sort_id failed (8 shrink steps): -[0; 0; 1; 0] +[1; 0] === Error ====================================================================== @@ -280,51 +280,51 @@ Test printable never produces less than '5 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test bytes are empty failed (3 shrink steps): +Test bytes are empty failed (4 shrink steps): "a" --- Failure -------------------------------------------------------------------- -Test bytes never has a \000 char failed (19 shrink steps): +Test bytes never has a \000 char failed (6 shrink steps): -"aaaaaaaaaaaaaaa\000" +"\000" --- Failure -------------------------------------------------------------------- -Test bytes never has a \255 char failed (27 shrink steps): +Test bytes never has a \255 char failed (5 shrink steps): -"aaaaaaaaaaaaaaaaaaaaaaaaa\255" +"\255" --- Failure -------------------------------------------------------------------- -Test bytes have unique chars failed (32 shrink steps): +Test bytes have unique chars failed (29 shrink steps): -"aaaaaaaaaaaaaaaaaaaaaaaaaaaa" +"aaa" --- Failure -------------------------------------------------------------------- -Test strings are empty failed (3 shrink steps): +Test strings are empty failed (4 shrink steps): "a" --- Failure -------------------------------------------------------------------- -Test string never has a \000 char failed (19 shrink steps): +Test string never has a \000 char failed (6 shrink steps): -"aaaaaaaaaaaaaaa\000" +"\000" --- Failure -------------------------------------------------------------------- -Test string never has a \255 char failed (27 shrink steps): +Test string never has a \255 char failed (5 shrink steps): -"aaaaaaaaaaaaaaaaaaaaaaaaa\255" +"\255" --- Failure -------------------------------------------------------------------- -Test strings have unique chars failed (32 shrink steps): +Test strings have unique chars failed (29 shrink steps): -"aaaaaaaaaaaaaaaaaaaaaaaaaaaa" +"aaa" --- Failure -------------------------------------------------------------------- @@ -532,7 +532,7 @@ None --- Failure -------------------------------------------------------------------- -Test (int,string) result are Ok failed (1 shrink steps): +Test (int,string) result are Ok failed (5 shrink steps): Error ("") @@ -558,19 +558,19 @@ Test sum list = 0 failed (0 shrink steps): Test fail_pred_map_commute_int failed (91 shrink steps): -([0; 0], {0 -> 74; 5 -> 0; 26 -> 0; _ -> 0}, {0 -> false; 189249 -> false; 66 -> false; 9642498 -> false; 132 -> false; 339662148 -> false; 5 -> false; 21831 -> false; 12190023 -> false; 31049 -> false; 260053833 -> false; 679324297 -> false; 74 -> true; 17142220 -> false; 141 -> false; 24380046 -> false; 148602190 -> false; 47312 -> false; 5457 -> false; 659154 -> false; 1364 -> false; 126166 -> false; 1230422 -> false; 5624790 -> false; 88 -> false; 20376 -> false; 504665 -> false; 12856665 -> false; 26 -> false; 20699 -> false; 35484 -> false; 297204380 -> false; 48760093 -> false; 94 -> false; 671 -> false; 94624 -> false; 169831074 -> false; 99 -> false; 10915 -> false; 15524 -> false; 130026916 -> false; 165 -> false; 1318309 -> false; 8571110 -> false; 2728 -> false; 23656 -> false; 40674345 -> false; 2812395 -> false; 18285035 -> false; 252332 -> false; 6428332 -> false; 11249581 -> false; 15999405 -> false; 1007 -> false; 1153520 -> false; 13713776 -> false; 49 -> false; 177 -> false; 1009330 -> false; 254746611 -> false; 865140 -> false; 1406197 -> false; 9142517 -> false; 222903285 -> false; 23286 -> false; 41398 -> false; 195040374 -> false; 503 -> false; 1054647 -> false; 576760 -> false; 1001723384 -> false; 17465 -> false; 703098 -> false; 251 -> false; 11643 -> false; 988731 -> false; 97520187 -> false; 188 -> false; 125 -> false; 2046 -> false; 1343 -> false; 1151 -> false; 767 -> false; 1535 -> false; 1023 -> false; _ -> false}) +([0], {0 -> 74; 5 -> 0; 26 -> 0; _ -> 0}, {0 -> false; 189249 -> false; 66 -> false; 9642498 -> false; 132 -> false; 339662148 -> false; 5 -> false; 21831 -> false; 12190023 -> false; 31049 -> false; 260053833 -> false; 679324297 -> false; 74 -> true; 17142220 -> false; 141 -> false; 24380046 -> false; 148602190 -> false; 47312 -> false; 5457 -> false; 659154 -> false; 1364 -> false; 126166 -> false; 1230422 -> false; 5624790 -> false; 88 -> false; 20376 -> false; 504665 -> false; 12856665 -> false; 26 -> false; 20699 -> false; 35484 -> false; 297204380 -> false; 48760093 -> false; 94 -> false; 671 -> false; 94624 -> false; 169831074 -> false; 99 -> false; 10915 -> false; 15524 -> false; 130026916 -> false; 165 -> false; 1318309 -> false; 8571110 -> false; 2728 -> false; 23656 -> false; 40674345 -> false; 2812395 -> false; 18285035 -> false; 252332 -> false; 6428332 -> false; 11249581 -> false; 15999405 -> false; 1007 -> false; 1153520 -> false; 13713776 -> false; 49 -> false; 177 -> false; 1009330 -> false; 254746611 -> false; 865140 -> false; 1406197 -> false; 9142517 -> false; 222903285 -> false; 23286 -> false; 41398 -> false; 195040374 -> false; 503 -> false; 1054647 -> false; 576760 -> false; 1001723384 -> false; 17465 -> false; 703098 -> false; 251 -> false; 11643 -> false; 988731 -> false; 97520187 -> false; 188 -> false; 125 -> false; 2046 -> false; 1343 -> false; 1151 -> false; 767 -> false; 1535 -> false; 1023 -> false; _ -> false}) --- Failure -------------------------------------------------------------------- Test fail_pred_map_commute_int32 failed (91 shrink steps): -([0l; 0l], {-2051366210l -> 0l; 1992866105l -> 0l; 0l -> 99l; _ -> 0l}, {251l -> false; 251274l -> false; 335032l -> false; -2051366210l -> false; 1340129l -> false; 28986l -> false; 1337l -> false; 875186l -> false; 1867064l -> false; 167l -> false; 12802725l -> false; 258962793l -> false; 668l -> false; 3623l -> false; 7246l -> false; 7468256l -> false; 54966l -> false; 64740698l -> false; 1527l -> false; 8535150l -> false; 0l -> false; 394609971l -> false; 12138880l -> false; 47114l -> false; 1633681l -> false; 933532l -> false; 18208320l -> false; 129481396l -> false; 345283724l -> false; 1056359910l -> false; 1992866105l -> false; 66l -> false; 3734128l -> false; 22760400l -> false; 219l -> false; 125637l -> false; 295957478l -> false; 17070300l -> false; 1782l -> false; 1018l -> false; 88l -> false; 21243040l -> false; 41225l -> false; 31409l -> false; 1400298l -> false; 16185174l -> false; 334l -> false; 62818l -> false; 1531576l -> false; 2037l -> false; 172641862l -> false; 14493l -> false; 176l -> false; 32370349l -> false; 1358l -> false; 11380200l -> false; 117l -> false; 1312779l -> false; 30918l -> false; 27054l -> false; 225491412l -> false; 132l -> false; 23189l -> false; 765788l -> false; 188l -> false; 27483l -> false; 1148682l -> false; 450982824l -> false; 891l -> false; 167516l -> false; 79025834l -> false; 670064l -> false; 125l -> false; 14936513l -> false; 235l -> false; 2717l -> false; 99l -> true; 1750373l -> false; 24277761l -> false; 197304985l -> false; 20612l -> false; 1811l -> false; 15459l -> false; 338237118l -> false; 901965649l -> false; _ -> false}) +([0l], {-2051366210l -> 0l; 1992866105l -> 0l; 0l -> 99l; _ -> 0l}, {251l -> false; 251274l -> false; 335032l -> false; -2051366210l -> false; 1340129l -> false; 28986l -> false; 1337l -> false; 875186l -> false; 1867064l -> false; 167l -> false; 12802725l -> false; 258962793l -> false; 668l -> false; 3623l -> false; 7246l -> false; 7468256l -> false; 54966l -> false; 64740698l -> false; 1527l -> false; 8535150l -> false; 0l -> false; 394609971l -> false; 12138880l -> false; 47114l -> false; 1633681l -> false; 933532l -> false; 18208320l -> false; 129481396l -> false; 345283724l -> false; 1056359910l -> false; 1992866105l -> false; 66l -> false; 3734128l -> false; 22760400l -> false; 219l -> false; 125637l -> false; 295957478l -> false; 17070300l -> false; 1782l -> false; 1018l -> false; 88l -> false; 21243040l -> false; 41225l -> false; 31409l -> false; 1400298l -> false; 16185174l -> false; 334l -> false; 62818l -> false; 1531576l -> false; 2037l -> false; 172641862l -> false; 14493l -> false; 176l -> false; 32370349l -> false; 1358l -> false; 11380200l -> false; 117l -> false; 1312779l -> false; 30918l -> false; 27054l -> false; 225491412l -> false; 132l -> false; 23189l -> false; 765788l -> false; 188l -> false; 27483l -> false; 1148682l -> false; 450982824l -> false; 891l -> false; 167516l -> false; 79025834l -> false; 670064l -> false; 125l -> false; 14936513l -> false; 235l -> false; 2717l -> false; 99l -> true; 1750373l -> false; 24277761l -> false; 197304985l -> false; 20612l -> false; 1811l -> false; 15459l -> false; 338237118l -> false; 901965649l -> false; _ -> false}) --- Failure -------------------------------------------------------------------- Test fail_pred_map_commute_int64 failed (201 shrink steps): -([0L; 0L], {-8810550782076602055L -> 0L; 2193919536756226345L -> 0L; 0L -> 1L; _ -> 0L}, {99979597015665302L -> false; 1468801460202L -> false; 15L -> false; 1952082L -> false; 284805883781L -> false; 720593L -> false; 422076469410L -> false; 735847988098523L -> false; 866701437833153609L -> false; 4537031266334529194L -> false; 1041110L -> false; 1L -> true; 101861769836880L -> false; 21L -> false; 59110L -> false; 210173L -> false; 12691630L -> false; 86L -> false; 23362982654L -> false; 963900958258L -> false; 1733402875666307218L -> false; 304L -> false; 1137545637156014112L -> false; 325492438607L -> false; 241450121094828L -> false; 5045814775532730L -> false; 1561665L -> false; 3844430305167794L -> false; 960790L -> false; 1032751026705L -> false; 976041L -> false; 990515928952175553L -> false; 488020L -> false; 2937602920405L -> false; 118838731476360L -> false; 51722L -> false; 8761118495L -> false; 90543795410560L -> false; 826200821364L -> false; 206957246652710L -> false; 2235910448L -> false; 2943391952394092L -> false; 2193919536756226345L -> false; 6345815L -> false; 57L -> false; 290461226260L -> false; 101533043L -> false; 32805805270765177L -> false; 1044L -> false; 1516727516208018816L -> false; 1485773893428263330L -> false; 142193204644501764L -> false; 29555L -> false; 480395L -> false; 1471695976197046L -> false; 580922452521L -> false; 78814L -> false; 203066086L -> false; 118221L -> false; 1586453L -> false; 174056645L -> false; 551885991073892L -> false; 37492348880874488L -> false; 464151052L -> false; 10221304911L -> false; 7176269902979883L -> false; 10L -> false; 1392L -> false; 44333L -> false; 31150643538L -> false; 840692L -> false; 49989798507832651L -> false; 76L -> false; 2395618337L -> false; 4100725658845647L -> false; -8810550782076602055L -> false; 1916494670L -> false; 5766645457751691L -> false; 11314L -> false; 1103771982147785L -> false; 7688860610335589L -> false; 7425L -> false; 379741178375L -> false; 774563270028L -> false; 116037763L -> false; 1277663113L -> false; 114L -> false; 854035L -> false; 6714520960926L -> false; 7957950768506L -> false; 1981031857904351106L -> false; 15575321769L -> false; 5840745663L -> false; 8952694614569L -> false; 45257L -> false; 2475472282L -> false; 609L -> false; 8201451317691294L -> false; 232075526L -> false; 381230359467L -> false; 1218L -> false; 11681491327L -> false; 93314290547954282L -> false; 74984697761748977L -> false; 1300052156749730414L -> false; 275942995536946L -> false; 696L -> false; 1856L -> false; 5110652455L -> false; 387281635014L -> false; 152L -> false; 1821943L -> false; 120725060547414L -> false; 7833607787747L -> false; 16971L -> false; 217845919695L -> false; 5886783904788185L -> false; 53322451741688161L -> false; 0L -> false; 3712L -> false; 56238523321311732L -> false; 758363758104009408L -> false; 5875205840810L -> false; 4476347307284L -> false; 3916803893873L -> false; 326768879543L -> false; 43L -> false; 9900L -> false; 428884154400L -> false; 6151088488268471L -> false; 16402902635382588L -> false; 7L -> false; 71096602322250882L -> false; 25383260L -> false; 435691839390L -> false; 6727753034043640L -> false; 38792L -> false; 1189840L -> false; 420346L -> false; 79983677612532242L -> false; 3L -> false; 928L -> false; 25861L -> false; 15915901537012L -> false; 928302105L -> false; 31831803074025L -> false; 106644903483376323L -> false; 1101601095152L -> false; 22628L -> false; 915038L -> false; 50766521L -> false; 734400730101L -> false; 284386409289003528L -> false; 2082220L -> false; 3873912968074562848L -> false; 945539L -> false; 63663606148050L -> false; 732030L -> false; 11936926152759L -> false; 550800547576L -> false; 408461099429L -> false; 137971497768473L -> false; 67907846557920L -> false; 135815693115840L -> false; 3172907L -> false; 105086L -> false; 3363876517021820L -> false; 249205148308L -> false; 1784760L -> false; 213604412835L -> false; 1237736141L -> false; 189870589187L -> false; 516375513352L -> false; 65611610541530354L -> false; 568772818578007056L -> false; 2379680L -> false; 618868070L -> false; 62301287077L -> false; 433989918143L -> false; 19800L -> false; 3962063715808702212L -> false; 157629L -> false; 124602574154L -> false; 181087590821121L -> false; 2555326227L -> false; 142402941890L -> false; 5968463076379L -> false; 127327212296100L -> false; 4950L -> false; 216994959071L -> false; 432287996895L -> false; _ -> false}) +([0L], {-8810550782076602055L -> 0L; 2193919536756226345L -> 0L; 0L -> 1L; _ -> 0L}, {99979597015665302L -> false; 1468801460202L -> false; 15L -> false; 1952082L -> false; 284805883781L -> false; 720593L -> false; 422076469410L -> false; 735847988098523L -> false; 866701437833153609L -> false; 4537031266334529194L -> false; 1041110L -> false; 1L -> true; 101861769836880L -> false; 21L -> false; 59110L -> false; 210173L -> false; 12691630L -> false; 86L -> false; 23362982654L -> false; 963900958258L -> false; 1733402875666307218L -> false; 304L -> false; 1137545637156014112L -> false; 325492438607L -> false; 241450121094828L -> false; 5045814775532730L -> false; 1561665L -> false; 3844430305167794L -> false; 960790L -> false; 1032751026705L -> false; 976041L -> false; 990515928952175553L -> false; 488020L -> false; 2937602920405L -> false; 118838731476360L -> false; 51722L -> false; 8761118495L -> false; 90543795410560L -> false; 826200821364L -> false; 206957246652710L -> false; 2235910448L -> false; 2943391952394092L -> false; 2193919536756226345L -> false; 6345815L -> false; 57L -> false; 290461226260L -> false; 101533043L -> false; 32805805270765177L -> false; 1044L -> false; 1516727516208018816L -> false; 1485773893428263330L -> false; 142193204644501764L -> false; 29555L -> false; 480395L -> false; 1471695976197046L -> false; 580922452521L -> false; 78814L -> false; 203066086L -> false; 118221L -> false; 1586453L -> false; 174056645L -> false; 551885991073892L -> false; 37492348880874488L -> false; 464151052L -> false; 10221304911L -> false; 7176269902979883L -> false; 10L -> false; 1392L -> false; 44333L -> false; 31150643538L -> false; 840692L -> false; 49989798507832651L -> false; 76L -> false; 2395618337L -> false; 4100725658845647L -> false; -8810550782076602055L -> false; 1916494670L -> false; 5766645457751691L -> false; 11314L -> false; 1103771982147785L -> false; 7688860610335589L -> false; 7425L -> false; 379741178375L -> false; 774563270028L -> false; 116037763L -> false; 1277663113L -> false; 114L -> false; 854035L -> false; 6714520960926L -> false; 7957950768506L -> false; 1981031857904351106L -> false; 15575321769L -> false; 5840745663L -> false; 8952694614569L -> false; 45257L -> false; 2475472282L -> false; 609L -> false; 8201451317691294L -> false; 232075526L -> false; 381230359467L -> false; 1218L -> false; 11681491327L -> false; 93314290547954282L -> false; 74984697761748977L -> false; 1300052156749730414L -> false; 275942995536946L -> false; 696L -> false; 1856L -> false; 5110652455L -> false; 387281635014L -> false; 152L -> false; 1821943L -> false; 120725060547414L -> false; 7833607787747L -> false; 16971L -> false; 217845919695L -> false; 5886783904788185L -> false; 53322451741688161L -> false; 0L -> false; 3712L -> false; 56238523321311732L -> false; 758363758104009408L -> false; 5875205840810L -> false; 4476347307284L -> false; 3916803893873L -> false; 326768879543L -> false; 43L -> false; 9900L -> false; 428884154400L -> false; 6151088488268471L -> false; 16402902635382588L -> false; 7L -> false; 71096602322250882L -> false; 25383260L -> false; 435691839390L -> false; 6727753034043640L -> false; 38792L -> false; 1189840L -> false; 420346L -> false; 79983677612532242L -> false; 3L -> false; 928L -> false; 25861L -> false; 15915901537012L -> false; 928302105L -> false; 31831803074025L -> false; 106644903483376323L -> false; 1101601095152L -> false; 22628L -> false; 915038L -> false; 50766521L -> false; 734400730101L -> false; 284386409289003528L -> false; 2082220L -> false; 3873912968074562848L -> false; 945539L -> false; 63663606148050L -> false; 732030L -> false; 11936926152759L -> false; 550800547576L -> false; 408461099429L -> false; 137971497768473L -> false; 67907846557920L -> false; 135815693115840L -> false; 3172907L -> false; 105086L -> false; 3363876517021820L -> false; 249205148308L -> false; 1784760L -> false; 213604412835L -> false; 1237736141L -> false; 189870589187L -> false; 516375513352L -> false; 65611610541530354L -> false; 568772818578007056L -> false; 2379680L -> false; 618868070L -> false; 62301287077L -> false; 433989918143L -> false; 19800L -> false; 3962063715808702212L -> false; 157629L -> false; 124602574154L -> false; 181087590821121L -> false; 2555326227L -> false; 142402941890L -> false; 5968463076379L -> false; 127327212296100L -> false; 4950L -> false; 216994959071L -> false; 432287996895L -> false; _ -> false}) --- Failure -------------------------------------------------------------------- diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.64 b/test/core/QCheck2_expect_test.expected.ocaml5.64 index 57d49c14..5c1564ce 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.64 @@ -146,9 +146,9 @@ random seed: 1234 --- Failure -------------------------------------------------------------------- -Test should_fail_sort_id failed (9 shrink steps): +Test should_fail_sort_id failed (8 shrink steps): -[0; 0; 1; 0] +[1; 0] === Error ====================================================================== @@ -342,51 +342,51 @@ Test printable never produces less than '5 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test bytes are empty failed (3 shrink steps): +Test bytes are empty failed (4 shrink steps): "a" --- Failure -------------------------------------------------------------------- -Test bytes never has a \000 char failed (19 shrink steps): +Test bytes never has a \000 char failed (6 shrink steps): -"aaaaaaaaaaaaaaa\000" +"\000" --- Failure -------------------------------------------------------------------- -Test bytes never has a \255 char failed (27 shrink steps): +Test bytes never has a \255 char failed (5 shrink steps): -"aaaaaaaaaaaaaaaaaaaaaaaaa\255" +"\255" --- Failure -------------------------------------------------------------------- -Test bytes have unique chars failed (32 shrink steps): +Test bytes have unique chars failed (29 shrink steps): -"aaaaaaaaaaaaaaaaaaaaaaaaaaaa" +"aaa" --- Failure -------------------------------------------------------------------- -Test strings are empty failed (3 shrink steps): +Test strings are empty failed (4 shrink steps): "a" --- Failure -------------------------------------------------------------------- -Test string never has a \000 char failed (19 shrink steps): +Test string never has a \000 char failed (6 shrink steps): -"aaaaaaaaaaaaaaa\000" +"\000" --- Failure -------------------------------------------------------------------- -Test string never has a \255 char failed (27 shrink steps): +Test string never has a \255 char failed (5 shrink steps): -"aaaaaaaaaaaaaaaaaaaaaaaaa\255" +"\255" --- Failure -------------------------------------------------------------------- -Test strings have unique chars failed (32 shrink steps): +Test strings have unique chars failed (29 shrink steps): -"aaaaaaaaaaaaaaaaaaaaaaaaaaaa" +"aaa" --- Failure -------------------------------------------------------------------- @@ -594,7 +594,7 @@ None --- Failure -------------------------------------------------------------------- -Test (int,string) result are Ok failed (1 shrink steps): +Test (int,string) result are Ok failed (5 shrink steps): Error ("") @@ -620,19 +620,19 @@ Test sum list = 0 failed (0 shrink steps): Test fail_pred_map_commute_int failed (200 shrink steps): -([0; 0], {0 -> 1; 5 -> 0; 26 -> 0; _ -> 0}, {25868127433904000 -> false; 22172680657632000 -> false; 14781787105088000 -> false; 0 -> false; 1 -> true; 580232960935041 -> false; 29563574210176001 -> false; 56143987586 -> false; 3 -> false; 74858650115 -> false; 1160465921870083 -> false; 1326246767851523 -> false; 4 -> false; 11652 -> false; 217159411844 -> false; 112287975173 -> false; 169092480261 -> false; 1989370151777285 -> false; 5 -> false; 6 -> false; 2320931843740166 -> false; 2652493535703046 -> false; 149717300231 -> false; 8 -> false; 23305 -> false; 4605561481 -> false; 24562994569 -> false; 434318823689 -> false; 975983242 -> false; 2647276639626 -> false; 1250955 -> false; 512560423131771020 -> false; 71395852615053 -> false; 390522227148016015 -> false; 16 -> false; 1544244706448 -> false; 12550052217489 -> false; 274 -> false; 46610 -> false; 49125989138 -> false; 9211122963 -> false; 150304426899 -> false; 26773444730644 -> false; 22 -> false; 2501910 -> false; 192407 -> false; 615704 -> false; 26 -> false; 411 -> false; 2014933147 -> false; 171105485979 -> false; 21022986105014045 -> false; 30 -> false; 40160167095966 -> false; 112122592560074910 -> false; 1951 -> false; 781044454296032031 -> false; 33 -> false; 3088489412897 -> false; 6690 -> false; 243995810 -> false; 81595260131490 -> false; 25100104434979 -> false; 597987160320399523 -> false; 548 -> false; 98251978276 -> false; 3137513054372 -> false; 503733286 -> false; 20391 -> false; 28030648140018727 -> false; 1515710591830312 -> false; 53546889461289 -> false; 428248039555175850 -> false; 19709049473450667 -> false; 5003820 -> false; 31534479157521068 -> false; 45 -> false; 703662 -> false; 82863 -> false; 384815 -> false; 161040457392 -> false; 217587360350640 -> false; 20015281 -> false; 17842 -> false; 378802 -> false; 2829326438083250 -> false; 372789 -> false; 579091764918 -> false; 1463 -> false; 4029866295 -> false; 755599929 -> false; 3529702186169 -> false; 42045972210028091 -> false; 683413897509028027 -> false; 60 -> false; 331452 -> false; 360764 -> false; 91498428 -> false; 229035317180 -> false; 2273565887745468 -> false; 15293 -> false; 95194470153405 -> false; 224245185120149821 -> false; 3902 -> false; 166408472638 -> false; 1562088908592064063 -> false; 290116480467520 -> false; 12934063716952000 -> false; 62147 -> false; 881533251 -> false; 84215981379 -> false; 2302780740 -> false; 12281497284 -> false; 625477 -> false; 80061125 -> false; 487991621 -> false; 17478 -> false; 284102 -> false; 325739117766 -> false; 50200208869958 -> false; 35697926307526 -> false; 944499912 -> false; 6275026108744 -> false; 336713 -> false; 820939 -> false; 68623821 -> false; 1007466573 -> false; 85552742989 -> false; 171776487885 -> false; 56061296280037455 -> false; 3031421183660625 -> false; 298993580160199761 -> false; 10195 -> false; 41431 -> false; 39418098946901335 -> false; 585783340722024023 -> false; 10007640 -> false; 2316367059672 -> false; 108793680175320 -> false; 8921 -> false; 189401 -> false; 128832365913 -> false; 731 -> false; 289545882459 -> false; 1764851093084 -> false; 341706948754514013 -> false; 165726 -> false; 769630 -> false; 45749214 -> false; 114517658590 -> false; 47597235076702 -> false; 480 -> false; 435174720701280 -> false; 6467031858476000 -> false; 31073 -> false; 40030562 -> false; 6140748642 -> false; 288611 -> false; 46853528278627 -> false; 410469 -> false; 3454171110 -> false; 85888243942 -> false; 380028970727 -> false; 938216 -> false; 170434484073 -> false; 4460 -> false; 1158183529836 -> false; 54396840087660 -> false; 365 -> false; 2927 -> false; 240 -> false; 3233515929238000 -> false; 718321 -> false; 365993715 -> false; 36790225683774579 -> false; 1937055216023938291 -> false; 469108 -> false; 128329114484 -> false; 2425136946928500 -> false; 4706269581558 -> false; 120 -> false; 407173897208 -> false; 1616757964619000 -> false; 182996857 -> false; 305380422906 -> false; 448490370240299642 -> false; 2353134790779 -> false; 203586948604 -> false; 7805 -> false; 152690211453 -> false; _ -> false}) +([0], {0 -> 1; 5 -> 0; 26 -> 0; _ -> 0}, {25868127433904000 -> false; 22172680657632000 -> false; 14781787105088000 -> false; 0 -> false; 1 -> true; 580232960935041 -> false; 29563574210176001 -> false; 56143987586 -> false; 3 -> false; 74858650115 -> false; 1160465921870083 -> false; 1326246767851523 -> false; 4 -> false; 11652 -> false; 217159411844 -> false; 112287975173 -> false; 169092480261 -> false; 1989370151777285 -> false; 5 -> false; 6 -> false; 2320931843740166 -> false; 2652493535703046 -> false; 149717300231 -> false; 8 -> false; 23305 -> false; 4605561481 -> false; 24562994569 -> false; 434318823689 -> false; 975983242 -> false; 2647276639626 -> false; 1250955 -> false; 512560423131771020 -> false; 71395852615053 -> false; 390522227148016015 -> false; 16 -> false; 1544244706448 -> false; 12550052217489 -> false; 274 -> false; 46610 -> false; 49125989138 -> false; 9211122963 -> false; 150304426899 -> false; 26773444730644 -> false; 22 -> false; 2501910 -> false; 192407 -> false; 615704 -> false; 26 -> false; 411 -> false; 2014933147 -> false; 171105485979 -> false; 21022986105014045 -> false; 30 -> false; 40160167095966 -> false; 112122592560074910 -> false; 1951 -> false; 781044454296032031 -> false; 33 -> false; 3088489412897 -> false; 6690 -> false; 243995810 -> false; 81595260131490 -> false; 25100104434979 -> false; 597987160320399523 -> false; 548 -> false; 98251978276 -> false; 3137513054372 -> false; 503733286 -> false; 20391 -> false; 28030648140018727 -> false; 1515710591830312 -> false; 53546889461289 -> false; 428248039555175850 -> false; 19709049473450667 -> false; 5003820 -> false; 31534479157521068 -> false; 45 -> false; 703662 -> false; 82863 -> false; 384815 -> false; 161040457392 -> false; 217587360350640 -> false; 20015281 -> false; 17842 -> false; 378802 -> false; 2829326438083250 -> false; 372789 -> false; 579091764918 -> false; 1463 -> false; 4029866295 -> false; 755599929 -> false; 3529702186169 -> false; 42045972210028091 -> false; 683413897509028027 -> false; 60 -> false; 331452 -> false; 360764 -> false; 91498428 -> false; 229035317180 -> false; 2273565887745468 -> false; 15293 -> false; 95194470153405 -> false; 224245185120149821 -> false; 3902 -> false; 166408472638 -> false; 1562088908592064063 -> false; 290116480467520 -> false; 12934063716952000 -> false; 62147 -> false; 881533251 -> false; 84215981379 -> false; 2302780740 -> false; 12281497284 -> false; 625477 -> false; 80061125 -> false; 487991621 -> false; 17478 -> false; 284102 -> false; 325739117766 -> false; 50200208869958 -> false; 35697926307526 -> false; 944499912 -> false; 6275026108744 -> false; 336713 -> false; 820939 -> false; 68623821 -> false; 1007466573 -> false; 85552742989 -> false; 171776487885 -> false; 56061296280037455 -> false; 3031421183660625 -> false; 298993580160199761 -> false; 10195 -> false; 41431 -> false; 39418098946901335 -> false; 585783340722024023 -> false; 10007640 -> false; 2316367059672 -> false; 108793680175320 -> false; 8921 -> false; 189401 -> false; 128832365913 -> false; 731 -> false; 289545882459 -> false; 1764851093084 -> false; 341706948754514013 -> false; 165726 -> false; 769630 -> false; 45749214 -> false; 114517658590 -> false; 47597235076702 -> false; 480 -> false; 435174720701280 -> false; 6467031858476000 -> false; 31073 -> false; 40030562 -> false; 6140748642 -> false; 288611 -> false; 46853528278627 -> false; 410469 -> false; 3454171110 -> false; 85888243942 -> false; 380028970727 -> false; 938216 -> false; 170434484073 -> false; 4460 -> false; 1158183529836 -> false; 54396840087660 -> false; 365 -> false; 2927 -> false; 240 -> false; 3233515929238000 -> false; 718321 -> false; 365993715 -> false; 36790225683774579 -> false; 1937055216023938291 -> false; 469108 -> false; 128329114484 -> false; 2425136946928500 -> false; 4706269581558 -> false; 120 -> false; 407173897208 -> false; 1616757964619000 -> false; 182996857 -> false; 305380422906 -> false; 448490370240299642 -> false; 2353134790779 -> false; 203586948604 -> false; 7805 -> false; 152690211453 -> false; _ -> false}) --- Failure -------------------------------------------------------------------- Test fail_pred_map_commute_int32 failed (91 shrink steps): -([0l; 0l], {-2051366210l -> 0l; 1992866105l -> 0l; 0l -> 99l; _ -> 0l}, {251l -> false; 251274l -> false; 335032l -> false; -2051366210l -> false; 1340129l -> false; 28986l -> false; 1337l -> false; 875186l -> false; 1867064l -> false; 167l -> false; 12802725l -> false; 258962793l -> false; 668l -> false; 3623l -> false; 7246l -> false; 7468256l -> false; 54966l -> false; 64740698l -> false; 1527l -> false; 8535150l -> false; 0l -> false; 394609971l -> false; 12138880l -> false; 47114l -> false; 1633681l -> false; 933532l -> false; 18208320l -> false; 129481396l -> false; 345283724l -> false; 1056359910l -> false; 1992866105l -> false; 66l -> false; 3734128l -> false; 22760400l -> false; 219l -> false; 125637l -> false; 295957478l -> false; 17070300l -> false; 1782l -> false; 1018l -> false; 88l -> false; 21243040l -> false; 41225l -> false; 31409l -> false; 1400298l -> false; 16185174l -> false; 334l -> false; 62818l -> false; 1531576l -> false; 2037l -> false; 172641862l -> false; 14493l -> false; 176l -> false; 32370349l -> false; 1358l -> false; 11380200l -> false; 117l -> false; 1312779l -> false; 30918l -> false; 27054l -> false; 225491412l -> false; 132l -> false; 23189l -> false; 765788l -> false; 188l -> false; 27483l -> false; 1148682l -> false; 450982824l -> false; 891l -> false; 167516l -> false; 79025834l -> false; 670064l -> false; 125l -> false; 14936513l -> false; 235l -> false; 2717l -> false; 99l -> true; 1750373l -> false; 24277761l -> false; 197304985l -> false; 20612l -> false; 1811l -> false; 15459l -> false; 338237118l -> false; 901965649l -> false; _ -> false}) +([0l], {-2051366210l -> 0l; 1992866105l -> 0l; 0l -> 99l; _ -> 0l}, {251l -> false; 251274l -> false; 335032l -> false; -2051366210l -> false; 1340129l -> false; 28986l -> false; 1337l -> false; 875186l -> false; 1867064l -> false; 167l -> false; 12802725l -> false; 258962793l -> false; 668l -> false; 3623l -> false; 7246l -> false; 7468256l -> false; 54966l -> false; 64740698l -> false; 1527l -> false; 8535150l -> false; 0l -> false; 394609971l -> false; 12138880l -> false; 47114l -> false; 1633681l -> false; 933532l -> false; 18208320l -> false; 129481396l -> false; 345283724l -> false; 1056359910l -> false; 1992866105l -> false; 66l -> false; 3734128l -> false; 22760400l -> false; 219l -> false; 125637l -> false; 295957478l -> false; 17070300l -> false; 1782l -> false; 1018l -> false; 88l -> false; 21243040l -> false; 41225l -> false; 31409l -> false; 1400298l -> false; 16185174l -> false; 334l -> false; 62818l -> false; 1531576l -> false; 2037l -> false; 172641862l -> false; 14493l -> false; 176l -> false; 32370349l -> false; 1358l -> false; 11380200l -> false; 117l -> false; 1312779l -> false; 30918l -> false; 27054l -> false; 225491412l -> false; 132l -> false; 23189l -> false; 765788l -> false; 188l -> false; 27483l -> false; 1148682l -> false; 450982824l -> false; 891l -> false; 167516l -> false; 79025834l -> false; 670064l -> false; 125l -> false; 14936513l -> false; 235l -> false; 2717l -> false; 99l -> true; 1750373l -> false; 24277761l -> false; 197304985l -> false; 20612l -> false; 1811l -> false; 15459l -> false; 338237118l -> false; 901965649l -> false; _ -> false}) --- Failure -------------------------------------------------------------------- Test fail_pred_map_commute_int64 failed (201 shrink steps): -([0L; 0L], {-8810550782076602055L -> 0L; 2193919536756226345L -> 0L; 0L -> 1L; _ -> 0L}, {99979597015665302L -> false; 1468801460202L -> false; 15L -> false; 1952082L -> false; 284805883781L -> false; 720593L -> false; 422076469410L -> false; 735847988098523L -> false; 866701437833153609L -> false; 4537031266334529194L -> false; 1041110L -> false; 1L -> true; 101861769836880L -> false; 21L -> false; 59110L -> false; 210173L -> false; 12691630L -> false; 86L -> false; 23362982654L -> false; 963900958258L -> false; 1733402875666307218L -> false; 304L -> false; 1137545637156014112L -> false; 325492438607L -> false; 241450121094828L -> false; 5045814775532730L -> false; 1561665L -> false; 3844430305167794L -> false; 960790L -> false; 1032751026705L -> false; 976041L -> false; 990515928952175553L -> false; 488020L -> false; 2937602920405L -> false; 118838731476360L -> false; 51722L -> false; 8761118495L -> false; 90543795410560L -> false; 826200821364L -> false; 206957246652710L -> false; 2235910448L -> false; 2943391952394092L -> false; 2193919536756226345L -> false; 6345815L -> false; 57L -> false; 290461226260L -> false; 101533043L -> false; 32805805270765177L -> false; 1044L -> false; 1516727516208018816L -> false; 1485773893428263330L -> false; 142193204644501764L -> false; 29555L -> false; 480395L -> false; 1471695976197046L -> false; 580922452521L -> false; 78814L -> false; 203066086L -> false; 118221L -> false; 1586453L -> false; 174056645L -> false; 551885991073892L -> false; 37492348880874488L -> false; 464151052L -> false; 10221304911L -> false; 7176269902979883L -> false; 10L -> false; 1392L -> false; 44333L -> false; 31150643538L -> false; 840692L -> false; 49989798507832651L -> false; 76L -> false; 2395618337L -> false; 4100725658845647L -> false; -8810550782076602055L -> false; 1916494670L -> false; 5766645457751691L -> false; 11314L -> false; 1103771982147785L -> false; 7688860610335589L -> false; 7425L -> false; 379741178375L -> false; 774563270028L -> false; 116037763L -> false; 1277663113L -> false; 114L -> false; 854035L -> false; 6714520960926L -> false; 7957950768506L -> false; 1981031857904351106L -> false; 15575321769L -> false; 5840745663L -> false; 8952694614569L -> false; 45257L -> false; 2475472282L -> false; 609L -> false; 8201451317691294L -> false; 232075526L -> false; 381230359467L -> false; 1218L -> false; 11681491327L -> false; 93314290547954282L -> false; 74984697761748977L -> false; 1300052156749730414L -> false; 275942995536946L -> false; 696L -> false; 1856L -> false; 5110652455L -> false; 387281635014L -> false; 152L -> false; 1821943L -> false; 120725060547414L -> false; 7833607787747L -> false; 16971L -> false; 217845919695L -> false; 5886783904788185L -> false; 53322451741688161L -> false; 0L -> false; 3712L -> false; 56238523321311732L -> false; 758363758104009408L -> false; 5875205840810L -> false; 4476347307284L -> false; 3916803893873L -> false; 326768879543L -> false; 43L -> false; 9900L -> false; 428884154400L -> false; 6151088488268471L -> false; 16402902635382588L -> false; 7L -> false; 71096602322250882L -> false; 25383260L -> false; 435691839390L -> false; 6727753034043640L -> false; 38792L -> false; 1189840L -> false; 420346L -> false; 79983677612532242L -> false; 3L -> false; 928L -> false; 25861L -> false; 15915901537012L -> false; 928302105L -> false; 31831803074025L -> false; 106644903483376323L -> false; 1101601095152L -> false; 22628L -> false; 915038L -> false; 50766521L -> false; 734400730101L -> false; 284386409289003528L -> false; 2082220L -> false; 3873912968074562848L -> false; 945539L -> false; 63663606148050L -> false; 732030L -> false; 11936926152759L -> false; 550800547576L -> false; 408461099429L -> false; 137971497768473L -> false; 67907846557920L -> false; 135815693115840L -> false; 3172907L -> false; 105086L -> false; 3363876517021820L -> false; 249205148308L -> false; 1784760L -> false; 213604412835L -> false; 1237736141L -> false; 189870589187L -> false; 516375513352L -> false; 65611610541530354L -> false; 568772818578007056L -> false; 2379680L -> false; 618868070L -> false; 62301287077L -> false; 433989918143L -> false; 19800L -> false; 3962063715808702212L -> false; 157629L -> false; 124602574154L -> false; 181087590821121L -> false; 2555326227L -> false; 142402941890L -> false; 5968463076379L -> false; 127327212296100L -> false; 4950L -> false; 216994959071L -> false; 432287996895L -> false; _ -> false}) +([0L], {-8810550782076602055L -> 0L; 2193919536756226345L -> 0L; 0L -> 1L; _ -> 0L}, {99979597015665302L -> false; 1468801460202L -> false; 15L -> false; 1952082L -> false; 284805883781L -> false; 720593L -> false; 422076469410L -> false; 735847988098523L -> false; 866701437833153609L -> false; 4537031266334529194L -> false; 1041110L -> false; 1L -> true; 101861769836880L -> false; 21L -> false; 59110L -> false; 210173L -> false; 12691630L -> false; 86L -> false; 23362982654L -> false; 963900958258L -> false; 1733402875666307218L -> false; 304L -> false; 1137545637156014112L -> false; 325492438607L -> false; 241450121094828L -> false; 5045814775532730L -> false; 1561665L -> false; 3844430305167794L -> false; 960790L -> false; 1032751026705L -> false; 976041L -> false; 990515928952175553L -> false; 488020L -> false; 2937602920405L -> false; 118838731476360L -> false; 51722L -> false; 8761118495L -> false; 90543795410560L -> false; 826200821364L -> false; 206957246652710L -> false; 2235910448L -> false; 2943391952394092L -> false; 2193919536756226345L -> false; 6345815L -> false; 57L -> false; 290461226260L -> false; 101533043L -> false; 32805805270765177L -> false; 1044L -> false; 1516727516208018816L -> false; 1485773893428263330L -> false; 142193204644501764L -> false; 29555L -> false; 480395L -> false; 1471695976197046L -> false; 580922452521L -> false; 78814L -> false; 203066086L -> false; 118221L -> false; 1586453L -> false; 174056645L -> false; 551885991073892L -> false; 37492348880874488L -> false; 464151052L -> false; 10221304911L -> false; 7176269902979883L -> false; 10L -> false; 1392L -> false; 44333L -> false; 31150643538L -> false; 840692L -> false; 49989798507832651L -> false; 76L -> false; 2395618337L -> false; 4100725658845647L -> false; -8810550782076602055L -> false; 1916494670L -> false; 5766645457751691L -> false; 11314L -> false; 1103771982147785L -> false; 7688860610335589L -> false; 7425L -> false; 379741178375L -> false; 774563270028L -> false; 116037763L -> false; 1277663113L -> false; 114L -> false; 854035L -> false; 6714520960926L -> false; 7957950768506L -> false; 1981031857904351106L -> false; 15575321769L -> false; 5840745663L -> false; 8952694614569L -> false; 45257L -> false; 2475472282L -> false; 609L -> false; 8201451317691294L -> false; 232075526L -> false; 381230359467L -> false; 1218L -> false; 11681491327L -> false; 93314290547954282L -> false; 74984697761748977L -> false; 1300052156749730414L -> false; 275942995536946L -> false; 696L -> false; 1856L -> false; 5110652455L -> false; 387281635014L -> false; 152L -> false; 1821943L -> false; 120725060547414L -> false; 7833607787747L -> false; 16971L -> false; 217845919695L -> false; 5886783904788185L -> false; 53322451741688161L -> false; 0L -> false; 3712L -> false; 56238523321311732L -> false; 758363758104009408L -> false; 5875205840810L -> false; 4476347307284L -> false; 3916803893873L -> false; 326768879543L -> false; 43L -> false; 9900L -> false; 428884154400L -> false; 6151088488268471L -> false; 16402902635382588L -> false; 7L -> false; 71096602322250882L -> false; 25383260L -> false; 435691839390L -> false; 6727753034043640L -> false; 38792L -> false; 1189840L -> false; 420346L -> false; 79983677612532242L -> false; 3L -> false; 928L -> false; 25861L -> false; 15915901537012L -> false; 928302105L -> false; 31831803074025L -> false; 106644903483376323L -> false; 1101601095152L -> false; 22628L -> false; 915038L -> false; 50766521L -> false; 734400730101L -> false; 284386409289003528L -> false; 2082220L -> false; 3873912968074562848L -> false; 945539L -> false; 63663606148050L -> false; 732030L -> false; 11936926152759L -> false; 550800547576L -> false; 408461099429L -> false; 137971497768473L -> false; 67907846557920L -> false; 135815693115840L -> false; 3172907L -> false; 105086L -> false; 3363876517021820L -> false; 249205148308L -> false; 1784760L -> false; 213604412835L -> false; 1237736141L -> false; 189870589187L -> false; 516375513352L -> false; 65611610541530354L -> false; 568772818578007056L -> false; 2379680L -> false; 618868070L -> false; 62301287077L -> false; 433989918143L -> false; 19800L -> false; 3962063715808702212L -> false; 157629L -> false; 124602574154L -> false; 181087590821121L -> false; 2555326227L -> false; 142402941890L -> false; 5968463076379L -> false; 127327212296100L -> false; 4950L -> false; 216994959071L -> false; 432287996895L -> false; _ -> false}) --- Failure -------------------------------------------------------------------- From 3e8c87cc3640a856c92194fbcca0f876ee78f4c4 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 31 Jan 2025 18:55:41 +0100 Subject: [PATCH 311/391] Utilize improved QCheck2 list shrinker in function shrinker --- src/core/QCheck2.ml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index 18ecf80c..5adb9867 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -1259,14 +1259,14 @@ end = struct (* This only gets evaluated *after* the test was run for [tbl], meaning it is correctly populated with bindings recorded during the test already *) let current_bindings : (k * v Tree.t) list = List.rev !(root.p_tree_bindings_rev) in - let take_at_most_tree : int Tree.t = Tree.make_primitive (Shrink.int_towards 0) (List.length current_bindings) in let current_tree_bindings : (k * v) Tree.t list = List.map (fun (k, tree) -> Tree.map (fun v -> (k, v)) tree) current_bindings in - let shrunk_bindings_tree : (k * v) list Tree.t = Tree.bind take_at_most_tree (fun take_at_most -> Tree.applicative_take take_at_most current_tree_bindings) in + let shrunk_bindings_tree_seq : (k * v) list Tree.t Seq.t = Tree.build_list_shrink_tree current_tree_bindings in (* During shrinking, we don't want to record/add bindings, so [~extend:false]. *) - let shrunk_poly_tbl_tree : (k, v) t Tree.t = Tree.map (fun bindings -> List.to_seq bindings |> T.of_seq |> make ~extend:false) shrunk_bindings_tree in - (* [shrunk_poly_tbl_tree] is a bit misleading: its root *should* be the same as [root] but because of the required laziness - induced by the mutation of bindings, we don't use it, only graft its children to the original [root]. *) - Tree.children shrunk_poly_tbl_tree () + let shrunk_poly_tbl_tree_seq : (k, v) t Tree.t Seq.t = + Seq.map (fun t -> Tree.map (fun bindings -> List.to_seq bindings |> T.of_seq |> make ~extend:false) t) shrunk_bindings_tree_seq in + (* [shrunk_poly_tbl_tree_seq] is a bit misleading: its head *should* be the same as [root] but because of the required laziness + induced by the mutation of bindings, we don't use it, only graft its tail to the original [root]. *) + Seq.drop 1 shrunk_poly_tbl_tree_seq () in Tree.Tree (root, shrinks) From d8f527b845acd90605e526e8907efa2d6a660885 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 31 Jan 2025 19:11:20 +0100 Subject: [PATCH 312/391] Update QCheck2 expect test output wrt QCheck2 function shrinker improvements --- .../QCheck2_expect_test.expected.ocaml4.32 | 28 +++++++++---------- .../QCheck2_expect_test.expected.ocaml4.64 | 28 +++++++++---------- .../QCheck2_expect_test.expected.ocaml5.32 | 28 +++++++++---------- .../QCheck2_expect_test.expected.ocaml5.64 | 28 +++++++++---------- 4 files changed, 56 insertions(+), 56 deletions(-) diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.32 b/test/core/QCheck2_expect_test.expected.ocaml4.32 index 1e5b7880..f8e83f04 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.32 @@ -554,33 +554,33 @@ Test sum list = 0 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int failed (28 shrink steps): +Test fail_pred_map_commute_int failed (14 shrink steps): -([0], {0 -> -1; 1 -> 0; 2 -> 0; 5 -> 0; 21 -> 0; 7 -> 0; 9 -> 0; 78 -> 0; _ -> 0}, {0 -> true; 998130433 -> false; 1 -> false; 2 -> false; 402927669 -> false; 5 -> false; 21 -> false; 7 -> false; -1041906807 -> false; 9 -> false; -1072173830 -> false; -353172948 -> false; -952635860 -> false; 78 -> false; 286212959 -> false; _ -> false}) +([0], {0 -> -1; _ -> 0}, {0 -> true; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int32 failed (67 shrink steps): +Test fail_pred_map_commute_int32 failed (58 shrink steps): -([0l], {480624048l -> 0l; -1054565120l -> 0l; 708270421l -> 0l; -1441877194l -> 0l; -239944349l -> 0l; 0l -> 1l; -973889953l -> 0l; 1395009590l -> 0l; _ -> 0l}, {-1990017031l -> false; 443535120l -> false; 480624048l -> false; -1054565120l -> false; 829558403l -> false; -1311148841l -> false; 2084431360l -> false; 708270421l -> false; 79063824l -> false; -1441877194l -> false; -239944349l -> false; 0l -> true; 457187395l -> false; 1395009590l -> false; -973889953l -> false; _ -> false}) +([0l], {0l -> 1l; _ -> 0l}, {0l -> true; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int64 failed (122 shrink steps): +Test fail_pred_map_commute_int64 failed (113 shrink steps): -([0L], {-5912897149740583042L -> 0L; 2064264570832434420L -> 0L; 8769531915837689755L -> 0L; -1030553128493932961L -> 0L; 0L -> 1L; 6077417419721789289L -> 0L; -4529322700507305930L -> 0L; -6192815392369977003L -> 0L; _ -> 0L}, {-8367471897177334538L -> false; 8952564522059662897L -> false; -5912897149740583042L -> false; -5897649978982613650L -> false; 339576540681650169L -> false; 2064264570832434420L -> false; 1963604910111969040L -> false; 8769531915837689755L -> false; -1030553128493932961L -> false; 0L -> true; 6077417419721789289L -> false; -3575913752036838904L -> false; 3562926213990806743L -> false; -6192815392369977003L -> false; -4529322700507305930L -> false; _ -> false}) +([0L], {0L -> 1L; _ -> 0L}, {0L -> true; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_strings failed (2 shrink steps): +Test fail_pred_strings failed (1 shrink steps): -{"some random string" -> true; _ -> false} +{"some random string" -> true; "some other string" -> false; _ -> false} --- Failure -------------------------------------------------------------------- -Test fold_left fold_right failed (23 shrink steps): +Test fold_left fold_right failed (10 shrink steps): -(0, [1], {(70, 3) -> 0; (1, 0) -> 1; (3, 0) -> 0; (0, 6) -> 0; (2, 6) -> 0; (0, 90) -> 0; (3, 26) -> 0; (3, 9) -> 0; (20, 3) -> 0; (3, 2) -> 0; (2, 0) -> 0; (4, 3) -> 0; (9, 6) -> 0; (6, 8) -> 0; (0, 3) -> 0; (6, 6) -> 0; (0, 7) -> 0; (0, 0) -> 0; _ -> 0}) +(0, [1], {(1, 0) -> 1; _ -> 0}) +++ Messages ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -591,15 +591,15 @@ l=[1], fold_left=1, fold_right=0 --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried failed (45 shrink steps): +Test fold_left fold_right uncurried failed (62 shrink steps): -({(3, 76) -> 0; (9, 3) -> 0; (5, 2) -> 0; (1, 2) -> 1; (34, 1) -> 0; (9, 6) -> 0; (7, 3) -> 0; (3, 8) -> 0; (67, 3) -> 0; (2, 24) -> 0; (1, 1) -> 0; (37, 6) -> 0; (6, 2) -> 0; (5, 8) -> 0; (5, 7) -> 0; (5, 6) -> 0; (4, 8) -> 0; (17, 3) -> 0; (3, 4) -> 0; (84, 79) -> 0; (4, 17) -> 0; (6, 1) -> 0; (7, 6) -> 0; (3, 5) -> 0; (9, 4) -> 0; (1, 9) -> 0; (2, 5) -> 0; _ -> 0}, 1, [2]) +({(5, 2) -> 0; (4, 1) -> 0; (1, 2) -> 1; (79, 4) -> 0; (9, 6) -> 0; (7, 3) -> 0; (3, 8) -> 0; (17, 6) -> 0; (37, 6) -> 0; (4, 8) -> 0; (17, 3) -> 0; (3, 4) -> 0; (84, 79) -> 0; (8, 1) -> 0; (6, 8) -> 0; (4, 17) -> 0; (3, 5) -> 0; (1, 6) -> 0; (9, 4) -> 0; (2, 5) -> 0; (5, 4) -> 0; (3, 76) -> 0; (9, 3) -> 0; (3, 1) -> 0; (8, 3) -> 0; (3, 24) -> 0; (34, 1) -> 0; (3, 3) -> 0; (6, 9) -> 0; (76, 8) -> 0; (67, 3) -> 0; (8, 9) -> 0; (2, 24) -> 0; (1, 1) -> 0; (1, 5) -> 0; (2, 3) -> 0; (6, 2) -> 0; (5, 8) -> 0; (5, 7) -> 0; (5, 6) -> 0; (24, 5) -> 0; (2, 17) -> 0; (6, 1) -> 0; (7, 6) -> 0; (6, 3) -> 0; (2, 4) -> 0; (1, 9) -> 0; _ -> 0}, 1, [2]) --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried fun last failed (23 shrink steps): +Test fold_left fold_right uncurried fun last failed (10 shrink steps): -(0, [1], {(0, 20) -> 0; (90, 3) -> 0; (3, 9) -> 0; (8, 3) -> 0; (3, 2) -> 0; (9, 6) -> 0; (7, 3) -> 0; (6, 20) -> 0; (0, 3) -> 0; (0, 70) -> 0; (6, 70) -> 0; (3, 0) -> 0; (0, 4) -> 0; (0, 0) -> 0; (0, 1) -> 1; (2, 0) -> 0; (26, 6) -> 0; (6, 3) -> 0; _ -> 0}) +(0, [1], {(0, 1) -> 1; _ -> 0}) --- Failure -------------------------------------------------------------------- diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.64 b/test/core/QCheck2_expect_test.expected.ocaml4.64 index c5959e29..8a67bc62 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.64 @@ -614,33 +614,33 @@ Test sum list = 0 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int failed (28 shrink steps): +Test fail_pred_map_commute_int failed (14 shrink steps): -([0], {0 -> -1; 1 -> 0; 2 -> 0; 5 -> 0; 21 -> 0; 7 -> 0; 9 -> 0; 78 -> 0; _ -> 0}, {0 -> true; -3049580483007556080 -> false; 1 -> false; 2 -> false; -4368949366664347629 -> false; 2099003838291149429 -> false; 5 -> false; 21 -> false; 7 -> false; 9 -> false; 3703556273698913451 -> false; -4370157698609639012 -> false; -2235000253316812931 -> false; 78 -> false; 2211700024537999903 -> false; _ -> false}) +([0], {0 -> -1; _ -> 0}, {0 -> true; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int32 failed (67 shrink steps): +Test fail_pred_map_commute_int32 failed (58 shrink steps): -([0l], {480624048l -> 0l; -1054565120l -> 0l; 708270421l -> 0l; -1441877194l -> 0l; -239944349l -> 0l; 0l -> 1l; -973889953l -> 0l; 1395009590l -> 0l; _ -> 0l}, {-1990017031l -> false; 443535120l -> false; 480624048l -> false; -1054565120l -> false; 829558403l -> false; -1311148841l -> false; 2084431360l -> false; 708270421l -> false; 79063824l -> false; -1441877194l -> false; -239944349l -> false; 0l -> true; 457187395l -> false; 1395009590l -> false; -973889953l -> false; _ -> false}) +([0l], {0l -> 1l; _ -> 0l}, {0l -> true; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int64 failed (122 shrink steps): +Test fail_pred_map_commute_int64 failed (113 shrink steps): -([0L], {-5912897149740583042L -> 0L; 2064264570832434420L -> 0L; 8769531915837689755L -> 0L; -1030553128493932961L -> 0L; 0L -> 1L; 6077417419721789289L -> 0L; -4529322700507305930L -> 0L; -6192815392369977003L -> 0L; _ -> 0L}, {-8367471897177334538L -> false; 8952564522059662897L -> false; -5912897149740583042L -> false; -5897649978982613650L -> false; 339576540681650169L -> false; 2064264570832434420L -> false; 1963604910111969040L -> false; 8769531915837689755L -> false; -1030553128493932961L -> false; 0L -> true; 6077417419721789289L -> false; -3575913752036838904L -> false; 3562926213990806743L -> false; -6192815392369977003L -> false; -4529322700507305930L -> false; _ -> false}) +([0L], {0L -> 1L; _ -> 0L}, {0L -> true; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_strings failed (2 shrink steps): +Test fail_pred_strings failed (1 shrink steps): -{"some random string" -> true; _ -> false} +{"some random string" -> true; "some other string" -> false; _ -> false} --- Failure -------------------------------------------------------------------- -Test fold_left fold_right failed (23 shrink steps): +Test fold_left fold_right failed (10 shrink steps): -(0, [1], {(70, 3) -> 0; (1, 0) -> 1; (3, 0) -> 0; (0, 6) -> 0; (2, 6) -> 0; (0, 90) -> 0; (3, 26) -> 0; (3, 9) -> 0; (20, 3) -> 0; (3, 2) -> 0; (2, 0) -> 0; (4, 3) -> 0; (9, 6) -> 0; (6, 8) -> 0; (0, 3) -> 0; (6, 6) -> 0; (0, 7) -> 0; (0, 0) -> 0; _ -> 0}) +(0, [1], {(1, 0) -> 1; _ -> 0}) +++ Messages ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -651,15 +651,15 @@ l=[1], fold_left=1, fold_right=0 --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried failed (45 shrink steps): +Test fold_left fold_right uncurried failed (62 shrink steps): -({(3, 76) -> 0; (9, 3) -> 0; (5, 2) -> 0; (1, 2) -> 1; (34, 1) -> 0; (9, 6) -> 0; (7, 3) -> 0; (3, 8) -> 0; (67, 3) -> 0; (2, 24) -> 0; (1, 1) -> 0; (37, 6) -> 0; (6, 2) -> 0; (5, 8) -> 0; (5, 7) -> 0; (5, 6) -> 0; (4, 8) -> 0; (17, 3) -> 0; (3, 4) -> 0; (84, 79) -> 0; (4, 17) -> 0; (6, 1) -> 0; (7, 6) -> 0; (3, 5) -> 0; (9, 4) -> 0; (1, 9) -> 0; (2, 5) -> 0; _ -> 0}, 1, [2]) +({(5, 2) -> 0; (4, 1) -> 0; (1, 2) -> 1; (79, 4) -> 0; (9, 6) -> 0; (7, 3) -> 0; (3, 8) -> 0; (17, 6) -> 0; (37, 6) -> 0; (4, 8) -> 0; (17, 3) -> 0; (3, 4) -> 0; (84, 79) -> 0; (8, 1) -> 0; (6, 8) -> 0; (4, 17) -> 0; (3, 5) -> 0; (1, 6) -> 0; (9, 4) -> 0; (2, 5) -> 0; (5, 4) -> 0; (3, 76) -> 0; (9, 3) -> 0; (3, 1) -> 0; (8, 3) -> 0; (3, 24) -> 0; (34, 1) -> 0; (3, 3) -> 0; (6, 9) -> 0; (76, 8) -> 0; (67, 3) -> 0; (8, 9) -> 0; (2, 24) -> 0; (1, 1) -> 0; (1, 5) -> 0; (2, 3) -> 0; (6, 2) -> 0; (5, 8) -> 0; (5, 7) -> 0; (5, 6) -> 0; (24, 5) -> 0; (2, 17) -> 0; (6, 1) -> 0; (7, 6) -> 0; (6, 3) -> 0; (2, 4) -> 0; (1, 9) -> 0; _ -> 0}, 1, [2]) --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried fun last failed (23 shrink steps): +Test fold_left fold_right uncurried fun last failed (10 shrink steps): -(0, [1], {(0, 20) -> 0; (90, 3) -> 0; (3, 9) -> 0; (8, 3) -> 0; (3, 2) -> 0; (9, 6) -> 0; (7, 3) -> 0; (6, 20) -> 0; (0, 3) -> 0; (0, 70) -> 0; (6, 70) -> 0; (3, 0) -> 0; (0, 4) -> 0; (0, 0) -> 0; (0, 1) -> 1; (2, 0) -> 0; (26, 6) -> 0; (6, 3) -> 0; _ -> 0}) +(0, [1], {(0, 1) -> 1; _ -> 0}) --- Failure -------------------------------------------------------------------- diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.32 b/test/core/QCheck2_expect_test.expected.ocaml5.32 index be611aa1..3c826420 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.32 @@ -556,33 +556,33 @@ Test sum list = 0 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int failed (91 shrink steps): +Test fail_pred_map_commute_int failed (53 shrink steps): -([0], {0 -> 74; 5 -> 0; 26 -> 0; _ -> 0}, {0 -> false; 189249 -> false; 66 -> false; 9642498 -> false; 132 -> false; 339662148 -> false; 5 -> false; 21831 -> false; 12190023 -> false; 31049 -> false; 260053833 -> false; 679324297 -> false; 74 -> true; 17142220 -> false; 141 -> false; 24380046 -> false; 148602190 -> false; 47312 -> false; 5457 -> false; 659154 -> false; 1364 -> false; 126166 -> false; 1230422 -> false; 5624790 -> false; 88 -> false; 20376 -> false; 504665 -> false; 12856665 -> false; 26 -> false; 20699 -> false; 35484 -> false; 297204380 -> false; 48760093 -> false; 94 -> false; 671 -> false; 94624 -> false; 169831074 -> false; 99 -> false; 10915 -> false; 15524 -> false; 130026916 -> false; 165 -> false; 1318309 -> false; 8571110 -> false; 2728 -> false; 23656 -> false; 40674345 -> false; 2812395 -> false; 18285035 -> false; 252332 -> false; 6428332 -> false; 11249581 -> false; 15999405 -> false; 1007 -> false; 1153520 -> false; 13713776 -> false; 49 -> false; 177 -> false; 1009330 -> false; 254746611 -> false; 865140 -> false; 1406197 -> false; 9142517 -> false; 222903285 -> false; 23286 -> false; 41398 -> false; 195040374 -> false; 503 -> false; 1054647 -> false; 576760 -> false; 1001723384 -> false; 17465 -> false; 703098 -> false; 251 -> false; 11643 -> false; 988731 -> false; 97520187 -> false; 188 -> false; 125 -> false; 2046 -> false; 1343 -> false; 1151 -> false; 767 -> false; 1535 -> false; 1023 -> false; _ -> false}) +([0], {0 -> 74; _ -> 0}, {74 -> true; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int32 failed (91 shrink steps): +Test fail_pred_map_commute_int32 failed (52 shrink steps): -([0l], {-2051366210l -> 0l; 1992866105l -> 0l; 0l -> 99l; _ -> 0l}, {251l -> false; 251274l -> false; 335032l -> false; -2051366210l -> false; 1340129l -> false; 28986l -> false; 1337l -> false; 875186l -> false; 1867064l -> false; 167l -> false; 12802725l -> false; 258962793l -> false; 668l -> false; 3623l -> false; 7246l -> false; 7468256l -> false; 54966l -> false; 64740698l -> false; 1527l -> false; 8535150l -> false; 0l -> false; 394609971l -> false; 12138880l -> false; 47114l -> false; 1633681l -> false; 933532l -> false; 18208320l -> false; 129481396l -> false; 345283724l -> false; 1056359910l -> false; 1992866105l -> false; 66l -> false; 3734128l -> false; 22760400l -> false; 219l -> false; 125637l -> false; 295957478l -> false; 17070300l -> false; 1782l -> false; 1018l -> false; 88l -> false; 21243040l -> false; 41225l -> false; 31409l -> false; 1400298l -> false; 16185174l -> false; 334l -> false; 62818l -> false; 1531576l -> false; 2037l -> false; 172641862l -> false; 14493l -> false; 176l -> false; 32370349l -> false; 1358l -> false; 11380200l -> false; 117l -> false; 1312779l -> false; 30918l -> false; 27054l -> false; 225491412l -> false; 132l -> false; 23189l -> false; 765788l -> false; 188l -> false; 27483l -> false; 1148682l -> false; 450982824l -> false; 891l -> false; 167516l -> false; 79025834l -> false; 670064l -> false; 125l -> false; 14936513l -> false; 235l -> false; 2717l -> false; 99l -> true; 1750373l -> false; 24277761l -> false; 197304985l -> false; 20612l -> false; 1811l -> false; 15459l -> false; 338237118l -> false; 901965649l -> false; _ -> false}) +([0l], {0l -> 99l; _ -> 0l}, {99l -> true; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int64 failed (201 shrink steps): +Test fail_pred_map_commute_int64 failed (108 shrink steps): -([0L], {-8810550782076602055L -> 0L; 2193919536756226345L -> 0L; 0L -> 1L; _ -> 0L}, {99979597015665302L -> false; 1468801460202L -> false; 15L -> false; 1952082L -> false; 284805883781L -> false; 720593L -> false; 422076469410L -> false; 735847988098523L -> false; 866701437833153609L -> false; 4537031266334529194L -> false; 1041110L -> false; 1L -> true; 101861769836880L -> false; 21L -> false; 59110L -> false; 210173L -> false; 12691630L -> false; 86L -> false; 23362982654L -> false; 963900958258L -> false; 1733402875666307218L -> false; 304L -> false; 1137545637156014112L -> false; 325492438607L -> false; 241450121094828L -> false; 5045814775532730L -> false; 1561665L -> false; 3844430305167794L -> false; 960790L -> false; 1032751026705L -> false; 976041L -> false; 990515928952175553L -> false; 488020L -> false; 2937602920405L -> false; 118838731476360L -> false; 51722L -> false; 8761118495L -> false; 90543795410560L -> false; 826200821364L -> false; 206957246652710L -> false; 2235910448L -> false; 2943391952394092L -> false; 2193919536756226345L -> false; 6345815L -> false; 57L -> false; 290461226260L -> false; 101533043L -> false; 32805805270765177L -> false; 1044L -> false; 1516727516208018816L -> false; 1485773893428263330L -> false; 142193204644501764L -> false; 29555L -> false; 480395L -> false; 1471695976197046L -> false; 580922452521L -> false; 78814L -> false; 203066086L -> false; 118221L -> false; 1586453L -> false; 174056645L -> false; 551885991073892L -> false; 37492348880874488L -> false; 464151052L -> false; 10221304911L -> false; 7176269902979883L -> false; 10L -> false; 1392L -> false; 44333L -> false; 31150643538L -> false; 840692L -> false; 49989798507832651L -> false; 76L -> false; 2395618337L -> false; 4100725658845647L -> false; -8810550782076602055L -> false; 1916494670L -> false; 5766645457751691L -> false; 11314L -> false; 1103771982147785L -> false; 7688860610335589L -> false; 7425L -> false; 379741178375L -> false; 774563270028L -> false; 116037763L -> false; 1277663113L -> false; 114L -> false; 854035L -> false; 6714520960926L -> false; 7957950768506L -> false; 1981031857904351106L -> false; 15575321769L -> false; 5840745663L -> false; 8952694614569L -> false; 45257L -> false; 2475472282L -> false; 609L -> false; 8201451317691294L -> false; 232075526L -> false; 381230359467L -> false; 1218L -> false; 11681491327L -> false; 93314290547954282L -> false; 74984697761748977L -> false; 1300052156749730414L -> false; 275942995536946L -> false; 696L -> false; 1856L -> false; 5110652455L -> false; 387281635014L -> false; 152L -> false; 1821943L -> false; 120725060547414L -> false; 7833607787747L -> false; 16971L -> false; 217845919695L -> false; 5886783904788185L -> false; 53322451741688161L -> false; 0L -> false; 3712L -> false; 56238523321311732L -> false; 758363758104009408L -> false; 5875205840810L -> false; 4476347307284L -> false; 3916803893873L -> false; 326768879543L -> false; 43L -> false; 9900L -> false; 428884154400L -> false; 6151088488268471L -> false; 16402902635382588L -> false; 7L -> false; 71096602322250882L -> false; 25383260L -> false; 435691839390L -> false; 6727753034043640L -> false; 38792L -> false; 1189840L -> false; 420346L -> false; 79983677612532242L -> false; 3L -> false; 928L -> false; 25861L -> false; 15915901537012L -> false; 928302105L -> false; 31831803074025L -> false; 106644903483376323L -> false; 1101601095152L -> false; 22628L -> false; 915038L -> false; 50766521L -> false; 734400730101L -> false; 284386409289003528L -> false; 2082220L -> false; 3873912968074562848L -> false; 945539L -> false; 63663606148050L -> false; 732030L -> false; 11936926152759L -> false; 550800547576L -> false; 408461099429L -> false; 137971497768473L -> false; 67907846557920L -> false; 135815693115840L -> false; 3172907L -> false; 105086L -> false; 3363876517021820L -> false; 249205148308L -> false; 1784760L -> false; 213604412835L -> false; 1237736141L -> false; 189870589187L -> false; 516375513352L -> false; 65611610541530354L -> false; 568772818578007056L -> false; 2379680L -> false; 618868070L -> false; 62301287077L -> false; 433989918143L -> false; 19800L -> false; 3962063715808702212L -> false; 157629L -> false; 124602574154L -> false; 181087590821121L -> false; 2555326227L -> false; 142402941890L -> false; 5968463076379L -> false; 127327212296100L -> false; 4950L -> false; 216994959071L -> false; 432287996895L -> false; _ -> false}) +([0L], {0L -> 1L; _ -> 0L}, {1L -> true; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_strings failed (1 shrink steps): +Test fail_pred_strings failed (0 shrink steps): -{"some random string" -> true; _ -> false} +{"some random string" -> true; "some other string" -> false; _ -> false} --- Failure -------------------------------------------------------------------- -Test fold_left fold_right failed (152 shrink steps): +Test fold_left fold_right failed (18 shrink steps): -(0, [1], {(55, 3) -> 0; (3, 4) -> 0; (42, 7) -> 0; (89, 6) -> 0; (1, 9) -> 0; (6, 9) -> 0; (5, 61) -> 0; (1, 7) -> 0; (2, 57) -> 0; (57, 1) -> 0; (47, 1) -> 0; (9, 4) -> 0; (5, 92) -> 0; (6, 8) -> 0; (4, 0) -> 0; (25, 32) -> 0; (96, 6) -> 0; (7, 1) -> 0; (2, 9) -> 0; (3, 50) -> 0; (0, 0) -> 0; (7, 4) -> 0; (4, 7) -> 0; (2, 65) -> 0; (13, 5) -> 0; (61, 4) -> 0; (8, 6) -> 0; (82, 8) -> 0; (4, 44) -> 0; (9, 3) -> 0; (4, 3) -> 0; (25, 8) -> 0; (1, 2) -> 0; (6, 3) -> 0; (4, 1) -> 0; (1, 55) -> 0; (40, 0) -> 0; (5, 13) -> 0; (5, 73) -> 0; (7, 2) -> 0; (3, 3) -> 0; (8, 64) -> 0; (6, 4) -> 0; (46, 0) -> 0; (4, 39) -> 0; (7, 0) -> 0; (4, 5) -> 0; (9, 7) -> 0; (28, 0) -> 0; (47, 15) -> 0; (11, 8) -> 0; (3, 5) -> 0; (1, 4) -> 0; (9, 13) -> 0; (25, 43) -> 0; (6, 5) -> 0; (4, 4) -> 0; (0, 1) -> 1; (9, 89) -> 0; (43, 6) -> 0; (7, 40) -> 0; (5, 8) -> 0; (4, 6) -> 0; (1, 1) -> 0; (5, 72) -> 0; (92, 5) -> 0; (57, 6) -> 0; (48, 7) -> 0; (2, 0) -> 0; (21, 52) -> 0; (5, 2) -> 0; (8, 4) -> 0; (21, 15) -> 0; (0, 9) -> 0; (6, 43) -> 0; (8, 3) -> 0; (0, 4) -> 0; (21, 0) -> 0; (21, 8) -> 0; (0, 21) -> 0; (2, 15) -> 0; (57, 3) -> 0; (8, 7) -> 0; (7, 3) -> 0; (1, 0) -> 0; (2, 16) -> 0; (5, 1) -> 0; (4, 78) -> 0; (2, 4) -> 0; (8, 46) -> 0; (32, 0) -> 0; (2, 47) -> 0; (3, 17) -> 0; (50, 5) -> 0; (0, 3) -> 0; (3, 7) -> 0; (6, 6) -> 0; (59, 5) -> 0; (8, 1) -> 0; (0, 8) -> 0; (5, 32) -> 0; (3, 21) -> 0; (0, 6) -> 0; (3, 46) -> 0; (64, 8) -> 0; (9, 2) -> 0; (67, 0) -> 0; (3, 51) -> 0; (5, 94) -> 0; (6, 2) -> 0; (43, 7) -> 0; (54, 21) -> 0; (4, 9) -> 0; (17, 5) -> 0; (1, 8) -> 0; (6, 7) -> 0; (3, 8) -> 0; (41, 55) -> 0; (3, 6) -> 0; (5, 0) -> 0; (6, 1) -> 0; (0, 2) -> 0; (2, 1) -> 0; (0, 5) -> 0; (21, 6) -> 0; (4, 2) -> 0; (64, 4) -> 0; (57, 0) -> 0; (9, 1) -> 0; (9, 31) -> 0; (5, 57) -> 0; (3, 0) -> 0; (7, 7) -> 0; (2, 64) -> 0; (3, 9) -> 0; (7, 96) -> 0; (32, 7) -> 0; (8, 10) -> 0; (9, 47) -> 0; (4, 8) -> 0; (31, 92) -> 0; (0, 32) -> 0; (37, 2) -> 0; (5, 4) -> 0; (18, 8) -> 0; (8, 30) -> 0; (6, 0) -> 0; (8, 9) -> 0; (5, 64) -> 0; (8, 96) -> 0; (3, 1) -> 0; (7, 21) -> 0; _ -> 0}) +(0, [1], {(0, 1) -> 1; _ -> 0}) +++ Messages ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -593,15 +593,15 @@ l=[1], fold_left=0, fold_right=1 --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried failed (166 shrink steps): +Test fold_left fold_right uncurried failed (114 shrink steps): -({(53, 0) -> 0; (1, 91) -> 0; (5, 93) -> 0; (4, 80) -> 0; (50, 2) -> 0; (0, 7) -> 0; (83, 8) -> 0; (4, 45) -> 0; (28, 73) -> 0; (8, 2) -> 0; (7, 0) -> 0; (0, 0) -> 0; (1, 7) -> 0; (4, 6) -> 0; (8, 1) -> 0; (3, 5) -> 0; (8, 8) -> 0; (9, 3) -> 0; (3, 9) -> 0; (74, 0) -> 0; (5, 4) -> 0; (3, 52) -> 0; (6, 13) -> 0; (9, 22) -> 0; (83, 42) -> 0; (0, 99) -> 0; (26, 7) -> 0; (6, 14) -> 0; (4, 7) -> 0; (1, 1) -> 0; (0, 5) -> 0; (1, 5) -> 0; (5, 8) -> 0; (44, 8) -> 0; (2, 4) -> 0; (8, 12) -> 0; (4, 3) -> 0; (3, 6) -> 0; (8, 81) -> 0; (1, 2) -> 0; (2, 1) -> 0; (6, 5) -> 0; (9, 9) -> 0; (9, 38) -> 0; (7, 79) -> 0; (25, 4) -> 0; (2, 6) -> 0; (7, 94) -> 0; (5, 3) -> 0; (76, 49) -> 0; (36, 9) -> 0; (3, 84) -> 0; (1, 23) -> 0; (1, 6) -> 0; (0, 6) -> 0; (44, 2) -> 0; (83, 3) -> 0; (5, 18) -> 0; (3, 1) -> 0; (46, 7) -> 0; (24, 9) -> 0; (22, 5) -> 0; (5, 5) -> 0; (7, 4) -> 0; (36, 92) -> 0; (5, 14) -> 0; (6, 2) -> 0; (96, 5) -> 0; (1, 0) -> 0; (8, 4) -> 0; (5, 0) -> 0; (7, 5) -> 0; (9, 8) -> 0; (0, 19) -> 0; (0, 32) -> 0; (1, 33) -> 0; (6, 1) -> 0; (2, 82) -> 0; (8, 74) -> 0; (9, 6) -> 0; (8, 6) -> 0; (64, 2) -> 0; (3, 8) -> 0; (32, 56) -> 0; (6, 74) -> 0; (7, 1) -> 0; (6, 6) -> 0; (8, 98) -> 0; (4, 97) -> 0; (6, 72) -> 0; (0, 9) -> 0; (4, 8) -> 0; (2, 92) -> 0; (4, 23) -> 0; (3, 95) -> 0; (4, 61) -> 0; (0, 85) -> 0; (10, 92) -> 0; (89, 6) -> 0; (8, 3) -> 0; (32, 6) -> 0; (3, 2) -> 0; (9, 21) -> 0; (58, 6) -> 0; (3, 10) -> 0; (6, 9) -> 0; (8, 9) -> 0; (7, 8) -> 0; (23, 9) -> 0; (4, 9) -> 0; (23, 68) -> 0; (0, 1) -> 0; (6, 85) -> 0; (2, 0) -> 0; (7, 6) -> 0; (6, 3) -> 0; (0, 96) -> 0; (77, 8) -> 0; (9, 15) -> 0; (77, 0) -> 0; (0, 8) -> 0; (4, 2) -> 0; (8, 7) -> 0; (87, 7) -> 0; (3, 0) -> 0; (90, 46) -> 0; (7, 9) -> 0; (6, 4) -> 0; (6, 0) -> 1; (96, 71) -> 0; (76, 0) -> 0; (74, 3) -> 0; (1, 3) -> 0; (7, 71) -> 0; (7, 99) -> 0; (6, 7) -> 0; (9, 4) -> 0; (1, 8) -> 0; (4, 5) -> 0; (82, 4) -> 0; (5, 9) -> 0; (3, 3) -> 0; (0, 4) -> 0; (2, 3) -> 0; (44, 4) -> 0; (5, 7) -> 0; (5, 6) -> 0; (4, 4) -> 0; (4, 83) -> 0; (6, 49) -> 0; (1, 9) -> 0; (7, 7) -> 0; _ -> 0}, 0, [6]) +({(6, 0) -> 1; _ -> 0}, 0, [6]) --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried fun last failed (27 shrink steps): +Test fold_left fold_right uncurried fun last failed (21 shrink steps): -(0, [1], {(8, 3) -> 0; (5, 9) -> 0; (8, 0) -> 0; (0, 8) -> 0; (0, 7) -> 0; (50, 57) -> 0; (8, 47) -> 0; (32, 4) -> 0; (4, 21) -> 0; (0, 4) -> 0; (1, 0) -> 1; (7, 5) -> 0; _ -> 0}) +(0, [1], {(0, 1) -> 1; _ -> 0}) --- Failure -------------------------------------------------------------------- diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.64 b/test/core/QCheck2_expect_test.expected.ocaml5.64 index 5c1564ce..27663b47 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.64 @@ -618,33 +618,33 @@ Test sum list = 0 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int failed (200 shrink steps): +Test fail_pred_map_commute_int failed (108 shrink steps): -([0], {0 -> 1; 5 -> 0; 26 -> 0; _ -> 0}, {25868127433904000 -> false; 22172680657632000 -> false; 14781787105088000 -> false; 0 -> false; 1 -> true; 580232960935041 -> false; 29563574210176001 -> false; 56143987586 -> false; 3 -> false; 74858650115 -> false; 1160465921870083 -> false; 1326246767851523 -> false; 4 -> false; 11652 -> false; 217159411844 -> false; 112287975173 -> false; 169092480261 -> false; 1989370151777285 -> false; 5 -> false; 6 -> false; 2320931843740166 -> false; 2652493535703046 -> false; 149717300231 -> false; 8 -> false; 23305 -> false; 4605561481 -> false; 24562994569 -> false; 434318823689 -> false; 975983242 -> false; 2647276639626 -> false; 1250955 -> false; 512560423131771020 -> false; 71395852615053 -> false; 390522227148016015 -> false; 16 -> false; 1544244706448 -> false; 12550052217489 -> false; 274 -> false; 46610 -> false; 49125989138 -> false; 9211122963 -> false; 150304426899 -> false; 26773444730644 -> false; 22 -> false; 2501910 -> false; 192407 -> false; 615704 -> false; 26 -> false; 411 -> false; 2014933147 -> false; 171105485979 -> false; 21022986105014045 -> false; 30 -> false; 40160167095966 -> false; 112122592560074910 -> false; 1951 -> false; 781044454296032031 -> false; 33 -> false; 3088489412897 -> false; 6690 -> false; 243995810 -> false; 81595260131490 -> false; 25100104434979 -> false; 597987160320399523 -> false; 548 -> false; 98251978276 -> false; 3137513054372 -> false; 503733286 -> false; 20391 -> false; 28030648140018727 -> false; 1515710591830312 -> false; 53546889461289 -> false; 428248039555175850 -> false; 19709049473450667 -> false; 5003820 -> false; 31534479157521068 -> false; 45 -> false; 703662 -> false; 82863 -> false; 384815 -> false; 161040457392 -> false; 217587360350640 -> false; 20015281 -> false; 17842 -> false; 378802 -> false; 2829326438083250 -> false; 372789 -> false; 579091764918 -> false; 1463 -> false; 4029866295 -> false; 755599929 -> false; 3529702186169 -> false; 42045972210028091 -> false; 683413897509028027 -> false; 60 -> false; 331452 -> false; 360764 -> false; 91498428 -> false; 229035317180 -> false; 2273565887745468 -> false; 15293 -> false; 95194470153405 -> false; 224245185120149821 -> false; 3902 -> false; 166408472638 -> false; 1562088908592064063 -> false; 290116480467520 -> false; 12934063716952000 -> false; 62147 -> false; 881533251 -> false; 84215981379 -> false; 2302780740 -> false; 12281497284 -> false; 625477 -> false; 80061125 -> false; 487991621 -> false; 17478 -> false; 284102 -> false; 325739117766 -> false; 50200208869958 -> false; 35697926307526 -> false; 944499912 -> false; 6275026108744 -> false; 336713 -> false; 820939 -> false; 68623821 -> false; 1007466573 -> false; 85552742989 -> false; 171776487885 -> false; 56061296280037455 -> false; 3031421183660625 -> false; 298993580160199761 -> false; 10195 -> false; 41431 -> false; 39418098946901335 -> false; 585783340722024023 -> false; 10007640 -> false; 2316367059672 -> false; 108793680175320 -> false; 8921 -> false; 189401 -> false; 128832365913 -> false; 731 -> false; 289545882459 -> false; 1764851093084 -> false; 341706948754514013 -> false; 165726 -> false; 769630 -> false; 45749214 -> false; 114517658590 -> false; 47597235076702 -> false; 480 -> false; 435174720701280 -> false; 6467031858476000 -> false; 31073 -> false; 40030562 -> false; 6140748642 -> false; 288611 -> false; 46853528278627 -> false; 410469 -> false; 3454171110 -> false; 85888243942 -> false; 380028970727 -> false; 938216 -> false; 170434484073 -> false; 4460 -> false; 1158183529836 -> false; 54396840087660 -> false; 365 -> false; 2927 -> false; 240 -> false; 3233515929238000 -> false; 718321 -> false; 365993715 -> false; 36790225683774579 -> false; 1937055216023938291 -> false; 469108 -> false; 128329114484 -> false; 2425136946928500 -> false; 4706269581558 -> false; 120 -> false; 407173897208 -> false; 1616757964619000 -> false; 182996857 -> false; 305380422906 -> false; 448490370240299642 -> false; 2353134790779 -> false; 203586948604 -> false; 7805 -> false; 152690211453 -> false; _ -> false}) +([0], {0 -> 1; _ -> 0}, {1 -> true; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int32 failed (91 shrink steps): +Test fail_pred_map_commute_int32 failed (52 shrink steps): -([0l], {-2051366210l -> 0l; 1992866105l -> 0l; 0l -> 99l; _ -> 0l}, {251l -> false; 251274l -> false; 335032l -> false; -2051366210l -> false; 1340129l -> false; 28986l -> false; 1337l -> false; 875186l -> false; 1867064l -> false; 167l -> false; 12802725l -> false; 258962793l -> false; 668l -> false; 3623l -> false; 7246l -> false; 7468256l -> false; 54966l -> false; 64740698l -> false; 1527l -> false; 8535150l -> false; 0l -> false; 394609971l -> false; 12138880l -> false; 47114l -> false; 1633681l -> false; 933532l -> false; 18208320l -> false; 129481396l -> false; 345283724l -> false; 1056359910l -> false; 1992866105l -> false; 66l -> false; 3734128l -> false; 22760400l -> false; 219l -> false; 125637l -> false; 295957478l -> false; 17070300l -> false; 1782l -> false; 1018l -> false; 88l -> false; 21243040l -> false; 41225l -> false; 31409l -> false; 1400298l -> false; 16185174l -> false; 334l -> false; 62818l -> false; 1531576l -> false; 2037l -> false; 172641862l -> false; 14493l -> false; 176l -> false; 32370349l -> false; 1358l -> false; 11380200l -> false; 117l -> false; 1312779l -> false; 30918l -> false; 27054l -> false; 225491412l -> false; 132l -> false; 23189l -> false; 765788l -> false; 188l -> false; 27483l -> false; 1148682l -> false; 450982824l -> false; 891l -> false; 167516l -> false; 79025834l -> false; 670064l -> false; 125l -> false; 14936513l -> false; 235l -> false; 2717l -> false; 99l -> true; 1750373l -> false; 24277761l -> false; 197304985l -> false; 20612l -> false; 1811l -> false; 15459l -> false; 338237118l -> false; 901965649l -> false; _ -> false}) +([0l], {0l -> 99l; _ -> 0l}, {99l -> true; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int64 failed (201 shrink steps): +Test fail_pred_map_commute_int64 failed (108 shrink steps): -([0L], {-8810550782076602055L -> 0L; 2193919536756226345L -> 0L; 0L -> 1L; _ -> 0L}, {99979597015665302L -> false; 1468801460202L -> false; 15L -> false; 1952082L -> false; 284805883781L -> false; 720593L -> false; 422076469410L -> false; 735847988098523L -> false; 866701437833153609L -> false; 4537031266334529194L -> false; 1041110L -> false; 1L -> true; 101861769836880L -> false; 21L -> false; 59110L -> false; 210173L -> false; 12691630L -> false; 86L -> false; 23362982654L -> false; 963900958258L -> false; 1733402875666307218L -> false; 304L -> false; 1137545637156014112L -> false; 325492438607L -> false; 241450121094828L -> false; 5045814775532730L -> false; 1561665L -> false; 3844430305167794L -> false; 960790L -> false; 1032751026705L -> false; 976041L -> false; 990515928952175553L -> false; 488020L -> false; 2937602920405L -> false; 118838731476360L -> false; 51722L -> false; 8761118495L -> false; 90543795410560L -> false; 826200821364L -> false; 206957246652710L -> false; 2235910448L -> false; 2943391952394092L -> false; 2193919536756226345L -> false; 6345815L -> false; 57L -> false; 290461226260L -> false; 101533043L -> false; 32805805270765177L -> false; 1044L -> false; 1516727516208018816L -> false; 1485773893428263330L -> false; 142193204644501764L -> false; 29555L -> false; 480395L -> false; 1471695976197046L -> false; 580922452521L -> false; 78814L -> false; 203066086L -> false; 118221L -> false; 1586453L -> false; 174056645L -> false; 551885991073892L -> false; 37492348880874488L -> false; 464151052L -> false; 10221304911L -> false; 7176269902979883L -> false; 10L -> false; 1392L -> false; 44333L -> false; 31150643538L -> false; 840692L -> false; 49989798507832651L -> false; 76L -> false; 2395618337L -> false; 4100725658845647L -> false; -8810550782076602055L -> false; 1916494670L -> false; 5766645457751691L -> false; 11314L -> false; 1103771982147785L -> false; 7688860610335589L -> false; 7425L -> false; 379741178375L -> false; 774563270028L -> false; 116037763L -> false; 1277663113L -> false; 114L -> false; 854035L -> false; 6714520960926L -> false; 7957950768506L -> false; 1981031857904351106L -> false; 15575321769L -> false; 5840745663L -> false; 8952694614569L -> false; 45257L -> false; 2475472282L -> false; 609L -> false; 8201451317691294L -> false; 232075526L -> false; 381230359467L -> false; 1218L -> false; 11681491327L -> false; 93314290547954282L -> false; 74984697761748977L -> false; 1300052156749730414L -> false; 275942995536946L -> false; 696L -> false; 1856L -> false; 5110652455L -> false; 387281635014L -> false; 152L -> false; 1821943L -> false; 120725060547414L -> false; 7833607787747L -> false; 16971L -> false; 217845919695L -> false; 5886783904788185L -> false; 53322451741688161L -> false; 0L -> false; 3712L -> false; 56238523321311732L -> false; 758363758104009408L -> false; 5875205840810L -> false; 4476347307284L -> false; 3916803893873L -> false; 326768879543L -> false; 43L -> false; 9900L -> false; 428884154400L -> false; 6151088488268471L -> false; 16402902635382588L -> false; 7L -> false; 71096602322250882L -> false; 25383260L -> false; 435691839390L -> false; 6727753034043640L -> false; 38792L -> false; 1189840L -> false; 420346L -> false; 79983677612532242L -> false; 3L -> false; 928L -> false; 25861L -> false; 15915901537012L -> false; 928302105L -> false; 31831803074025L -> false; 106644903483376323L -> false; 1101601095152L -> false; 22628L -> false; 915038L -> false; 50766521L -> false; 734400730101L -> false; 284386409289003528L -> false; 2082220L -> false; 3873912968074562848L -> false; 945539L -> false; 63663606148050L -> false; 732030L -> false; 11936926152759L -> false; 550800547576L -> false; 408461099429L -> false; 137971497768473L -> false; 67907846557920L -> false; 135815693115840L -> false; 3172907L -> false; 105086L -> false; 3363876517021820L -> false; 249205148308L -> false; 1784760L -> false; 213604412835L -> false; 1237736141L -> false; 189870589187L -> false; 516375513352L -> false; 65611610541530354L -> false; 568772818578007056L -> false; 2379680L -> false; 618868070L -> false; 62301287077L -> false; 433989918143L -> false; 19800L -> false; 3962063715808702212L -> false; 157629L -> false; 124602574154L -> false; 181087590821121L -> false; 2555326227L -> false; 142402941890L -> false; 5968463076379L -> false; 127327212296100L -> false; 4950L -> false; 216994959071L -> false; 432287996895L -> false; _ -> false}) +([0L], {0L -> 1L; _ -> 0L}, {1L -> true; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_strings failed (1 shrink steps): +Test fail_pred_strings failed (0 shrink steps): -{"some random string" -> true; _ -> false} +{"some random string" -> true; "some other string" -> false; _ -> false} --- Failure -------------------------------------------------------------------- -Test fold_left fold_right failed (152 shrink steps): +Test fold_left fold_right failed (18 shrink steps): -(0, [1], {(55, 3) -> 0; (3, 4) -> 0; (42, 7) -> 0; (89, 6) -> 0; (1, 9) -> 0; (6, 9) -> 0; (5, 61) -> 0; (1, 7) -> 0; (2, 57) -> 0; (57, 1) -> 0; (47, 1) -> 0; (9, 4) -> 0; (5, 92) -> 0; (6, 8) -> 0; (4, 0) -> 0; (25, 32) -> 0; (96, 6) -> 0; (7, 1) -> 0; (2, 9) -> 0; (3, 50) -> 0; (0, 0) -> 0; (7, 4) -> 0; (4, 7) -> 0; (2, 65) -> 0; (13, 5) -> 0; (61, 4) -> 0; (8, 6) -> 0; (82, 8) -> 0; (4, 44) -> 0; (9, 3) -> 0; (4, 3) -> 0; (25, 8) -> 0; (1, 2) -> 0; (6, 3) -> 0; (4, 1) -> 0; (1, 55) -> 0; (40, 0) -> 0; (5, 13) -> 0; (5, 73) -> 0; (7, 2) -> 0; (3, 3) -> 0; (8, 64) -> 0; (6, 4) -> 0; (46, 0) -> 0; (4, 39) -> 0; (7, 0) -> 0; (4, 5) -> 0; (9, 7) -> 0; (28, 0) -> 0; (47, 15) -> 0; (11, 8) -> 0; (3, 5) -> 0; (1, 4) -> 0; (9, 13) -> 0; (25, 43) -> 0; (6, 5) -> 0; (4, 4) -> 0; (0, 1) -> 1; (9, 89) -> 0; (43, 6) -> 0; (7, 40) -> 0; (5, 8) -> 0; (4, 6) -> 0; (1, 1) -> 0; (5, 72) -> 0; (92, 5) -> 0; (57, 6) -> 0; (48, 7) -> 0; (2, 0) -> 0; (21, 52) -> 0; (5, 2) -> 0; (8, 4) -> 0; (21, 15) -> 0; (0, 9) -> 0; (6, 43) -> 0; (8, 3) -> 0; (0, 4) -> 0; (21, 0) -> 0; (21, 8) -> 0; (0, 21) -> 0; (2, 15) -> 0; (57, 3) -> 0; (8, 7) -> 0; (7, 3) -> 0; (1, 0) -> 0; (2, 16) -> 0; (5, 1) -> 0; (4, 78) -> 0; (2, 4) -> 0; (8, 46) -> 0; (32, 0) -> 0; (2, 47) -> 0; (3, 17) -> 0; (50, 5) -> 0; (0, 3) -> 0; (3, 7) -> 0; (6, 6) -> 0; (59, 5) -> 0; (8, 1) -> 0; (0, 8) -> 0; (5, 32) -> 0; (3, 21) -> 0; (0, 6) -> 0; (3, 46) -> 0; (64, 8) -> 0; (9, 2) -> 0; (67, 0) -> 0; (3, 51) -> 0; (5, 94) -> 0; (6, 2) -> 0; (43, 7) -> 0; (54, 21) -> 0; (4, 9) -> 0; (17, 5) -> 0; (1, 8) -> 0; (6, 7) -> 0; (3, 8) -> 0; (41, 55) -> 0; (3, 6) -> 0; (5, 0) -> 0; (6, 1) -> 0; (0, 2) -> 0; (2, 1) -> 0; (0, 5) -> 0; (21, 6) -> 0; (4, 2) -> 0; (64, 4) -> 0; (57, 0) -> 0; (9, 1) -> 0; (9, 31) -> 0; (5, 57) -> 0; (3, 0) -> 0; (7, 7) -> 0; (2, 64) -> 0; (3, 9) -> 0; (7, 96) -> 0; (32, 7) -> 0; (8, 10) -> 0; (9, 47) -> 0; (4, 8) -> 0; (31, 92) -> 0; (0, 32) -> 0; (37, 2) -> 0; (5, 4) -> 0; (18, 8) -> 0; (8, 30) -> 0; (6, 0) -> 0; (8, 9) -> 0; (5, 64) -> 0; (8, 96) -> 0; (3, 1) -> 0; (7, 21) -> 0; _ -> 0}) +(0, [1], {(0, 1) -> 1; _ -> 0}) +++ Messages ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -655,15 +655,15 @@ l=[1], fold_left=0, fold_right=1 --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried failed (166 shrink steps): +Test fold_left fold_right uncurried failed (114 shrink steps): -({(53, 0) -> 0; (1, 91) -> 0; (5, 93) -> 0; (4, 80) -> 0; (50, 2) -> 0; (0, 7) -> 0; (83, 8) -> 0; (4, 45) -> 0; (28, 73) -> 0; (8, 2) -> 0; (7, 0) -> 0; (0, 0) -> 0; (1, 7) -> 0; (4, 6) -> 0; (8, 1) -> 0; (3, 5) -> 0; (8, 8) -> 0; (9, 3) -> 0; (3, 9) -> 0; (74, 0) -> 0; (5, 4) -> 0; (3, 52) -> 0; (6, 13) -> 0; (9, 22) -> 0; (83, 42) -> 0; (0, 99) -> 0; (26, 7) -> 0; (6, 14) -> 0; (4, 7) -> 0; (1, 1) -> 0; (0, 5) -> 0; (1, 5) -> 0; (5, 8) -> 0; (44, 8) -> 0; (2, 4) -> 0; (8, 12) -> 0; (4, 3) -> 0; (3, 6) -> 0; (8, 81) -> 0; (1, 2) -> 0; (2, 1) -> 0; (6, 5) -> 0; (9, 9) -> 0; (9, 38) -> 0; (7, 79) -> 0; (25, 4) -> 0; (2, 6) -> 0; (7, 94) -> 0; (5, 3) -> 0; (76, 49) -> 0; (36, 9) -> 0; (3, 84) -> 0; (1, 23) -> 0; (1, 6) -> 0; (0, 6) -> 0; (44, 2) -> 0; (83, 3) -> 0; (5, 18) -> 0; (3, 1) -> 0; (46, 7) -> 0; (24, 9) -> 0; (22, 5) -> 0; (5, 5) -> 0; (7, 4) -> 0; (36, 92) -> 0; (5, 14) -> 0; (6, 2) -> 0; (96, 5) -> 0; (1, 0) -> 0; (8, 4) -> 0; (5, 0) -> 0; (7, 5) -> 0; (9, 8) -> 0; (0, 19) -> 0; (0, 32) -> 0; (1, 33) -> 0; (6, 1) -> 0; (2, 82) -> 0; (8, 74) -> 0; (9, 6) -> 0; (8, 6) -> 0; (64, 2) -> 0; (3, 8) -> 0; (32, 56) -> 0; (6, 74) -> 0; (7, 1) -> 0; (6, 6) -> 0; (8, 98) -> 0; (4, 97) -> 0; (6, 72) -> 0; (0, 9) -> 0; (4, 8) -> 0; (2, 92) -> 0; (4, 23) -> 0; (3, 95) -> 0; (4, 61) -> 0; (0, 85) -> 0; (10, 92) -> 0; (89, 6) -> 0; (8, 3) -> 0; (32, 6) -> 0; (3, 2) -> 0; (9, 21) -> 0; (58, 6) -> 0; (3, 10) -> 0; (6, 9) -> 0; (8, 9) -> 0; (7, 8) -> 0; (23, 9) -> 0; (4, 9) -> 0; (23, 68) -> 0; (0, 1) -> 0; (6, 85) -> 0; (2, 0) -> 0; (7, 6) -> 0; (6, 3) -> 0; (0, 96) -> 0; (77, 8) -> 0; (9, 15) -> 0; (77, 0) -> 0; (0, 8) -> 0; (4, 2) -> 0; (8, 7) -> 0; (87, 7) -> 0; (3, 0) -> 0; (90, 46) -> 0; (7, 9) -> 0; (6, 4) -> 0; (6, 0) -> 1; (96, 71) -> 0; (76, 0) -> 0; (74, 3) -> 0; (1, 3) -> 0; (7, 71) -> 0; (7, 99) -> 0; (6, 7) -> 0; (9, 4) -> 0; (1, 8) -> 0; (4, 5) -> 0; (82, 4) -> 0; (5, 9) -> 0; (3, 3) -> 0; (0, 4) -> 0; (2, 3) -> 0; (44, 4) -> 0; (5, 7) -> 0; (5, 6) -> 0; (4, 4) -> 0; (4, 83) -> 0; (6, 49) -> 0; (1, 9) -> 0; (7, 7) -> 0; _ -> 0}, 0, [6]) +({(6, 0) -> 1; _ -> 0}, 0, [6]) --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried fun last failed (27 shrink steps): +Test fold_left fold_right uncurried fun last failed (21 shrink steps): -(0, [1], {(8, 3) -> 0; (5, 9) -> 0; (8, 0) -> 0; (0, 8) -> 0; (0, 7) -> 0; (50, 57) -> 0; (8, 47) -> 0; (32, 4) -> 0; (4, 21) -> 0; (0, 4) -> 0; (1, 0) -> 1; (7, 5) -> 0; _ -> 0}) +(0, [1], {(0, 1) -> 1; _ -> 0}) --- Failure -------------------------------------------------------------------- From b237bd9bd1c1276c71d0a3bcab948dc729a09202 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 31 Jan 2025 20:02:34 +0100 Subject: [PATCH 313/391] Backport Seq.drop to support < ocaml.4.14 --- src/core/QCheck2.ml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index 5adb9867..46519f77 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -88,6 +88,25 @@ module Seq = struct let cons x next () = Cons (x, next) + let rec force_drop n xs = + match xs() with + | Nil -> + Nil + | Cons (_, xs) -> + let n = n - 1 in + if n = 0 then + xs() + else + force_drop n xs + + let drop n xs = + if n < 0 then invalid_arg "Seq.drop" + else if n = 0 then + xs + else + fun () -> + force_drop n xs + (* End of copy of old functions. *) let is_empty (seq : _ t) : bool = match seq () with From 5583d9aabd926c7f27c7f18a825a346f9566a2e2 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Sat, 1 Feb 2025 15:54:05 +0100 Subject: [PATCH 314/391] Add a CHANGELOG entry --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ec6d4c3..747abe2a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## NEXT RELEASE +- Improve the `QCheck2.Gen.list` shrinker heuristic and utilize the improved + shrinker in other `QCheck2` `{list,array,bytes,string,function}*` shrinkers - Use `split` and `copy` in `Random.State` underlying `QCheck2` to avoid non-deterministic shrinking behaviour - Add missing documentation strings for `QCheck.{Print,Iter,Shrink,Gen}` and `QCheck2.Gen`. From 50ea085d5a9a0258c6e1be785d7871622150bb2f Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 5 Feb 2025 16:17:37 +0100 Subject: [PATCH 315/391] Replace QCheck2 Random.State.split hack on OCaml4 by a faster one --- src/core/QCheck2.ml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index 46519f77..7b3bda9b 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -14,12 +14,15 @@ module RS = struct (* This definition is shadowed by the [include] on OCaml >=5.0 *) (* For the record, this is a hack: Seeding a child RNG based on the output of a parent RNG - does not create an independent RNG. As an added bonus, - performance is bad. *) - let split rs = - let bits = Random.State.bits rs in - let rs' = Random.State.make [|bits|] in - rs' + does not create an independent RNG. *) + (* copy of 4.14 Random.State.t to create a record of the right shape *) + type rs = { st : int array; mutable idx : int } [@@warning "-69"] + let split rs : Random.State.t = + let rs' = { st = Array.init 55 (fun _i -> Random.State.bits rs); idx = 0 } in + for i = 0 to 54 do + rs'.st.(i) <- (rs'.st.(i) lxor rs'.st.((i+1) mod 55)) land 0x3FFFFFFF; + done; + Obj.magic rs' (* sorry! *) include Random.State (* This is how OCaml 5.0 splits: *) (* Split a new PRNG off the given PRNG *) From a059c9ca12791a6702d99fecc86e66490427a999 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 5 Feb 2025 16:19:03 +0100 Subject: [PATCH 316/391] Reenable Shrink.fold_left_test --- test/core/QCheck2_tests.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/core/QCheck2_tests.ml b/test/core/QCheck2_tests.ml index 1594e45b..372478eb 100644 --- a/test/core/QCheck2_tests.ml +++ b/test/core/QCheck2_tests.ml @@ -852,7 +852,7 @@ module Function = struct prop_foldleft_foldright; prop_foldleft_foldright_uncurry; prop_foldleft_foldright_uncurry_funlast; - (*fold_left_test;*) (* Temporarily disabled, as the underlying shrinking takes excessively long *) + fold_left_test; ] end From f436f45b56899d9b39268476ca1f2aae8fecdf14 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 5 Feb 2025 16:22:41 +0100 Subject: [PATCH 317/391] Add simple RNG independence test --- test/core/dune | 5 +++++ test/core/rng_independence.ml | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 test/core/rng_independence.ml diff --git a/test/core/dune b/test/core/dune index 2f6b364b..e30b99ac 100644 --- a/test/core/dune +++ b/test/core/dune @@ -66,3 +66,8 @@ (name shrink_benchmark) (modules shrink_benchmark) (libraries qcheck-core qcheck-core.runner QCheck_tests QCheck2_tests)) + +(executable + (name rng_independence) + (modules rng_independence) + (libraries qcheck-core qcheck-core.runner)) diff --git a/test/core/rng_independence.ml b/test/core/rng_independence.ml new file mode 100644 index 00000000..0eb94fbb --- /dev/null +++ b/test/core/rng_independence.ml @@ -0,0 +1,21 @@ +open QCheck2 + +(* +From https://github.com/haskell/random/issues/25 +Assess splitting behaviour by generating stat tests of the form: + +let test_to_1 = + Test.make ~count:2000 ~name:"2000 pairs in [0;1]" ~collect + Gen.(pair (int_bound 1) (int_bound 1)) (fun _ -> true) +*) + +let collect (x,y) = if x=y then "equal " else "not-equal" + +let gen_test i = + let count = 1000 + i * 1000 in + let name = Printf.sprintf "%i pairs in [0;%i] - should be around 1000" count i in + Test.make ~count ~name ~collect + Gen.(pair (int_bound i) (int_bound i)) (fun _ -> true) + +let _ = + QCheck_base_runner.run_tests ~verbose:true (List.init 14 (fun i -> gen_test (i+1))) From a774fb58bd14e817bb85a65ecea563e24fe4541d Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 5 Feb 2025 17:14:58 +0100 Subject: [PATCH 318/391] Update QCheck2 unit tests wrt split change --- test/core/QCheck2_unit_tests.ml | 242 +++++++++++++++++--------------- 1 file changed, 125 insertions(+), 117 deletions(-) diff --git a/test/core/QCheck2_unit_tests.ml b/test/core/QCheck2_unit_tests.ml index f6c5db49..1278284e 100644 --- a/test/core/QCheck2_unit_tests.ml +++ b/test/core/QCheck2_unit_tests.ml @@ -133,13 +133,13 @@ module Shrink = struct if ocaml_major_version < 5 then (Alcotest.(check' (list (pair int int))) - ~msg:"1,3 on repeated failure" + ~msg:"9,1 on repeated failure" ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (pair small_int small_int)) |> repeated_failure) - ~expected:[(1, 3); (0, 3); (1, 0); (1, 1); (1, 2)]; + ~expected:[(9, 1); (0, 1); (4, 1); (6, 1); (7, 1); (8, 1); (9, 0)]; Alcotest.(check' (list (pair int int))) - ~msg:"1,3 on repeated success" + ~msg:"9,1 on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (pair small_int small_int)) |> repeated_success) - ~expected:[(1, 3); (0, 3); (0, 0)]) + ~expected:[(9, 1); (0, 1); (0, 0)]) else (Alcotest.(check' (list (pair int int))) ~msg:"2,6 on repeated failure" @@ -154,13 +154,13 @@ module Shrink = struct if ocaml_major_version < 5 then (Alcotest.(check' (list (pair int int))) - ~msg:"1,3 on repeated failure" + ~msg:"9,1 on repeated failure" ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (small_int >>= fun i -> map (fun j -> (i,j)) small_int)) |> repeated_failure) - ~expected:[(1, 3); (0, 3); (1, 0); (1, 1); (1, 2)]; + ~expected:[(9, 1); (0, 1); (4, 1); (6, 1); (7, 1); (8, 1); (9, 0)]; Alcotest.(check' (list (pair int int))) - ~msg:"1,3 on repeated success" + ~msg:"9,1 on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (small_int >>= fun i -> map (fun j -> (i,j)) small_int)) |> repeated_success) - ~expected:[(1, 3); (0, 3); (0, 0)]) + ~expected:[(9, 1); (0, 1); (0, 0)]) else (Alcotest.(check' (list (pair int int))) ~msg:"2,6 on repeated failure" @@ -175,15 +175,18 @@ module Shrink = struct if ocaml_major_version < 5 then (Alcotest.(check' (list (list int))) - ~msg:"[10; 8] on repeated failure" + ~msg:"[8; 0; 9; 0; 8; 8; 2] on repeated failure" ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (list_size (int_bound 8) (int_bound 10))) |> repeated_failure) - ~expected:[ [10; 8]; []; [10]; - [0; 8]; [5; 8]; [8; 8]; [9; 8]; - [10; 0]; [10; 4]; [10; 6]; [10; 7]; ]; + ~expected:[ [8; 0; 9; 0; 8; 8; 2]; []; [8; 0; 9]; [8; 0; 9; 0; 8]; [8; 0; 9; 0; 8; 8]; + [0; 0; 9; 0; 8; 8; 2]; [4; 0; 9; 0; 8; 8; 2]; [6; 0; 9; 0; 8; 8; 2]; [7; 0; 9; 0; 8; 8; 2]; + [8; 0; 0; 0; 8; 8; 2]; [8; 0; 4; 0; 8; 8; 2]; [8; 0; 6; 0; 8; 8; 2]; [8; 0; 7; 0; 8; 8; 2]; [8; 0; 8; 0; 8; 8; 2]; + [8; 0; 9; 0; 0; 8; 2]; [8; 0; 9; 0; 4; 8; 2]; [8; 0; 9; 0; 6; 8; 2]; [8; 0; 9; 0; 7; 8; 2]; + [8; 0; 9; 0; 8; 0; 2]; [8; 0; 9; 0; 8; 4; 2]; [8; 0; 9; 0; 8; 6; 2]; [8; 0; 9; 0; 8; 7; 2]; + [8; 0; 9; 0; 8; 8; 0]; [8; 0; 9; 0; 8; 8; 1]; ]; Alcotest.(check' (list (list int))) - ~msg:"[10; 8] on repeated success" + ~msg:"[8; 0; 9; 0; 8; 8; 2] on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (list_size (int_bound 8) (int_bound 10))) |> repeated_success) - ~expected:[ [10; 8]; []; ]) + ~expected:[ [8; 0; 9; 0; 8; 8; 2]; []; ]) else (Alcotest.(check' (list (list int))) ~msg:"[9; 2; 7; 3; 8; 6] repeated failure" @@ -204,17 +207,16 @@ module Shrink = struct if ocaml_major_version < 5 then (Alcotest.(check' (list (list int))) - ~msg:"[5; 9; 4; 10] on repeated failure" - ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) (list (int_bound 10))) |> repeated_failure) - ~expected:[ [5; 9; 4; 10]; [5; 9]; [4; 10]; [9; 4; 10]; [5; 9; 10]; - [0; 9; 4; 10]; [2; 9; 4; 10]; [3; 9; 4; 10]; [4; 9; 4; 10]; - [5; 0; 4; 10]; [5; 4; 4; 10]; [5; 6; 4; 10]; [5; 7; 4; 10]; [5; 8; 4; 10]; - [5; 9; 0; 10]; [5; 9; 2; 10]; [5; 9; 3; 10]; - [5; 9; 4; 0]; [5; 9; 4; 5]; [5; 9; 4; 8]; [5; 9; 4; 9]; ]; + ~msg:"[0; 5; 3; 7] on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3345) (list (int_bound 10))) |> repeated_failure) + ~expected:[ [0; 5; 3; 7]; [0; 5]; [3; 7]; [5; 3; 7]; [0; 5; 7]; + [0; 0; 3; 7]; [0; 2; 3; 7]; [0; 3; 3; 7]; [0; 4; 3; 7]; + [0; 5; 0; 7]; [0; 5; 1; 7]; [0; 5; 2; 7]; + [0; 5; 3; 0]; [0; 5; 3; 3]; [0; 5; 3; 5]; [0; 5; 3; 6]; ]; Alcotest.(check' (list (list int))) - ~msg:"[5; 9; 4; 10] on repeated success" - ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) (list (int_bound 10))) |> repeated_success) - ~expected:[ [5; 9; 4; 10]; [5; 9]; [5]; []; ]) + ~msg:"[0; 5; 3; 7] on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3345) (list (int_bound 10))) |> repeated_success) + ~expected:[ [0; 5; 3; 7]; [0; 5]; [0]; []; ]) else (Alcotest.(check' (list (list int))) ~msg:"[1; 10; 10; 7; 3] on repeated failure" @@ -234,17 +236,16 @@ module Shrink = struct if ocaml_major_version < 5 then (Alcotest.(check' (list (list int))) - ~msg:"[5; 9; 4; 10] on repeated failure" - ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) (small_list (int_bound 10))) |> repeated_failure) - ~expected:[ [5; 9; 4; 10]; [5; 9]; [4; 10]; [9; 4; 10]; [5; 9; 10]; - [0; 9; 4; 10]; [2; 9; 4; 10]; [3; 9; 4; 10]; [4; 9; 4; 10]; - [5; 0; 4; 10]; [5; 4; 4; 10]; [5; 6; 4; 10]; [5; 7; 4; 10]; [5; 8; 4; 10]; - [5; 9; 0; 10]; [5; 9; 2; 10]; [5; 9; 3; 10]; - [5; 9; 4; 0]; [5; 9; 4; 5]; [5; 9; 4; 8]; [5; 9; 4; 9]; ]; + ~msg:"[0; 5; 3; 7] on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3345) (small_list (int_bound 10))) |> repeated_failure) + ~expected:[[0; 5; 3; 7]; [0; 5]; [3; 7]; [5; 3; 7]; [0; 5; 7]; + [0; 0; 3; 7]; [0; 2; 3; 7]; [0; 3; 3; 7]; [0; 4; 3; 7]; + [0; 5; 0; 7]; [0; 5; 1; 7]; [0; 5; 2; 7]; + [0; 5; 3; 0]; [0; 5; 3; 3]; [0; 5; 3; 5]; [0; 5; 3; 6]; ]; Alcotest.(check' (list (list int))) - ~msg:"[5; 9; 4; 10] on repeated success" - ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) (small_list (int_bound 10))) |> repeated_success) - ~expected:[ [5; 9; 4; 10]; [5; 9]; [5]; []; ]) + ~msg:"[0; 5; 3; 7] on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3345) (small_list (int_bound 10))) |> repeated_success) + ~expected:[ [0; 5; 3; 7]; [0; 5]; [0]; []; ]) else (Alcotest.(check' (list (list int))) ~msg:"[1; 10; 10; 7; 3] on repeated failure" @@ -264,15 +265,16 @@ module Shrink = struct if ocaml_major_version < 5 then (Alcotest.(check' (list (array int))) - ~msg:"[|10; 8|] on repeated failure" - ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (array_size (int_bound 8) (int_bound 10))) |> repeated_failure) - ~expected:[ [|10; 8|]; [||]; [|10|]; - [|0; 8|]; [|5; 8|]; [|8; 8|]; [|9; 8|]; - [|10; 0|]; [|10; 4|]; [|10; 6|]; [|10; 7|]; ]; + ~msg:"[|2; 5; 1|] on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3347) (array_size (int_bound 8) (int_bound 10))) |> repeated_failure) + ~expected:[ [|2; 5; 1|]; [||]; [|2|]; [|2; 5|]; + [|0; 5; 1|]; [|1; 5; 1|]; + [|2; 0; 1|]; [|2; 2; 1|]; [|2; 3; 1|]; [|2; 4; 1|]; + [|2; 5; 0|]; ]; Alcotest.(check' (list (array int))) - ~msg:"[|10; 8|] on repeated success" - ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (array_size (int_bound 8) (int_bound 10))) |> repeated_success) - ~expected:[ [|10; 8|]; [| |]; ]) + ~msg:"[|2; 5; 1|] on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3347) (array_size (int_bound 8) (int_bound 10))) |> repeated_success) + ~expected:[ [|2; 5; 1|]; [| |]; ]) else (Alcotest.(check' (list (array int))) ~msg:"[|9; 2; 7; 3; 8; 6|] repeated failure" @@ -293,17 +295,16 @@ module Shrink = struct if ocaml_major_version < 5 then (Alcotest.(check' (list (array int))) - ~msg:"[|5; 9; 4; 10|] on repeated failure" - ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) (array (int_bound 10))) |> repeated_failure) - ~expected:[ [|5; 9; 4; 10|]; [|5; 9|]; [|4; 10|]; [|9; 4; 10|]; [|5; 9; 10|]; - [|0; 9; 4; 10|]; [|2; 9; 4; 10|]; [|3; 9; 4; 10|]; [|4; 9; 4; 10|]; - [|5; 0; 4; 10|]; [|5; 4; 4; 10|]; [|5; 6; 4; 10|]; [|5; 7; 4; 10|]; [|5; 8; 4; 10|]; - [|5; 9; 0; 10|]; [|5; 9; 2; 10|]; [|5; 9; 3; 10|]; - [|5; 9; 4; 0|]; [|5; 9; 4; 5|]; [|5; 9; 4; 8|]; [|5; 9; 4; 9|]; ]; + ~msg:"[|0; 5; 3; 7|] on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3345) (array (int_bound 10))) |> repeated_failure) + ~expected:[ [|0; 5; 3; 7|]; [|0; 5|]; [|3; 7|]; [|5; 3; 7|]; [|0; 5; 7|]; + [|0; 0; 3; 7|]; [|0; 2; 3; 7|]; [|0; 3; 3; 7|]; [|0; 4; 3; 7|]; + [|0; 5; 0; 7|]; [|0; 5; 1; 7|]; [|0; 5; 2; 7|]; + [|0; 5; 3; 0|]; [|0; 5; 3; 3|]; [|0; 5; 3; 5|]; [|0; 5; 3; 6|]; ]; Alcotest.(check' (list (array int))) - ~msg:"[|5; 9; 4; 10|] on repeated success" - ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) (array (int_bound 10))) |> repeated_success) - ~expected:[ [|5; 9; 4; 10|]; [|5; 9|]; [|5|]; [||]; ]) + ~msg:"[|0; 5; 3; 7|] on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3345) (array (int_bound 10))) |> repeated_success) + ~expected:[ [|0; 5; 3; 7|]; [|0; 5|]; [|0|]; [||]; ]) else (Alcotest.(check' (list (array int))) ~msg:"[|1; 10; 10; 7; 3|] on repeated failure" @@ -323,17 +324,16 @@ module Shrink = struct if ocaml_major_version < 5 then (Alcotest.(check' (list (array int))) - ~msg:"[|5; 9; 4; 10|] on repeated failure" - ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) (small_array (int_bound 10))) |> repeated_failure) - ~expected:[ [|5; 9; 4; 10|]; [|5; 9|]; [|4; 10|]; [|9; 4; 10|]; [|5; 9; 10|]; - [|0; 9; 4; 10|]; [|2; 9; 4; 10|]; [|3; 9; 4; 10|]; [|4; 9; 4; 10|]; - [|5; 0; 4; 10|]; [|5; 4; 4; 10|]; [|5; 6; 4; 10|]; [|5; 7; 4; 10|]; [|5; 8; 4; 10|]; - [|5; 9; 0; 10|]; [|5; 9; 2; 10|]; [|5; 9; 3; 10|]; - [|5; 9; 4; 0|]; [|5; 9; 4; 5|]; [|5; 9; 4; 8|]; [|5; 9; 4; 9|]; ]; + ~msg:"[|0; 5; 3; 7|] on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3345) (small_array (int_bound 10))) |> repeated_failure) + ~expected:[ [|0; 5; 3; 7|]; [|0; 5|]; [|3; 7|]; [|5; 3; 7|]; [|0; 5; 7|]; + [|0; 0; 3; 7|]; [|0; 2; 3; 7|]; [|0; 3; 3; 7|]; [|0; 4; 3; 7|]; + [|0; 5; 0; 7|]; [|0; 5; 1; 7|]; [|0; 5; 2; 7|]; + [|0; 5; 3; 0|]; [|0; 5; 3; 3|]; [|0; 5; 3; 5|]; [|0; 5; 3; 6|]; ]; Alcotest.(check' (list (array int))) - ~msg:"[|5; 9; 4; 10|] on repeated success" - ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) (small_array (int_bound 10))) |> repeated_success) - ~expected:[ [|5; 9; 4; 10|]; [|5; 9|]; [|5|]; [||]; ]) + ~msg:"[|0; 5; 3; 7|] on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3345) (small_array (int_bound 10))) |> repeated_success) + ~expected:[ [|0; 5; 3; 7|]; [|0; 5|]; [|0|]; [||]; ]) else (Alcotest.(check' (list (array int))) ~msg:"[|1; 10; 10; 7; 3|] on repeated failure" @@ -353,16 +353,21 @@ module Shrink = struct if ocaml_major_version < 5 then (Alcotest.(check' (list bytes)) - ~msg:"\"_!\" on repeated failure" + ~msg:"\"H Ap>&U\" on repeated failure" ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (bytes_size ~gen:printable (int_bound 8))) |> repeated_failure) ~expected:(List.map Bytes.of_string - [ "_!"; ""; "_"; - "a!"; "2!"; "H!"; "S!"; "Y!"; "\\!"; "]!"; "^!"; - "_a"; "_n"; "_u"; "_x"; "_z"; "_ "; ] ); + [ "H Ap>&U"; ""; "H A"; "H Ap>"; "H Ap>&"; "a Ap>&U"; "' Ap>&U"; + "8 Ap>&U"; "@ Ap>&U"; "D Ap>&U"; "F Ap>&U"; "G Ap>&U"; + "HaAp>&U"; "HnAp>&U"; "HuAp>&U"; "HxAp>&U"; "HzAp>&U"; + "H ap>&U"; "H #p>&U"; "H 2p>&U"; "H 9p>&U"; "H =p>&U"; "H ?p>&U"; "H @p>&U"; + "H Aa>&U"; "H Ah>&U"; "H Al>&U"; "H An>&U"; "H Ao>&U"; + "H Apa&U"; "H Ap\"&U"; "H Ap0&U"; "H Ap7&U"; "H Ap;&U"; "H Ap=&U"; + "H Ap>aU"; "H Ap>qU"; "H Ap>yU"; "H Ap>\"U"; "H Ap>$U"; "H Ap>%U"; + "H Ap>&a"; "H Ap>&-"; "H Ap>&A"; "H Ap>&K"; "H Ap>&P"; "H Ap>&R"; "H Ap>&S"; "H Ap>&T"; ] ); Alcotest.(check' (list bytes)) - ~msg:"\"_!\" on repeated success" + ~msg:"\"H Ap>&U\" on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (bytes_size ~gen:printable (int_bound 8))) |> repeated_success) - ~expected:(List.map Bytes.of_string ["_!"; ""])) + ~expected:(List.map Bytes.of_string ["H Ap>&U"; ""])) else (Alcotest.(check' (list bytes)) ~msg:"\"Ns<>W\\\" on repeated failure" @@ -384,18 +389,18 @@ module Shrink = struct if ocaml_major_version < 5 then (Alcotest.(check' (list bytes)) - ~msg:"\"u\238\154I\" on repeated failure" - ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) bytes) |> repeated_failure) + ~msg:"\"9\007\127\250\" on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3345) bytes) |> repeated_failure) ~expected:(List.map Bytes.of_string - [ "u\238\154I"; "u\238"; "\154I"; "\238\154I"; "u\238I"; - "a\238\154I"; "k\238\154I"; "p\238\154I"; "r\238\154I"; "s\238\154I"; "t\238\154I"; - "ua\154I"; "u\168\154I"; "u\203\154I"; "u\221\154I"; "u\230\154I"; "u\234\154I"; "u\236\154I"; "u\237\154I"; - "u\238aI"; "u\238~I"; "u\238\140I"; "u\238\147I"; "u\238\151I"; "u\238\153I"; - "u\238\154a"; "u\238\154U"; "u\238\154O"; "u\238\154L"; "u\238\154J"; ] ); + [ "9\007\127\250"; "9\007"; "\127\250"; "\007\127\250"; "9\007\250"; + "a\007\127\250"; "M\007\127\250"; "C\007\127\250"; ">\007\127\250"; ";\007\127\250"; ":\007\127\250"; + "9a\127\250"; "94\127\250"; "9\029\127\250"; "9\018\127\250"; "9\012\127\250"; "9\t\127\250"; "9\b\127\250"; + "9\007a\250"; "9\007p\250"; "9\007w\250"; "9\007{\250"; "9\007}\250"; "9\007~\250"; + "9\007\127a"; "9\007\127\174"; "9\007\127\212"; "9\007\127\231"; "9\007\127\241"; "9\007\127\246"; "9\007\127\248"; "9\007\127\249"; ] ); Alcotest.(check' (list bytes)) - ~msg:"\"u\238\154I\" on repeated success" - ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) bytes) |> repeated_success) - ~expected:(List.map Bytes.of_string ["u\238\154I"; "u\238"; "u"; ""; ])) + ~msg:"\"9\007\127\250\" on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3345) bytes) |> repeated_success) + ~expected:(List.map Bytes.of_string [ "9\007\127\250"; "9\007"; "9"; ""; ])) else (Alcotest.(check' (list bytes)) ~msg:"\"\253NS\173\" on repeated failure" @@ -415,18 +420,18 @@ module Shrink = struct if ocaml_major_version < 5 then (Alcotest.(check' (list bytes)) - ~msg:"\"u\238\154I\" on repeated failure" - ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) bytes_small) |> repeated_failure) + ~msg:"\"9\007\127\250\" on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3345) bytes_small) |> repeated_failure) ~expected:(List.map Bytes.of_string - [ "u\238\154I"; "u\238"; "\154I"; "\238\154I"; "u\238I"; - "a\238\154I"; "k\238\154I"; "p\238\154I"; "r\238\154I"; "s\238\154I"; "t\238\154I"; - "ua\154I"; "u\168\154I"; "u\203\154I"; "u\221\154I"; "u\230\154I"; "u\234\154I"; "u\236\154I"; "u\237\154I"; - "u\238aI"; "u\238~I"; "u\238\140I"; "u\238\147I"; "u\238\151I"; "u\238\153I"; - "u\238\154a"; "u\238\154U"; "u\238\154O"; "u\238\154L"; "u\238\154J"; ] ); + [ "9\007\127\250"; "9\007"; "\127\250"; "\007\127\250"; "9\007\250"; + "a\007\127\250"; "M\007\127\250"; "C\007\127\250"; ">\007\127\250"; ";\007\127\250"; ":\007\127\250"; + "9a\127\250"; "94\127\250"; "9\029\127\250"; "9\018\127\250"; "9\012\127\250"; "9\t\127\250"; "9\b\127\250"; + "9\007a\250"; "9\007p\250"; "9\007w\250"; "9\007{\250"; "9\007}\250"; "9\007~\250"; + "9\007\127a"; "9\007\127\174"; "9\007\127\212"; "9\007\127\231"; "9\007\127\241"; "9\007\127\246"; "9\007\127\248"; "9\007\127\249"; ] ); Alcotest.(check' (list bytes)) - ~msg:"\"u\238\154I\" on repeated success" - ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) bytes_small) |> repeated_success) - ~expected:(List.map Bytes.of_string ["u\238\154I"; "u\238"; "u"; ""; ])) + ~msg:"\"9\007\127\250\" on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3345) bytes_small) |> repeated_success) + ~expected:(List.map Bytes.of_string [ "9\007\127\250"; "9\007"; "9"; ""; ])) else (Alcotest.(check' (list bytes)) ~msg:"\"\253NS\173\" on repeated failure" @@ -446,17 +451,20 @@ module Shrink = struct if ocaml_major_version < 5 then (Alcotest.(check' (list string)) - ~msg:"\";T /\" on repeated failure" - ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) (string_size ~gen:printable (int_bound 8))) |> repeated_failure) - ~expected:[ ";T /"; ""; ";T"; ";T "; - "aT /"; " T /"; "-T /"; "4T /"; "7T /"; "9T /"; ":T /"; - ";a /"; ";- /"; ";A /"; ";K /"; ";P /"; ";R /"; ";S /"; - ";Ta/"; ";Tn/"; ";Tu/"; ";Tx/"; ";Tz/"; - ";T a"; ";T u"; ";T $"; ";T )"; ";T ,"; ";T -"; ";T ."; ]; + ~msg:"\"H Ap>&U\" on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (string_size ~gen:printable (int_bound 8))) |> repeated_failure) + ~expected:[ "H Ap>&U"; ""; "H A"; "H Ap>"; "H Ap>&"; "a Ap>&U"; "' Ap>&U"; + "8 Ap>&U"; "@ Ap>&U"; "D Ap>&U"; "F Ap>&U"; "G Ap>&U"; + "HaAp>&U"; "HnAp>&U"; "HuAp>&U"; "HxAp>&U"; "HzAp>&U"; + "H ap>&U"; "H #p>&U"; "H 2p>&U"; "H 9p>&U"; "H =p>&U"; "H ?p>&U"; "H @p>&U"; + "H Aa>&U"; "H Ah>&U"; "H Al>&U"; "H An>&U"; "H Ao>&U"; + "H Apa&U"; "H Ap\"&U"; "H Ap0&U"; "H Ap7&U"; "H Ap;&U"; "H Ap=&U"; + "H Ap>aU"; "H Ap>qU"; "H Ap>yU"; "H Ap>\"U"; "H Ap>$U"; "H Ap>%U"; + "H Ap>&a"; "H Ap>&-"; "H Ap>&A"; "H Ap>&K"; "H Ap>&P"; "H Ap>&R"; "H Ap>&S"; "H Ap>&T"; ]; Alcotest.(check' (list string)) - ~msg:"\";T /\" on repeated success" - ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) (string_size ~gen:printable (int_bound 8))) |> repeated_success) - ~expected:[ ";T /"; ""; ]) + ~msg:"\"H Ap>&U\" on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3346) (string_size ~gen:printable (int_bound 8))) |> repeated_success) + ~expected:[ "H Ap>&U"; ""; ]) else (Alcotest.(check' (list string)) ~msg:"\"Ns<>W\\\" on repeated failure" @@ -477,17 +485,17 @@ module Shrink = struct if ocaml_major_version < 5 then (Alcotest.(check' (list string)) - ~msg:"\"u\238\154I\" on repeated failure" - ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) string) |> repeated_failure) - ~expected:[ "u\238\154I"; "u\238"; "\154I"; "\238\154I"; "u\238I"; - "a\238\154I"; "k\238\154I"; "p\238\154I"; "r\238\154I"; "s\238\154I"; "t\238\154I"; - "ua\154I"; "u\168\154I"; "u\203\154I"; "u\221\154I"; "u\230\154I"; "u\234\154I"; "u\236\154I"; "u\237\154I"; - "u\238aI"; "u\238~I"; "u\238\140I"; "u\238\147I"; "u\238\151I"; "u\238\153I"; - "u\238\154a"; "u\238\154U"; "u\238\154O"; "u\238\154L"; "u\238\154J"; ]; + ~msg:"\"9\007\127\250\" on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3345) string) |> repeated_failure) + ~expected:[ "9\007\127\250"; "9\007"; "\127\250"; "\007\127\250"; "9\007\250"; + "a\007\127\250"; "M\007\127\250"; "C\007\127\250"; ">\007\127\250"; ";\007\127\250"; ":\007\127\250"; + "9a\127\250"; "94\127\250"; "9\029\127\250"; "9\018\127\250"; "9\012\127\250"; "9\t\127\250"; "9\b\127\250"; + "9\007a\250"; "9\007p\250"; "9\007w\250"; "9\007{\250"; "9\007}\250"; "9\007~\250"; + "9\007\127a"; "9\007\127\174"; "9\007\127\212"; "9\007\127\231"; "9\007\127\241"; "9\007\127\246"; "9\007\127\248"; "9\007\127\249"; ]; Alcotest.(check' (list string)) - ~msg:"\"u\238\154I\" on repeated success" - ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) string) |> repeated_success) - ~expected:[ "u\238\154I"; "u\238"; "u"; ""; ]) + ~msg:"\"9\007\127\250\" on repeated success" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3345) string) |> repeated_success) + ~expected:[ "9\007\127\250"; "9\007"; "9"; ""; ]) else (Alcotest.(check' (list string)) ~msg:"\"\253NS\173\" on repeated failure" @@ -506,17 +514,17 @@ module Shrink = struct if ocaml_major_version < 5 then (Alcotest.(check' (list string)) - ~msg:"\"u\238\154I\" on repeated failure" - ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) string_small) |> repeated_failure) - ~expected:[ "u\238\154I"; "u\238"; "\154I"; "\238\154I"; "u\238I"; - "a\238\154I"; "k\238\154I"; "p\238\154I"; "r\238\154I"; "s\238\154I"; "t\238\154I"; - "ua\154I"; "u\168\154I"; "u\203\154I"; "u\221\154I"; "u\230\154I"; "u\234\154I"; "u\236\154I"; "u\237\154I"; - "u\238aI"; "u\238~I"; "u\238\140I"; "u\238\147I"; "u\238\151I"; "u\238\153I"; - "u\238\154a"; "u\238\154U"; "u\238\154O"; "u\238\154L"; "u\238\154J"; ]; + ~msg:"\"9\007\127\250\" on repeated failure" + ~actual:(Gen.(generate_tree ~rand:(rand_init 3345) string_small) |> repeated_failure) + ~expected:[ "9\007\127\250"; "9\007"; "\127\250"; "\007\127\250"; "9\007\250"; + "a\007\127\250"; "M\007\127\250"; "C\007\127\250"; ">\007\127\250"; ";\007\127\250"; ":\007\127\250"; + "9a\127\250"; "94\127\250"; "9\029\127\250"; "9\018\127\250"; "9\012\127\250"; "9\t\127\250"; "9\b\127\250"; + "9\007a\250"; "9\007p\250"; "9\007w\250"; "9\007{\250"; "9\007}\250"; "9\007~\250"; + "9\007\127a"; "9\007\127\174"; "9\007\127\212"; "9\007\127\231"; "9\007\127\241"; "9\007\127\246"; "9\007\127\248"; "9\007\127\249"; ]; Alcotest.(check' (list string)) ~msg:"\"u\238\154I\" on repeated success" - ~actual:(Gen.(generate_tree ~rand:(rand_init 3344) string_small) |> repeated_success) - ~expected:[ "u\238\154I"; "u\238"; "u"; ""; ]) + ~actual:(Gen.(generate_tree ~rand:(rand_init 3345) string_small) |> repeated_success) + ~expected:[ "9\007\127\250"; "9\007"; "9"; ""; ]) else (Alcotest.(check' (list string)) ~msg:"\"\253NS\173\" on repeated failure" From d0f7cc137faccb1aacdc40dc6c754a1ff2703c39 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 5 Feb 2025 17:26:19 +0100 Subject: [PATCH 319/391] Update QCheck2 expect tests wrt reenabled Shrink function test on OCaml 5 --- test/core/QCheck2_expect_test.expected.ocaml5.32 | 8 +++++++- test/core/QCheck2_expect_test.expected.ocaml5.64 | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.32 b/test/core/QCheck2_expect_test.expected.ocaml5.32 index 3c826420..f14668fe 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.32 @@ -605,6 +605,12 @@ Test fold_left fold_right uncurried fun last failed (21 shrink steps): --- Failure -------------------------------------------------------------------- +Test fold_left test, fun first failed (50 shrink steps): + +({("", 5) -> "a"; _ -> ""}, "", [0; 0; 5], [0]) + +--- Failure -------------------------------------------------------------------- + Test FAIL_#99_1 failed: ERROR: uncaught exception in generator for test FAIL_#99_1 after 100 steps: @@ -1640,7 +1646,7 @@ stats dist: -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (73 tests failed, 3 tests errored, ran 165 tests) +failure (74 tests failed, 3 tests errored, ran 166 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.64 b/test/core/QCheck2_expect_test.expected.ocaml5.64 index 27663b47..33fb14d8 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.64 @@ -667,6 +667,12 @@ Test fold_left fold_right uncurried fun last failed (21 shrink steps): --- Failure -------------------------------------------------------------------- +Test fold_left test, fun first failed (50 shrink steps): + +({("", 5) -> "a"; _ -> ""}, "", [0; 0; 5], [0]) + +--- Failure -------------------------------------------------------------------- + Test FAIL_#99_1 failed: ERROR: uncaught exception in generator for test FAIL_#99_1 after 100 steps: @@ -1702,7 +1708,7 @@ stats dist: -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (73 tests failed, 3 tests errored, ran 165 tests) +failure (74 tests failed, 3 tests errored, ran 166 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ From dcf4197bdd741c6fb8c1595343b0e6f7a58a935e Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 5 Feb 2025 17:33:02 +0100 Subject: [PATCH 320/391] Update QCheck2 expect tests wrt split change on OCaml 4 --- .../QCheck2_expect_test.expected.ocaml4.32 | 1123 ++++++++-------- .../QCheck2_expect_test.expected.ocaml4.64 | 1192 +++++++++-------- 2 files changed, 1182 insertions(+), 1133 deletions(-) diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.32 b/test/core/QCheck2_expect_test.expected.ocaml4.32 index f8e83f04..80ab3d81 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.32 @@ -1,94 +1,112 @@ random seed: 1234 -50 7 0 0 0 0 0 0 0 0 0 0 3 3 3 3 3 3 3 3 3 3 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 (2,fun,16) (6,fun,1) (9,fun,7) (0,fun,9) (60,fun,7) (7,fun,2) (3,fun,9) (54,fun,4) (4,fun,3) (2,fun,0) -(2,fun,16) (6,fun,1) (9,fun,7) (0,fun,9) (60,fun,7) (7,fun,2) (3,fun,9) (54,fun,4) (4,fun,3) (2,fun,0) -(2,fun,16) (6,fun,1) (9,fun,7) (0,fun,9) (60,fun,7) (7,fun,2) (3,fun,9) (54,fun,4) (4,fun,3) (2,fun,0) -(2,fun,16) (6,fun,1) (9,fun,7) (0,fun,9) (60,fun,7) (7,fun,2) (3,fun,9) (54,fun,4) (4,fun,3) (2,fun,0) -(2,fun,16) (6,fun,1) (9,fun,7) (0,fun,9) (60,fun,7) (7,fun,2) (3,fun,9) (54,fun,4) (4,fun,3) (2,fun,0) -(2,fun,16) (6,fun,1) (9,fun,7) (0,fun,9) (60,fun,7) (7,fun,2) (3,fun,9) (54,fun,4) (4,fun,3) (2,fun,0) -(2,fun,16) (6,fun,1) (9,fun,7) (0,fun,9) (60,fun,7) (7,fun,2) (3,fun,9) (54,fun,4) (4,fun,3) (2,fun,0) -(2,fun,16) (6,fun,1) (9,fun,7) (0,fun,9) (60,fun,7) (7,fun,2) (3,fun,9) (54,fun,4) (4,fun,3) (2,fun,0) --693587245 -693587244 +50 7 0 0 0 0 0 0 0 0 0 0 3 3 3 3 3 3 3 3 3 3 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 (5,fun,0) (2,fun,16) (4,fun,1) (8,fun,7) (5,fun,1) (8,fun,4) (6,fun,3) (2,fun,3) (39,fun,5) (7,fun,1) +(5,fun,0) (2,fun,16) (4,fun,1) (8,fun,7) (5,fun,1) (8,fun,4) (6,fun,3) (2,fun,3) (39,fun,5) (7,fun,1) +(5,fun,0) (2,fun,16) (4,fun,1) (8,fun,7) (5,fun,1) (8,fun,4) (6,fun,3) (2,fun,3) (39,fun,5) (7,fun,1) +(5,fun,0) (2,fun,16) (4,fun,1) (8,fun,7) (5,fun,1) (8,fun,4) (6,fun,3) (2,fun,3) (39,fun,5) (7,fun,1) +(5,fun,0) (2,fun,16) (4,fun,1) (8,fun,7) (5,fun,1) (8,fun,4) (6,fun,3) (2,fun,3) (39,fun,5) (7,fun,1) +(5,fun,0) (2,fun,16) (4,fun,1) (8,fun,7) (5,fun,1) (8,fun,4) (6,fun,3) (2,fun,3) (39,fun,5) (7,fun,1) +(5,fun,0) (2,fun,16) (4,fun,1) (8,fun,7) (5,fun,1) (8,fun,4) (6,fun,3) (2,fun,3) (39,fun,5) (7,fun,1) +(5,fun,0) (2,fun,16) (4,fun,1) (8,fun,7) (5,fun,1) (8,fun,4) (6,fun,3) (2,fun,3) (39,fun,5) (7,fun,1) +602816853 0 -346793622 +301408426 0 -173396811 +150704213 0 -86698405 +75352106 0 -43349202 +37676053 0 -21674601 +18838026 0 -10837300 +9419013 0 -5418650 +4709506 0 -2709325 +2354753 0 -1354662 +1177376 0 -677331 +588688 0 -338665 +294344 0 -169332 +147172 0 -84666 +73586 0 -42333 +36793 0 -21166 +18396 0 -10583 +9198 0 -5291 +4599 0 -2645 +2299 0 -1322 +1149 0 -661 +574 0 -330 +287 0 -165 +143 0 -82 +71 0 -41 +35 0 -20 +17 0 -10 +8 0 -5 +4 0 2 0 1 0 -[16; 1; 1] -[16; 1] -[16] -[] +[0; 13; 4; 6; 14; 6; 47; 3; 4; 3; 6; 6; 9; 4; 3; 65; 2; 4; 55; 2; 4; 87; 9; 5; 35; 73; 9; 9; 2; 74; 5; 9; 10; 93; 2; 7; 1; 4; 6; 91; 8; 8; 2; 9; 47; 6; 26; 3; 60; 1; 0; 5; 26; 4; 28; 6; 0; 5; 88; 3; 7] +[0; 13; 4; 6; 14; 6; 47; 3; 4; 3; 6; 6; 9; 4; 3; 65; 2; 4; 55; 2; 4; 87; 9; 5; 35; 73; 9; 9; 2; 74; 5] +[0; 13; 4; 6; 14; 6; 47; 3; 4; 3; 6; 6; 9; 4; 3; 65] +[0; 13; 4; 6; 14; 6; 47; 3] +[0; 13; 4; 6] +[0; 13] [0] -[16; 1; 1] -[16; 1] -[1] -[0; 1; 1] -[0; 0; 1] +[] +[0; 13; 4; 6; 14; 6; 47; 3; 4; 3; 6; 6; 9; 4; 3; 65; 2; 4; 55; 2; 4; 87; 9; 5; 35; 73; 9; 9; 2; 74; 5; 9; 10; 93; 2; 7; 1; 4; 6; 91; 8; 8; 2; 9; 47; 6; 26; 3; 60; 1; 0; 5; 26; 4; 28; 6; 0; 5; 88; 3; 7] +[0; 13; 4; 6; 14; 6; 47; 3; 4; 3; 6; 6; 9; 4; 3; 65; 2; 4; 55; 2; 4; 87; 9; 5; 35; 73; 9; 9; 2; 74; 5] +[0; 13; 4; 6; 14; 6; 47; 3; 4; 3; 6; 6; 9; 4; 3; 65] +[0; 13; 4; 6; 14; 6; 47; 3] +[0; 13; 4; 6] +[14; 6; 47; 3] +[13; 4; 6; 14; 6; 47; 3] +[13; 4; 6; 14] +[6; 47; 3] +[4; 6; 14; 6; 47; 3] +[4; 6; 14] +[6; 47; 3] +[6; 14; 6; 47; 3] +[6; 14; 6] +[6; 14] +[6] +[0; 14; 6] +[3; 14; 6] +[5; 14; 6] +[6; 0; 6] +[0; 0; 6] [0; 0; 0] --- Failure -------------------------------------------------------------------- -Test should_fail_sort_id failed (6 shrink steps): +Test should_fail_sort_id failed (5 shrink steps): [1; 0] === Error ====================================================================== -Test should_error_raise_exn errored on (2 shrink steps): +Test should_error_raise_exn errored on (1 shrink steps): 0 @@ -206,7 +224,7 @@ Test big bound issue59 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test long_shrink failed (2998 shrink steps): +Test long_shrink failed (3053 shrink steps): ([0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0], [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 1]) @@ -218,7 +236,7 @@ Test ints arent 0 mod 3 failed (1 shrink steps): --- Failure -------------------------------------------------------------------- -Test ints are 0 failed (30 shrink steps): +Test ints are 0 failed (29 shrink steps): 1 @@ -278,13 +296,13 @@ Test printable never produces less than '5 failed (1 shrink steps): --- Failure -------------------------------------------------------------------- -Test bytes are empty failed (3 shrink steps): +Test bytes are empty failed (7 shrink steps): "a" --- Failure -------------------------------------------------------------------- -Test bytes never has a \000 char failed (9 shrink steps): +Test bytes never has a \000 char failed (13 shrink steps): "\000" @@ -296,19 +314,19 @@ Test bytes never has a \255 char failed (5 shrink steps): --- Failure -------------------------------------------------------------------- -Test bytes have unique chars failed (31 shrink steps): +Test bytes have unique chars failed (16 shrink steps): -"aaaaaaaaaaa" +"aaa" --- Failure -------------------------------------------------------------------- -Test strings are empty failed (3 shrink steps): +Test strings are empty failed (7 shrink steps): "a" --- Failure -------------------------------------------------------------------- -Test string never has a \000 char failed (9 shrink steps): +Test string never has a \000 char failed (13 shrink steps): "\000" @@ -320,15 +338,15 @@ Test string never has a \255 char failed (5 shrink steps): --- Failure -------------------------------------------------------------------- -Test strings have unique chars failed (31 shrink steps): +Test strings have unique chars failed (16 shrink steps): -"aaaaaaaaaaa" +"aaa" --- Failure -------------------------------------------------------------------- Test pairs have different components failed (0 shrink steps): -(6, 6) +(3, 3) --- Failure -------------------------------------------------------------------- @@ -338,7 +356,7 @@ Test pairs have same components failed (31 shrink steps): --- Failure -------------------------------------------------------------------- -Test pairs have a zero component failed (59 shrink steps): +Test pairs have a zero component failed (58 shrink steps): (1, 1) @@ -350,67 +368,67 @@ Test pairs are (0,0) failed (31 shrink steps): --- Failure -------------------------------------------------------------------- -Test pairs are ordered failed (44 shrink steps): +Test pairs are ordered failed (39 shrink steps): (1, 0) --- Failure -------------------------------------------------------------------- -Test pairs are ordered reversely failed (29 shrink steps): +Test pairs are ordered reversely failed (30 shrink steps): (0, 1) --- Failure -------------------------------------------------------------------- -Test pairs sum to less than 128 failed (24 shrink steps): +Test pairs sum to less than 128 failed (26 shrink steps): (0, 128) --- Failure -------------------------------------------------------------------- -Test pairs lists rev concat failed (35 shrink steps): +Test pairs lists rev concat failed (34 shrink steps): ([0], [1]) --- Failure -------------------------------------------------------------------- -Test pairs lists no overlap failed (6 shrink steps): +Test pairs lists no overlap failed (12 shrink steps): -([1], [1]) +([0], [0]) --- Failure -------------------------------------------------------------------- -Test triples have pair-wise different components failed (3 shrink steps): +Test triples have pair-wise different components failed (2 shrink steps): (0, 0, 0) --- Failure -------------------------------------------------------------------- -Test triples have same components failed (32 shrink steps): +Test triples have same components failed (33 shrink steps): (0, 1, 0) --- Failure -------------------------------------------------------------------- -Test triples are ordered failed (3 shrink steps): +Test triples are ordered failed (4 shrink steps): (0, 0, -1) --- Failure -------------------------------------------------------------------- -Test triples are ordered reversely failed (60 shrink steps): +Test triples are ordered reversely failed (61 shrink steps): (0, 0, 1) --- Failure -------------------------------------------------------------------- -Test quadruples have pair-wise different components failed (4 shrink steps): +Test quadruples have pair-wise different components failed (3 shrink steps): (0, 0, 0, 0) --- Failure -------------------------------------------------------------------- -Test quadruples have same components failed (60 shrink steps): +Test quadruples have same components failed (61 shrink steps): (0, 1, 0, 1) @@ -428,19 +446,19 @@ Test quadruples are ordered reversely failed (62 shrink steps): --- Failure -------------------------------------------------------------------- -Test forall (a, b) in nat: a < b failed (7 shrink steps): +Test forall (a, b) in nat: a < b failed (1 shrink steps): (0, 0) --- Failure -------------------------------------------------------------------- -Test forall (a, b, c) in nat: a < b < c failed (4 shrink steps): +Test forall (a, b, c) in nat: a < b < c failed (2 shrink steps): (0, 0, 0) --- Failure -------------------------------------------------------------------- -Test forall (a, b, c, d) in nat: a < b < c < d failed (4 shrink steps): +Test forall (a, b, c, d) in nat: a < b < c < d failed (3 shrink steps): (0, 0, 0, 0) @@ -464,13 +482,13 @@ Test forall (a, b, c, d, e, f, g) in nat: a < b < c < d < e < f < g failed (6 sh --- Failure -------------------------------------------------------------------- -Test forall (a, b, c, d, e, f, g, h) in nat: a < b < c < d < e < f < g < h failed (6 shrink steps): +Test forall (a, b, c, d, e, f, g, h) in nat: a < b < c < d < e < f < g < h failed (7 shrink steps): (0, 0, 0, 0, 0, 0, 0, 0) --- Failure -------------------------------------------------------------------- -Test forall (a, b, c, d, e, f, g, h, i) in nat: a < b < c < d < e < f < g < h < i failed (7 shrink steps): +Test forall (a, b, c, d, e, f, g, h, i) in nat: a < b < c < d < e < f < g < h < i failed (8 shrink steps): (0, 0, 0, 0, 0, 0, 0, 0, 0) @@ -488,31 +506,31 @@ Test bind list_size constant failed (12 shrink steps): --- Failure -------------------------------------------------------------------- -Test lists are empty failed (3 shrink steps): +Test lists are empty failed (6 shrink steps): [0] --- Failure -------------------------------------------------------------------- -Test lists shorter than 10 failed (16 shrink steps): +Test lists shorter than 10 failed (18 shrink steps): [0; 0; 0; 0; 0; 0; 0; 0; 0; 0] --- Failure -------------------------------------------------------------------- -Test lists shorter than 432 failed (405 shrink steps): +Test lists shorter than 432 failed (403 shrink steps): [...] list length: 432 --- Failure -------------------------------------------------------------------- -Test lists shorter than 4332 failed (3998 shrink steps): +Test lists shorter than 4332 failed (4022 shrink steps): [...] list length: 4332 --- Failure -------------------------------------------------------------------- -Test lists have unique elems failed (3 shrink steps): +Test lists have unique elems failed (10 shrink steps): [0; 0; 0] @@ -530,7 +548,7 @@ None --- Failure -------------------------------------------------------------------- -Test (int,string) result are Ok failed (2 shrink steps): +Test (int,string) result are Ok failed (4 shrink steps): Error ("") @@ -542,7 +560,7 @@ Ok (0) --- Failure -------------------------------------------------------------------- -Test tree contains only 42 failed (2 shrink steps): +Test tree contains only 42 failed (1 shrink steps): Leaf 0 @@ -550,56 +568,62 @@ Leaf 0 Test sum list = 0 failed (0 shrink steps): -[16; 1; 1] +[0; 13; 4; 6; 14; 6; 47; 3; 4; 3; 6; 6; 9; 4; 3; 65; 2; 4; 55; 2; 4; 87; 9; 5; 35; 73; 9; 9; 2; 74; 5; 9; 10; 93; 2; 7; 1; 4; 6; 91; 8; 8; 2; 9; 47; 6; 26; 3; 60; 1; 0; 5; 26; 4; 28; 6; 0; 5; 88; 3; 7] --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int failed (14 shrink steps): +Test fail_pred_map_commute_int failed (53 shrink steps): -([0], {0 -> -1; _ -> 0}, {0 -> true; _ -> false}) +([0], {0 -> 5; _ -> 0}, {5 -> true; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int32 failed (58 shrink steps): +Test fail_pred_map_commute_int32 failed (54 shrink steps): -([0l], {0l -> 1l; _ -> 0l}, {0l -> true; _ -> false}) +([0l], {0l -> -15l; _ -> 0l}, {-15l -> true; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int64 failed (113 shrink steps): +Test fail_pred_map_commute_int64 failed (105 shrink steps): -([0L], {0L -> 1L; _ -> 0L}, {0L -> true; _ -> false}) +([0L], {0L -> -71L; _ -> 0L}, {-71L -> true; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_strings failed (1 shrink steps): +Test fail_pred_strings failed (0 shrink steps): {"some random string" -> true; "some other string" -> false; _ -> false} --- Failure -------------------------------------------------------------------- -Test fold_left fold_right failed (10 shrink steps): +Test fold_left fold_right failed (17 shrink steps): -(0, [1], {(1, 0) -> 1; _ -> 0}) +(0, [1], {(0, 1) -> 1; _ -> 0}) +++ Messages ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Messages for test fold_left fold_right: -l=[1], fold_left=1, fold_right=0 +l=[1], fold_left=0, fold_right=1 --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried failed (62 shrink steps): +Test fold_left fold_right uncurried failed (14 shrink steps): -({(5, 2) -> 0; (4, 1) -> 0; (1, 2) -> 1; (79, 4) -> 0; (9, 6) -> 0; (7, 3) -> 0; (3, 8) -> 0; (17, 6) -> 0; (37, 6) -> 0; (4, 8) -> 0; (17, 3) -> 0; (3, 4) -> 0; (84, 79) -> 0; (8, 1) -> 0; (6, 8) -> 0; (4, 17) -> 0; (3, 5) -> 0; (1, 6) -> 0; (9, 4) -> 0; (2, 5) -> 0; (5, 4) -> 0; (3, 76) -> 0; (9, 3) -> 0; (3, 1) -> 0; (8, 3) -> 0; (3, 24) -> 0; (34, 1) -> 0; (3, 3) -> 0; (6, 9) -> 0; (76, 8) -> 0; (67, 3) -> 0; (8, 9) -> 0; (2, 24) -> 0; (1, 1) -> 0; (1, 5) -> 0; (2, 3) -> 0; (6, 2) -> 0; (5, 8) -> 0; (5, 7) -> 0; (5, 6) -> 0; (24, 5) -> 0; (2, 17) -> 0; (6, 1) -> 0; (7, 6) -> 0; (6, 3) -> 0; (2, 4) -> 0; (1, 9) -> 0; _ -> 0}, 1, [2]) +({(9, 6) -> 0; (1, 5) -> 0; (4, 8) -> 1; (9, 8) -> 0; _ -> 0}, 8, [4]) --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried fun last failed (10 shrink steps): +Test fold_left fold_right uncurried fun last failed (48 shrink steps): -(0, [1], {(0, 1) -> 1; _ -> 0}) +(0, [0; 1], {(0, 0) -> 1; _ -> 0}) + +--- Failure -------------------------------------------------------------------- + +Test fold_left test, fun first failed (87 shrink steps): + +({("\188Bt\000", 9) -> ""; ("8\252D", 2) -> ""; ("\241\223v\190~>", 6) -> "a"; ("\252R\2108,\226\019\006\t", 2) -> ""; ("\154\241\031\198W\176\ng\150\002\213\197\026\221z\019\151", 0) -> ""; ("1\015\255", 46) -> "a"; ("\177W\174", 8) -> ""; ("\0140WD\024%\195\145\176\200\023\185\138\247\193\172[+\237\186LT\158\208y|\223\231\192\012#\144c\016", 66) -> ""; ("Z}(:?\216", 4) -> ""; ("", 13) -> "a"; ("", 9) -> ""; ("\144\189\"\030E\183\024h\023", 8) -> ""; ("\147\172\209U\252\209\bM&\175m\005\250N[p\180\204jh\217$I\208\002H\168[F\174\145\190b\151w\174\177Ib|\022\149\224\140\250E\239\216g\249\137\246\252\229\192\136\249\131\182&\127\173\015\147H\240\201\166\163\163\239\196", 29) -> ""; ("B\012\251", 1) -> "a"; ("\140", 9) -> ""; ("@\131}\002uPha\151\245\224\240\148ad\191", 7) -> ""; _ -> ""}, "", [0; 13], [0]) --- Failure -------------------------------------------------------------------- @@ -684,445 +708,445 @@ stats char code: +++ Stats for tree's depth ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats depth: - num: 1000, avg: 3.92, stddev: 3.36, median 3, min 1, max 15 - 1: ####################################################### 364 - 2: ############## 96 - 3: ############ 83 - 4: ##################### 145 - 5: ########## 71 - 6: ##### 34 - 7: ###### 44 - 8: ####### 49 - 9: # 11 - 10: ### 24 - 11: ######## 54 + num: 1000, avg: 3.97, stddev: 3.35, median 3, min 1, max 15 + 1: ####################################################### 356 + 2: ############## 91 + 3: ############### 98 + 4: ################### 129 + 5: ############ 78 + 6: #### 31 + 7: ####### 47 + 8: ######## 53 + 9: # 12 + 10: #### 27 + 11: ######## 55 12: 3 - 13: 6 - 14: # 12 - 15: 4 + 13: # 8 + 14: # 9 + 15: 3 +++ Stats for bytes_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 7.47, stddev: 1.70, median 7, min 5, max 10 - 5: ##################################################### 848 - 6: #################################################### 829 - 7: ####################################################### 869 - 8: ##################################################### 839 - 9: ################################################# 787 - 10: #################################################### 828 + num: 5000, avg: 7.53, stddev: 1.71, median 8, min 5, max 10 + 5: #################################################### 814 + 6: #################################################### 809 + 7: ##################################################### 830 + 8: ###################################################### 845 + 9: ####################################################### 854 + 10: ###################################################### 848 +++ Stats for bytes len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 381.73, stddev: 1276.71, median 9, min 0, max 9931 - 0.. 496: ####################################################### 4213 - 497.. 993: ###### 526 - 994..1490: 22 - 1491..1987: 14 - 1988..2484: 19 - 2485..2981: 14 - 2982..3478: 19 - 3479..3975: 15 - 3976..4472: 18 - 4473..4969: 14 - 4970..5466: 13 - 5467..5963: 11 - 5964..6460: 14 - 6461..6957: 18 - 6958..7454: 8 - 7455..7951: 15 - 7952..8448: 12 - 8449..8945: 9 - 8946..9442: 7 - 9443..9939: 19 + num: 5000, avg: 327.56, stddev: 1159.62, median 9, min 0, max 9916 + 0.. 495: ####################################################### 4285 + 496.. 991: ###### 509 + 992..1487: 21 + 1488..1983: 13 + 1984..2479: 13 + 2480..2975: 13 + 2976..3471: 10 + 3472..3967: 13 + 3968..4463: 10 + 4464..4959: 12 + 4960..5455: 7 + 5456..5951: 12 + 5952..6447: 11 + 6448..6943: 7 + 6944..7439: 9 + 7440..7935: 6 + 7936..8431: 16 + 8432..8927: 9 + 8928..9423: 13 + 9424..9919: 11 +++ Stats for bytes_of len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 381.73, stddev: 1276.71, median 9, min 0, max 9931 - 0.. 496: ####################################################### 4213 - 497.. 993: ###### 526 - 994..1490: 22 - 1491..1987: 14 - 1988..2484: 19 - 2485..2981: 14 - 2982..3478: 19 - 3479..3975: 15 - 3976..4472: 18 - 4473..4969: 14 - 4970..5466: 13 - 5467..5963: 11 - 5964..6460: 14 - 6461..6957: 18 - 6958..7454: 8 - 7455..7951: 15 - 7952..8448: 12 - 8449..8945: 9 - 8946..9442: 7 - 9443..9939: 19 + num: 5000, avg: 327.56, stddev: 1159.62, median 9, min 0, max 9916 + 0.. 495: ####################################################### 4285 + 496.. 991: ###### 509 + 992..1487: 21 + 1488..1983: 13 + 1984..2479: 13 + 2480..2975: 13 + 2976..3471: 10 + 3472..3967: 13 + 3968..4463: 10 + 4464..4959: 12 + 4960..5455: 7 + 5456..5951: 12 + 5952..6447: 11 + 6448..6943: 7 + 6944..7439: 9 + 7440..7935: 6 + 7936..8431: 16 + 8432..8927: 9 + 8928..9423: 13 + 9424..9919: 11 +++ Stats for bytes_printable len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 381.73, stddev: 1276.71, median 9, min 0, max 9931 - 0.. 496: ####################################################### 4213 - 497.. 993: ###### 526 - 994..1490: 22 - 1491..1987: 14 - 1988..2484: 19 - 2485..2981: 14 - 2982..3478: 19 - 3479..3975: 15 - 3976..4472: 18 - 4473..4969: 14 - 4970..5466: 13 - 5467..5963: 11 - 5964..6460: 14 - 6461..6957: 18 - 6958..7454: 8 - 7455..7951: 15 - 7952..8448: 12 - 8449..8945: 9 - 8946..9442: 7 - 9443..9939: 19 + num: 5000, avg: 327.56, stddev: 1159.62, median 9, min 0, max 9916 + 0.. 495: ####################################################### 4285 + 496.. 991: ###### 509 + 992..1487: 21 + 1488..1983: 13 + 1984..2479: 13 + 2480..2975: 13 + 2976..3471: 10 + 3472..3967: 13 + 3968..4463: 10 + 4464..4959: 12 + 4960..5455: 7 + 5456..5951: 12 + 5952..6447: 11 + 6448..6943: 7 + 6944..7439: 9 + 7440..7935: 6 + 7936..8431: 16 + 8432..8927: 9 + 8928..9423: 13 + 9424..9919: 11 +++ Stats for bytes_small len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 16.26, stddev: 24.83, median 6, min 0, max 99 - 0.. 4: #################################################### 1868 - 5.. 9: ####################################################### 1967 - 10.. 14: # 66 - 15.. 19: # 62 - 20.. 24: # 70 - 25.. 29: # 59 - 30.. 34: # 62 - 35.. 39: # 62 - 40.. 44: ## 73 - 45.. 49: # 66 - 50.. 54: # 68 - 55.. 59: # 59 - 60.. 64: # 61 - 65.. 69: ## 75 - 70.. 74: # 56 - 75.. 79: # 64 - 80.. 84: # 46 - 85.. 89: ## 72 - 90.. 94: # 67 - 95.. 99: ## 77 + num: 5000, avg: 15.47, stddev: 24.03, median 6, min 0, max 99 + 0.. 4: ####################################################### 1958 + 5.. 9: ##################################################### 1914 + 10.. 14: # 64 + 15.. 19: ## 75 + 20.. 24: # 64 + 25.. 29: # 71 + 30.. 34: ## 74 + 35.. 39: # 60 + 40.. 44: # 61 + 45.. 49: # 57 + 50.. 54: # 62 + 55.. 59: # 58 + 60.. 64: # 63 + 65.. 69: # 46 + 70.. 74: # 67 + 75.. 79: # 62 + 80.. 84: # 57 + 85.. 89: # 67 + 90.. 94: # 66 + 95.. 99: # 54 +++ Stats for string_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 7.47, stddev: 1.70, median 7, min 5, max 10 - 5: ##################################################### 848 - 6: #################################################### 829 - 7: ####################################################### 869 - 8: ##################################################### 839 - 9: ################################################# 787 - 10: #################################################### 828 + num: 5000, avg: 7.53, stddev: 1.71, median 8, min 5, max 10 + 5: #################################################### 814 + 6: #################################################### 809 + 7: ##################################################### 830 + 8: ###################################################### 845 + 9: ####################################################### 854 + 10: ###################################################### 848 +++ Stats for string len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 381.73, stddev: 1276.71, median 9, min 0, max 9931 - 0.. 496: ####################################################### 4213 - 497.. 993: ###### 526 - 994..1490: 22 - 1491..1987: 14 - 1988..2484: 19 - 2485..2981: 14 - 2982..3478: 19 - 3479..3975: 15 - 3976..4472: 18 - 4473..4969: 14 - 4970..5466: 13 - 5467..5963: 11 - 5964..6460: 14 - 6461..6957: 18 - 6958..7454: 8 - 7455..7951: 15 - 7952..8448: 12 - 8449..8945: 9 - 8946..9442: 7 - 9443..9939: 19 + num: 5000, avg: 327.56, stddev: 1159.62, median 9, min 0, max 9916 + 0.. 495: ####################################################### 4285 + 496.. 991: ###### 509 + 992..1487: 21 + 1488..1983: 13 + 1984..2479: 13 + 2480..2975: 13 + 2976..3471: 10 + 3472..3967: 13 + 3968..4463: 10 + 4464..4959: 12 + 4960..5455: 7 + 5456..5951: 12 + 5952..6447: 11 + 6448..6943: 7 + 6944..7439: 9 + 7440..7935: 6 + 7936..8431: 16 + 8432..8927: 9 + 8928..9423: 13 + 9424..9919: 11 +++ Stats for string_of len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 381.73, stddev: 1276.71, median 9, min 0, max 9931 - 0.. 496: ####################################################### 4213 - 497.. 993: ###### 526 - 994..1490: 22 - 1491..1987: 14 - 1988..2484: 19 - 2485..2981: 14 - 2982..3478: 19 - 3479..3975: 15 - 3976..4472: 18 - 4473..4969: 14 - 4970..5466: 13 - 5467..5963: 11 - 5964..6460: 14 - 6461..6957: 18 - 6958..7454: 8 - 7455..7951: 15 - 7952..8448: 12 - 8449..8945: 9 - 8946..9442: 7 - 9443..9939: 19 + num: 5000, avg: 327.56, stddev: 1159.62, median 9, min 0, max 9916 + 0.. 495: ####################################################### 4285 + 496.. 991: ###### 509 + 992..1487: 21 + 1488..1983: 13 + 1984..2479: 13 + 2480..2975: 13 + 2976..3471: 10 + 3472..3967: 13 + 3968..4463: 10 + 4464..4959: 12 + 4960..5455: 7 + 5456..5951: 12 + 5952..6447: 11 + 6448..6943: 7 + 6944..7439: 9 + 7440..7935: 6 + 7936..8431: 16 + 8432..8927: 9 + 8928..9423: 13 + 9424..9919: 11 +++ Stats for string_printable len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 381.73, stddev: 1276.71, median 9, min 0, max 9931 - 0.. 496: ####################################################### 4213 - 497.. 993: ###### 526 - 994..1490: 22 - 1491..1987: 14 - 1988..2484: 19 - 2485..2981: 14 - 2982..3478: 19 - 3479..3975: 15 - 3976..4472: 18 - 4473..4969: 14 - 4970..5466: 13 - 5467..5963: 11 - 5964..6460: 14 - 6461..6957: 18 - 6958..7454: 8 - 7455..7951: 15 - 7952..8448: 12 - 8449..8945: 9 - 8946..9442: 7 - 9443..9939: 19 + num: 5000, avg: 327.56, stddev: 1159.62, median 9, min 0, max 9916 + 0.. 495: ####################################################### 4285 + 496.. 991: ###### 509 + 992..1487: 21 + 1488..1983: 13 + 1984..2479: 13 + 2480..2975: 13 + 2976..3471: 10 + 3472..3967: 13 + 3968..4463: 10 + 4464..4959: 12 + 4960..5455: 7 + 5456..5951: 12 + 5952..6447: 11 + 6448..6943: 7 + 6944..7439: 9 + 7440..7935: 6 + 7936..8431: 16 + 8432..8927: 9 + 8928..9423: 13 + 9424..9919: 11 +++ Stats for small_string len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 16.26, stddev: 24.83, median 6, min 0, max 99 - 0.. 4: #################################################### 1868 - 5.. 9: ####################################################### 1967 - 10.. 14: # 66 - 15.. 19: # 62 - 20.. 24: # 70 - 25.. 29: # 59 - 30.. 34: # 62 - 35.. 39: # 62 - 40.. 44: ## 73 - 45.. 49: # 66 - 50.. 54: # 68 - 55.. 59: # 59 - 60.. 64: # 61 - 65.. 69: ## 75 - 70.. 74: # 56 - 75.. 79: # 64 - 80.. 84: # 46 - 85.. 89: ## 72 - 90.. 94: # 67 - 95.. 99: ## 77 + num: 5000, avg: 15.47, stddev: 24.03, median 6, min 0, max 99 + 0.. 4: ####################################################### 1958 + 5.. 9: ##################################################### 1914 + 10.. 14: # 64 + 15.. 19: ## 75 + 20.. 24: # 64 + 25.. 29: # 71 + 30.. 34: ## 74 + 35.. 39: # 60 + 40.. 44: # 61 + 45.. 49: # 57 + 50.. 54: # 62 + 55.. 59: # 58 + 60.. 64: # 63 + 65.. 69: # 46 + 70.. 74: # 67 + 75.. 79: # 62 + 80.. 84: # 57 + 85.. 89: # 67 + 90.. 94: # 66 + 95.. 99: # 54 +++ Stats for pair dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats pair sum: - num: 500000, avg: 99.97, stddev: 41.23, median 100, min 0, max 200 - 0.. 9: ### 2732 - 10.. 19: ######## 7470 - 20.. 29: ############## 12606 - 30.. 39: #################### 17281 - 40.. 49: ######################### 22161 - 50.. 59: ################################ 27693 - 60.. 69: ##################################### 32264 - 70.. 79: ########################################### 37078 - 80.. 89: ################################################ 41933 - 90.. 99: ##################################################### 46178 - 100..109: ####################################################### 47368 - 110..119: ################################################# 42440 - 120..129: ########################################### 37526 - 130..139: ##################################### 32630 - 140..149: ############################### 27558 - 150..159: ########################## 22873 - 160..169: #################### 17956 - 170..179: ############### 13095 - 180..189: ######### 7957 - 190..199: ### 3157 - 200..209: 44 + num: 500000, avg: 100.09, stddev: 41.23, median 100, min 0, max 200 + 0.. 9: ### 2599 + 10.. 19: ######## 7571 + 20.. 29: ############## 12587 + 30.. 39: #################### 17235 + 40.. 49: ########################## 22334 + 50.. 59: ############################### 27179 + 60.. 69: ##################################### 32092 + 70.. 79: ########################################### 37071 + 80.. 89: ################################################ 41592 + 90.. 99: ###################################################### 46677 + 100..109: ####################################################### 47155 + 110..119: ################################################# 42772 + 120..129: ########################################### 37679 + 130..139: ###################################### 32681 + 140..149: ################################ 27465 + 150..159: ########################## 23061 + 160..169: #################### 17923 + 170..179: ############### 12910 + 180..189: ######### 8135 + 190..199: ### 3233 + 200..209: 49 +++ Stats for triple dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats triple sum: - num: 500000, avg: 150.03, stddev: 50.48, median 150, min 0, max 299 - 0.. 14: 313 - 15.. 29: ## 2122 - 30.. 44: ##### 5446 - 45.. 59: ########## 10500 - 60.. 74: ################ 17013 - 75.. 89: ######################### 25666 - 90..104: ################################### 35268 - 105..119: ############################################# 45180 - 120..134: ################################################### 51212 - 135..149: ###################################################### 55048 - 150..164: ####################################################### 55217 - 165..179: ################################################### 52179 - 180..194: ############################################# 45446 - 195..209: #################################### 36527 - 210..224: ######################### 26036 - 225..239: ################# 17655 - 240..254: ########## 10770 - 255..269: ##### 5786 - 270..284: ## 2253 - 285..299: 363 + num: 500000, avg: 149.91, stddev: 50.48, median 150, min 1, max 299 + 1.. 15: 404 + 16.. 30: ## 2212 + 31.. 45: ##### 5889 + 46.. 60: ########## 10700 + 61.. 75: ################# 17772 + 76.. 90: ######################### 26105 + 91..105: ################################### 36005 + 106..120: ############################################# 45660 + 121..135: ################################################### 52122 + 136..150: ####################################################### 55483 + 151..165: ###################################################### 54945 + 166..180: ################################################### 51868 + 181..195: ############################################ 45051 + 196..210: ################################## 35080 + 211..225: ######################### 25470 + 226..240: ################ 16973 + 241..255: ########## 10427 + 256..270: ##### 5344 + 271..285: ## 2133 + 286..300: 357 +++ Stats for quad dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats quad sum: - num: 500000, avg: 200.05, stddev: 58.23, median 200, min 1, max 395 - 1.. 20: 56 - 21.. 40: 613 - 41.. 60: # 2355 - 61.. 80: ##### 6151 - 81..100: ########## 12762 - 101..120: ################### 22881 - 121..140: ############################# 35023 - 141..160: ######################################## 48107 - 161..180: ################################################# 58482 - 181..200: ###################################################### 64916 - 201..220: ####################################################### 65035 - 221..240: ################################################# 58235 - 241..260: ####################################### 47099 - 261..280: ############################# 34772 - 281..300: ################## 22400 - 301..320: ########## 12463 - 321..340: #### 5856 - 341..360: # 2260 - 361..380: 501 - 381..400: 33 + num: 500000, avg: 199.94, stddev: 58.37, median 200, min 5, max 394 + 5.. 24: 105 + 25.. 44: 829 + 45.. 64: ## 2997 + 65.. 84: ###### 7402 + 85..104: ############ 14559 + 105..124: ##################### 25103 + 125..144: ################################ 38055 + 145..164: ########################################## 50469 + 165..184: ################################################## 60434 + 185..204: ####################################################### 65242 + 205..224: ##################################################### 63665 + 225..244: ############################################### 55764 + 245..264: ###################################### 45244 + 265..284: ########################## 31847 + 285..304: ################ 20092 + 305..324: ######### 11027 + 325..344: #### 5011 + 345..364: # 1794 + 365..384: 348 + 385..404: 13 +++ Stats for bind dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats ordered pair difference: - num: 1000000, avg: 24.99, stddev: 22.33, median 19, min 0, max 100 - 0.. 4: ####################################################### 193839 - 5.. 9: #################################### 129347 - 10.. 14: ############################# 103847 - 15.. 19: ######################## 87031 - 20.. 24: ##################### 75338 - 25.. 29: ################## 64783 - 30.. 34: ################ 56422 - 35.. 39: ############## 49351 - 40.. 44: ############ 43140 - 45.. 49: ########## 38109 - 50.. 54: ######### 32501 - 55.. 59: ####### 28129 - 60.. 64: ###### 24178 - 65.. 69: ##### 20069 - 70.. 74: #### 16578 - 75.. 79: ### 13204 - 80.. 84: ## 10269 - 85.. 89: ## 7232 - 90.. 94: # 4471 - 95.. 99: 2047 - 100..104: 115 + num: 1000000, avg: 25.02, stddev: 22.38, median 19, min 0, max 100 + 0.. 4: ####################################################### 193818 + 5.. 9: #################################### 129891 + 10.. 14: ############################# 103378 + 15.. 19: ######################## 87043 + 20.. 24: ##################### 75202 + 25.. 29: ################## 64688 + 30.. 34: ################ 56523 + 35.. 39: ############# 49283 + 40.. 44: ############ 42859 + 45.. 49: ########## 37336 + 50.. 54: ######### 32591 + 55.. 59: ######## 28285 + 60.. 64: ###### 24255 + 65.. 69: ##### 20314 + 70.. 74: #### 16733 + 75.. 79: ### 13555 + 80.. 84: ## 10170 + 85.. 89: ## 7255 + 90.. 94: # 4729 + 95.. 99: 1992 + 100..104: 100 stats ordered pair sum: - num: 1000000, avg: 75.00, stddev: 46.92, median 72, min 0, max 200 - 0.. 9: ####################################################### 70575 - 10.. 19: ##################################################### 68853 - 20.. 29: ##################################################### 68585 - 30.. 39: ##################################################### 68532 - 40.. 49: ##################################################### 68240 - 50.. 59: ##################################################### 68715 - 60.. 69: ##################################################### 68990 - 70.. 79: ##################################################### 68722 - 80.. 89: ##################################################### 68480 - 90.. 99: ##################################################### 68372 - 100..109: ################################################## 64287 - 110..119: ########################################### 55514 - 120..129: #################################### 47048 - 130..139: ############################### 39962 - 140..149: ######################### 32688 - 150..159: #################### 26183 - 160..169: ############### 19821 - 170..179: ########## 14077 - 180..189: ###### 8713 - 190..199: ## 3560 - 200..209: 83 + num: 1000000, avg: 75.04, stddev: 46.91, median 72, min 0, max 200 + 0.. 9: ####################################################### 70296 + 10.. 19: ##################################################### 68918 + 20.. 29: ##################################################### 68448 + 30.. 39: ##################################################### 68654 + 40.. 49: ##################################################### 68490 + 50.. 59: ##################################################### 68513 + 60.. 69: ##################################################### 68299 + 70.. 79: ##################################################### 68552 + 80.. 89: ##################################################### 68560 + 90.. 99: ###################################################### 69283 + 100..109: ################################################## 64173 + 110..119: ########################################### 55624 + 120..129: ##################################### 47381 + 130..139: ############################## 39552 + 140..149: ######################### 32856 + 150..159: #################### 26038 + 160..169: ############### 20035 + 170..179: ########### 14164 + 180..189: ###### 8568 + 190..199: ## 3515 + 200..209: 81 +++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Collect results for test option dist: -None : 1489 cases -Some _: 8511 cases +None : 1519 cases +Some _: 8481 cases +++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Collect results for test result dist: -Error _: 2531 cases -Ok _ : 7469 cases +Error _: 2577 cases +Ok _ : 7423 cases +++ Stats for list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 381.73, stddev: 1276.71, median 9, min 0, max 9931 - 0.. 496: ####################################################### 4213 - 497.. 993: ###### 526 - 994..1490: 22 - 1491..1987: 14 - 1988..2484: 19 - 2485..2981: 14 - 2982..3478: 19 - 3479..3975: 15 - 3976..4472: 18 - 4473..4969: 14 - 4970..5466: 13 - 5467..5963: 11 - 5964..6460: 14 - 6461..6957: 18 - 6958..7454: 8 - 7455..7951: 15 - 7952..8448: 12 - 8449..8945: 9 - 8946..9442: 7 - 9443..9939: 19 + num: 5000, avg: 327.56, stddev: 1159.62, median 9, min 0, max 9916 + 0.. 495: ####################################################### 4285 + 496.. 991: ###### 509 + 992..1487: 21 + 1488..1983: 13 + 1984..2479: 13 + 2480..2975: 13 + 2976..3471: 10 + 3472..3967: 13 + 3968..4463: 10 + 4464..4959: 12 + 4960..5455: 7 + 5456..5951: 12 + 5952..6447: 11 + 6448..6943: 7 + 6944..7439: 9 + 7440..7935: 6 + 7936..8431: 16 + 8432..8927: 9 + 8928..9423: 13 + 9424..9919: 11 +++ Stats for small_list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 16.26, stddev: 24.83, median 6, min 0, max 99 - 0.. 4: #################################################### 1868 - 5.. 9: ####################################################### 1967 - 10.. 14: # 66 - 15.. 19: # 62 - 20.. 24: # 70 - 25.. 29: # 59 - 30.. 34: # 62 - 35.. 39: # 62 - 40.. 44: ## 73 - 45.. 49: # 66 - 50.. 54: # 68 - 55.. 59: # 59 - 60.. 64: # 61 - 65.. 69: ## 75 - 70.. 74: # 56 - 75.. 79: # 64 - 80.. 84: # 46 - 85.. 89: ## 72 - 90.. 94: # 67 - 95.. 99: ## 77 + num: 5000, avg: 15.47, stddev: 24.03, median 6, min 0, max 99 + 0.. 4: ####################################################### 1958 + 5.. 9: ##################################################### 1914 + 10.. 14: # 64 + 15.. 19: ## 75 + 20.. 24: # 64 + 25.. 29: # 71 + 30.. 34: ## 74 + 35.. 39: # 60 + 40.. 44: # 61 + 45.. 49: # 57 + 50.. 54: # 62 + 55.. 59: # 58 + 60.. 64: # 63 + 65.. 69: # 46 + 70.. 74: # 67 + 75.. 79: # 62 + 80.. 84: # 57 + 85.. 89: # 67 + 90.. 94: # 66 + 95.. 99: # 54 +++ Stats for list_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 7.47, stddev: 1.70, median 7, min 5, max 10 - 5: ##################################################### 848 - 6: #################################################### 829 - 7: ####################################################### 869 - 8: ##################################################### 839 - 9: ################################################# 787 - 10: #################################################### 828 + num: 5000, avg: 7.53, stddev: 1.71, median 8, min 5, max 10 + 5: #################################################### 814 + 6: #################################################### 809 + 7: ##################################################### 830 + 8: ###################################################### 845 + 9: ####################################################### 854 + 10: ###################################################### 848 +++ Stats for list_repeat len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -1133,63 +1157,63 @@ stats len: +++ Stats for array len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 381.73, stddev: 1276.71, median 9, min 0, max 9931 - 0.. 496: ####################################################### 4213 - 497.. 993: ###### 526 - 994..1490: 22 - 1491..1987: 14 - 1988..2484: 19 - 2485..2981: 14 - 2982..3478: 19 - 3479..3975: 15 - 3976..4472: 18 - 4473..4969: 14 - 4970..5466: 13 - 5467..5963: 11 - 5964..6460: 14 - 6461..6957: 18 - 6958..7454: 8 - 7455..7951: 15 - 7952..8448: 12 - 8449..8945: 9 - 8946..9442: 7 - 9443..9939: 19 + num: 5000, avg: 327.56, stddev: 1159.62, median 9, min 0, max 9916 + 0.. 495: ####################################################### 4285 + 496.. 991: ###### 509 + 992..1487: 21 + 1488..1983: 13 + 1984..2479: 13 + 2480..2975: 13 + 2976..3471: 10 + 3472..3967: 13 + 3968..4463: 10 + 4464..4959: 12 + 4960..5455: 7 + 5456..5951: 12 + 5952..6447: 11 + 6448..6943: 7 + 6944..7439: 9 + 7440..7935: 6 + 7936..8431: 16 + 8432..8927: 9 + 8928..9423: 13 + 9424..9919: 11 +++ Stats for small_array len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 16.26, stddev: 24.83, median 6, min 0, max 99 - 0.. 4: #################################################### 1868 - 5.. 9: ####################################################### 1967 - 10.. 14: # 66 - 15.. 19: # 62 - 20.. 24: # 70 - 25.. 29: # 59 - 30.. 34: # 62 - 35.. 39: # 62 - 40.. 44: ## 73 - 45.. 49: # 66 - 50.. 54: # 68 - 55.. 59: # 59 - 60.. 64: # 61 - 65.. 69: ## 75 - 70.. 74: # 56 - 75.. 79: # 64 - 80.. 84: # 46 - 85.. 89: ## 72 - 90.. 94: # 67 - 95.. 99: ## 77 + num: 5000, avg: 15.47, stddev: 24.03, median 6, min 0, max 99 + 0.. 4: ####################################################### 1958 + 5.. 9: ##################################################### 1914 + 10.. 14: # 64 + 15.. 19: ## 75 + 20.. 24: # 64 + 25.. 29: # 71 + 30.. 34: ## 74 + 35.. 39: # 60 + 40.. 44: # 61 + 45.. 49: # 57 + 50.. 54: # 62 + 55.. 59: # 58 + 60.. 64: # 63 + 65.. 69: # 46 + 70.. 74: # 67 + 75.. 79: # 62 + 80.. 84: # 57 + 85.. 89: # 67 + 90.. 94: # 66 + 95.. 99: # 54 +++ Stats for array_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 7.47, stddev: 1.70, median 7, min 5, max 10 - 5: ##################################################### 848 - 6: #################################################### 829 - 7: ####################################################### 869 - 8: ##################################################### 839 - 9: ################################################# 787 - 10: #################################################### 828 + num: 5000, avg: 7.53, stddev: 1.71, median 8, min 5, max 10 + 5: #################################################### 814 + 6: #################################################### 809 + 7: ##################################################### 830 + 8: ###################################################### 845 + 9: ####################################################### 854 + 10: ###################################################### 848 +++ Stats for array_repeat len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -1389,27 +1413,27 @@ stats dist: +++ Stats for int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 100000, avg: -2291958.04, stddev: 619491993.46, median -5040258, min -1073697085, max 1073726761 - -1073697085.. -966325893: ################################################### 4878 - -966325892.. -858954700: ####################################################### 5163 - -858954699.. -751583507: #################################################### 4975 - -751583506.. -644212314: ##################################################### 5061 - -644212313.. -536841121: ##################################################### 4982 - -536841120.. -429469928: ###################################################### 5091 - -429469927.. -322098735: ##################################################### 4995 - -322098734.. -214727542: ##################################################### 5016 - -214727541.. -107356349: ##################################################### 5006 - -107356348.. 14844: ##################################################### 5054 - 14845.. 107386037: ##################################################### 4988 - 107386038.. 214757230: #################################################### 4921 - 214757231.. 322128423: ##################################################### 5001 - 322128424.. 429499616: ##################################################### 5048 - 429499617.. 536870809: ##################################################### 5016 - 536870810.. 644242002: ##################################################### 4979 - 644242003.. 751613195: #################################################### 4883 - 751613196.. 858984388: ##################################################### 5063 - 858984389.. 966355581: #################################################### 4929 - 966355582.. 1073726774: #################################################### 4951 + num: 100000, avg: -298652.90, stddev: 619096154.85, median 419404, min -1073741519, max 1073728237 + -1073741519.. -966368032: ##################################################### 4984 + -966368031.. -858994544: ###################################################### 5025 + -858994543.. -751621056: ###################################################### 5035 + -751621055.. -644247568: #################################################### 4897 + -644247567.. -536874080: ###################################################### 5025 + -536874079.. -429500592: ##################################################### 4968 + -429500591.. -322127104: ###################################################### 5029 + -322127103.. -214753616: ##################################################### 5003 + -214753615.. -107380128: ###################################################### 5022 + -107380127.. -6640: ##################################################### 4987 + -6639.. 107366848: ###################################################### 5062 + 107366849.. 214740336: ##################################################### 4954 + 214740337.. 322113824: ###################################################### 5062 + 322113825.. 429487312: #################################################### 4917 + 429487313.. 536860800: ###################################################### 5021 + 536860801.. 644234288: ####################################################### 5107 + 644234289.. 751607776: ###################################################### 5058 + 751607777.. 858981264: #################################################### 4918 + 858981265.. 966354752: ###################################################### 5026 + 966354753.. 1073728240: #################################################### 4900 +++ Stats for oneof int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -1637,33 +1661,32 @@ stats dist: 6.. 10: 0 ================================================================================ 1 warning(s) -failure (73 tests failed, 3 tests errored, ran 165 tests) +failure (74 tests failed, 3 tests errored, ran 166 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 1000, avg: -3528483.94, stddev: 437402795.33, median 16, min -1058119937, max 1073741823 - -1058119937.. -951526850: ### 31 - -951526849.. -844933762: ## 26 - -844933761.. -738340674: ## 27 - -738340673.. -631747586: ## 21 - -631747585.. -525154498: ## 25 - -525154497.. -418561410: # 19 - -418561409.. -311968322: ## 27 - -311968321.. -205375234: # 19 - -205375233.. -98782146: ### 31 - -98782145.. 7810942: ####################################################### 537 - 7810943.. 114404030: ## 26 - 114404031.. 220997118: ## 20 - 220997119.. 327590206: ## 22 - 327590207.. 434183294: ## 27 - 434183295.. 540776382: # 18 - 540776383.. 647369470: ## 24 - 647369471.. 753962558: ## 24 - 753962559.. 860555646: ## 26 - 860555647.. 967148734: ## 21 - 967148735.. 1073741822: ## 28 - 1073741823.. 1073741823: 1 + num: 1000, avg: 2229293.51, stddev: 427568354.78, median 9, min -1072726813, max 1073741823 + -1072726813.. -965403382: ## 22 + -965403381.. -858079950: ## 28 + -858079949.. -750756518: # 17 + -750756517.. -643433086: ### 32 + -643433085.. -536109654: ## 22 + -536109653.. -428786222: ## 25 + -428786221.. -321462790: ## 20 + -321462789.. -214139358: ## 23 + -214139357.. -106815926: ## 26 + -106815925.. 507506: ####################################################### 533 + 507507.. 107830938: ## 29 + 107830939.. 215154370: ## 25 + 215154371.. 322477802: ## 24 + 322477803.. 429801234: ## 25 + 429801235.. 537124666: ### 34 + 537124667.. 644448098: ## 20 + 644448099.. 751771530: ## 28 + 751771531.. 859094962: ## 23 + 859094963.. 966418394: ## 21 + 966418395.. 1073741823: ## 23 ================================================================================ success (ran 1 tests) diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.64 b/test/core/QCheck2_expect_test.expected.ocaml4.64 index 8a67bc62..bcbf02ef 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.64 @@ -1,124 +1,125 @@ random seed: 1234 -50 7 0 0 0 0 0 0 0 0 0 0 3 3 3 3 3 3 3 3 3 3 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 (2,fun,16) (6,fun,1) (9,fun,7) (0,fun,9) (60,fun,7) (7,fun,2) (3,fun,9) (54,fun,4) (4,fun,3) (2,fun,0) -(2,fun,16) (6,fun,1) (9,fun,7) (0,fun,9) (60,fun,7) (7,fun,2) (3,fun,9) (54,fun,4) (4,fun,3) (2,fun,0) -(2,fun,16) (6,fun,1) (9,fun,7) (0,fun,9) (60,fun,7) (7,fun,2) (3,fun,9) (54,fun,4) (4,fun,3) (2,fun,0) -(2,fun,16) (6,fun,1) (9,fun,7) (0,fun,9) (60,fun,7) (7,fun,2) (3,fun,9) (54,fun,4) (4,fun,3) (2,fun,0) -(2,fun,16) (6,fun,1) (9,fun,7) (0,fun,9) (60,fun,7) (7,fun,2) (3,fun,9) (54,fun,4) (4,fun,3) (2,fun,0) -(2,fun,16) (6,fun,1) (9,fun,7) (0,fun,9) (60,fun,7) (7,fun,2) (3,fun,9) (54,fun,4) (4,fun,3) (2,fun,0) -(2,fun,16) (6,fun,1) (9,fun,7) (0,fun,9) (60,fun,7) (7,fun,2) (3,fun,9) (54,fun,4) (4,fun,3) (2,fun,0) -(2,fun,16) (6,fun,1) (9,fun,7) (0,fun,9) (60,fun,7) (7,fun,2) (3,fun,9) (54,fun,4) (4,fun,3) (2,fun,0) --947389732205813673 -947389732205813672 +50 7 0 0 0 0 0 0 0 0 0 0 3 3 3 3 3 3 3 3 3 3 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 (5,fun,0) (2,fun,16) (4,fun,1) (8,fun,7) (5,fun,1) (8,fun,4) (6,fun,3) (2,fun,3) (39,fun,5) (7,fun,1) +(5,fun,0) (2,fun,16) (4,fun,1) (8,fun,7) (5,fun,1) (8,fun,4) (6,fun,3) (2,fun,3) (39,fun,5) (7,fun,1) +(5,fun,0) (2,fun,16) (4,fun,1) (8,fun,7) (5,fun,1) (8,fun,4) (6,fun,3) (2,fun,3) (39,fun,5) (7,fun,1) +(5,fun,0) (2,fun,16) (4,fun,1) (8,fun,7) (5,fun,1) (8,fun,4) (6,fun,3) (2,fun,3) (39,fun,5) (7,fun,1) +(5,fun,0) (2,fun,16) (4,fun,1) (8,fun,7) (5,fun,1) (8,fun,4) (6,fun,3) (2,fun,3) (39,fun,5) (7,fun,1) +(5,fun,0) (2,fun,16) (4,fun,1) (8,fun,7) (5,fun,1) (8,fun,4) (6,fun,3) (2,fun,3) (39,fun,5) (7,fun,1) +(5,fun,0) (2,fun,16) (4,fun,1) (8,fun,7) (5,fun,1) (8,fun,4) (6,fun,3) (2,fun,3) (39,fun,5) (7,fun,1) +(5,fun,0) (2,fun,16) (4,fun,1) (8,fun,7) (5,fun,1) (8,fun,4) (6,fun,3) (2,fun,3) (39,fun,5) (7,fun,1) +2007784939368327536 0 -473694866102906836 +1003892469684163768 0 -236847433051453418 +501946234842081884 0 -118423716525726709 +250973117421040942 0 -59211858262863354 +125486558710520471 0 -29605929131431677 +62743279355260235 0 -14802964565715838 +31371639677630117 0 -7401482282857919 +15685819838815058 0 -3700741141428959 +7842909919407529 0 -1850370570714479 +3921454959703764 0 -925185285357239 +1960727479851882 0 -462592642678619 +980363739925941 0 -231296321339309 +490181869962970 0 -115648160669654 +245090934981485 0 -57824080334827 +122545467490742 0 -28912040167413 +61272733745371 0 -14456020083706 +30636366872685 0 -7228010041853 +15318183436342 0 -3614005020926 +7659091718171 0 -1807002510463 +3829545859085 0 -903501255231 +1914772929542 0 -451750627615 +957386464771 0 -225875313807 +478693232385 0 -112937656903 +239346616192 0 -56468828451 +119673308096 0 -28234414225 +59836654048 0 -14117207112 +29918327024 0 -7058603556 +14959163512 0 -3529301778 +7479581756 0 -1764650889 +3739790878 0 -882325444 +1869895439 0 -441162722 +934947719 0 -220581361 +467473859 0 -110290680 +233736929 0 -55145340 +116868464 0 -27572670 +58434232 0 -13786335 +29217116 0 -6893167 +14608558 0 -3446583 +7304279 0 -1723291 +3652139 0 -861645 +1826069 0 -430822 +913034 0 -215411 +456517 0 -107705 +228258 0 -53852 +114129 0 -26926 +57064 0 -13463 +28532 0 -6731 +14266 0 -3365 +7133 0 -1682 +3566 0 -841 +1783 0 -420 +891 0 -210 +445 0 -105 +222 0 -52 +111 0 -26 +55 +0 +27 0 13 0 @@ -128,27 +129,46 @@ random seed: 1234 0 1 0 -[16; 1; 1] -[16; 1] -[16] -[] +[0; 13; 4; 6; 14; 6; 47; 3; 4; 3; 6; 6; 9; 4; 3; 65; 2; 4; 55; 2; 4; 87; 9; 5; 35; 73; 9; 9; 2; 74; 5; 9; 10; 93; 2; 7; 1; 4; 6; 91; 8; 8; 2; 9; 47; 6; 26; 3; 60; 1; 0; 5; 26; 4; 28; 6; 0; 5; 88; 3; 7] +[0; 13; 4; 6; 14; 6; 47; 3; 4; 3; 6; 6; 9; 4; 3; 65; 2; 4; 55; 2; 4; 87; 9; 5; 35; 73; 9; 9; 2; 74; 5] +[0; 13; 4; 6; 14; 6; 47; 3; 4; 3; 6; 6; 9; 4; 3; 65] +[0; 13; 4; 6; 14; 6; 47; 3] +[0; 13; 4; 6] +[0; 13] [0] -[16; 1; 1] -[16; 1] -[1] -[0; 1; 1] -[0; 0; 1] +[] +[0; 13; 4; 6; 14; 6; 47; 3; 4; 3; 6; 6; 9; 4; 3; 65; 2; 4; 55; 2; 4; 87; 9; 5; 35; 73; 9; 9; 2; 74; 5; 9; 10; 93; 2; 7; 1; 4; 6; 91; 8; 8; 2; 9; 47; 6; 26; 3; 60; 1; 0; 5; 26; 4; 28; 6; 0; 5; 88; 3; 7] +[0; 13; 4; 6; 14; 6; 47; 3; 4; 3; 6; 6; 9; 4; 3; 65; 2; 4; 55; 2; 4; 87; 9; 5; 35; 73; 9; 9; 2; 74; 5] +[0; 13; 4; 6; 14; 6; 47; 3; 4; 3; 6; 6; 9; 4; 3; 65] +[0; 13; 4; 6; 14; 6; 47; 3] +[0; 13; 4; 6] +[14; 6; 47; 3] +[13; 4; 6; 14; 6; 47; 3] +[13; 4; 6; 14] +[6; 47; 3] +[4; 6; 14; 6; 47; 3] +[4; 6; 14] +[6; 47; 3] +[6; 14; 6; 47; 3] +[6; 14; 6] +[6; 14] +[6] +[0; 14; 6] +[3; 14; 6] +[5; 14; 6] +[6; 0; 6] +[0; 0; 6] [0; 0; 0] --- Failure -------------------------------------------------------------------- -Test should_fail_sort_id failed (6 shrink steps): +Test should_fail_sort_id failed (5 shrink steps): [1; 0] === Error ====================================================================== -Test should_error_raise_exn errored on (2 shrink steps): +Test should_error_raise_exn errored on (1 shrink steps): 0 @@ -207,7 +227,7 @@ Test with shrinking retries failed (0 shrink steps): Warning for test WARN_unlikely_precond: -WARNING: only 0.4% tests (of 2000) passed precondition for "WARN_unlikely_precond" +WARNING: only 0.3% tests (of 2000) passed precondition for "WARN_unlikely_precond" NOTE: it is likely that the precondition is too strong, or that the generator is buggy. @@ -215,7 +235,7 @@ NOTE: it is likely that the precondition is too strong, or that the generator is Test FAIL_unlikely_precond failed: -ERROR: only 0.4% tests (of 2000) passed precondition for "FAIL_unlikely_precond" +ERROR: only 0.3% tests (of 2000) passed precondition for "FAIL_unlikely_precond" NOTE: it is likely that the precondition is too strong, or that the generator is buggy. @@ -266,15 +286,15 @@ Test big bound issue59 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test long_shrink failed (3030 shrink steps): +Test long_shrink failed (3086 shrink steps): ([0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0], [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 1]) --- Failure -------------------------------------------------------------------- -Test ints arent 0 mod 3 failed (76 shrink steps): +Test ints arent 0 mod 3 failed (85 shrink steps): --24381 +-141 --- Failure -------------------------------------------------------------------- @@ -338,13 +358,13 @@ Test printable never produces less than '5 failed (1 shrink steps): --- Failure -------------------------------------------------------------------- -Test bytes are empty failed (3 shrink steps): +Test bytes are empty failed (7 shrink steps): "a" --- Failure -------------------------------------------------------------------- -Test bytes never has a \000 char failed (9 shrink steps): +Test bytes never has a \000 char failed (13 shrink steps): "\000" @@ -356,19 +376,19 @@ Test bytes never has a \255 char failed (5 shrink steps): --- Failure -------------------------------------------------------------------- -Test bytes have unique chars failed (31 shrink steps): +Test bytes have unique chars failed (16 shrink steps): -"aaaaaaaaaaa" +"aaa" --- Failure -------------------------------------------------------------------- -Test strings are empty failed (3 shrink steps): +Test strings are empty failed (7 shrink steps): "a" --- Failure -------------------------------------------------------------------- -Test string never has a \000 char failed (9 shrink steps): +Test string never has a \000 char failed (13 shrink steps): "\000" @@ -380,37 +400,37 @@ Test string never has a \255 char failed (5 shrink steps): --- Failure -------------------------------------------------------------------- -Test strings have unique chars failed (31 shrink steps): +Test strings have unique chars failed (16 shrink steps): -"aaaaaaaaaaa" +"aaa" --- Failure -------------------------------------------------------------------- Test pairs have different components failed (0 shrink steps): -(6, 6) +(3, 3) --- Failure -------------------------------------------------------------------- -Test pairs have same components failed (61 shrink steps): +Test pairs have same components failed (63 shrink steps): (0, 1) --- Failure -------------------------------------------------------------------- -Test pairs have a zero component failed (120 shrink steps): +Test pairs have a zero component failed (123 shrink steps): (1, 1) --- Failure -------------------------------------------------------------------- -Test pairs are (0,0) failed (61 shrink steps): +Test pairs are (0,0) failed (63 shrink steps): (0, 1) --- Failure -------------------------------------------------------------------- -Test pairs are ordered failed (90 shrink steps): +Test pairs are ordered failed (94 shrink steps): (1, 0) @@ -422,55 +442,55 @@ Test pairs are ordered reversely failed (62 shrink steps): --- Failure -------------------------------------------------------------------- -Test pairs sum to less than 128 failed (57 shrink steps): +Test pairs sum to less than 128 failed (58 shrink steps): (0, 128) --- Failure -------------------------------------------------------------------- -Test pairs lists rev concat failed (65 shrink steps): +Test pairs lists rev concat failed (66 shrink steps): ([0], [1]) --- Failure -------------------------------------------------------------------- -Test pairs lists no overlap failed (6 shrink steps): +Test pairs lists no overlap failed (12 shrink steps): -([1], [1]) +([0], [0]) --- Failure -------------------------------------------------------------------- -Test triples have pair-wise different components failed (3 shrink steps): +Test triples have pair-wise different components failed (2 shrink steps): (0, 0, 0) --- Failure -------------------------------------------------------------------- -Test triples have same components failed (64 shrink steps): +Test triples have same components failed (65 shrink steps): (0, 1, 0) --- Failure -------------------------------------------------------------------- -Test triples are ordered failed (3 shrink steps): +Test triples are ordered failed (4 shrink steps): (0, 0, -1) --- Failure -------------------------------------------------------------------- -Test triples are ordered reversely failed (63 shrink steps): +Test triples are ordered reversely failed (125 shrink steps): (0, 0, 1) --- Failure -------------------------------------------------------------------- -Test quadruples have pair-wise different components failed (4 shrink steps): +Test quadruples have pair-wise different components failed (3 shrink steps): (0, 0, 0, 0) --- Failure -------------------------------------------------------------------- -Test quadruples have same components failed (122 shrink steps): +Test quadruples have same components failed (125 shrink steps): (0, 1, 0, 1) @@ -482,25 +502,25 @@ Test quadruples are ordered failed (5 shrink steps): --- Failure -------------------------------------------------------------------- -Test quadruples are ordered reversely failed (124 shrink steps): +Test quadruples are ordered reversely failed (126 shrink steps): (0, 0, 0, 1) --- Failure -------------------------------------------------------------------- -Test forall (a, b) in nat: a < b failed (7 shrink steps): +Test forall (a, b) in nat: a < b failed (1 shrink steps): (0, 0) --- Failure -------------------------------------------------------------------- -Test forall (a, b, c) in nat: a < b < c failed (4 shrink steps): +Test forall (a, b, c) in nat: a < b < c failed (2 shrink steps): (0, 0, 0) --- Failure -------------------------------------------------------------------- -Test forall (a, b, c, d) in nat: a < b < c < d failed (4 shrink steps): +Test forall (a, b, c, d) in nat: a < b < c < d failed (3 shrink steps): (0, 0, 0, 0) @@ -524,13 +544,13 @@ Test forall (a, b, c, d, e, f, g) in nat: a < b < c < d < e < f < g failed (6 sh --- Failure -------------------------------------------------------------------- -Test forall (a, b, c, d, e, f, g, h) in nat: a < b < c < d < e < f < g < h failed (6 shrink steps): +Test forall (a, b, c, d, e, f, g, h) in nat: a < b < c < d < e < f < g < h failed (7 shrink steps): (0, 0, 0, 0, 0, 0, 0, 0) --- Failure -------------------------------------------------------------------- -Test forall (a, b, c, d, e, f, g, h, i) in nat: a < b < c < d < e < f < g < h < i failed (7 shrink steps): +Test forall (a, b, c, d, e, f, g, h, i) in nat: a < b < c < d < e < f < g < h < i failed (8 shrink steps): (0, 0, 0, 0, 0, 0, 0, 0, 0) @@ -548,31 +568,31 @@ Test bind list_size constant failed (12 shrink steps): --- Failure -------------------------------------------------------------------- -Test lists are empty failed (3 shrink steps): +Test lists are empty failed (6 shrink steps): [0] --- Failure -------------------------------------------------------------------- -Test lists shorter than 10 failed (16 shrink steps): +Test lists shorter than 10 failed (18 shrink steps): [0; 0; 0; 0; 0; 0; 0; 0; 0; 0] --- Failure -------------------------------------------------------------------- -Test lists shorter than 432 failed (405 shrink steps): +Test lists shorter than 432 failed (403 shrink steps): [...] list length: 432 --- Failure -------------------------------------------------------------------- -Test lists shorter than 4332 failed (3998 shrink steps): +Test lists shorter than 4332 failed (4022 shrink steps): [...] list length: 4332 --- Failure -------------------------------------------------------------------- -Test lists have unique elems failed (3 shrink steps): +Test lists have unique elems failed (10 shrink steps): [0; 0; 0] @@ -590,7 +610,7 @@ None --- Failure -------------------------------------------------------------------- -Test (int,string) result are Ok failed (2 shrink steps): +Test (int,string) result are Ok failed (4 shrink steps): Error ("") @@ -602,7 +622,7 @@ Ok (0) --- Failure -------------------------------------------------------------------- -Test tree contains only 42 failed (2 shrink steps): +Test tree contains only 42 failed (1 shrink steps): Leaf 0 @@ -610,56 +630,62 @@ Leaf 0 Test sum list = 0 failed (0 shrink steps): -[16; 1; 1] +[0; 13; 4; 6; 14; 6; 47; 3; 4; 3; 6; 6; 9; 4; 3; 65; 2; 4; 55; 2; 4; 87; 9; 5; 35; 73; 9; 9; 2; 74; 5; 9; 10; 93; 2; 7; 1; 4; 6; 91; 8; 8; 2; 9; 47; 6; 26; 3; 60; 1; 0; 5; 26; 4; 28; 6; 0; 5; 88; 3; 7] --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int failed (14 shrink steps): +Test fail_pred_map_commute_int failed (105 shrink steps): -([0], {0 -> -1; _ -> 0}, {0 -> true; _ -> false}) +([0], {0 -> 29; _ -> 0}, {29 -> true; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int32 failed (58 shrink steps): +Test fail_pred_map_commute_int32 failed (54 shrink steps): -([0l], {0l -> 1l; _ -> 0l}, {0l -> true; _ -> false}) +([0l], {0l -> -15l; _ -> 0l}, {-15l -> true; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int64 failed (113 shrink steps): +Test fail_pred_map_commute_int64 failed (105 shrink steps): -([0L], {0L -> 1L; _ -> 0L}, {0L -> true; _ -> false}) +([0L], {0L -> -71L; _ -> 0L}, {-71L -> true; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_strings failed (1 shrink steps): +Test fail_pred_strings failed (0 shrink steps): {"some random string" -> true; "some other string" -> false; _ -> false} --- Failure -------------------------------------------------------------------- -Test fold_left fold_right failed (10 shrink steps): +Test fold_left fold_right failed (17 shrink steps): -(0, [1], {(1, 0) -> 1; _ -> 0}) +(0, [1], {(0, 1) -> 1; _ -> 0}) +++ Messages ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Messages for test fold_left fold_right: -l=[1], fold_left=1, fold_right=0 +l=[1], fold_left=0, fold_right=1 --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried failed (62 shrink steps): +Test fold_left fold_right uncurried failed (14 shrink steps): -({(5, 2) -> 0; (4, 1) -> 0; (1, 2) -> 1; (79, 4) -> 0; (9, 6) -> 0; (7, 3) -> 0; (3, 8) -> 0; (17, 6) -> 0; (37, 6) -> 0; (4, 8) -> 0; (17, 3) -> 0; (3, 4) -> 0; (84, 79) -> 0; (8, 1) -> 0; (6, 8) -> 0; (4, 17) -> 0; (3, 5) -> 0; (1, 6) -> 0; (9, 4) -> 0; (2, 5) -> 0; (5, 4) -> 0; (3, 76) -> 0; (9, 3) -> 0; (3, 1) -> 0; (8, 3) -> 0; (3, 24) -> 0; (34, 1) -> 0; (3, 3) -> 0; (6, 9) -> 0; (76, 8) -> 0; (67, 3) -> 0; (8, 9) -> 0; (2, 24) -> 0; (1, 1) -> 0; (1, 5) -> 0; (2, 3) -> 0; (6, 2) -> 0; (5, 8) -> 0; (5, 7) -> 0; (5, 6) -> 0; (24, 5) -> 0; (2, 17) -> 0; (6, 1) -> 0; (7, 6) -> 0; (6, 3) -> 0; (2, 4) -> 0; (1, 9) -> 0; _ -> 0}, 1, [2]) +({(9, 6) -> 0; (1, 5) -> 0; (4, 8) -> 1; (9, 8) -> 0; _ -> 0}, 8, [4]) --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried fun last failed (10 shrink steps): +Test fold_left fold_right uncurried fun last failed (48 shrink steps): -(0, [1], {(0, 1) -> 1; _ -> 0}) +(0, [0; 1], {(0, 0) -> 1; _ -> 0}) + +--- Failure -------------------------------------------------------------------- + +Test fold_left test, fun first failed (87 shrink steps): + +({("\188Bt\000", 9) -> ""; ("8\252D", 2) -> ""; ("\241\223v\190~>", 6) -> "a"; ("\252R\2108,\226\019\006\t", 2) -> ""; ("\154\241\031\198W\176\ng\150\002\213\197\026\221z\019\151", 0) -> ""; ("1\015\255", 46) -> "a"; ("\177W\174", 8) -> ""; ("\0140WD\024%\195\145\176\200\023\185\138\247\193\172[+\237\186LT\158\208y|\223\231\192\012#\144c\016", 66) -> ""; ("Z}(:?\216", 4) -> ""; ("", 13) -> "a"; ("", 9) -> ""; ("\144\189\"\030E\183\024h\023", 8) -> ""; ("\147\172\209U\252\209\bM&\175m\005\250N[p\180\204jh\217$I\208\002H\168[F\174\145\190b\151w\174\177Ib|\022\149\224\140\250E\239\216g\249\137\246\252\229\192\136\249\131\182&\127\173\015\147H\240\201\166\163\163\239\196", 29) -> ""; ("B\012\251", 1) -> "a"; ("\140", 9) -> ""; ("@\131}\002uPha\151\245\224\240\148ad\191", 7) -> ""; _ -> ""}, "", [0; 13], [0]) --- Failure -------------------------------------------------------------------- @@ -744,445 +770,445 @@ stats char code: +++ Stats for tree's depth ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats depth: - num: 1000, avg: 3.92, stddev: 3.36, median 3, min 1, max 15 - 1: ####################################################### 364 - 2: ############## 96 - 3: ############ 83 - 4: ##################### 145 - 5: ########## 71 - 6: ##### 34 - 7: ###### 44 - 8: ####### 49 - 9: # 11 - 10: ### 24 - 11: ######## 54 + num: 1000, avg: 3.97, stddev: 3.35, median 3, min 1, max 15 + 1: ####################################################### 356 + 2: ############## 91 + 3: ############### 98 + 4: ################### 129 + 5: ############ 78 + 6: #### 31 + 7: ####### 47 + 8: ######## 53 + 9: # 12 + 10: #### 27 + 11: ######## 55 12: 3 - 13: 6 - 14: # 12 - 15: 4 + 13: # 8 + 14: # 9 + 15: 3 +++ Stats for bytes_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 7.47, stddev: 1.70, median 7, min 5, max 10 - 5: ##################################################### 848 - 6: #################################################### 829 - 7: ####################################################### 869 - 8: ##################################################### 839 - 9: ################################################# 787 - 10: #################################################### 828 + num: 5000, avg: 7.53, stddev: 1.71, median 8, min 5, max 10 + 5: #################################################### 814 + 6: #################################################### 809 + 7: ##################################################### 830 + 8: ###################################################### 845 + 9: ####################################################### 854 + 10: ###################################################### 848 +++ Stats for bytes len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 381.73, stddev: 1276.71, median 9, min 0, max 9931 - 0.. 496: ####################################################### 4213 - 497.. 993: ###### 526 - 994..1490: 22 - 1491..1987: 14 - 1988..2484: 19 - 2485..2981: 14 - 2982..3478: 19 - 3479..3975: 15 - 3976..4472: 18 - 4473..4969: 14 - 4970..5466: 13 - 5467..5963: 11 - 5964..6460: 14 - 6461..6957: 18 - 6958..7454: 8 - 7455..7951: 15 - 7952..8448: 12 - 8449..8945: 9 - 8946..9442: 7 - 9443..9939: 19 + num: 5000, avg: 327.56, stddev: 1159.62, median 9, min 0, max 9916 + 0.. 495: ####################################################### 4285 + 496.. 991: ###### 509 + 992..1487: 21 + 1488..1983: 13 + 1984..2479: 13 + 2480..2975: 13 + 2976..3471: 10 + 3472..3967: 13 + 3968..4463: 10 + 4464..4959: 12 + 4960..5455: 7 + 5456..5951: 12 + 5952..6447: 11 + 6448..6943: 7 + 6944..7439: 9 + 7440..7935: 6 + 7936..8431: 16 + 8432..8927: 9 + 8928..9423: 13 + 9424..9919: 11 +++ Stats for bytes_of len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 381.73, stddev: 1276.71, median 9, min 0, max 9931 - 0.. 496: ####################################################### 4213 - 497.. 993: ###### 526 - 994..1490: 22 - 1491..1987: 14 - 1988..2484: 19 - 2485..2981: 14 - 2982..3478: 19 - 3479..3975: 15 - 3976..4472: 18 - 4473..4969: 14 - 4970..5466: 13 - 5467..5963: 11 - 5964..6460: 14 - 6461..6957: 18 - 6958..7454: 8 - 7455..7951: 15 - 7952..8448: 12 - 8449..8945: 9 - 8946..9442: 7 - 9443..9939: 19 + num: 5000, avg: 327.56, stddev: 1159.62, median 9, min 0, max 9916 + 0.. 495: ####################################################### 4285 + 496.. 991: ###### 509 + 992..1487: 21 + 1488..1983: 13 + 1984..2479: 13 + 2480..2975: 13 + 2976..3471: 10 + 3472..3967: 13 + 3968..4463: 10 + 4464..4959: 12 + 4960..5455: 7 + 5456..5951: 12 + 5952..6447: 11 + 6448..6943: 7 + 6944..7439: 9 + 7440..7935: 6 + 7936..8431: 16 + 8432..8927: 9 + 8928..9423: 13 + 9424..9919: 11 +++ Stats for bytes_printable len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 381.73, stddev: 1276.71, median 9, min 0, max 9931 - 0.. 496: ####################################################### 4213 - 497.. 993: ###### 526 - 994..1490: 22 - 1491..1987: 14 - 1988..2484: 19 - 2485..2981: 14 - 2982..3478: 19 - 3479..3975: 15 - 3976..4472: 18 - 4473..4969: 14 - 4970..5466: 13 - 5467..5963: 11 - 5964..6460: 14 - 6461..6957: 18 - 6958..7454: 8 - 7455..7951: 15 - 7952..8448: 12 - 8449..8945: 9 - 8946..9442: 7 - 9443..9939: 19 + num: 5000, avg: 327.56, stddev: 1159.62, median 9, min 0, max 9916 + 0.. 495: ####################################################### 4285 + 496.. 991: ###### 509 + 992..1487: 21 + 1488..1983: 13 + 1984..2479: 13 + 2480..2975: 13 + 2976..3471: 10 + 3472..3967: 13 + 3968..4463: 10 + 4464..4959: 12 + 4960..5455: 7 + 5456..5951: 12 + 5952..6447: 11 + 6448..6943: 7 + 6944..7439: 9 + 7440..7935: 6 + 7936..8431: 16 + 8432..8927: 9 + 8928..9423: 13 + 9424..9919: 11 +++ Stats for bytes_small len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 16.26, stddev: 24.83, median 6, min 0, max 99 - 0.. 4: #################################################### 1868 - 5.. 9: ####################################################### 1967 - 10.. 14: # 66 - 15.. 19: # 62 - 20.. 24: # 70 - 25.. 29: # 59 - 30.. 34: # 62 - 35.. 39: # 62 - 40.. 44: ## 73 - 45.. 49: # 66 - 50.. 54: # 68 - 55.. 59: # 59 - 60.. 64: # 61 - 65.. 69: ## 75 - 70.. 74: # 56 - 75.. 79: # 64 - 80.. 84: # 46 - 85.. 89: ## 72 - 90.. 94: # 67 - 95.. 99: ## 77 + num: 5000, avg: 15.47, stddev: 24.03, median 6, min 0, max 99 + 0.. 4: ####################################################### 1958 + 5.. 9: ##################################################### 1914 + 10.. 14: # 64 + 15.. 19: ## 75 + 20.. 24: # 64 + 25.. 29: # 71 + 30.. 34: ## 74 + 35.. 39: # 60 + 40.. 44: # 61 + 45.. 49: # 57 + 50.. 54: # 62 + 55.. 59: # 58 + 60.. 64: # 63 + 65.. 69: # 46 + 70.. 74: # 67 + 75.. 79: # 62 + 80.. 84: # 57 + 85.. 89: # 67 + 90.. 94: # 66 + 95.. 99: # 54 +++ Stats for string_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 7.47, stddev: 1.70, median 7, min 5, max 10 - 5: ##################################################### 848 - 6: #################################################### 829 - 7: ####################################################### 869 - 8: ##################################################### 839 - 9: ################################################# 787 - 10: #################################################### 828 + num: 5000, avg: 7.53, stddev: 1.71, median 8, min 5, max 10 + 5: #################################################### 814 + 6: #################################################### 809 + 7: ##################################################### 830 + 8: ###################################################### 845 + 9: ####################################################### 854 + 10: ###################################################### 848 +++ Stats for string len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 381.73, stddev: 1276.71, median 9, min 0, max 9931 - 0.. 496: ####################################################### 4213 - 497.. 993: ###### 526 - 994..1490: 22 - 1491..1987: 14 - 1988..2484: 19 - 2485..2981: 14 - 2982..3478: 19 - 3479..3975: 15 - 3976..4472: 18 - 4473..4969: 14 - 4970..5466: 13 - 5467..5963: 11 - 5964..6460: 14 - 6461..6957: 18 - 6958..7454: 8 - 7455..7951: 15 - 7952..8448: 12 - 8449..8945: 9 - 8946..9442: 7 - 9443..9939: 19 + num: 5000, avg: 327.56, stddev: 1159.62, median 9, min 0, max 9916 + 0.. 495: ####################################################### 4285 + 496.. 991: ###### 509 + 992..1487: 21 + 1488..1983: 13 + 1984..2479: 13 + 2480..2975: 13 + 2976..3471: 10 + 3472..3967: 13 + 3968..4463: 10 + 4464..4959: 12 + 4960..5455: 7 + 5456..5951: 12 + 5952..6447: 11 + 6448..6943: 7 + 6944..7439: 9 + 7440..7935: 6 + 7936..8431: 16 + 8432..8927: 9 + 8928..9423: 13 + 9424..9919: 11 +++ Stats for string_of len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 381.73, stddev: 1276.71, median 9, min 0, max 9931 - 0.. 496: ####################################################### 4213 - 497.. 993: ###### 526 - 994..1490: 22 - 1491..1987: 14 - 1988..2484: 19 - 2485..2981: 14 - 2982..3478: 19 - 3479..3975: 15 - 3976..4472: 18 - 4473..4969: 14 - 4970..5466: 13 - 5467..5963: 11 - 5964..6460: 14 - 6461..6957: 18 - 6958..7454: 8 - 7455..7951: 15 - 7952..8448: 12 - 8449..8945: 9 - 8946..9442: 7 - 9443..9939: 19 + num: 5000, avg: 327.56, stddev: 1159.62, median 9, min 0, max 9916 + 0.. 495: ####################################################### 4285 + 496.. 991: ###### 509 + 992..1487: 21 + 1488..1983: 13 + 1984..2479: 13 + 2480..2975: 13 + 2976..3471: 10 + 3472..3967: 13 + 3968..4463: 10 + 4464..4959: 12 + 4960..5455: 7 + 5456..5951: 12 + 5952..6447: 11 + 6448..6943: 7 + 6944..7439: 9 + 7440..7935: 6 + 7936..8431: 16 + 8432..8927: 9 + 8928..9423: 13 + 9424..9919: 11 +++ Stats for string_printable len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 381.73, stddev: 1276.71, median 9, min 0, max 9931 - 0.. 496: ####################################################### 4213 - 497.. 993: ###### 526 - 994..1490: 22 - 1491..1987: 14 - 1988..2484: 19 - 2485..2981: 14 - 2982..3478: 19 - 3479..3975: 15 - 3976..4472: 18 - 4473..4969: 14 - 4970..5466: 13 - 5467..5963: 11 - 5964..6460: 14 - 6461..6957: 18 - 6958..7454: 8 - 7455..7951: 15 - 7952..8448: 12 - 8449..8945: 9 - 8946..9442: 7 - 9443..9939: 19 + num: 5000, avg: 327.56, stddev: 1159.62, median 9, min 0, max 9916 + 0.. 495: ####################################################### 4285 + 496.. 991: ###### 509 + 992..1487: 21 + 1488..1983: 13 + 1984..2479: 13 + 2480..2975: 13 + 2976..3471: 10 + 3472..3967: 13 + 3968..4463: 10 + 4464..4959: 12 + 4960..5455: 7 + 5456..5951: 12 + 5952..6447: 11 + 6448..6943: 7 + 6944..7439: 9 + 7440..7935: 6 + 7936..8431: 16 + 8432..8927: 9 + 8928..9423: 13 + 9424..9919: 11 +++ Stats for small_string len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 16.26, stddev: 24.83, median 6, min 0, max 99 - 0.. 4: #################################################### 1868 - 5.. 9: ####################################################### 1967 - 10.. 14: # 66 - 15.. 19: # 62 - 20.. 24: # 70 - 25.. 29: # 59 - 30.. 34: # 62 - 35.. 39: # 62 - 40.. 44: ## 73 - 45.. 49: # 66 - 50.. 54: # 68 - 55.. 59: # 59 - 60.. 64: # 61 - 65.. 69: ## 75 - 70.. 74: # 56 - 75.. 79: # 64 - 80.. 84: # 46 - 85.. 89: ## 72 - 90.. 94: # 67 - 95.. 99: ## 77 + num: 5000, avg: 15.47, stddev: 24.03, median 6, min 0, max 99 + 0.. 4: ####################################################### 1958 + 5.. 9: ##################################################### 1914 + 10.. 14: # 64 + 15.. 19: ## 75 + 20.. 24: # 64 + 25.. 29: # 71 + 30.. 34: ## 74 + 35.. 39: # 60 + 40.. 44: # 61 + 45.. 49: # 57 + 50.. 54: # 62 + 55.. 59: # 58 + 60.. 64: # 63 + 65.. 69: # 46 + 70.. 74: # 67 + 75.. 79: # 62 + 80.. 84: # 57 + 85.. 89: # 67 + 90.. 94: # 66 + 95.. 99: # 54 +++ Stats for pair dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats pair sum: - num: 500000, avg: 99.97, stddev: 41.23, median 100, min 0, max 200 - 0.. 9: ### 2732 - 10.. 19: ######## 7470 - 20.. 29: ############## 12606 - 30.. 39: #################### 17281 - 40.. 49: ######################### 22161 - 50.. 59: ################################ 27693 - 60.. 69: ##################################### 32264 - 70.. 79: ########################################### 37078 - 80.. 89: ################################################ 41933 - 90.. 99: ##################################################### 46178 - 100..109: ####################################################### 47368 - 110..119: ################################################# 42440 - 120..129: ########################################### 37526 - 130..139: ##################################### 32630 - 140..149: ############################### 27558 - 150..159: ########################## 22873 - 160..169: #################### 17956 - 170..179: ############### 13095 - 180..189: ######### 7957 - 190..199: ### 3157 - 200..209: 44 + num: 500000, avg: 100.09, stddev: 41.23, median 100, min 0, max 200 + 0.. 9: ### 2599 + 10.. 19: ######## 7571 + 20.. 29: ############## 12587 + 30.. 39: #################### 17235 + 40.. 49: ########################## 22334 + 50.. 59: ############################### 27179 + 60.. 69: ##################################### 32092 + 70.. 79: ########################################### 37071 + 80.. 89: ################################################ 41592 + 90.. 99: ###################################################### 46677 + 100..109: ####################################################### 47155 + 110..119: ################################################# 42772 + 120..129: ########################################### 37679 + 130..139: ###################################### 32681 + 140..149: ################################ 27465 + 150..159: ########################## 23061 + 160..169: #################### 17923 + 170..179: ############### 12910 + 180..189: ######### 8135 + 190..199: ### 3233 + 200..209: 49 +++ Stats for triple dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats triple sum: - num: 500000, avg: 150.03, stddev: 50.48, median 150, min 0, max 299 - 0.. 14: 313 - 15.. 29: ## 2122 - 30.. 44: ##### 5446 - 45.. 59: ########## 10500 - 60.. 74: ################ 17013 - 75.. 89: ######################### 25666 - 90..104: ################################### 35268 - 105..119: ############################################# 45180 - 120..134: ################################################### 51212 - 135..149: ###################################################### 55048 - 150..164: ####################################################### 55217 - 165..179: ################################################### 52179 - 180..194: ############################################# 45446 - 195..209: #################################### 36527 - 210..224: ######################### 26036 - 225..239: ################# 17655 - 240..254: ########## 10770 - 255..269: ##### 5786 - 270..284: ## 2253 - 285..299: 363 + num: 500000, avg: 149.91, stddev: 50.48, median 150, min 1, max 299 + 1.. 15: 404 + 16.. 30: ## 2212 + 31.. 45: ##### 5889 + 46.. 60: ########## 10700 + 61.. 75: ################# 17772 + 76.. 90: ######################### 26105 + 91..105: ################################### 36005 + 106..120: ############################################# 45660 + 121..135: ################################################### 52122 + 136..150: ####################################################### 55483 + 151..165: ###################################################### 54945 + 166..180: ################################################### 51868 + 181..195: ############################################ 45051 + 196..210: ################################## 35080 + 211..225: ######################### 25470 + 226..240: ################ 16973 + 241..255: ########## 10427 + 256..270: ##### 5344 + 271..285: ## 2133 + 286..300: 357 +++ Stats for quad dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats quad sum: - num: 500000, avg: 200.05, stddev: 58.23, median 200, min 1, max 395 - 1.. 20: 56 - 21.. 40: 613 - 41.. 60: # 2355 - 61.. 80: ##### 6151 - 81..100: ########## 12762 - 101..120: ################### 22881 - 121..140: ############################# 35023 - 141..160: ######################################## 48107 - 161..180: ################################################# 58482 - 181..200: ###################################################### 64916 - 201..220: ####################################################### 65035 - 221..240: ################################################# 58235 - 241..260: ####################################### 47099 - 261..280: ############################# 34772 - 281..300: ################## 22400 - 301..320: ########## 12463 - 321..340: #### 5856 - 341..360: # 2260 - 361..380: 501 - 381..400: 33 + num: 500000, avg: 199.94, stddev: 58.37, median 200, min 5, max 394 + 5.. 24: 105 + 25.. 44: 829 + 45.. 64: ## 2997 + 65.. 84: ###### 7402 + 85..104: ############ 14559 + 105..124: ##################### 25103 + 125..144: ################################ 38055 + 145..164: ########################################## 50469 + 165..184: ################################################## 60434 + 185..204: ####################################################### 65242 + 205..224: ##################################################### 63665 + 225..244: ############################################### 55764 + 245..264: ###################################### 45244 + 265..284: ########################## 31847 + 285..304: ################ 20092 + 305..324: ######### 11027 + 325..344: #### 5011 + 345..364: # 1794 + 365..384: 348 + 385..404: 13 +++ Stats for bind dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats ordered pair difference: - num: 1000000, avg: 24.99, stddev: 22.33, median 19, min 0, max 100 - 0.. 4: ####################################################### 193839 - 5.. 9: #################################### 129347 - 10.. 14: ############################# 103847 - 15.. 19: ######################## 87031 - 20.. 24: ##################### 75338 - 25.. 29: ################## 64783 - 30.. 34: ################ 56422 - 35.. 39: ############## 49351 - 40.. 44: ############ 43140 - 45.. 49: ########## 38109 - 50.. 54: ######### 32501 - 55.. 59: ####### 28129 - 60.. 64: ###### 24178 - 65.. 69: ##### 20069 - 70.. 74: #### 16578 - 75.. 79: ### 13204 - 80.. 84: ## 10269 - 85.. 89: ## 7232 - 90.. 94: # 4471 - 95.. 99: 2047 - 100..104: 115 + num: 1000000, avg: 25.02, stddev: 22.38, median 19, min 0, max 100 + 0.. 4: ####################################################### 193818 + 5.. 9: #################################### 129891 + 10.. 14: ############################# 103378 + 15.. 19: ######################## 87043 + 20.. 24: ##################### 75202 + 25.. 29: ################## 64688 + 30.. 34: ################ 56523 + 35.. 39: ############# 49283 + 40.. 44: ############ 42859 + 45.. 49: ########## 37336 + 50.. 54: ######### 32591 + 55.. 59: ######## 28285 + 60.. 64: ###### 24255 + 65.. 69: ##### 20314 + 70.. 74: #### 16733 + 75.. 79: ### 13555 + 80.. 84: ## 10170 + 85.. 89: ## 7255 + 90.. 94: # 4729 + 95.. 99: 1992 + 100..104: 100 stats ordered pair sum: - num: 1000000, avg: 75.00, stddev: 46.92, median 72, min 0, max 200 - 0.. 9: ####################################################### 70575 - 10.. 19: ##################################################### 68853 - 20.. 29: ##################################################### 68585 - 30.. 39: ##################################################### 68532 - 40.. 49: ##################################################### 68240 - 50.. 59: ##################################################### 68715 - 60.. 69: ##################################################### 68990 - 70.. 79: ##################################################### 68722 - 80.. 89: ##################################################### 68480 - 90.. 99: ##################################################### 68372 - 100..109: ################################################## 64287 - 110..119: ########################################### 55514 - 120..129: #################################### 47048 - 130..139: ############################### 39962 - 140..149: ######################### 32688 - 150..159: #################### 26183 - 160..169: ############### 19821 - 170..179: ########## 14077 - 180..189: ###### 8713 - 190..199: ## 3560 - 200..209: 83 + num: 1000000, avg: 75.04, stddev: 46.91, median 72, min 0, max 200 + 0.. 9: ####################################################### 70296 + 10.. 19: ##################################################### 68918 + 20.. 29: ##################################################### 68448 + 30.. 39: ##################################################### 68654 + 40.. 49: ##################################################### 68490 + 50.. 59: ##################################################### 68513 + 60.. 69: ##################################################### 68299 + 70.. 79: ##################################################### 68552 + 80.. 89: ##################################################### 68560 + 90.. 99: ###################################################### 69283 + 100..109: ################################################## 64173 + 110..119: ########################################### 55624 + 120..129: ##################################### 47381 + 130..139: ############################## 39552 + 140..149: ######################### 32856 + 150..159: #################### 26038 + 160..169: ############### 20035 + 170..179: ########### 14164 + 180..189: ###### 8568 + 190..199: ## 3515 + 200..209: 81 +++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Collect results for test option dist: -None : 1489 cases -Some _: 8511 cases +None : 1519 cases +Some _: 8481 cases +++ Collect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Collect results for test result dist: -Error _: 2531 cases -Ok _ : 7469 cases +Error _: 2577 cases +Ok _ : 7423 cases +++ Stats for list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 381.73, stddev: 1276.71, median 9, min 0, max 9931 - 0.. 496: ####################################################### 4213 - 497.. 993: ###### 526 - 994..1490: 22 - 1491..1987: 14 - 1988..2484: 19 - 2485..2981: 14 - 2982..3478: 19 - 3479..3975: 15 - 3976..4472: 18 - 4473..4969: 14 - 4970..5466: 13 - 5467..5963: 11 - 5964..6460: 14 - 6461..6957: 18 - 6958..7454: 8 - 7455..7951: 15 - 7952..8448: 12 - 8449..8945: 9 - 8946..9442: 7 - 9443..9939: 19 + num: 5000, avg: 327.56, stddev: 1159.62, median 9, min 0, max 9916 + 0.. 495: ####################################################### 4285 + 496.. 991: ###### 509 + 992..1487: 21 + 1488..1983: 13 + 1984..2479: 13 + 2480..2975: 13 + 2976..3471: 10 + 3472..3967: 13 + 3968..4463: 10 + 4464..4959: 12 + 4960..5455: 7 + 5456..5951: 12 + 5952..6447: 11 + 6448..6943: 7 + 6944..7439: 9 + 7440..7935: 6 + 7936..8431: 16 + 8432..8927: 9 + 8928..9423: 13 + 9424..9919: 11 +++ Stats for small_list len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 16.26, stddev: 24.83, median 6, min 0, max 99 - 0.. 4: #################################################### 1868 - 5.. 9: ####################################################### 1967 - 10.. 14: # 66 - 15.. 19: # 62 - 20.. 24: # 70 - 25.. 29: # 59 - 30.. 34: # 62 - 35.. 39: # 62 - 40.. 44: ## 73 - 45.. 49: # 66 - 50.. 54: # 68 - 55.. 59: # 59 - 60.. 64: # 61 - 65.. 69: ## 75 - 70.. 74: # 56 - 75.. 79: # 64 - 80.. 84: # 46 - 85.. 89: ## 72 - 90.. 94: # 67 - 95.. 99: ## 77 + num: 5000, avg: 15.47, stddev: 24.03, median 6, min 0, max 99 + 0.. 4: ####################################################### 1958 + 5.. 9: ##################################################### 1914 + 10.. 14: # 64 + 15.. 19: ## 75 + 20.. 24: # 64 + 25.. 29: # 71 + 30.. 34: ## 74 + 35.. 39: # 60 + 40.. 44: # 61 + 45.. 49: # 57 + 50.. 54: # 62 + 55.. 59: # 58 + 60.. 64: # 63 + 65.. 69: # 46 + 70.. 74: # 67 + 75.. 79: # 62 + 80.. 84: # 57 + 85.. 89: # 67 + 90.. 94: # 66 + 95.. 99: # 54 +++ Stats for list_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 7.47, stddev: 1.70, median 7, min 5, max 10 - 5: ##################################################### 848 - 6: #################################################### 829 - 7: ####################################################### 869 - 8: ##################################################### 839 - 9: ################################################# 787 - 10: #################################################### 828 + num: 5000, avg: 7.53, stddev: 1.71, median 8, min 5, max 10 + 5: #################################################### 814 + 6: #################################################### 809 + 7: ##################################################### 830 + 8: ###################################################### 845 + 9: ####################################################### 854 + 10: ###################################################### 848 +++ Stats for list_repeat len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -1193,63 +1219,63 @@ stats len: +++ Stats for array len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 381.73, stddev: 1276.71, median 9, min 0, max 9931 - 0.. 496: ####################################################### 4213 - 497.. 993: ###### 526 - 994..1490: 22 - 1491..1987: 14 - 1988..2484: 19 - 2485..2981: 14 - 2982..3478: 19 - 3479..3975: 15 - 3976..4472: 18 - 4473..4969: 14 - 4970..5466: 13 - 5467..5963: 11 - 5964..6460: 14 - 6461..6957: 18 - 6958..7454: 8 - 7455..7951: 15 - 7952..8448: 12 - 8449..8945: 9 - 8946..9442: 7 - 9443..9939: 19 + num: 5000, avg: 327.56, stddev: 1159.62, median 9, min 0, max 9916 + 0.. 495: ####################################################### 4285 + 496.. 991: ###### 509 + 992..1487: 21 + 1488..1983: 13 + 1984..2479: 13 + 2480..2975: 13 + 2976..3471: 10 + 3472..3967: 13 + 3968..4463: 10 + 4464..4959: 12 + 4960..5455: 7 + 5456..5951: 12 + 5952..6447: 11 + 6448..6943: 7 + 6944..7439: 9 + 7440..7935: 6 + 7936..8431: 16 + 8432..8927: 9 + 8928..9423: 13 + 9424..9919: 11 +++ Stats for small_array len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 16.26, stddev: 24.83, median 6, min 0, max 99 - 0.. 4: #################################################### 1868 - 5.. 9: ####################################################### 1967 - 10.. 14: # 66 - 15.. 19: # 62 - 20.. 24: # 70 - 25.. 29: # 59 - 30.. 34: # 62 - 35.. 39: # 62 - 40.. 44: ## 73 - 45.. 49: # 66 - 50.. 54: # 68 - 55.. 59: # 59 - 60.. 64: # 61 - 65.. 69: ## 75 - 70.. 74: # 56 - 75.. 79: # 64 - 80.. 84: # 46 - 85.. 89: ## 72 - 90.. 94: # 67 - 95.. 99: ## 77 + num: 5000, avg: 15.47, stddev: 24.03, median 6, min 0, max 99 + 0.. 4: ####################################################### 1958 + 5.. 9: ##################################################### 1914 + 10.. 14: # 64 + 15.. 19: ## 75 + 20.. 24: # 64 + 25.. 29: # 71 + 30.. 34: ## 74 + 35.. 39: # 60 + 40.. 44: # 61 + 45.. 49: # 57 + 50.. 54: # 62 + 55.. 59: # 58 + 60.. 64: # 63 + 65.. 69: # 46 + 70.. 74: # 67 + 75.. 79: # 62 + 80.. 84: # 57 + 85.. 89: # 67 + 90.. 94: # 66 + 95.. 99: # 54 +++ Stats for array_size len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats len: - num: 5000, avg: 7.47, stddev: 1.70, median 7, min 5, max 10 - 5: ##################################################### 848 - 6: #################################################### 829 - 7: ####################################################### 869 - 8: ##################################################### 839 - 9: ################################################# 787 - 10: #################################################### 828 + num: 5000, avg: 7.53, stddev: 1.71, median 8, min 5, max 10 + 5: #################################################### 814 + 6: #################################################### 809 + 7: ##################################################### 830 + 8: ###################################################### 845 + 9: ####################################################### 854 + 10: ###################################################### 848 +++ Stats for array_repeat len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -1449,27 +1475,27 @@ stats dist: +++ Stats for int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 100000, avg: -5866174995160813.00, stddev: 2658200940243709440.00, median -18644524111195217, min -4611457719403274307, max 4611628237031853985 - -4611457719403274307..-4150303421581517892: #################################################### 4943 - -4150303421581517891..-3689149123759761476: ##################################################### 5000 - -3689149123759761475..-3227994825938005060: ###################################################### 5080 - -3227994825938005059..-2766840528116248644: #################################################### 4931 - -2766840528116248643..-2305686230294492228: ##################################################### 5026 - -2305686230294492227..-1844531932472735812: ################################################### 4870 - -1844531932472735811..-1383377634650979396: ##################################################### 5017 - -1383377634650979395.. -922223336829222980: ####################################################### 5157 - -922223336829222979.. -461069039007466564: ###################################################### 5107 - -461069039007466563.. 85258814289852: ###################################################### 5089 - 85258814289853.. 461239556636046268: ##################################################### 5045 - 461239556636046269.. 922393854457802684: #################################################### 4958 - 922393854457802685.. 1383548152279559100: ##################################################### 5007 - 1383548152279559101.. 1844702450101315516: ##################################################### 5052 - 1844702450101315517.. 2305856747923071932: #################################################### 4951 - 2305856747923071933.. 2767011045744828348: ################################################### 4872 - 2767011045744828349.. 3228165343566584764: ################################################### 4845 - 3228165343566584765.. 3689319641388341180: ##################################################### 4990 - 3689319641388341181.. 4150473939210097596: ##################################################### 5046 - 4150473939210097597.. 4611628237031854012: ##################################################### 5014 + num: 100000, avg: 6739840024355437.00, stddev: 2654793546877646336.00, median 2435838602111153, min -4611682300221562449, max 4611492907363159042 + -4611682300221562449..-4150523539842326354: #################################################### 4927 + -4150523539842326353..-3689364779463090258: #################################################### 4923 + -3689364779463090257..-3228206019083854162: #################################################### 4923 + -3228206019083854161..-2767047258704618066: ##################################################### 4981 + -2767047258704618065..-2305888498325381970: ##################################################### 5010 + -2305888498325381969..-1844729737946145874: ##################################################### 5016 + -1844729737946145873..-1383570977566909778: #################################################### 4929 + -1383570977566909777.. -922412217187673682: ##################################################### 5045 + -922412217187673681.. -461253456808437586: ###################################################### 5081 + -461253456808437585.. -94696429201490: ####################################################### 5140 + -94696429201489.. 461064063950034606: ###################################################### 5110 + 461064063950034607.. 922222824329270702: ##################################################### 4998 + 922222824329270703.. 1383381584708506798: ##################################################### 4996 + 1383381584708506799.. 1844540345087742894: #################################################### 4915 + 1844540345087742895.. 2305699105466978990: ##################################################### 5014 + 2305699105466978991.. 2766857865846215086: ###################################################### 5072 + 2766857865846215087.. 3228016626225451182: #################################################### 4913 + 3228016626225451183.. 3689175386604687278: ###################################################### 5063 + 3689175386604687279.. 4150334146983923374: #################################################### 4909 + 4150334146983923375.. 4611492907363159470: ##################################################### 5035 +++ Stats for oneof int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -1697,33 +1723,33 @@ stats dist: 6.. 10: 0 ================================================================================ 1 warning(s) -failure (73 tests failed, 3 tests errored, ran 165 tests) +failure (74 tests failed, 3 tests errored, ran 166 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 1000, avg: -11617229187609574.00, stddev: 1819229268312887040.00, median 16, min -4603354806264772278, max 4611686018427387903 - -4603354806264772278..-4142602765030164279: ## 23 - -4142602765030164278..-3681850723795556279: ## 20 - -3681850723795556278..-3221098682560948279: ### 31 - -3221098682560948278..-2760346641326340279: ## 22 - -2760346641326340278..-2299594600091732279: ## 21 - -2299594600091732278..-1838842558857124279: ### 31 - -1838842558857124278..-1378090517622516279: ## 22 - -1378090517622516278.. -917338476387908279: ## 26 - -917338476387908278.. -456586435153300279: ## 20 - -456586435153300278.. 4165606081307721: ####################################################### 547 - 4165606081307722.. 464917647315915721: ## 21 - 464917647315915722.. 925669688550523721: ### 30 - 925669688550523722.. 1386421729785131721: # 15 - 1386421729785131722.. 1847173771019739721: ## 28 - 1847173771019739722.. 2307925812254347721: ## 22 - 2307925812254347722.. 2768677853488955721: ### 31 - 2768677853488955722.. 3229429894723563721: ## 28 - 3229429894723563722.. 3690181935958171721: # 19 - 3690181935958171722.. 4150933977192779721: ## 21 - 4150933977192779722.. 4611686018427387721: ## 21 - 4611686018427387722.. 4611686018427387903: 1 + num: 1000, avg: 48985084121559400.00, stddev: 1793541561270566400.00, median 9, min -4580864984167113344, max 4611686018427387903 + -4580864984167113344..-4121237434037388289: ## 23 + -4121237434037388288..-3661609883907663233: # 19 + -3661609883907663232..-3201982333777938177: ## 28 + -3201982333777938176..-2742354783648213121: ## 24 + -2742354783648213120..-2282727233518488065: ## 20 + -2282727233518488064..-1823099683388763009: # 17 + -1823099683388763008..-1363472133259037953: ## 21 + -1363472133259037952.. -903844583129312897: ## 23 + -903844583129312896.. -444217032999587841: ## 27 + -444217032999587840.. 15410517130137215: ####################################################### 546 + 15410517130137216.. 475038067259862271: ## 24 + 475038067259862272.. 934665617389587327: ## 25 + 934665617389587328.. 1394293167519312383: ## 27 + 1394293167519312384.. 1853920717649037439: ### 35 + 1853920717649037440.. 2313548267778762495: ## 27 + 2313548267778762496.. 2773175817908487551: ## 21 + 2773175817908487552.. 3232803368038212607: ## 29 + 3232803368038212608.. 3692430918167937663: ## 20 + 3692430918167937664.. 4152058468297662719: ## 22 + 4152058468297662720.. 4611686018427387775: ## 21 + 4611686018427387776.. 4611686018427387903: 1 ================================================================================ success (ran 1 tests) From 8224fa03bfc1a1dae25bb09b742f1b9ee1f163f5 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 5 Feb 2025 18:27:05 +0100 Subject: [PATCH 321/391] Add a CHANGELOG entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 747abe2a..6a28959b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## NEXT RELEASE +- Replace the `QCheck2` OCaml 4 `Random.State.split` hack with a faster one - Improve the `QCheck2.Gen.list` shrinker heuristic and utilize the improved shrinker in other `QCheck2` `{list,array,bytes,string,function}*` shrinkers - Use `split` and `copy` in `Random.State` underlying `QCheck2` to From 593c2812e24e6dd94ce38692d42f357bc2680fd9 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 7 Feb 2025 14:45:43 +0100 Subject: [PATCH 322/391] Unify QCheck2.list shrinking strategy for length 1-3, dropping each element in turn --- src/core/QCheck2.ml | 46 ++++++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index 7b3bda9b..b9e07c38 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -267,30 +267,38 @@ module Tree = struct | (0, _) | (_, []) -> pure [] | (n, (tree :: trees)) -> liftA2 List.cons tree (applicative_take (pred n) trees) + (** [drop_one l []] returns all versions of [l] with one element removed, for example + [drop_one [1;2;3] [] = [ [2;3]; [1;3]; [1;2] ]] *) + let rec drop_one (l : 'a list) (rev_prefix : 'a list) : 'a list list = match l with + | [] -> [] + | x::xs -> (List.rev rev_prefix @ xs) :: drop_one xs (x::rev_prefix) + let rec build_list_shrink_tree (l : 'a t list) : 'a list t Seq.t = match l with | [] -> Seq.empty - | [_] -> - fun () -> Seq.cons (Tree ([], Seq.empty)) (* [x] leaves only empty list to try *) - (children (sequence_list l)) () (* otherwise, reduce element(s) *) | _::_ -> fun () -> let len = List.length l in - let xs,ys = list_split l ((1 + len) / 2) [] in - let xs_roots = List.map root xs in - let ys_roots = List.map root ys in - (* Try reducing a list [1;2;3;4] in halves: [1;2] and [3;4] *) - Seq.cons (Tree (xs_roots, build_list_shrink_tree xs)) - (Seq.cons (Tree (ys_roots, build_list_shrink_tree ys)) - (fun () -> - (if len >= 4 - then (* Try dropping an element from either half: [2;3;4] and [1;2;4] *) - let rest = List.tl l in - let rest_roots = List.map root rest in - (Seq.cons (Tree (rest_roots, build_list_shrink_tree rest)) - (Seq.cons (Tree (xs_roots@(List.tl ys_roots), build_list_shrink_tree (xs@(List.tl ys)))) - (children (sequence_list l)))) (* at bottom: reduce elements *) - else - children (sequence_list l)) ())) () + if len < 4 then + let candidates = drop_one l [] in + List.fold_right (* try dropping each element in turn, starting with the list head *) + (fun cand acc -> Seq.cons (Tree (List.map root cand, build_list_shrink_tree cand)) acc) + candidates + (fun () -> children (sequence_list l) ()) () (* otherwise, reduce element(s) *) + else + let xs,ys = list_split l ((1 + len) / 2) [] in + let xs_roots = List.map root xs in + let ys_roots = List.map root ys in + (* Try reducing a list [1;2;3;4] in halves: [1;2] and [3;4] *) + Seq.cons (Tree (xs_roots, build_list_shrink_tree xs)) + (Seq.cons (Tree (ys_roots, build_list_shrink_tree ys)) + (fun () -> + (* Try dropping an element from either half: [2;3;4] and [1;2;4] *) + let rest = List.tl l in + let rest_roots = List.map root rest in + (Seq.cons (Tree (rest_roots, build_list_shrink_tree rest)) + (Seq.cons (Tree (xs_roots@(List.tl ys_roots), build_list_shrink_tree (xs@(List.tl ys)))) + (fun () -> children (sequence_list l) ()))) (* at bottom: reduce elements *) + () )) () end module Gen = struct From d161debe52cabff8acbd1d701da81c05b4590b1f Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 7 Feb 2025 14:53:52 +0100 Subject: [PATCH 323/391] Update QCheck2 unit shrink test wrt changes --- test/core/QCheck2_unit_tests.ml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/test/core/QCheck2_unit_tests.ml b/test/core/QCheck2_unit_tests.ml index 1278284e..9d89f474 100644 --- a/test/core/QCheck2_unit_tests.ml +++ b/test/core/QCheck2_unit_tests.ml @@ -216,7 +216,7 @@ module Shrink = struct Alcotest.(check' (list (list int))) ~msg:"[0; 5; 3; 7] on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3345) (list (int_bound 10))) |> repeated_success) - ~expected:[ [0; 5; 3; 7]; [0; 5]; [0]; []; ]) + ~expected:[ [0; 5; 3; 7]; [0; 5]; [5]; []; ]) else (Alcotest.(check' (list (list int))) ~msg:"[1; 10; 10; 7; 3] on repeated failure" @@ -230,7 +230,7 @@ module Shrink = struct Alcotest.(check' (list (list int))) ~msg:"[1; 10; 10; 7; 3] on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3347) (list (int_bound 10))) |> repeated_success) - ~expected:[ [1; 10; 10; 7; 3]; [1; 10; 10]; [1; 10]; [1]; []; ]) + ~expected:[ [1; 10; 10; 7; 3]; [1; 10; 10]; [10; 10]; [10]; []; ]) let test_small_list_int () = if ocaml_major_version < 5 @@ -245,7 +245,7 @@ module Shrink = struct Alcotest.(check' (list (list int))) ~msg:"[0; 5; 3; 7] on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3345) (small_list (int_bound 10))) |> repeated_success) - ~expected:[ [0; 5; 3; 7]; [0; 5]; [0]; []; ]) + ~expected:[ [0; 5; 3; 7]; [0; 5]; [5]; []; ]) else (Alcotest.(check' (list (list int))) ~msg:"[1; 10; 10; 7; 3] on repeated failure" @@ -259,7 +259,7 @@ module Shrink = struct Alcotest.(check' (list (list int))) ~msg:"[1; 10; 10; 7; 3] on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3347) (small_list (int_bound 10))) |> repeated_success) - ~expected:[ [1; 10; 10; 7; 3]; [1; 10; 10]; [1; 10]; [1]; []; ]) + ~expected:[ [1; 10; 10; 7; 3]; [1; 10; 10]; [10; 10]; [10]; []; ]) let test_array_size_int () = if ocaml_major_version < 5 @@ -304,7 +304,7 @@ module Shrink = struct Alcotest.(check' (list (array int))) ~msg:"[|0; 5; 3; 7|] on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3345) (array (int_bound 10))) |> repeated_success) - ~expected:[ [|0; 5; 3; 7|]; [|0; 5|]; [|0|]; [||]; ]) + ~expected:[ [|0; 5; 3; 7|]; [|0; 5|]; [|5|]; [||]; ]) else (Alcotest.(check' (list (array int))) ~msg:"[|1; 10; 10; 7; 3|] on repeated failure" @@ -318,7 +318,7 @@ module Shrink = struct Alcotest.(check' (list (array int))) ~msg:"[|1; 10; 10; 7; 3|] on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3347) (array (int_bound 10))) |> repeated_success) - ~expected:[ [|1; 10; 10; 7; 3|]; [|1; 10; 10|]; [|1; 10|]; [|1|]; [||]; ]) + ~expected:[ [|1; 10; 10; 7; 3|]; [|1; 10; 10|]; [|10; 10|]; [|10|]; [||]; ]) let test_small_array_int () = if ocaml_major_version < 5 @@ -333,7 +333,7 @@ module Shrink = struct Alcotest.(check' (list (array int))) ~msg:"[|0; 5; 3; 7|] on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3345) (small_array (int_bound 10))) |> repeated_success) - ~expected:[ [|0; 5; 3; 7|]; [|0; 5|]; [|0|]; [||]; ]) + ~expected:[ [|0; 5; 3; 7|]; [|0; 5|]; [|5|]; [||]; ]) else (Alcotest.(check' (list (array int))) ~msg:"[|1; 10; 10; 7; 3|] on repeated failure" @@ -347,7 +347,7 @@ module Shrink = struct Alcotest.(check' (list (array int))) ~msg:"[|1; 10; 10; 7; 3|] on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3347) (small_array (int_bound 10))) |> repeated_success) - ~expected:[ [|1; 10; 10; 7; 3|]; [|1; 10; 10|]; [|1; 10|]; [|1|]; [||]; ]) + ~expected:[ [|1; 10; 10; 7; 3|]; [|1; 10; 10|]; [|10; 10|]; [|10|]; [||]; ]) let test_bytes_size () = if ocaml_major_version < 5 @@ -400,7 +400,7 @@ module Shrink = struct Alcotest.(check' (list bytes)) ~msg:"\"9\007\127\250\" on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3345) bytes) |> repeated_success) - ~expected:(List.map Bytes.of_string [ "9\007\127\250"; "9\007"; "9"; ""; ])) + ~expected:(List.map Bytes.of_string [ "9\007\127\250"; "9\007"; "\007"; ""; ])) else (Alcotest.(check' (list bytes)) ~msg:"\"\253NS\173\" on repeated failure" @@ -414,7 +414,7 @@ module Shrink = struct Alcotest.(check' (list bytes)) ~msg:"\"\253NS\173\" on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3349) bytes) |> repeated_success) - ~expected:(List.map Bytes.of_string [ "\253NS\173"; "\253N"; "\253"; ""; ])) + ~expected:(List.map Bytes.of_string [ "\253NS\173"; "\253N"; "N"; ""; ])) let test_bytes_small () = if ocaml_major_version < 5 @@ -431,7 +431,7 @@ module Shrink = struct Alcotest.(check' (list bytes)) ~msg:"\"9\007\127\250\" on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3345) bytes_small) |> repeated_success) - ~expected:(List.map Bytes.of_string [ "9\007\127\250"; "9\007"; "9"; ""; ])) + ~expected:(List.map Bytes.of_string [ "9\007\127\250"; "9\007"; "\007"; ""; ])) else (Alcotest.(check' (list bytes)) ~msg:"\"\253NS\173\" on repeated failure" @@ -445,7 +445,7 @@ module Shrink = struct Alcotest.(check' (list bytes)) ~msg:"\"\253NS\173\" on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3349) bytes_small) |> repeated_success) - ~expected:(List.map Bytes.of_string [ "\253NS\173"; "\253N"; "\253"; ""; ])) + ~expected:(List.map Bytes.of_string [ "\253NS\173"; "\253N"; "N"; ""; ])) let test_string_size () = if ocaml_major_version < 5 @@ -495,7 +495,7 @@ module Shrink = struct Alcotest.(check' (list string)) ~msg:"\"9\007\127\250\" on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3345) string) |> repeated_success) - ~expected:[ "9\007\127\250"; "9\007"; "9"; ""; ]) + ~expected:[ "9\007\127\250"; "9\007"; "\007"; ""; ]) else (Alcotest.(check' (list string)) ~msg:"\"\253NS\173\" on repeated failure" @@ -508,7 +508,7 @@ module Shrink = struct Alcotest.(check' (list string)) ~msg:"\"\253NS\173\" on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3349) string) |> repeated_success) - ~expected:[ "\253NS\173"; "\253N"; "\253"; ""; ]) + ~expected:[ "\253NS\173"; "\253N"; "N"; ""; ]) let test_string_small () = if ocaml_major_version < 5 @@ -524,7 +524,7 @@ module Shrink = struct Alcotest.(check' (list string)) ~msg:"\"u\238\154I\" on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3345) string_small) |> repeated_success) - ~expected:[ "9\007\127\250"; "9\007"; "9"; ""; ]) + ~expected:[ "9\007\127\250"; "9\007"; "\007"; ""; ]) else (Alcotest.(check' (list string)) ~msg:"\"\253NS\173\" on repeated failure" @@ -537,7 +537,7 @@ module Shrink = struct Alcotest.(check' (list string)) ~msg:"\"\253NS\173\" on repeated success" ~actual:(Gen.(generate_tree ~rand:(rand_init 3349) string_small) |> repeated_success) - ~expected:[ "\253NS\173"; "\253N"; "\253"; ""; ]) + ~expected:[ "\253NS\173"; "\253N"; "N"; ""; ]) let tests = ("Shrink", Alcotest.[ test_case "int_towards" `Quick test_int_towards; From c3e0221d9ab285c906a6149d1a9c52bc042cc686 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 7 Feb 2025 14:59:42 +0100 Subject: [PATCH 324/391] Update QCheck2 expect tests wrt changes --- .../QCheck2_expect_test.expected.ocaml4.32 | 57 ++++++++++--------- .../QCheck2_expect_test.expected.ocaml4.64 | 55 +++++++++--------- .../QCheck2_expect_test.expected.ocaml5.32 | 40 ++++++------- .../QCheck2_expect_test.expected.ocaml5.64 | 40 ++++++------- 4 files changed, 101 insertions(+), 91 deletions(-) diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.32 b/test/core/QCheck2_expect_test.expected.ocaml4.32 index 80ab3d81..d27af061 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.32 @@ -73,8 +73,9 @@ random seed: 1234 [0; 13; 4; 6; 14; 6; 47; 3] [0; 13; 4; 6] [0; 13] -[0] +[13] [] +[0] [0; 13; 4; 6; 14; 6; 47; 3; 4; 3; 6; 6; 9; 4; 3; 65; 2; 4; 55; 2; 4; 87; 9; 5; 35; 73; 9; 9; 2; 74; 5; 9; 10; 93; 2; 7; 1; 4; 6; 91; 8; 8; 2; 9; 47; 6; 26; 3; 60; 1; 0; 5; 26; 4; 28; 6; 0; 5; 88; 3; 7] [0; 13; 4; 6; 14; 6; 47; 3; 4; 3; 6; 6; 9; 4; 3; 65; 2; 4; 55; 2; 4; 87; 9; 5; 35; 73; 9; 9; 2; 74; 5] [0; 13; 4; 6; 14; 6; 47; 3; 4; 3; 6; 6; 9; 4; 3; 65] @@ -89,14 +90,16 @@ random seed: 1234 [6; 47; 3] [6; 14; 6; 47; 3] [6; 14; 6] -[6; 14] +[14; 6] +[6; 6] +[6] [6] -[0; 14; 6] -[3; 14; 6] -[5; 14; 6] -[6; 0; 6] -[0; 0; 6] -[0; 0; 0] +[0; 6] +[3; 6] +[5; 6] +[6; 0] +[6; 3] +[6; 5] --- Failure -------------------------------------------------------------------- @@ -308,15 +311,15 @@ Test bytes never has a \000 char failed (13 shrink steps): --- Failure -------------------------------------------------------------------- -Test bytes never has a \255 char failed (5 shrink steps): +Test bytes never has a \255 char failed (6 shrink steps): "\255" --- Failure -------------------------------------------------------------------- -Test bytes have unique chars failed (16 shrink steps): +Test bytes have unique chars failed (13 shrink steps): -"aaa" +"**" --- Failure -------------------------------------------------------------------- @@ -332,15 +335,15 @@ Test string never has a \000 char failed (13 shrink steps): --- Failure -------------------------------------------------------------------- -Test string never has a \255 char failed (5 shrink steps): +Test string never has a \255 char failed (6 shrink steps): "\255" --- Failure -------------------------------------------------------------------- -Test strings have unique chars failed (16 shrink steps): +Test strings have unique chars failed (13 shrink steps): -"aaa" +"**" --- Failure -------------------------------------------------------------------- @@ -386,13 +389,13 @@ Test pairs sum to less than 128 failed (26 shrink steps): --- Failure -------------------------------------------------------------------- -Test pairs lists rev concat failed (34 shrink steps): +Test pairs lists rev concat failed (30 shrink steps): ([0], [1]) --- Failure -------------------------------------------------------------------- -Test pairs lists no overlap failed (12 shrink steps): +Test pairs lists no overlap failed (13 shrink steps): ([0], [0]) @@ -506,7 +509,7 @@ Test bind list_size constant failed (12 shrink steps): --- Failure -------------------------------------------------------------------- -Test lists are empty failed (6 shrink steps): +Test lists are empty failed (7 shrink steps): [0] @@ -530,9 +533,9 @@ Test lists shorter than 4332 failed (4022 shrink steps): --- Failure -------------------------------------------------------------------- -Test lists have unique elems failed (10 shrink steps): +Test lists have unique elems failed (8 shrink steps): -[0; 0; 0] +[6; 6] --- Failure -------------------------------------------------------------------- @@ -572,31 +575,31 @@ Test sum list = 0 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int failed (53 shrink steps): +Test fail_pred_map_commute_int failed (55 shrink steps): ([0], {0 -> 5; _ -> 0}, {5 -> true; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int32 failed (54 shrink steps): +Test fail_pred_map_commute_int32 failed (57 shrink steps): ([0l], {0l -> -15l; _ -> 0l}, {-15l -> true; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int64 failed (105 shrink steps): +Test fail_pred_map_commute_int64 failed (107 shrink steps): ([0L], {0L -> -71L; _ -> 0L}, {-71L -> true; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_strings failed (0 shrink steps): +Test fail_pred_strings failed (1 shrink steps): -{"some random string" -> true; "some other string" -> false; _ -> false} +{"some random string" -> true; _ -> false} --- Failure -------------------------------------------------------------------- -Test fold_left fold_right failed (17 shrink steps): +Test fold_left fold_right failed (20 shrink steps): (0, [1], {(0, 1) -> 1; _ -> 0}) @@ -609,9 +612,9 @@ l=[1], fold_left=0, fold_right=1 --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried failed (14 shrink steps): +Test fold_left fold_right uncurried failed (17 shrink steps): -({(9, 6) -> 0; (1, 5) -> 0; (4, 8) -> 1; (9, 8) -> 0; _ -> 0}, 8, [4]) +({(9, 6) -> 0; (1, 5) -> 0; (4, 8) -> 0; (9, 8) -> 1; _ -> 0}, 8, [9]) --- Failure -------------------------------------------------------------------- diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.64 b/test/core/QCheck2_expect_test.expected.ocaml4.64 index bcbf02ef..cc4a28e8 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.64 @@ -135,8 +135,9 @@ random seed: 1234 [0; 13; 4; 6; 14; 6; 47; 3] [0; 13; 4; 6] [0; 13] -[0] +[13] [] +[0] [0; 13; 4; 6; 14; 6; 47; 3; 4; 3; 6; 6; 9; 4; 3; 65; 2; 4; 55; 2; 4; 87; 9; 5; 35; 73; 9; 9; 2; 74; 5; 9; 10; 93; 2; 7; 1; 4; 6; 91; 8; 8; 2; 9; 47; 6; 26; 3; 60; 1; 0; 5; 26; 4; 28; 6; 0; 5; 88; 3; 7] [0; 13; 4; 6; 14; 6; 47; 3; 4; 3; 6; 6; 9; 4; 3; 65; 2; 4; 55; 2; 4; 87; 9; 5; 35; 73; 9; 9; 2; 74; 5] [0; 13; 4; 6; 14; 6; 47; 3; 4; 3; 6; 6; 9; 4; 3; 65] @@ -151,14 +152,16 @@ random seed: 1234 [6; 47; 3] [6; 14; 6; 47; 3] [6; 14; 6] -[6; 14] +[14; 6] +[6; 6] +[6] [6] -[0; 14; 6] -[3; 14; 6] -[5; 14; 6] -[6; 0; 6] -[0; 0; 6] -[0; 0; 0] +[0; 6] +[3; 6] +[5; 6] +[6; 0] +[6; 3] +[6; 5] --- Failure -------------------------------------------------------------------- @@ -370,15 +373,15 @@ Test bytes never has a \000 char failed (13 shrink steps): --- Failure -------------------------------------------------------------------- -Test bytes never has a \255 char failed (5 shrink steps): +Test bytes never has a \255 char failed (6 shrink steps): "\255" --- Failure -------------------------------------------------------------------- -Test bytes have unique chars failed (16 shrink steps): +Test bytes have unique chars failed (13 shrink steps): -"aaa" +"**" --- Failure -------------------------------------------------------------------- @@ -394,15 +397,15 @@ Test string never has a \000 char failed (13 shrink steps): --- Failure -------------------------------------------------------------------- -Test string never has a \255 char failed (5 shrink steps): +Test string never has a \255 char failed (6 shrink steps): "\255" --- Failure -------------------------------------------------------------------- -Test strings have unique chars failed (16 shrink steps): +Test strings have unique chars failed (13 shrink steps): -"aaa" +"**" --- Failure -------------------------------------------------------------------- @@ -454,7 +457,7 @@ Test pairs lists rev concat failed (66 shrink steps): --- Failure -------------------------------------------------------------------- -Test pairs lists no overlap failed (12 shrink steps): +Test pairs lists no overlap failed (13 shrink steps): ([0], [0]) @@ -568,7 +571,7 @@ Test bind list_size constant failed (12 shrink steps): --- Failure -------------------------------------------------------------------- -Test lists are empty failed (6 shrink steps): +Test lists are empty failed (7 shrink steps): [0] @@ -592,9 +595,9 @@ Test lists shorter than 4332 failed (4022 shrink steps): --- Failure -------------------------------------------------------------------- -Test lists have unique elems failed (10 shrink steps): +Test lists have unique elems failed (8 shrink steps): -[0; 0; 0] +[6; 6] --- Failure -------------------------------------------------------------------- @@ -634,31 +637,31 @@ Test sum list = 0 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int failed (105 shrink steps): +Test fail_pred_map_commute_int failed (107 shrink steps): ([0], {0 -> 29; _ -> 0}, {29 -> true; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int32 failed (54 shrink steps): +Test fail_pred_map_commute_int32 failed (57 shrink steps): ([0l], {0l -> -15l; _ -> 0l}, {-15l -> true; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int64 failed (105 shrink steps): +Test fail_pred_map_commute_int64 failed (107 shrink steps): ([0L], {0L -> -71L; _ -> 0L}, {-71L -> true; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_strings failed (0 shrink steps): +Test fail_pred_strings failed (1 shrink steps): -{"some random string" -> true; "some other string" -> false; _ -> false} +{"some random string" -> true; _ -> false} --- Failure -------------------------------------------------------------------- -Test fold_left fold_right failed (17 shrink steps): +Test fold_left fold_right failed (20 shrink steps): (0, [1], {(0, 1) -> 1; _ -> 0}) @@ -671,9 +674,9 @@ l=[1], fold_left=0, fold_right=1 --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried failed (14 shrink steps): +Test fold_left fold_right uncurried failed (17 shrink steps): -({(9, 6) -> 0; (1, 5) -> 0; (4, 8) -> 1; (9, 8) -> 0; _ -> 0}, 8, [4]) +({(9, 6) -> 0; (1, 5) -> 0; (4, 8) -> 0; (9, 8) -> 1; _ -> 0}, 8, [9]) --- Failure -------------------------------------------------------------------- diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.32 b/test/core/QCheck2_expect_test.expected.ocaml5.32 index f14668fe..2207d60c 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.32 @@ -70,17 +70,19 @@ random seed: 1234 [0; 1; 80; 0; 9; 2; 3] [0; 1; 80; 0] [0; 1] -[0] +[1] [] +[0] [0; 1; 80; 0; 9; 2; 3] [0; 1; 80; 0] [0; 1] [80; 0] [1; 80; 0] [0; 1; 0] -[0; 1] +[1; 0] +[0; 0] +[0] [0] -[0; 0; 0] --- Failure -------------------------------------------------------------------- @@ -298,9 +300,9 @@ Test bytes never has a \255 char failed (5 shrink steps): --- Failure -------------------------------------------------------------------- -Test bytes have unique chars failed (29 shrink steps): +Test bytes have unique chars failed (27 shrink steps): -"aaa" +"\253\253" --- Failure -------------------------------------------------------------------- @@ -322,9 +324,9 @@ Test string never has a \255 char failed (5 shrink steps): --- Failure -------------------------------------------------------------------- -Test strings have unique chars failed (29 shrink steps): +Test strings have unique chars failed (27 shrink steps): -"aaa" +"\253\253" --- Failure -------------------------------------------------------------------- @@ -376,7 +378,7 @@ Test pairs lists rev concat failed (47 shrink steps): --- Failure -------------------------------------------------------------------- -Test pairs lists no overlap failed (17 shrink steps): +Test pairs lists no overlap failed (18 shrink steps): ([0], [0]) @@ -490,7 +492,7 @@ Test bind list_size constant failed (12 shrink steps): --- Failure -------------------------------------------------------------------- -Test lists are empty failed (3 shrink steps): +Test lists are empty failed (4 shrink steps): [0] @@ -516,7 +518,7 @@ Test lists shorter than 4332 failed (4005 shrink steps): Test lists have unique elems failed (3 shrink steps): -[0; 0; 0] +[0; 0] --- Failure -------------------------------------------------------------------- @@ -556,31 +558,31 @@ Test sum list = 0 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int failed (53 shrink steps): +Test fail_pred_map_commute_int failed (54 shrink steps): ([0], {0 -> 74; _ -> 0}, {74 -> true; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int32 failed (52 shrink steps): +Test fail_pred_map_commute_int32 failed (53 shrink steps): ([0l], {0l -> 99l; _ -> 0l}, {99l -> true; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int64 failed (108 shrink steps): +Test fail_pred_map_commute_int64 failed (109 shrink steps): ([0L], {0L -> 1L; _ -> 0L}, {1L -> true; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_strings failed (0 shrink steps): +Test fail_pred_strings failed (1 shrink steps): -{"some random string" -> true; "some other string" -> false; _ -> false} +{"some random string" -> true; _ -> false} --- Failure -------------------------------------------------------------------- -Test fold_left fold_right failed (18 shrink steps): +Test fold_left fold_right failed (24 shrink steps): (0, [1], {(0, 1) -> 1; _ -> 0}) @@ -593,13 +595,13 @@ l=[1], fold_left=0, fold_right=1 --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried failed (114 shrink steps): +Test fold_left fold_right uncurried failed (115 shrink steps): ({(6, 0) -> 1; _ -> 0}, 0, [6]) --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried fun last failed (21 shrink steps): +Test fold_left fold_right uncurried fun last failed (19 shrink steps): (0, [1], {(0, 1) -> 1; _ -> 0}) @@ -607,7 +609,7 @@ Test fold_left fold_right uncurried fun last failed (21 shrink steps): Test fold_left test, fun first failed (50 shrink steps): -({("", 5) -> "a"; _ -> ""}, "", [0; 0; 5], [0]) +({("", 5) -> "a"; _ -> ""}, "", [0; 5], [0]) --- Failure -------------------------------------------------------------------- diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.64 b/test/core/QCheck2_expect_test.expected.ocaml5.64 index 33fb14d8..9205829a 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.64 @@ -132,17 +132,19 @@ random seed: 1234 [0; 1; 80; 0; 9; 2; 3] [0; 1; 80; 0] [0; 1] -[0] +[1] [] +[0] [0; 1; 80; 0; 9; 2; 3] [0; 1; 80; 0] [0; 1] [80; 0] [1; 80; 0] [0; 1; 0] -[0; 1] +[1; 0] +[0; 0] +[0] [0] -[0; 0; 0] --- Failure -------------------------------------------------------------------- @@ -360,9 +362,9 @@ Test bytes never has a \255 char failed (5 shrink steps): --- Failure -------------------------------------------------------------------- -Test bytes have unique chars failed (29 shrink steps): +Test bytes have unique chars failed (27 shrink steps): -"aaa" +"\253\253" --- Failure -------------------------------------------------------------------- @@ -384,9 +386,9 @@ Test string never has a \255 char failed (5 shrink steps): --- Failure -------------------------------------------------------------------- -Test strings have unique chars failed (29 shrink steps): +Test strings have unique chars failed (27 shrink steps): -"aaa" +"\253\253" --- Failure -------------------------------------------------------------------- @@ -438,7 +440,7 @@ Test pairs lists rev concat failed (79 shrink steps): --- Failure -------------------------------------------------------------------- -Test pairs lists no overlap failed (17 shrink steps): +Test pairs lists no overlap failed (18 shrink steps): ([0], [0]) @@ -552,7 +554,7 @@ Test bind list_size constant failed (12 shrink steps): --- Failure -------------------------------------------------------------------- -Test lists are empty failed (3 shrink steps): +Test lists are empty failed (4 shrink steps): [0] @@ -578,7 +580,7 @@ Test lists shorter than 4332 failed (4005 shrink steps): Test lists have unique elems failed (3 shrink steps): -[0; 0; 0] +[0; 0] --- Failure -------------------------------------------------------------------- @@ -618,31 +620,31 @@ Test sum list = 0 failed (0 shrink steps): --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int failed (108 shrink steps): +Test fail_pred_map_commute_int failed (109 shrink steps): ([0], {0 -> 1; _ -> 0}, {1 -> true; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int32 failed (52 shrink steps): +Test fail_pred_map_commute_int32 failed (53 shrink steps): ([0l], {0l -> 99l; _ -> 0l}, {99l -> true; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_map_commute_int64 failed (108 shrink steps): +Test fail_pred_map_commute_int64 failed (109 shrink steps): ([0L], {0L -> 1L; _ -> 0L}, {1L -> true; _ -> false}) --- Failure -------------------------------------------------------------------- -Test fail_pred_strings failed (0 shrink steps): +Test fail_pred_strings failed (1 shrink steps): -{"some random string" -> true; "some other string" -> false; _ -> false} +{"some random string" -> true; _ -> false} --- Failure -------------------------------------------------------------------- -Test fold_left fold_right failed (18 shrink steps): +Test fold_left fold_right failed (24 shrink steps): (0, [1], {(0, 1) -> 1; _ -> 0}) @@ -655,13 +657,13 @@ l=[1], fold_left=0, fold_right=1 --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried failed (114 shrink steps): +Test fold_left fold_right uncurried failed (115 shrink steps): ({(6, 0) -> 1; _ -> 0}, 0, [6]) --- Failure -------------------------------------------------------------------- -Test fold_left fold_right uncurried fun last failed (21 shrink steps): +Test fold_left fold_right uncurried fun last failed (19 shrink steps): (0, [1], {(0, 1) -> 1; _ -> 0}) @@ -669,7 +671,7 @@ Test fold_left fold_right uncurried fun last failed (21 shrink steps): Test fold_left test, fun first failed (50 shrink steps): -({("", 5) -> "a"; _ -> ""}, "", [0; 0; 5], [0]) +({("", 5) -> "a"; _ -> ""}, "", [0; 5], [0]) --- Failure -------------------------------------------------------------------- From e0eb09bb4e39357b95e70eb52f523f741c1cf2ce Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 7 Feb 2025 15:12:42 +0100 Subject: [PATCH 325/391] Add CHANGELOG entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a28959b..b66a1cd0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## NEXT RELEASE +- Adjust the `QCheck2.Gen.list` shrinker to produce minimal counterexamples at size 3 too - Replace the `QCheck2` OCaml 4 `Random.State.split` hack with a faster one - Improve the `QCheck2.Gen.list` shrinker heuristic and utilize the improved shrinker in other `QCheck2` `{list,array,bytes,string,function}*` shrinkers From a91babc1933acb9a3723c394da141b80fba0cb09 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 14 Feb 2025 18:45:07 +0100 Subject: [PATCH 326/391] Add optional speed_level parameter to QCheck_alcotest.to_alcotest --- src/alcotest/QCheck_alcotest.ml | 6 +++--- src/alcotest/QCheck_alcotest.mli | 13 +++++++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/alcotest/QCheck_alcotest.ml b/src/alcotest/QCheck_alcotest.ml index d2f26152..3f0b8b8a 100644 --- a/src/alcotest/QCheck_alcotest.ml +++ b/src/alcotest/QCheck_alcotest.ml @@ -34,8 +34,8 @@ let long_ = lazy ( let to_alcotest ?(colors=false) ?(verbose=Lazy.force verbose_) ?(long=Lazy.force long_) - ?(debug_shrink = None) ?debug_shrink_list ?(rand=default_rand()) - (t:T.t) = + ?(debug_shrink = None) ?debug_shrink_list ?(speed_level = `Slow) + ?(rand=default_rand()) (t:T.t) = let T.Test cell = t in let handler name cell r = match r, debug_shrink with @@ -56,4 +56,4 @@ let to_alcotest let call = Raw.callback ~colors ~verbose ~print_res:true ~print in T.check_cell_exn ~long ~call ~handler ~rand cell in - ((name, `Slow, run) : unit Alcotest.test_case) + ((name, speed_level, run) : unit Alcotest.test_case) diff --git a/src/alcotest/QCheck_alcotest.mli b/src/alcotest/QCheck_alcotest.mli index bb7c2394..9528087b 100644 --- a/src/alcotest/QCheck_alcotest.mli +++ b/src/alcotest/QCheck_alcotest.mli @@ -15,15 +15,20 @@ val to_alcotest : ?colors:bool -> ?verbose:bool -> ?long:bool -> ?debug_shrink:(out_channel option) -> ?debug_shrink_list:(string list) -> - ?rand:Random.State.t -> + ?speed_level:Alcotest.speed_level -> ?rand:Random.State.t -> QCheck2.Test.t -> unit Alcotest.test_case (** Convert a qcheck test into an alcotest test. - In addition to the environment variables mentioned above, you can control - the behavior of QCheck tests using optional parameters that behave in the - same way as the parameters of {!QCheck_base_runner.run_tests}. + The optional [speed_level] is [`Slow] by default, meaning Alcotest can skip + such a test when the [-q] flag is passed. Passing [`Quick] instead means the + test is always run. + + In addition to [speed_level] and the environment variables mentioned above, + you can control the behavior of QCheck tests using optional parameters that + behave in the same way as the parameters of {!QCheck_base_runner.run_tests}. @since 0.9 @since 0.9 parameters [verbose], [long], [rand] @since 0.19 parameters [colors], [debug_shrink], [debug_shrink_list] + @since NEXT_RELEASE parameter [speed_level] *) From f415c8cfc0a55b096350f0f15a9aa9de2fd101cf Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 14 Feb 2025 18:58:06 +0100 Subject: [PATCH 327/391] Add a CHANGELOG entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b66a1cd0..6cb72d69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## NEXT RELEASE +- [qcheck-alcotest] Add an optional `speed_level` parameter to `to_alcotest` - Adjust the `QCheck2.Gen.list` shrinker to produce minimal counterexamples at size 3 too - Replace the `QCheck2` OCaml 4 `Random.State.split` hack with a faster one - Improve the `QCheck2.Gen.list` shrinker heuristic and utilize the improved From 98c8ecb642ca601ea8560e9d2c7cfdc0c1bc0926 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 17 Feb 2025 16:31:23 +0100 Subject: [PATCH 328/391] Prepare for 0.24 release --- CHANGELOG.md | 2 +- qcheck-alcotest.opam | 2 +- qcheck-core.opam | 2 +- qcheck-ounit.opam | 2 +- qcheck.opam | 2 +- src/alcotest/QCheck_alcotest.mli | 2 +- src/core/QCheck.mli | 22 +++++++++++----------- src/core/QCheck2.mli | 14 +++++++------- 8 files changed, 24 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6cb72d69..402f5c1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changes -## NEXT RELEASE +## 0.24 - [qcheck-alcotest] Add an optional `speed_level` parameter to `to_alcotest` - Adjust the `QCheck2.Gen.list` shrinker to produce minimal counterexamples at size 3 too diff --git a/qcheck-alcotest.opam b/qcheck-alcotest.opam index 7e13ec71..bfb93af7 100644 --- a/qcheck-alcotest.opam +++ b/qcheck-alcotest.opam @@ -5,7 +5,7 @@ homepage: "https://github.com/c-cube/qcheck/" license: "BSD-2-Clause" synopsis: "Alcotest backend for qcheck" doc: ["http://c-cube.github.io/qcheck/"] -version: "0.23" +version: "0.24" tags: [ "test" "quickcheck" diff --git a/qcheck-core.opam b/qcheck-core.opam index 4b7dd673..c931abe1 100644 --- a/qcheck-core.opam +++ b/qcheck-core.opam @@ -5,7 +5,7 @@ homepage: "https://github.com/c-cube/qcheck/" license: "BSD-2-Clause" synopsis: "Core qcheck library" doc: ["http://c-cube.github.io/qcheck/"] -version: "0.23" +version: "0.24" tags: [ "test" "property" diff --git a/qcheck-ounit.opam b/qcheck-ounit.opam index f6b7235e..80493392 100644 --- a/qcheck-ounit.opam +++ b/qcheck-ounit.opam @@ -5,7 +5,7 @@ license: "BSD-2-Clause" homepage: "https://github.com/c-cube/qcheck/" doc: ["http://c-cube.github.io/qcheck/"] synopsis: "OUnit backend for qcheck" -version: "0.23" +version: "0.24" tags: [ "qcheck" "quickcheck" diff --git a/qcheck.opam b/qcheck.opam index c828bb39..9fa4ec93 100644 --- a/qcheck.opam +++ b/qcheck.opam @@ -5,7 +5,7 @@ synopsis: "Compatibility package for qcheck" homepage: "https://github.com/c-cube/qcheck/" license: "BSD-2-Clause" doc: ["http://c-cube.github.io/qcheck/"] -version: "0.23" +version: "0.24" tags: [ "test" "property" diff --git a/src/alcotest/QCheck_alcotest.mli b/src/alcotest/QCheck_alcotest.mli index 9528087b..54900e7f 100644 --- a/src/alcotest/QCheck_alcotest.mli +++ b/src/alcotest/QCheck_alcotest.mli @@ -30,5 +30,5 @@ val to_alcotest : @since 0.9 @since 0.9 parameters [verbose], [long], [rand] @since 0.19 parameters [colors], [debug_shrink], [debug_shrink_list] - @since NEXT_RELEASE parameter [speed_level] + @since 0.24 parameter [speed_level] *) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index d2dd5213..f8146755 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -339,11 +339,11 @@ module Gen : sig val int32 : int32 t (** Generates [int32] values uniformly. - @since NEXT_RELEASE *) + @since 0.24 *) val int64 : int64 t (** Generates [int64] values uniformly. - @since NEXT_RELEASE *) + @since 0.24 *) val ui32 : int32 t (** Generates [int32] values. @@ -392,7 +392,7 @@ module Gen : sig @param ratio a float between [0.] and [1.] indicating the probability of a sample to be [Ok _] rather than [Error _]. - @since NEXT_RELEASE + @since 0.24 *) val char : char t @@ -677,11 +677,11 @@ module Print : sig val int32 : int32 t (** 32-bit integer printer. - @since NEXT_RELEASE *) + @since 0.24 *) val int64 : int64 t (** 64-bit integer printer. - @since NEXT_RELEASE *) + @since 0.24 *) val bool : bool t (** Boolean printer. *) @@ -699,7 +699,7 @@ module Print : sig val result : 'a t -> 'e t -> ('a, 'e) result t (** Result printer. - @since NEXT_RELEASE *) + @since 0.24 *) val pair : 'a t -> 'b t -> ('a*'b) t (** Pair printer. Expects printers for each component. *) @@ -902,7 +902,7 @@ module Shrink : sig val result : 'a t -> 'e t -> ('a, 'e) result t (** result shrinker. [result ashk eshk] reduces [Ok a] values using [ashk] and [Error e] values using [eshk]. - @since NEXT_RELEASE *) + @since 0.24 *) val bytes : ?shrink:(char t) -> bytes t (** bytes shrinker. Shrinks towards shorter byte strings. @@ -1285,7 +1285,7 @@ val result : ?ratio:float -> 'a arbitrary -> 'e arbitrary -> ('a, 'e) result arb is a float between [0.] and [1.] indicating the probability of a sample to be [Ok _] rather than [Error _]. - @since NEXT_RELEASE *) + @since 0.24 *) (** {2 Tuples of arbitrary generators} @@ -1745,8 +1745,8 @@ module Observable : sig val unit : unit t val bool : bool t val int : int t - val int32 : int32 t (** @since NEXT_RELEASE *) - val int64 : int64 t (** @since NEXT_RELEASE *) + val int32 : int32 t (** @since 0.24 *) + val int64 : int64 t (** @since 0.24 *) val float : float t val string : string t val bytes : bytes t (** @since 0.20 *) @@ -1761,7 +1761,7 @@ module Observable : sig val map : ('a -> 'b) -> 'b t -> 'a t val option : 'a t -> 'a option t - val result : 'a t -> 'e t -> ('a, 'e) result t (** @since NEXT_RELEASE *) + val result : 'a t -> 'e t -> ('a, 'e) result t (** @since 0.24 *) val list : 'a t -> 'a list t val array : 'a t -> 'a array t diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index 6abb4788..f789ddd9 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -709,7 +709,7 @@ module Gen : sig @param ratio a float between [0.] and [1.] indicating the probability of a sample to be [Ok _] rather than [Error _]. - @since NEXT_RELEASE *) + @since 0.24 *) (** {3 Combining generators} *) @@ -1134,11 +1134,11 @@ module Print : sig val int32 : int32 t (** [int32] is a printer of 32-bit integers. - @since NEXT_RELEASE *) + @since 0.24 *) val int64 : int64 t (** [int64] is a printer of 64-bit integers. - @since NEXT_RELEASE *) + @since 0.24 *) val bool : bool t (** [bool] is a printer of boolean. *) @@ -1163,7 +1163,7 @@ module Print : sig (** [result okp errp] is a printer of [('a,'e) result], using [okp] for printing [Ok _] and [errp] for printing [Error _]. - @since NEXT_RELEASE *) + @since 0.24 *) val pair : 'a t -> 'b t -> ('a*'b) t (** [pair p1 p2] is a printer of pair. *) @@ -1369,11 +1369,11 @@ module Observable : sig val int32 : int32 t (** [int32] is an observable of [int32]. - @since NEXT_RELEASE *) + @since 0.24 *) val int64 : int64 t (** [int64] is an observable of [int64]. - @since NEXT_RELEASE *) + @since 0.24 *) val float : float t (** [float] is an observable of [float]. *) @@ -1407,7 +1407,7 @@ module Observable : sig val result : 'a t -> 'e t -> ('a, 'e) result t (** [result ok_o err_o] creates an [('a, 'e) result] observable out of two observables [ok_o] and [err_o]. - @since NEXT_RELEASE *) + @since 0.24 *) val list : 'a t -> 'a list t (** [list o] wraps the observable [o] of ['a] into an observable of From f32ad52ebf078305e457fec6b3955b971b471487 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 17 Feb 2025 19:45:16 +0100 Subject: [PATCH 329/391] Bump ppx_deriving_qcheck version to 0.6 --- ppx_deriving_qcheck.opam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ppx_deriving_qcheck.opam b/ppx_deriving_qcheck.opam index 1020a9dc..e9a6eb90 100644 --- a/ppx_deriving_qcheck.opam +++ b/ppx_deriving_qcheck.opam @@ -1,6 +1,6 @@ opam-version: "2.0" name: "ppx_deriving_qcheck" -version: "0.5" +version: "0.6" license: "BSD-2-Clause" synopsis: "PPX Deriver for QCheck" From 42429bf06ba12373cad02b1404f50d0ad6238af5 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 17 Feb 2025 19:45:57 +0100 Subject: [PATCH 330/391] Require at least 0.24 in ppx_deriving_qcheck --- ppx_deriving_qcheck.opam | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ppx_deriving_qcheck.opam b/ppx_deriving_qcheck.opam index e9a6eb90..5d1e9f08 100644 --- a/ppx_deriving_qcheck.opam +++ b/ppx_deriving_qcheck.opam @@ -10,12 +10,12 @@ author: [ "the qcheck contributors" ] depends: [ "dune" {>= "2.8.0"} "ocaml" {>= "4.08.0"} - "qcheck-core" {>= "0.19"} + "qcheck-core" {>= "0.24"} "ppxlib" {>= "0.22.0"} "ppx_deriving" {>= "5.2.1"} "odoc" {with-doc} "alcotest" {with-test & >= "1.4.0" } - "qcheck-alcotest" {with-test & >= "0.17"} + "qcheck-alcotest" {with-test & >= "0.24"} ] build: [ From 52ba9e2c0764d36431263febc9bd21f17c3fb5e4 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 18 Feb 2025 15:13:25 +0100 Subject: [PATCH 331/391] Fix ppx_deriving_qcheck dev-repo entry --- ppx_deriving_qcheck.opam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ppx_deriving_qcheck.opam b/ppx_deriving_qcheck.opam index 5d1e9f08..995ce767 100644 --- a/ppx_deriving_qcheck.opam +++ b/ppx_deriving_qcheck.opam @@ -26,5 +26,5 @@ build: [ homepage: "https://github.com/c-cube/qcheck/" bug-reports: "https://github.com/c-cube/qcheck/-/issues" -dev-repo: "git+https://github.com/vch9/ppx_deriving_qcheck.git" +dev-repo: "git+https://github.com/c-cube/qcheck.git" x-maintenance-intent: ["(latest)"] From 38290e23f9a9f28cd27ba947b7580a458c19cb57 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 27 Feb 2025 19:15:21 +0100 Subject: [PATCH 332/391] Prepare CHANGELOG for next release --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 402f5c1f..acf1f623 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes +## NEXT RELEASE + +- ... + ## 0.24 - [qcheck-alcotest] Add an optional `speed_level` parameter to `to_alcotest` From 4be8d74f9699aa396c6d98db88885f827807c994 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 4 Mar 2025 21:10:10 +0100 Subject: [PATCH 333/391] Add dependabot checking github actions --- .github/dependabot.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..5ace4600 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" From 86bb3e21973aeeab5a8b7b5fbbc40d8b2672f03a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Mar 2025 20:31:14 +0000 Subject: [PATCH 334/391] Bump peaceiris/actions-gh-pages from 3 to 4 Bumps [peaceiris/actions-gh-pages](https://github.com/peaceiris/actions-gh-pages) from 3 to 4. - [Release notes](https://github.com/peaceiris/actions-gh-pages/releases) - [Changelog](https://github.com/peaceiris/actions-gh-pages/blob/main/CHANGELOG.md) - [Commits](https://github.com/peaceiris/actions-gh-pages/compare/v3...v4) --- updated-dependencies: - dependency-name: peaceiris/actions-gh-pages dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> --- .github/workflows/gh-pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 9ceff68c..df625cb5 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -35,7 +35,7 @@ jobs: run: opam exec -- dune build @doc - name: Deploy - uses: peaceiris/actions-gh-pages@v3 + uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./_build/default/_doc/_html/ From e10d70e66db6a89b5212d2390de220a2fbff12f6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Mar 2025 20:31:19 +0000 Subject: [PATCH 335/391] Bump avsm/setup-ocaml from 1 to 3 Bumps [avsm/setup-ocaml](https://github.com/avsm/setup-ocaml) from 1 to 3. - [Release notes](https://github.com/avsm/setup-ocaml/releases) - [Commits](https://github.com/avsm/setup-ocaml/compare/v1...v3) --- updated-dependencies: - dependency-name: avsm/setup-ocaml dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> --- .github/workflows/gh-pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 9ceff68c..1527be8d 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -18,7 +18,7 @@ jobs: path: ~/.opam key: opam-ubuntu-latest-4.12.0 - - uses: avsm/setup-ocaml@v1 + - uses: avsm/setup-ocaml@v3 with: ocaml-version: '4.12.0' From 5a80abd99a94a97385c3fd80ed07116248afebd4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Mar 2025 20:31:21 +0000 Subject: [PATCH 336/391] Bump actions/cache from 2 to 4 Bumps [actions/cache](https://github.com/actions/cache) from 2 to 4. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v2...v4) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> --- .github/workflows/gh-pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 9ceff68c..78cc6dd4 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -13,7 +13,7 @@ jobs: - name: Cache opam id: cache-opam - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.opam key: opam-ubuntu-latest-4.12.0 From ebca1dd59c72cb6750bdb746b73ac2ee551eaf32 Mon Sep 17 00:00:00 2001 From: Patrick LaFontaine <32135464+Pat-Lafon@users.noreply.github.com> Date: Wed, 5 Mar 2025 08:55:46 -0500 Subject: [PATCH 337/391] Continue on fail when max_fail is gt 0 --- src/core/QCheck2.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index b9e07c38..7ad5b1db 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -884,7 +884,7 @@ module Gen = struct make_primitive ~gen:(fun st -> gen st |> Tree.root) ~shrink - + let no_shrink (gen: 'a t) : 'a t = set_shrink (fun _ -> Seq.empty) gen let (let+) = (>|=) @@ -1868,6 +1868,7 @@ module Test = struct state.step state.test.name state.test input Failure; state.cur_max_fail <- state.cur_max_fail - 1; R.fail state.res ~steps ~msg_l input; + if state.cur_max_fail > 0 then CR_continue else CR_yield state.res (* [check_state state] applies [state.test] repeatedly ([iter] times) From 6c2561f7c1c7dd9be440d22bbe5959dba54430e4 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 5 Mar 2025 17:09:25 +0100 Subject: [PATCH 338/391] Add a max_fail test --- test/core/QCheck2_tests.ml | 5 +++++ test/core/QCheck_tests.ml | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/test/core/QCheck2_tests.ml b/test/core/QCheck2_tests.ml index 372478eb..1c5d247f 100644 --- a/test/core/QCheck2_tests.ml +++ b/test/core/QCheck2_tests.ml @@ -51,6 +51,10 @@ module Overall = struct Test.make ~name:"should_fail_sort_id" ~count:10 ~print:Print.(list int) Gen.(small_list small_int) (fun l -> l = List.sort compare l) + let max_fail = + Test.make ~name:"max_fail" ~count:1000 ~max_fail:3 ~print:Print.(list int) + Gen.(list small_nat) (fun l -> l = List.rev l) + exception Error let error = @@ -142,6 +146,7 @@ module Overall = struct let tests = [ passing; failing; + max_fail; error; collect; stats; diff --git a/test/core/QCheck_tests.ml b/test/core/QCheck_tests.ml index 91044a6e..2efa1f66 100644 --- a/test/core/QCheck_tests.ml +++ b/test/core/QCheck_tests.ml @@ -60,6 +60,11 @@ module Overall = struct Test.make ~name:"should_fail_sort_id" ~count:10 (small_list small_int) (fun l -> l = List.sort compare l) + let max_fail = + Test.make ~name:"max_fail" ~count:1000 ~max_fail:3 + (list small_nat) + (fun l -> l = List.rev l) + exception Error let error = @@ -152,6 +157,7 @@ module Overall = struct let tests = [ passing; failing; + max_fail; error; collect; stats; From 84416fc50f2a9926db681ba549b33f558ccd724b Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 5 Mar 2025 17:42:16 +0100 Subject: [PATCH 339/391] Update expect test outputs --- .../QCheck2_expect_test.expected.ocaml4.32 | 20 ++++++++++++++++++- .../QCheck2_expect_test.expected.ocaml4.64 | 20 ++++++++++++++++++- .../QCheck2_expect_test.expected.ocaml5.32 | 20 ++++++++++++++++++- .../QCheck2_expect_test.expected.ocaml5.64 | 20 ++++++++++++++++++- .../QCheck_expect_test.expected.ocaml4.32 | 20 ++++++++++++++++++- .../QCheck_expect_test.expected.ocaml4.64 | 20 ++++++++++++++++++- .../QCheck_expect_test.expected.ocaml5.32 | 20 ++++++++++++++++++- .../QCheck_expect_test.expected.ocaml5.64 | 20 ++++++++++++++++++- 8 files changed, 152 insertions(+), 8 deletions(-) diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.32 b/test/core/QCheck2_expect_test.expected.ocaml4.32 index d27af061..02890005 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.32 @@ -107,6 +107,24 @@ Test should_fail_sort_id failed (5 shrink steps): [1; 0] +--- Failure -------------------------------------------------------------------- + +Test max_fail failed (3 shrink steps): + +[0; 1] + +--- Failure -------------------------------------------------------------------- + +Test max_fail failed (8 shrink steps): + +[0; 1] + +--- Failure -------------------------------------------------------------------- + +Test max_fail failed (8 shrink steps): + +[0; 1] + === Error ====================================================================== Test should_error_raise_exn errored on (1 shrink steps): @@ -1664,7 +1682,7 @@ stats dist: 6.. 10: 0 ================================================================================ 1 warning(s) -failure (74 tests failed, 3 tests errored, ran 166 tests) +failure (75 tests failed, 3 tests errored, ran 167 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.64 b/test/core/QCheck2_expect_test.expected.ocaml4.64 index cc4a28e8..54731242 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.64 @@ -169,6 +169,24 @@ Test should_fail_sort_id failed (5 shrink steps): [1; 0] +--- Failure -------------------------------------------------------------------- + +Test max_fail failed (3 shrink steps): + +[0; 1] + +--- Failure -------------------------------------------------------------------- + +Test max_fail failed (8 shrink steps): + +[0; 1] + +--- Failure -------------------------------------------------------------------- + +Test max_fail failed (8 shrink steps): + +[0; 1] + === Error ====================================================================== Test should_error_raise_exn errored on (1 shrink steps): @@ -1726,7 +1744,7 @@ stats dist: 6.. 10: 0 ================================================================================ 1 warning(s) -failure (74 tests failed, 3 tests errored, ran 166 tests) +failure (75 tests failed, 3 tests errored, ran 167 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.32 b/test/core/QCheck2_expect_test.expected.ocaml5.32 index 2207d60c..7a8c58a0 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.32 @@ -90,6 +90,24 @@ Test should_fail_sort_id failed (8 shrink steps): [1; 0] +--- Failure -------------------------------------------------------------------- + +Test max_fail failed (4 shrink steps): + +[0; 1] + +--- Failure -------------------------------------------------------------------- + +Test max_fail failed (8 shrink steps): + +[0; 1] + +--- Failure -------------------------------------------------------------------- + +Test max_fail failed (2 shrink steps): + +[0; 1] + === Error ====================================================================== Test should_error_raise_exn errored on (1 shrink steps): @@ -1648,7 +1666,7 @@ stats dist: -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (74 tests failed, 3 tests errored, ran 166 tests) +failure (75 tests failed, 3 tests errored, ran 167 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.64 b/test/core/QCheck2_expect_test.expected.ocaml5.64 index 9205829a..cfd42692 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.64 @@ -152,6 +152,24 @@ Test should_fail_sort_id failed (8 shrink steps): [1; 0] +--- Failure -------------------------------------------------------------------- + +Test max_fail failed (4 shrink steps): + +[0; 1] + +--- Failure -------------------------------------------------------------------- + +Test max_fail failed (8 shrink steps): + +[0; 1] + +--- Failure -------------------------------------------------------------------- + +Test max_fail failed (2 shrink steps): + +[0; 1] + === Error ====================================================================== Test should_error_raise_exn errored on (1 shrink steps): @@ -1710,7 +1728,7 @@ stats dist: -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (74 tests failed, 3 tests errored, ran 166 tests) +failure (75 tests failed, 3 tests errored, ran 167 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_expect_test.expected.ocaml4.32 b/test/core/QCheck_expect_test.expected.ocaml4.32 index 40fd3c2a..7823ce76 100644 --- a/test/core/QCheck_expect_test.expected.ocaml4.32 +++ b/test/core/QCheck_expect_test.expected.ocaml4.32 @@ -83,6 +83,24 @@ Test should_fail_sort_id failed (13 shrink steps): [1; 0] +--- Failure -------------------------------------------------------------------- + +Test max_fail failed (16 shrink steps): + +[0; 1] + +--- Failure -------------------------------------------------------------------- + +Test max_fail failed (19 shrink steps): + +[0; 1] + +--- Failure -------------------------------------------------------------------- + +Test max_fail failed (11 shrink steps): + +[1; 0] + === Error ====================================================================== Test should_error_raise_exn errored on (31 shrink steps): @@ -1641,7 +1659,7 @@ stats dist: 6.. 10: 0 ================================================================================ 1 warning(s) -failure (74 tests failed, 3 tests errored, ran 174 tests) +failure (75 tests failed, 3 tests errored, ran 175 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_expect_test.expected.ocaml4.64 b/test/core/QCheck_expect_test.expected.ocaml4.64 index 3551e331..76d2ec3d 100644 --- a/test/core/QCheck_expect_test.expected.ocaml4.64 +++ b/test/core/QCheck_expect_test.expected.ocaml4.64 @@ -115,6 +115,24 @@ Test should_fail_sort_id failed (13 shrink steps): [1; 0] +--- Failure -------------------------------------------------------------------- + +Test max_fail failed (16 shrink steps): + +[0; 1] + +--- Failure -------------------------------------------------------------------- + +Test max_fail failed (19 shrink steps): + +[0; 1] + +--- Failure -------------------------------------------------------------------- + +Test max_fail failed (11 shrink steps): + +[1; 0] + === Error ====================================================================== Test should_error_raise_exn errored on (63 shrink steps): @@ -1673,7 +1691,7 @@ stats dist: 6.. 10: 0 ================================================================================ 1 warning(s) -failure (74 tests failed, 3 tests errored, ran 174 tests) +failure (75 tests failed, 3 tests errored, ran 175 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_expect_test.expected.ocaml5.32 b/test/core/QCheck_expect_test.expected.ocaml5.32 index f8175e88..c03f8999 100644 --- a/test/core/QCheck_expect_test.expected.ocaml5.32 +++ b/test/core/QCheck_expect_test.expected.ocaml5.32 @@ -93,6 +93,24 @@ Test should_fail_sort_id failed (10 shrink steps): [1; 0] +--- Failure -------------------------------------------------------------------- + +Test max_fail failed (20 shrink steps): + +[0; 1] + +--- Failure -------------------------------------------------------------------- + +Test max_fail failed (14 shrink steps): + +[0; 1] + +--- Failure -------------------------------------------------------------------- + +Test max_fail failed (16 shrink steps): + +[1; 0] + === Error ====================================================================== Test should_error_raise_exn errored on (30 shrink steps): @@ -1652,7 +1670,7 @@ stats dist: -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (74 tests failed, 3 tests errored, ran 174 tests) +failure (75 tests failed, 3 tests errored, ran 175 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/test/core/QCheck_expect_test.expected.ocaml5.64 b/test/core/QCheck_expect_test.expected.ocaml5.64 index 4a2cd374..bd76e3f0 100644 --- a/test/core/QCheck_expect_test.expected.ocaml5.64 +++ b/test/core/QCheck_expect_test.expected.ocaml5.64 @@ -125,6 +125,24 @@ Test should_fail_sort_id failed (10 shrink steps): [1; 0] +--- Failure -------------------------------------------------------------------- + +Test max_fail failed (20 shrink steps): + +[0; 1] + +--- Failure -------------------------------------------------------------------- + +Test max_fail failed (14 shrink steps): + +[0; 1] + +--- Failure -------------------------------------------------------------------- + +Test max_fail failed (16 shrink steps): + +[1; 0] + === Error ====================================================================== Test should_error_raise_exn errored on (62 shrink steps): @@ -1684,7 +1702,7 @@ stats dist: -3.. 0: ####################################################### 1631 ================================================================================ 1 warning(s) -failure (74 tests failed, 3 tests errored, ran 174 tests) +failure (75 tests failed, 3 tests errored, ran 175 tests) random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ From 4f9c1d57c511a8de5482a9e3a731229a4300911d Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 5 Mar 2025 17:45:30 +0100 Subject: [PATCH 340/391] Add a CHANGELOG entry --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index acf1f623..4d36d8e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## NEXT RELEASE -- ... +- Restore `Test.make`'s `max_fail` parameter which was accidentally broken in 0.18 ## 0.24 From ae31ea5b59127ed3760461d2ad57b189335ff82c Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 3 Mar 2025 16:34:42 +0100 Subject: [PATCH 341/391] Add stddev summands in increasing order --- src/core/QCheck2.ml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index 7ad5b1db..a189a387 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -2049,8 +2049,10 @@ module Test = struct https://en.wikipedia.org/wiki/Standard_deviation *) let stddev = Hashtbl.fold - (fun i res m -> m +. (float_of_int i -. !avg) ** 2. *. float_of_int res) - tbl 0. + (fun i res acc -> float_of_int res *. ((float_of_int i -. !avg) ** 2.) :: acc) + tbl [] + |> List.sort Float.compare (* add summands in increasing order to preserve precision *) + |> List.fold_left (+.) 0. |> (fun s -> if !num>0 then s /. float_of_int !num else s) |> sqrt in From 5d801618a2f5182eb7084e7fa74e06ef4387b889 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 3 Mar 2025 23:04:03 +0100 Subject: [PATCH 342/391] Compute avg by summing posive and negative entries separately, by order of magnitude --- src/core/QCheck2.ml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index a189a387..5fd410e5 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -2031,17 +2031,24 @@ module Test = struct let stat_max_lines = 20 (* maximum number of lines for a histogram *) let print_stat ((name,_), tbl) = - let avg = ref 0. in + let neg_avg_summands = ref [] in + let pos_avg_summands = ref [] in let num = ref 0 in let min_idx, max_idx = Hashtbl.fold (fun i res (m1,m2) -> - avg := !avg +. float_of_int (i * res); + let avg_summand = float_of_int (i * res) in + if avg_summand < 0. + then neg_avg_summands := avg_summand::!neg_avg_summands + else pos_avg_summands := avg_summand::!pos_avg_summands; num := !num + res; min i m1, max i m2) tbl (max_int,min_int) in - (* compute average *) + (* compute average, summing positive/negative separately by order of magnitude *) + let neg_avg_sums = List.sort Float.compare !neg_avg_summands |> fun xs -> List.fold_right (+.) xs 0. in + let pos_avg_sums = List.sort Float.compare !pos_avg_summands |> List.fold_left (+.) 0. in + let avg = ref (neg_avg_sums +. pos_avg_sums) in if !num > 0 then ( avg := !avg /. float_of_int !num ); From 0c718d3fa49d6d57e04c753b0d2fca14b6443828 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 3 Mar 2025 23:04:28 +0100 Subject: [PATCH 343/391] Update expect test output --- test/core/QCheck2_expect_test.expected.ocaml4.64 | 4 ++-- test/core/QCheck2_expect_test.expected.ocaml5.64 | 4 ++-- test/core/QCheck_expect_test.expected.ocaml4.64 | 4 ++-- test/core/QCheck_expect_test.expected.ocaml5.64 | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.64 b/test/core/QCheck2_expect_test.expected.ocaml4.64 index 54731242..1b787d57 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.64 @@ -1496,7 +1496,7 @@ stats dist: +++ Stats for int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 100000, avg: 6739840024355437.00, stddev: 2654793546877646336.00, median 2435838602111153, min -4611682300221562449, max 4611492907363159042 + num: 100000, avg: 6739840024363391.00, stddev: 2654793546877632512.00, median 2435838602111153, min -4611682300221562449, max 4611492907363159042 -4611682300221562449..-4150523539842326354: #################################################### 4927 -4150523539842326353..-3689364779463090258: #################################################### 4923 -3689364779463090257..-3228206019083854162: #################################################### 4923 @@ -1750,7 +1750,7 @@ random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 1000, avg: 48985084121559400.00, stddev: 1793541561270566400.00, median 9, min -4580864984167113344, max 4611686018427387903 + num: 1000, avg: 48985084121559600.00, stddev: 1793541561270564352.00, median 9, min -4580864984167113344, max 4611686018427387903 -4580864984167113344..-4121237434037388289: ## 23 -4121237434037388288..-3661609883907663233: # 19 -3661609883907663232..-3201982333777938177: ## 28 diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.64 b/test/core/QCheck2_expect_test.expected.ocaml5.64 index cfd42692..a14e49c1 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.64 @@ -1479,7 +1479,7 @@ stats dist: +++ Stats for int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 100000, avg: -16187567683715200.00, stddev: 2661643267167753216.00, median -19064865724378010, min -4611580124327955972, max 4611682453232767028 + num: 100000, avg: -16187567683718264.00, stddev: 2661643267167777792.00, median -19064865724378010, min -4611580124327955972, max 4611682453232767028 -4611580124327955972..-4150416995449919813: #################################################### 4939 -4150416995449919812..-3689253866571883653: ###################################################### 5114 -3689253866571883652..-3228090737693847493: ##################################################### 5019 @@ -1734,7 +1734,7 @@ random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 1000, avg: 96259266356736624.00, stddev: 1858774986626273280.00, median 10, min -4602121864537469332, max 4611686018427387903 + num: 1000, avg: 96259266356736752.00, stddev: 1858774986626273536.00, median 10, min -4602121864537469332, max 4611686018427387903 -4602121864537469332..-4141431470389226517: # 17 -4141431470389226516..-3680741076240983701: ## 19 -3680741076240983700..-3220050682092740885: ## 19 diff --git a/test/core/QCheck_expect_test.expected.ocaml4.64 b/test/core/QCheck_expect_test.expected.ocaml4.64 index 76d2ec3d..12bacd70 100644 --- a/test/core/QCheck_expect_test.expected.ocaml4.64 +++ b/test/core/QCheck_expect_test.expected.ocaml4.64 @@ -1443,7 +1443,7 @@ stats dist: +++ Stats for int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 100000, avg: 2541076923587387.50, stddev: 2660730801206827008.00, median 158655268318060, min -4611522359435274428, max 4611540922436307689 + num: 100000, avg: 2541076923591940.00, stddev: 2660730801206814208.00, median 158655268318060, min -4611522359435274428, max 4611540922436307689 -4611522359435274428..-4150369195341695293: ##################################################### 4976 -4150369195341695292..-3689216031248116157: ##################################################### 4963 -3689216031248116156..-3228062867154537021: ###################################################### 5038 @@ -1697,7 +1697,7 @@ random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 1000, avg: -55083208105414400.00, stddev: 1847115855773139200.00, median 9, min -4590718933436425025, max 4611686018427387903 + num: 1000, avg: -55083208105414424.00, stddev: 1847115855773138688.00, median 9, min -4590718933436425025, max 4611686018427387903 -4590718933436425025..-4130598685843234370: ## 26 -4130598685843234369..-3670478438250043714: # 13 -3670478438250043713..-3210358190656853058: ### 37 diff --git a/test/core/QCheck_expect_test.expected.ocaml5.64 b/test/core/QCheck_expect_test.expected.ocaml5.64 index bd76e3f0..3123e474 100644 --- a/test/core/QCheck_expect_test.expected.ocaml5.64 +++ b/test/core/QCheck_expect_test.expected.ocaml5.64 @@ -1453,7 +1453,7 @@ stats dist: +++ Stats for int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 100000, avg: -7215552342607541.00, stddev: 2666234426234218496.00, median -16620417636667326, min -4611371852367564818, max 4611613630315464842 + num: 100000, avg: -7215552342608377.00, stddev: 2666234426234203648.00, median -16620417636667326, min -4611371852367564818, max 4611613630315464842 -4611371852367564818..-4150222578233413331: ##################################################### 5003 -4150222578233413330..-3689073304099261843: ####################################################### 5106 -3689073304099261842..-3227924029965110355: ###################################################### 5052 @@ -1708,7 +1708,7 @@ random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 1000, avg: -38152533987928128.00, stddev: 1828925617669212928.00, median 9, min -4606614955625884935, max 4611686018427387903 + num: 1000, avg: -38152533987928176.00, stddev: 1828925617669212672.00, median 9, min -4606614955625884935, max 4611686018427387903 -4606614955625884935..-4145699906923221320: ## 27 -4145699906923221319..-3684784858220557704: ## 22 -3684784858220557703..-3223869809517894088: ## 29 From cf59969d1cdaa32efda7da11200e29890ed75507 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 3 Mar 2025 23:23:44 +0100 Subject: [PATCH 344/391] Switch to scientific notation for avg and stddev beyond +/-1e7 --- src/core/QCheck2.ml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index 5fd410e5..ffd10266 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -2100,10 +2100,11 @@ module Test = struct max_val := max !max_val new_count) tbl; (* print entries of the table, sorted by increasing index *) let out = Buffer.create 128 in + let fmt_float f = if f > 1e7 || f < -1e7 then Printf.sprintf "%.3e" f else Printf.sprintf "%.2f" f in Printf.bprintf out "stats %s:\n" name; Printf.bprintf out - " num: %d, avg: %.2f, stddev: %.2f, median %d, min %d, max %d\n" - !num !avg stddev !median min_idx max_idx; + " num: %d, avg: %s, stddev: %s, median %d, min %d, max %d\n" + !num (fmt_float !avg) (fmt_float stddev) !median min_idx max_idx; let indwidth = let str_width i = String.length (Printf.sprintf "%d" i) in List.map str_width [min_idx; max_idx; min_idx + bucket_size * hist_size] |> List.fold_left max min_int in From 584ead1c2f896b99fd3829e8019d9948fdffc35e Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 3 Mar 2025 23:50:30 +0100 Subject: [PATCH 345/391] Update expect test outputs --- example/QCheck_runner_test.expected.ocaml4.32 | 2 +- example/QCheck_runner_test.expected.ocaml4.64 | 2 +- example/QCheck_runner_test.expected.ocaml5.32 | 2 +- example/QCheck_runner_test.expected.ocaml5.64 | 2 +- test/core/QCheck2_expect_test.expected.ocaml4.32 | 6 +++--- test/core/QCheck2_expect_test.expected.ocaml4.64 | 6 +++--- test/core/QCheck2_expect_test.expected.ocaml5.32 | 6 +++--- test/core/QCheck2_expect_test.expected.ocaml5.64 | 6 +++--- test/core/QCheck_expect_test.expected.ocaml4.32 | 6 +++--- test/core/QCheck_expect_test.expected.ocaml4.64 | 6 +++--- test/core/QCheck_expect_test.expected.ocaml5.32 | 6 +++--- test/core/QCheck_expect_test.expected.ocaml5.64 | 6 +++--- 12 files changed, 28 insertions(+), 28 deletions(-) diff --git a/example/QCheck_runner_test.expected.ocaml4.32 b/example/QCheck_runner_test.expected.ocaml4.32 index 0430ef85..1ae9e867 100644 --- a/example/QCheck_runner_test.expected.ocaml4.32 +++ b/example/QCheck_runner_test.expected.ocaml4.32 @@ -307,7 +307,7 @@ stats dist: +++ Stats for stat_display_test_7 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 100000, avg: 336840.90, stddev: 619301756.02, median 895228, min -1073728193, max 1073739280 + num: 100000, avg: 336840.90, stddev: 6.193e+08, median 895228, min -1073728193, max 1073739280 -1073728193.. -966354820: ##################################################### 5009 -966354819.. -858981446: #################################################### 5004 -858981445.. -751608072: #################################################### 4917 diff --git a/example/QCheck_runner_test.expected.ocaml4.64 b/example/QCheck_runner_test.expected.ocaml4.64 index e3a1573d..3c756506 100644 --- a/example/QCheck_runner_test.expected.ocaml4.64 +++ b/example/QCheck_runner_test.expected.ocaml4.64 @@ -307,7 +307,7 @@ stats dist: +++ Stats for stat_display_test_7 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 100000, avg: 2541076923587387.50, stddev: 2660730801206827008.00, median 158655268318060, min -4611522359435274428, max 4611540922436307689 + num: 100000, avg: 2.541e+15, stddev: 2.661e+18, median 158655268318060, min -4611522359435274428, max 4611540922436307689 -4611522359435274428..-4150369195341695293: ##################################################### 4976 -4150369195341695292..-3689216031248116157: ##################################################### 4963 -3689216031248116156..-3228062867154537021: ###################################################### 5038 diff --git a/example/QCheck_runner_test.expected.ocaml5.32 b/example/QCheck_runner_test.expected.ocaml5.32 index 4b1b17c4..e5816762 100644 --- a/example/QCheck_runner_test.expected.ocaml5.32 +++ b/example/QCheck_runner_test.expected.ocaml5.32 @@ -307,7 +307,7 @@ stats dist: +++ Stats for stat_display_test_7 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 100000, avg: -2481754.31, stddev: 618398387.27, median -5669677, min -1073719962, max 1073717275 + num: 100000, avg: -2481754.31, stddev: 6.184e+08, median -5669677, min -1073719962, max 1073717275 -1073719962.. -966348101: ##################################################### 4978 -966348100.. -858976239: ##################################################### 5008 -858976238.. -751604377: #################################################### 4907 diff --git a/example/QCheck_runner_test.expected.ocaml5.64 b/example/QCheck_runner_test.expected.ocaml5.64 index 1810c2bd..017b40c0 100644 --- a/example/QCheck_runner_test.expected.ocaml5.64 +++ b/example/QCheck_runner_test.expected.ocaml5.64 @@ -307,7 +307,7 @@ stats dist: +++ Stats for stat_display_test_7 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 100000, avg: -7215552342607541.00, stddev: 2666234426234218496.00, median -16620417636667326, min -4611371852367564818, max 4611613630315464842 + num: 100000, avg: -7.216e+15, stddev: 2.666e+18, median -16620417636667326, min -4611371852367564818, max 4611613630315464842 -4611371852367564818..-4150222578233413331: ##################################################### 5003 -4150222578233413330..-3689073304099261843: ####################################################### 5106 -3689073304099261842..-3227924029965110355: ###################################################### 5052 diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.32 b/test/core/QCheck2_expect_test.expected.ocaml4.32 index 02890005..68ba9ffc 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.32 @@ -1434,7 +1434,7 @@ stats dist: +++ Stats for int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 100000, avg: -298652.90, stddev: 619096154.85, median 419404, min -1073741519, max 1073728237 + num: 100000, avg: -298652.90, stddev: 6.191e+08, median 419404, min -1073741519, max 1073728237 -1073741519.. -966368032: ##################################################### 4984 -966368031.. -858994544: ###################################################### 5025 -858994543.. -751621056: ###################################################### 5035 @@ -1459,7 +1459,7 @@ stats dist: +++ Stats for oneof int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 1000, avg: 1073741.63, stddev: 676575790.92, median 0, min -1073741824, max 1073741823 + num: 1000, avg: 1073741.63, stddev: 6.766e+08, median 0, min -1073741824, max 1073741823 -1073741824.. -966367642: ################## 208 -966367641.. -858993459: 0 -858993458.. -751619276: 0 @@ -1688,7 +1688,7 @@ random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 1000, avg: 2229293.51, stddev: 427568354.78, median 9, min -1072726813, max 1073741823 + num: 1000, avg: 2229293.51, stddev: 4.276e+08, median 9, min -1072726813, max 1073741823 -1072726813.. -965403382: ## 22 -965403381.. -858079950: ## 28 -858079949.. -750756518: # 17 diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.64 b/test/core/QCheck2_expect_test.expected.ocaml4.64 index 1b787d57..51d318fa 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.64 @@ -1496,7 +1496,7 @@ stats dist: +++ Stats for int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 100000, avg: 6739840024363391.00, stddev: 2654793546877632512.00, median 2435838602111153, min -4611682300221562449, max 4611492907363159042 + num: 100000, avg: 6.740e+15, stddev: 2.655e+18, median 2435838602111153, min -4611682300221562449, max 4611492907363159042 -4611682300221562449..-4150523539842326354: #################################################### 4927 -4150523539842326353..-3689364779463090258: #################################################### 4923 -3689364779463090257..-3228206019083854162: #################################################### 4923 @@ -1521,7 +1521,7 @@ stats dist: +++ Stats for oneof int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 1000, avg: 4611686018427388.00, stddev: 2905870896563567616.00, median 0, min -4611686018427387904, max 4611686018427387903 + num: 1000, avg: 4.612e+15, stddev: 2.906e+18, median 0, min -4611686018427387904, max 4611686018427387903 -4611686018427387904..-4150517416584649089: ################## 208 -4150517416584649088..-3689348814741910273: 0 -3689348814741910272..-3228180212899171457: 0 @@ -1750,7 +1750,7 @@ random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 1000, avg: 48985084121559600.00, stddev: 1793541561270564352.00, median 9, min -4580864984167113344, max 4611686018427387903 + num: 1000, avg: 4.899e+16, stddev: 1.794e+18, median 9, min -4580864984167113344, max 4611686018427387903 -4580864984167113344..-4121237434037388289: ## 23 -4121237434037388288..-3661609883907663233: # 19 -3661609883907663232..-3201982333777938177: ## 28 diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.32 b/test/core/QCheck2_expect_test.expected.ocaml5.32 index 7a8c58a0..7d786ce1 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.32 @@ -1417,7 +1417,7 @@ stats dist: +++ Stats for int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 100000, avg: 1375300.54, stddev: 620110315.04, median -3852464, min -1073736753, max 1073733862 + num: 100000, avg: 1375300.54, stddev: 6.201e+08, median -3852464, min -1073736753, max 1073733862 -1073736753.. -966363223: #################################################### 4972 -966363222.. -858989692: ##################################################### 5032 -858989691.. -751616161: #################################################### 4928 @@ -1442,7 +1442,7 @@ stats dist: +++ Stats for oneof int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 1000, avg: 1073741.60, stddev: 673131652.31, median 0, min -1073741824, max 1073741823 + num: 1000, avg: 1073741.60, stddev: 6.731e+08, median 0, min -1073741824, max 1073741823 -1073741824.. -966367642: ################# 198 -966367641.. -858993459: 0 -858993458.. -751619276: 0 @@ -1672,7 +1672,7 @@ random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 1000, avg: 12189159.05, stddev: 451294853.72, median 10, min -1073230792, max 1073741823 + num: 1000, avg: 1.219e+07, stddev: 4.513e+08, median 10, min -1073230792, max 1073741823 -1073230792.. -965882162: ## 19 -965882161.. -858533531: ### 30 -858533530.. -751184900: ### 29 diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.64 b/test/core/QCheck2_expect_test.expected.ocaml5.64 index a14e49c1..4bef5265 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.64 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.64 @@ -1479,7 +1479,7 @@ stats dist: +++ Stats for int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 100000, avg: -16187567683718264.00, stddev: 2661643267167777792.00, median -19064865724378010, min -4611580124327955972, max 4611682453232767028 + num: 100000, avg: -1.619e+16, stddev: 2.662e+18, median -19064865724378010, min -4611580124327955972, max 4611682453232767028 -4611580124327955972..-4150416995449919813: #################################################### 4939 -4150416995449919812..-3689253866571883653: ###################################################### 5114 -3689253866571883652..-3228090737693847493: ##################################################### 5019 @@ -1504,7 +1504,7 @@ stats dist: +++ Stats for oneof int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 1000, avg: 4611686018427388.00, stddev: 2891078433912002560.00, median 0, min -4611686018427387904, max 4611686018427387903 + num: 1000, avg: 4.612e+15, stddev: 2.891e+18, median 0, min -4611686018427387904, max 4611686018427387903 -4611686018427387904..-4150517416584649089: ################# 198 -4150517416584649088..-3689348814741910273: 0 -3689348814741910272..-3228180212899171457: 0 @@ -1734,7 +1734,7 @@ random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 1000, avg: 96259266356736752.00, stddev: 1858774986626273536.00, median 10, min -4602121864537469332, max 4611686018427387903 + num: 1000, avg: 9.626e+16, stddev: 1.859e+18, median 10, min -4602121864537469332, max 4611686018427387903 -4602121864537469332..-4141431470389226517: # 17 -4141431470389226516..-3680741076240983701: ## 19 -3680741076240983700..-3220050682092740885: ## 19 diff --git a/test/core/QCheck_expect_test.expected.ocaml4.32 b/test/core/QCheck_expect_test.expected.ocaml4.32 index 7823ce76..048364c5 100644 --- a/test/core/QCheck_expect_test.expected.ocaml4.32 +++ b/test/core/QCheck_expect_test.expected.ocaml4.32 @@ -1411,7 +1411,7 @@ stats dist: +++ Stats for int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 100000, avg: 336840.90, stddev: 619301756.02, median 895228, min -1073728193, max 1073739280 + num: 100000, avg: 336840.90, stddev: 6.193e+08, median 895228, min -1073728193, max 1073739280 -1073728193.. -966354820: ##################################################### 5009 -966354819.. -858981446: #################################################### 5004 -858981445.. -751608072: #################################################### 4917 @@ -1436,7 +1436,7 @@ stats dist: +++ Stats for oneof int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 1000, avg: 1073741.63, stddev: 676575790.92, median 0, min -1073741824, max 1073741823 + num: 1000, avg: 1073741.63, stddev: 6.766e+08, median 0, min -1073741824, max 1073741823 -1073741824.. -966367642: ################## 208 -966367641.. -858993459: 0 -858993458.. -751619276: 0 @@ -1665,7 +1665,7 @@ random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 1000, avg: 10351291.88, stddev: 432212939.52, median 9, min -1066972208, max 1073741823 + num: 1000, avg: 1.035e+07, stddev: 4.322e+08, median 9, min -1066972208, max 1073741823 -1066972208.. -959936507: ## 27 -959936506.. -852900805: ## 22 -852900804.. -745865103: ## 22 diff --git a/test/core/QCheck_expect_test.expected.ocaml4.64 b/test/core/QCheck_expect_test.expected.ocaml4.64 index 12bacd70..bd826193 100644 --- a/test/core/QCheck_expect_test.expected.ocaml4.64 +++ b/test/core/QCheck_expect_test.expected.ocaml4.64 @@ -1443,7 +1443,7 @@ stats dist: +++ Stats for int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 100000, avg: 2541076923591940.00, stddev: 2660730801206814208.00, median 158655268318060, min -4611522359435274428, max 4611540922436307689 + num: 100000, avg: 2.541e+15, stddev: 2.661e+18, median 158655268318060, min -4611522359435274428, max 4611540922436307689 -4611522359435274428..-4150369195341695293: ##################################################### 4976 -4150369195341695292..-3689216031248116157: ##################################################### 4963 -3689216031248116156..-3228062867154537021: ###################################################### 5038 @@ -1468,7 +1468,7 @@ stats dist: +++ Stats for oneof int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 1000, avg: 4611686018427388.00, stddev: 2905870896563567616.00, median 0, min -4611686018427387904, max 4611686018427387903 + num: 1000, avg: 4.612e+15, stddev: 2.906e+18, median 0, min -4611686018427387904, max 4611686018427387903 -4611686018427387904..-4150517416584649089: ################## 208 -4150517416584649088..-3689348814741910273: 0 -3689348814741910272..-3228180212899171457: 0 @@ -1697,7 +1697,7 @@ random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 1000, avg: -55083208105414424.00, stddev: 1847115855773138688.00, median 9, min -4590718933436425025, max 4611686018427387903 + num: 1000, avg: -5.508e+16, stddev: 1.847e+18, median 9, min -4590718933436425025, max 4611686018427387903 -4590718933436425025..-4130598685843234370: ## 26 -4130598685843234369..-3670478438250043714: # 13 -3670478438250043713..-3210358190656853058: ### 37 diff --git a/test/core/QCheck_expect_test.expected.ocaml5.32 b/test/core/QCheck_expect_test.expected.ocaml5.32 index c03f8999..6c2dd7d0 100644 --- a/test/core/QCheck_expect_test.expected.ocaml5.32 +++ b/test/core/QCheck_expect_test.expected.ocaml5.32 @@ -1421,7 +1421,7 @@ stats dist: +++ Stats for int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 100000, avg: -2481754.31, stddev: 618398387.27, median -5669677, min -1073719962, max 1073717275 + num: 100000, avg: -2481754.31, stddev: 6.184e+08, median -5669677, min -1073719962, max 1073717275 -1073719962.. -966348101: ##################################################### 4978 -966348100.. -858976239: ##################################################### 5008 -858976238.. -751604377: #################################################### 4907 @@ -1446,7 +1446,7 @@ stats dist: +++ Stats for oneof int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 1000, avg: 1073741.60, stddev: 673131652.31, median 0, min -1073741824, max 1073741823 + num: 1000, avg: 1073741.60, stddev: 6.731e+08, median 0, min -1073741824, max 1073741823 -1073741824.. -966367642: ################# 198 -966367641.. -858993459: 0 -858993458.. -751619276: 0 @@ -1676,7 +1676,7 @@ random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 1000, avg: -20587725.59, stddev: 427231078.01, median 8, min -1072292884, max 1073741823 + num: 1000, avg: -2.059e+07, stddev: 4.272e+08, median 8, min -1072292884, max 1073741823 -1072292884.. -964991149: ## 26 -964991148.. -857689413: ### 31 -857689412.. -750387677: ## 22 diff --git a/test/core/QCheck_expect_test.expected.ocaml5.64 b/test/core/QCheck_expect_test.expected.ocaml5.64 index 3123e474..0b9562f4 100644 --- a/test/core/QCheck_expect_test.expected.ocaml5.64 +++ b/test/core/QCheck_expect_test.expected.ocaml5.64 @@ -1453,7 +1453,7 @@ stats dist: +++ Stats for int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 100000, avg: -7215552342608377.00, stddev: 2666234426234203648.00, median -16620417636667326, min -4611371852367564818, max 4611613630315464842 + num: 100000, avg: -7.216e+15, stddev: 2.666e+18, median -16620417636667326, min -4611371852367564818, max 4611613630315464842 -4611371852367564818..-4150222578233413331: ##################################################### 5003 -4150222578233413330..-3689073304099261843: ####################################################### 5106 -3689073304099261842..-3227924029965110355: ###################################################### 5052 @@ -1478,7 +1478,7 @@ stats dist: +++ Stats for oneof int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 1000, avg: 4611686018427388.00, stddev: 2891078433912002560.00, median 0, min -4611686018427387904, max 4611686018427387903 + num: 1000, avg: 4.612e+15, stddev: 2.891e+18, median 0, min -4611686018427387904, max 4611686018427387903 -4611686018427387904..-4150517416584649089: ################# 198 -4150517416584649088..-3689348814741910273: 0 -3689348814741910272..-3228180212899171457: 0 @@ -1708,7 +1708,7 @@ random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 1000, avg: -38152533987928176.00, stddev: 1828925617669212672.00, median 9, min -4606614955625884935, max 4611686018427387903 + num: 1000, avg: -3.815e+16, stddev: 1.829e+18, median 9, min -4606614955625884935, max 4611686018427387903 -4606614955625884935..-4145699906923221320: ## 27 -4145699906923221319..-3684784858220557704: ## 22 -3684784858220557703..-3223869809517894088: ## 29 From b7de376cc70da4afbca7bffe7d53463835342cd2 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 3 Mar 2025 23:56:08 +0100 Subject: [PATCH 346/391] Also trigger dune runtest on Windows --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a455c1ba..39465e67 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,4 +36,3 @@ jobs: - run: opam install . --deps-only --with-test - run: opam exec -- dune build - run: opam exec -- dune runtest - if: ${{ matrix.os != 'windows-latest'}} From e194b21d083b6522d15e42e5b169a7b8ad41e1f5 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 4 Mar 2025 00:19:14 +0100 Subject: [PATCH 347/391] Workaround for Windows printing of float exponents --- src/core/QCheck2.ml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/core/QCheck2.ml b/src/core/QCheck2.ml index ffd10266..89dfca41 100644 --- a/src/core/QCheck2.ml +++ b/src/core/QCheck2.ml @@ -2100,7 +2100,13 @@ module Test = struct max_val := max !max_val new_count) tbl; (* print entries of the table, sorted by increasing index *) let out = Buffer.create 128 in - let fmt_float f = if f > 1e7 || f < -1e7 then Printf.sprintf "%.3e" f else Printf.sprintf "%.2f" f in + (* Windows workaround to avoid annoying exponent zero such as "1.859e+018" *) + let cut_exp_zero s = + match String.split_on_char '+' s with + | [signif;exponent] -> Printf.sprintf "%s+%i" signif (int_of_string exponent) + | _ -> failwith "cut_exp_zero failed to parse scientific notation " ^ s in + let fmt_float f = + if f > 1e7 || f < -1e7 then cut_exp_zero (Printf.sprintf "%.3e" f) else Printf.sprintf "%.2f" f in Printf.bprintf out "stats %s:\n" name; Printf.bprintf out " num: %d, avg: %s, stddev: %s, median %d, min %d, max %d\n" From 947e46418598c929994e90097743894e588a7823 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 6 Mar 2025 00:15:43 +0100 Subject: [PATCH 348/391] Update 32-bit expect test outputs --- example/QCheck_runner_test.expected.ocaml4.32 | 2 +- example/QCheck_runner_test.expected.ocaml5.32 | 2 +- test/core/QCheck2_expect_test.expected.ocaml4.32 | 6 +++--- test/core/QCheck2_expect_test.expected.ocaml5.32 | 6 +++--- test/core/QCheck_expect_test.expected.ocaml4.32 | 6 +++--- test/core/QCheck_expect_test.expected.ocaml5.32 | 6 +++--- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/example/QCheck_runner_test.expected.ocaml4.32 b/example/QCheck_runner_test.expected.ocaml4.32 index 1ae9e867..d4eaa4ba 100644 --- a/example/QCheck_runner_test.expected.ocaml4.32 +++ b/example/QCheck_runner_test.expected.ocaml4.32 @@ -307,7 +307,7 @@ stats dist: +++ Stats for stat_display_test_7 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 100000, avg: 336840.90, stddev: 6.193e+08, median 895228, min -1073728193, max 1073739280 + num: 100000, avg: 336840.90, stddev: 6.193e+8, median 895228, min -1073728193, max 1073739280 -1073728193.. -966354820: ##################################################### 5009 -966354819.. -858981446: #################################################### 5004 -858981445.. -751608072: #################################################### 4917 diff --git a/example/QCheck_runner_test.expected.ocaml5.32 b/example/QCheck_runner_test.expected.ocaml5.32 index e5816762..92c96687 100644 --- a/example/QCheck_runner_test.expected.ocaml5.32 +++ b/example/QCheck_runner_test.expected.ocaml5.32 @@ -307,7 +307,7 @@ stats dist: +++ Stats for stat_display_test_7 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 100000, avg: -2481754.31, stddev: 6.184e+08, median -5669677, min -1073719962, max 1073717275 + num: 100000, avg: -2481754.31, stddev: 6.184e+8, median -5669677, min -1073719962, max 1073717275 -1073719962.. -966348101: ##################################################### 4978 -966348100.. -858976239: ##################################################### 5008 -858976238.. -751604377: #################################################### 4907 diff --git a/test/core/QCheck2_expect_test.expected.ocaml4.32 b/test/core/QCheck2_expect_test.expected.ocaml4.32 index 68ba9ffc..04472ca1 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml4.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml4.32 @@ -1434,7 +1434,7 @@ stats dist: +++ Stats for int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 100000, avg: -298652.90, stddev: 6.191e+08, median 419404, min -1073741519, max 1073728237 + num: 100000, avg: -298652.90, stddev: 6.191e+8, median 419404, min -1073741519, max 1073728237 -1073741519.. -966368032: ##################################################### 4984 -966368031.. -858994544: ###################################################### 5025 -858994543.. -751621056: ###################################################### 5035 @@ -1459,7 +1459,7 @@ stats dist: +++ Stats for oneof int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 1000, avg: 1073741.63, stddev: 6.766e+08, median 0, min -1073741824, max 1073741823 + num: 1000, avg: 1073741.63, stddev: 6.766e+8, median 0, min -1073741824, max 1073741823 -1073741824.. -966367642: ################## 208 -966367641.. -858993459: 0 -858993458.. -751619276: 0 @@ -1688,7 +1688,7 @@ random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 1000, avg: 2229293.51, stddev: 4.276e+08, median 9, min -1072726813, max 1073741823 + num: 1000, avg: 2229293.51, stddev: 4.276e+8, median 9, min -1072726813, max 1073741823 -1072726813.. -965403382: ## 22 -965403381.. -858079950: ## 28 -858079949.. -750756518: # 17 diff --git a/test/core/QCheck2_expect_test.expected.ocaml5.32 b/test/core/QCheck2_expect_test.expected.ocaml5.32 index 7d786ce1..257cae27 100644 --- a/test/core/QCheck2_expect_test.expected.ocaml5.32 +++ b/test/core/QCheck2_expect_test.expected.ocaml5.32 @@ -1417,7 +1417,7 @@ stats dist: +++ Stats for int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 100000, avg: 1375300.54, stddev: 6.201e+08, median -3852464, min -1073736753, max 1073733862 + num: 100000, avg: 1375300.54, stddev: 6.201e+8, median -3852464, min -1073736753, max 1073733862 -1073736753.. -966363223: #################################################### 4972 -966363222.. -858989692: ##################################################### 5032 -858989691.. -751616161: #################################################### 4928 @@ -1442,7 +1442,7 @@ stats dist: +++ Stats for oneof int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 1000, avg: 1073741.60, stddev: 6.731e+08, median 0, min -1073741824, max 1073741823 + num: 1000, avg: 1073741.60, stddev: 6.731e+8, median 0, min -1073741824, max 1073741823 -1073741824.. -966367642: ################# 198 -966367641.. -858993459: 0 -858993458.. -751619276: 0 @@ -1672,7 +1672,7 @@ random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 1000, avg: 1.219e+07, stddev: 4.513e+08, median 10, min -1073230792, max 1073741823 + num: 1000, avg: 1.219e+7, stddev: 4.513e+8, median 10, min -1073230792, max 1073741823 -1073230792.. -965882162: ## 19 -965882161.. -858533531: ### 30 -858533530.. -751184900: ### 29 diff --git a/test/core/QCheck_expect_test.expected.ocaml4.32 b/test/core/QCheck_expect_test.expected.ocaml4.32 index 048364c5..bdfefeb4 100644 --- a/test/core/QCheck_expect_test.expected.ocaml4.32 +++ b/test/core/QCheck_expect_test.expected.ocaml4.32 @@ -1411,7 +1411,7 @@ stats dist: +++ Stats for int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 100000, avg: 336840.90, stddev: 6.193e+08, median 895228, min -1073728193, max 1073739280 + num: 100000, avg: 336840.90, stddev: 6.193e+8, median 895228, min -1073728193, max 1073739280 -1073728193.. -966354820: ##################################################### 5009 -966354819.. -858981446: #################################################### 5004 -858981445.. -751608072: #################################################### 4917 @@ -1436,7 +1436,7 @@ stats dist: +++ Stats for oneof int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 1000, avg: 1073741.63, stddev: 6.766e+08, median 0, min -1073741824, max 1073741823 + num: 1000, avg: 1073741.63, stddev: 6.766e+8, median 0, min -1073741824, max 1073741823 -1073741824.. -966367642: ################## 208 -966367641.. -858993459: 0 -858993458.. -751619276: 0 @@ -1665,7 +1665,7 @@ random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 1000, avg: 1.035e+07, stddev: 4.322e+08, median 9, min -1066972208, max 1073741823 + num: 1000, avg: 1.035e+7, stddev: 4.322e+8, median 9, min -1066972208, max 1073741823 -1066972208.. -959936507: ## 27 -959936506.. -852900805: ## 22 -852900804.. -745865103: ## 22 diff --git a/test/core/QCheck_expect_test.expected.ocaml5.32 b/test/core/QCheck_expect_test.expected.ocaml5.32 index 6c2dd7d0..355f7bbe 100644 --- a/test/core/QCheck_expect_test.expected.ocaml5.32 +++ b/test/core/QCheck_expect_test.expected.ocaml5.32 @@ -1421,7 +1421,7 @@ stats dist: +++ Stats for int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 100000, avg: -2481754.31, stddev: 6.184e+08, median -5669677, min -1073719962, max 1073717275 + num: 100000, avg: -2481754.31, stddev: 6.184e+8, median -5669677, min -1073719962, max 1073717275 -1073719962.. -966348101: ##################################################### 4978 -966348100.. -858976239: ##################################################### 5008 -858976238.. -751604377: #################################################### 4907 @@ -1446,7 +1446,7 @@ stats dist: +++ Stats for oneof int dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 1000, avg: 1073741.60, stddev: 6.731e+08, median 0, min -1073741824, max 1073741823 + num: 1000, avg: 1073741.60, stddev: 6.731e+8, median 0, min -1073741824, max 1073741823 -1073741824.. -966367642: ################# 198 -966367641.. -858993459: 0 -858993458.. -751619276: 0 @@ -1676,7 +1676,7 @@ random seed: 153870556 +++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stats dist: - num: 1000, avg: -2.059e+07, stddev: 4.272e+08, median 8, min -1072292884, max 1073741823 + num: 1000, avg: -2.059e+7, stddev: 4.272e+8, median 8, min -1072292884, max 1073741823 -1072292884.. -964991149: ## 26 -964991148.. -857689413: ### 31 -857689412.. -750387677: ## 22 From d7ac0983eb8b29db047260a3015b25d6302c87e9 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Tue, 4 Mar 2025 00:29:45 +0100 Subject: [PATCH 349/391] Add CHANGELOG entry --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d36d8e2..a5eed084 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ ## NEXT RELEASE - Restore `Test.make`'s `max_fail` parameter which was accidentally broken in 0.18 +- Adjust `stats` computation of average and standard deviation to + limit precision loss, print both using scientific notation, and + workaround MinGW float printing to also pass expect tests ## 0.24 From 7063a4f57d0fc943a460f9108ef5f6347192d8f2 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 6 Mar 2025 11:09:45 +0100 Subject: [PATCH 350/391] Use source lisp for dune snippets --- README.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.adoc b/README.adoc index f21d7438..d7673ec7 100644 --- a/README.adoc +++ b/README.adoc @@ -457,7 +457,7 @@ let _ = QCheck_runner.run_tests_main [test] with the following `dune` file: -[source] +[source,lisp] ---- (test (name test) @@ -487,7 +487,7 @@ let _ = QCheck_base_runner.run_tests_main [test] and adjust the `dune` file accordingly to use `qcheck-core` and its `qcheck-core.runner` sub-package: -[source] +[source,lisp] ---- (test (name test) From 5f2336d5c7120429f0e16d65aeeb246a394e60f6 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 6 Mar 2025 11:10:59 +0100 Subject: [PATCH 351/391] Remove empty table-of-contents entry --- README.adoc | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.adoc b/README.adoc index d7673ec7..54737209 100644 --- a/README.adoc +++ b/README.adoc @@ -23,8 +23,6 @@ of interest: Jan Midtgaard (@jmid) has http://janmidtgaard.dk/quickcheck/index.html[a lecture] about property-based testing that relies on QCheck. -toc::[] - == Use See the documentation. I also wrote From 9a1f9f28da39e79e348a9ca55501debe298df357 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 6 Mar 2025 11:19:49 +0100 Subject: [PATCH 352/391] Add a workflow for checking asciidoc in README --- .github/workflows/check-asciidoc.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/check-asciidoc.yml diff --git a/.github/workflows/check-asciidoc.yml b/.github/workflows/check-asciidoc.yml new file mode 100644 index 00000000..8c3d56f6 --- /dev/null +++ b/.github/workflows/check-asciidoc.yml @@ -0,0 +1,17 @@ +name: build +on: + push: + branches: + - main + pull_request: + branches: + - main +jobs: + run: + name: Check asciidoc + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: sudo apt install asciidoc-base + - run: asciidoc README.adoc + From 58234125f500aabc0077e7b14e6ccdf51d9edc52 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 6 Mar 2025 11:59:15 +0100 Subject: [PATCH 353/391] Add a CHANGELOG entry --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a5eed084..7f477b73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ - Adjust `stats` computation of average and standard deviation to limit precision loss, print both using scientific notation, and workaround MinGW float printing to also pass expect tests +- Fix dune snippets missing a language specifier in README.adoc + causing `asciidoc` to error ## 0.24 From 6156efd09b03e832e07b2187e97b6caace38eef8 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 6 Mar 2025 12:12:37 +0100 Subject: [PATCH 354/391] Build and test on 5.3.0 too --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 39465e67..b77caa11 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,6 +22,7 @@ jobs: - "4.14" - "5.0" - "5.2" + - "5.3" exclude: - os: windows-latest ocaml-compiler: "4.08" From 9adb5d1f90eec77643f1bab87c4908da59c72de5 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 6 Mar 2025 12:20:28 +0100 Subject: [PATCH 355/391] Change macos test to target Apple-silicon --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b77caa11..a4427c52 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ jobs: fail-fast: false matrix: os: - - macos-13 + - macos-latest - ubuntu-latest - windows-latest ocaml-compiler: From 62ac6bc62b5970ff1739237b4dd759b81069d004 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 6 Mar 2025 12:52:19 +0100 Subject: [PATCH 356/391] Exclude macOS 4.08, which ARM64 support has not been backported to --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a4427c52..7531ae29 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,6 +24,8 @@ jobs: - "5.2" - "5.3" exclude: + - os: macos-latest + ocaml-compiler: "4.08" - os: windows-latest ocaml-compiler: "4.08" - os: windows-latest From 0c9f82065c57da87c8ef2a0e59c1e547636be683 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 6 Mar 2025 13:59:29 +0100 Subject: [PATCH 357/391] Add testing on 32-bit i386 of OCaml 4.14 and 5.3 via Docker containers --- .github/workflows/main.yml | 43 +++++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7531ae29..73822f8b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,10 +32,39 @@ jobs: ocaml-compiler: "4.12" runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 - - uses: ocaml/setup-ocaml@v3 - with: - ocaml-compiler: ${{ matrix.ocaml-compiler }} - - run: opam install . --deps-only --with-test - - run: opam exec -- dune build - - run: opam exec -- dune runtest + - uses: actions/checkout@v4 + - uses: ocaml/setup-ocaml@v3 + with: + ocaml-compiler: ${{ matrix.ocaml-compiler }} + - run: opam install . --deps-only --with-test + - run: opam exec -- dune build + - run: opam exec -- dune runtest + + i386: + strategy: + fail-fast: false + matrix: + container-image: + - ocaml/opam:debian-12-ocaml-4.14 + - ocaml/opam:debian-12-ocaml-5.3 + runs-on: ubuntu-latest + container: + image: ${{ matrix.container-image }} + options: --platform linux/i386 + steps: + # GitHub insists on HOME=/github/home which clashes with the opam image setup + - name: Setup and init opam + run: | + sudo cp /usr/bin/opam-2.3 /usr/bin/opam + cd /home/opam && HOME=/home/opam opam init -y + - name: Checkout repository + # See https://github.com/actions/checkout/issues/334 + uses: actions/checkout@v1 + - name: Setup repo and install dependencies + run: | + sudo chown -R opam:opam . + HOME=/home/opam opam install . --deps-only --with-test + - name: Build + run: HOME=/home/opam opam exec -- dune build + - name: Run the testsuite + run: HOME=/home/opam opam exec -- dune runtest From 9ed83fa7a16b0c4e61a6a88b3ae2fbc9f61a28c1 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 6 Mar 2025 21:34:12 +0100 Subject: [PATCH 358/391] opam update in original workflows --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 73822f8b..8e618e3c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,6 +36,7 @@ jobs: - uses: ocaml/setup-ocaml@v3 with: ocaml-compiler: ${{ matrix.ocaml-compiler }} + - run: opam update -y - run: opam install . --deps-only --with-test - run: opam exec -- dune build - run: opam exec -- dune runtest From 30f623978662318a8a447d5917f112a95674f4d0 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Thu, 6 Mar 2025 21:37:14 +0100 Subject: [PATCH 359/391] opam update in 32-bit workflows --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8e618e3c..54d619e4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -54,10 +54,11 @@ jobs: options: --platform linux/i386 steps: # GitHub insists on HOME=/github/home which clashes with the opam image setup - - name: Setup and init opam + - name: Setup, init, and update opam run: | sudo cp /usr/bin/opam-2.3 /usr/bin/opam cd /home/opam && HOME=/home/opam opam init -y + git -C /home/opam/opam-repository pull origin master && HOME=/home/opam opam update -y - name: Checkout repository # See https://github.com/actions/checkout/issues/334 uses: actions/checkout@v1 From c1a9429538fee63b90bad183edc79050d5e99934 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 7 Mar 2025 14:55:06 +0100 Subject: [PATCH 360/391] Add a note and an example to QCheck{,2.Gen}.small_int_corners --- src/core/QCheck.mli | 13 ++++++++++++- src/core/QCheck2.mli | 12 +++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index f8146755..e3e4a794 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -1144,7 +1144,18 @@ val pos_int : int arbitrary val small_int_corners : unit -> int arbitrary (** As [small_int], but each newly created generator starts with - a list of corner cases before falling back on random generation. *) + a list of corner cases before falling back on random generation. + + Note that [small_int_corners ()] is stateful, meaning that once the list of + corner cases has been emitted, subsequent calls will not reproduce them. + As a consequence, in the following example, the first test fails with a + counter example, whereas the second rerun does not: + {[ + let gen = QCheck.small_int_corners () + let t = QCheck.Test.make ~name:"never max_int" gen (fun i -> i <> max_int) + let _ = QCheck_base_runner.run_tests ~verbose:true [t;t] + ]} + *) val neg_int : int arbitrary (** Negative int generator (0 included, see {!Gen.neg_int}). diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index f789ddd9..b5557e1c 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -233,8 +233,18 @@ module Gen : sig val small_int_corners : unit -> int t (** As {!small_int}, but each newly created generator starts with - a list of corner cases before falling back on random generation. *) + a list of corner cases before falling back on random generation. + Note that [small_int_corners ()] is stateful, meaning that once the list of + corner cases has been emitted, subsequent calls will not reproduce them. + As a consequence, in the following example, the first test fails with a + counter example, whereas the second rerun does not: + {[ + let gen = QCheck2.Gen.small_int_corners () + let t = QCheck2.Test.make ~name:"never max_int" gen (fun i -> i <> max_int) + let _ = QCheck_base_runner.run_tests ~verbose:true [t;t] + ]} + *) val int32 : int32 t (** Generates uniform {!int32} values. From e191cd2ec0e00d994e8886d09c3a232a21e4db39 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Fri, 7 Mar 2025 15:05:57 +0100 Subject: [PATCH 361/391] Add a note to QCheck{,2}.Gen.graft_corners --- src/core/QCheck.mli | 6 ++++++ src/core/QCheck2.mli | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index e3e4a794..7e176cd0 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -325,6 +325,12 @@ module Gen : sig val graft_corners : 'a t -> 'a list -> unit -> 'a t (** [graft_corners gen l ()] makes a new generator that enumerates the corner cases in [l] and then behaves like [g]. + + Note that [graft_corners gen l ()] is stateful, meaning that once the + elements of [l] have been emitted, subsequent calls will not reproduce + them. It is therefore recommended that separate tests each use a fresh + generator. + @since 0.6 *) val int_pos_corners : int list diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index b5557e1c..6e8a30e1 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -634,6 +634,11 @@ module Gen : sig Does not shrink if the test fails on a grafted value. Shrinks towards [gen] otherwise. + Note that [graft_corners gen l ()] is stateful, meaning that once the + elements of [l] have been emitted, subsequent calls will not reproduce + them. It is therefore recommended that separate tests each use a fresh + generator. + @since 0.6 *) val int_pos_corners : int list From ae3386806c9336ea72e3425c8e3b624250a7f5ba Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Sat, 8 Mar 2025 09:36:10 +0100 Subject: [PATCH 362/391] Fix heading label warning --- doc/qcheck-core/index.mld | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/qcheck-core/index.mld b/doc/qcheck-core/index.mld index 5d9eea71..c664176b 100644 --- a/doc/qcheck-core/index.mld +++ b/doc/qcheck-core/index.mld @@ -5,7 +5,7 @@ The [qcheck-core] opam package contains two libraries: - The [qcheck-core] library for defining property-based tests - The [qcheck-core.runner] library for running property-based tests -{1: The [qcheck-core] library} +{1 The [qcheck-core] library} The [qcheck-core] library exposes two toplevel modules: @@ -21,7 +21,7 @@ removing the need for having to hand-write shrinkers. file an issue if you encounter problems using either of the two modules. -{1: The [qcheck-core.runner] library} +{1 The [qcheck-core.runner] library} The entry point of the [qcheck-core.runner] library is the {!QCheck_base_runner} module. From 066339387e3301a471037b877c91da58e6745698 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Sat, 8 Mar 2025 09:37:33 +0100 Subject: [PATCH 363/391] Fix warnings in src/ppx_deriving_qcheck --- src/ppx_deriving_qcheck/QCheck_generators.ml | 12 ++++++------ src/ppx_deriving_qcheck/tuple.ml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ppx_deriving_qcheck/QCheck_generators.ml b/src/ppx_deriving_qcheck/QCheck_generators.ml index 48e44cfe..21c71df2 100644 --- a/src/ppx_deriving_qcheck/QCheck_generators.ml +++ b/src/ppx_deriving_qcheck/QCheck_generators.ml @@ -3,7 +3,7 @@ open Ppxlib (** This module contains all generators from QCheck used to derive a type declaration *) -(** {2. Version} *) +(** {2 Version} *) type version = [`QCheck | `QCheck2] @@ -28,11 +28,11 @@ let apply3 loc f a b c = [%expr [%e f] [%e a] [%e b] [%e c]] let apply4 loc f a b c d = [%expr [%e f] [%e a] [%e b] [%e c] [%e d]] -(** {2. Type} *) +(** {2 Type} *) let ty version = Ldot (Ldot (Lident (to_module version), "Gen"), "t") -(** {2. Primitive generators} *) +(** {2 Primitive generators} *) let unit loc version = with_prefix_gen loc version "unit" @@ -62,7 +62,7 @@ let array ~loc ~version e = let gen = with_prefix_gen loc version "array" in apply1 loc gen e -(** {2. Generator combinators} *) +(** {2 Generator combinators} *) let pure ~loc ~version e = let gen = with_prefix_gen loc version "pure" in @@ -101,7 +101,7 @@ let fix ~loc ~version e = (** Observable generators *) module Observable = struct - (** {2. Primitive generators} *) + (** {2 Primitive generators} *) let unit loc version = with_prefix_obs loc version "unit" let int loc version = with_prefix_obs loc version "int" @@ -130,7 +130,7 @@ module Observable = struct let obs = with_prefix_obs loc version "array" in apply1 loc obs e - (** {2. Observable combinators} *) + (** {2 Observable combinators} *) let pair ~loc ~version a b = let obs = with_prefix_obs loc version "pair" in apply2 loc obs a b diff --git a/src/ppx_deriving_qcheck/tuple.ml b/src/ppx_deriving_qcheck/tuple.ml index 0b5a6e42..021f1019 100644 --- a/src/ppx_deriving_qcheck/tuple.ml +++ b/src/ppx_deriving_qcheck/tuple.ml @@ -2,7 +2,7 @@ open Ppxlib module G = QCheck_generators module O = G.Observable -(** {1. Tuple } *) +(** {1 Tuple } *) (** This module implements nested tuples based on QCheck tuples generators (or observables): - [Gen.pair] From 21986059182b5f76a3a35a12cc22c5aa25451336 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Sat, 8 Mar 2025 16:04:20 +0100 Subject: [PATCH 364/391] Fix broken type t documentation reference --- src/core/QCheck.mli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 7e176cd0..b85608f0 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -1895,7 +1895,7 @@ module Tuple : sig val nil : unit t val cons : 'a -> 'b t -> ('a * 'b) t - (** How to observe a {!'a t} *) + (** How to observe a {{!t}['a t]} *) type 'a obs val o_nil : unit obs From d57d3bc2cd35a7e36d1d6b16768956488cd0c9a3 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Sat, 8 Mar 2025 16:05:35 +0100 Subject: [PATCH 365/391] Fix broken B_cons documentation reference --- src/core/QCheck.mli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index b85608f0..39b71774 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -1906,7 +1906,7 @@ module Tuple : sig (** Alias to {!cons}. *) val (@->) : 'a Observable.t -> 'b obs -> ('a * 'b) obs - (** Alias to {!B_cons}. *) + (** Alias to {!o_cons}. *) end include module type of Infix From 2ccb37f9be5ed1e5bb0e95c6b8a3615a10c86ed7 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Sat, 8 Mar 2025 16:10:38 +0100 Subject: [PATCH 366/391] Fix broken Gen.(>>=) documentation reference --- src/core/QCheck.mli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 39b71774..24533a7f 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -646,7 +646,7 @@ module Gen : sig (** {{: https://ocaml.org/manual/bindingops.html} Binding operator} alias for {!pair}. *) val ( let* ) : 'a t -> ('a -> 'b t) -> 'b t - (** {{: https://ocaml.org/manual/bindingops.html} Binding operator} alias for {!bind}. *) + (** {{: https://ocaml.org/manual/bindingops.html} Binding operator} alias for {!(>>=)}. *) val ( and* ) : 'a t -> 'b t -> ('a * 'b) t (** {{: https://ocaml.org/manual/bindingops.html} Binding operator} alias for {!pair}. *) From a5eebef887100ae95fd4b7025e492f316cbd25cd Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Sat, 8 Mar 2025 16:12:09 +0100 Subject: [PATCH 367/391] Fix broken Gen.bytes_readable documentation reference --- src/core/QCheck.mli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 24533a7f..71bd89aa 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -421,7 +421,7 @@ module Gen : sig val bytes : ?gen:char t -> bytes t (** Builds a bytes generator. Bytes size is generated by {!nat}. Accepts an optional character generator (the default is {!char}). - See also {!bytes_of} and {!bytes_readable} for versions without + See also {!bytes_of} and {!bytes_printable} for versions without optional parameters. @since 0.20 *) From 849e19da0cabf2e6554c843e63458f584c7cbacd Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Sat, 8 Mar 2025 16:16:52 +0100 Subject: [PATCH 368/391] Fix broken Generator documentation reference --- src/core/QCheck.mli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index 71bd89aa..ea8c80e3 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -78,7 +78,7 @@ all rights reserved. ]} More complex and powerful combinators can be found in Gabriel Scherer's - {!Generator} module. Its documentation can be found + {{:https://github.com/gasche/random-generator}[Generator]} module. Its documentation can be found {{:http://gasche.github.io/random-generator/doc/Generator.html } here}. *) From 398d51ade174c174e28f36f50c06ac6ea4810436 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Sat, 8 Mar 2025 21:51:08 +0100 Subject: [PATCH 369/391] Fix broken QCheck2.map documentation reference --- src/core/QCheck2.mli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index 6e8a30e1..33f5163d 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -2043,7 +2043,7 @@ val find_example_gen : - as shrinking is now integrated, several function arguments like [~shrink] or [~rev] have been removed: you can remove such reverse functions, they will no longer be necessary. - accessor functions like {!QCheck.gen} have been renamed to consistent names like {!get_gen}. - - {!QCheck.map_keep_input} has been removed: you can use {!map} directly. + - {!QCheck.map_keep_input} has been removed: you can use {!Gen.map} directly. - {!Gen.t} is no longer public, it is now abstract: it is recommended to use {{!section:Gen.composing_generators} generator composition} to make generators. {!Gen.make_primitive} was added to create generators with finer control (in particular of shrinking). From 3ffd1b8c467d178f52b0f196f1304bc13237c487 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Sat, 8 Mar 2025 21:52:39 +0100 Subject: [PATCH 370/391] Fix broken QCheck2.get_gen documentation reference --- src/core/QCheck2.mli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index 33f5163d..84509626 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -2042,7 +2042,7 @@ val find_example_gen : Below are the most common situations you may encounter: - as shrinking is now integrated, several function arguments like [~shrink] or [~rev] have been removed: you can remove such reverse functions, they will no longer be necessary. - - accessor functions like {!QCheck.gen} have been renamed to consistent names like {!get_gen}. + - accessor functions like {!QCheck.gen} have been renamed to consistent names like {!Test.get_gen}. - {!QCheck.map_keep_input} has been removed: you can use {!Gen.map} directly. - {!Gen.t} is no longer public, it is now abstract: it is recommended to use {{!section:Gen.composing_generators} generator composition} to make generators. {!Gen.make_primitive} From 8aa6c5f1ac7db661c764f7d27bf93b65d4691eeb Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Sat, 8 Mar 2025 21:57:10 +0100 Subject: [PATCH 371/391] Fix ambiguous QCheck.gen documentation reference --- src/core/QCheck2.mli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index 84509626..1f124546 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -2042,7 +2042,7 @@ val find_example_gen : Below are the most common situations you may encounter: - as shrinking is now integrated, several function arguments like [~shrink] or [~rev] have been removed: you can remove such reverse functions, they will no longer be necessary. - - accessor functions like {!QCheck.gen} have been renamed to consistent names like {!Test.get_gen}. + - accessor functions like {!val:QCheck.gen} have been renamed to consistent names like {!Test.get_gen}. - {!QCheck.map_keep_input} has been removed: you can use {!Gen.map} directly. - {!Gen.t} is no longer public, it is now abstract: it is recommended to use {{!section:Gen.composing_generators} generator composition} to make generators. {!Gen.make_primitive} From 966269747cd382aacbd35066b2ced700d3f6ee6a Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Sat, 8 Mar 2025 21:59:33 +0100 Subject: [PATCH 372/391] Fix broken QCheck2.{int,int32,int64,float} documentation references --- src/core/QCheck2.mli | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index 1f124546..1c5bfb6d 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -1287,16 +1287,16 @@ module Shrink : sig *) val int_towards : int -> int -> int Seq.t - (** {!number_towards} specialized to {!int}. *) + (** {!number_towards} specialized to [int]. *) val int32_towards : int32 -> int32 -> int32 Seq.t - (** {!number_towards} specialized to {!int32}. *) + (** {!number_towards} specialized to [int32]. *) val int64_towards : int64 -> int64 -> int64 Seq.t - (** {!number_towards} specialized to {!int64}. *) + (** {!number_towards} specialized to [int64]. *) val float_towards : float -> float -> float Seq.t - (** {!number_towards} specialized to {!float}. + (** {!number_towards} specialized to [float]. There are various ways to shrink a float: - try removing floating digits, i.e. towards integer values From 20a88956b1a8f9af5c7cdea78d0575eab382f48e Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Sat, 8 Mar 2025 22:16:10 +0100 Subject: [PATCH 373/391] Fix broken Arg documentation references --- src/runner/QCheck_base_runner.mli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runner/QCheck_base_runner.mli b/src/runner/QCheck_base_runner.mli index d0e23a5f..1495f1d7 100644 --- a/src/runner/QCheck_base_runner.mli +++ b/src/runner/QCheck_base_runner.mli @@ -25,7 +25,7 @@ all rights reserved. will be 0 if all tests pass, 1 otherwise. {!run_tests_main} can be used as a shortcut for that, also - featuring command-line parsing (using {!Arg}) to activate + featuring command-line parsing (using [Arg]) to activate verbose mode and others. *) From f1a30d517b88b65d13f56c8839219d50c5c0fd58 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Sat, 8 Mar 2025 22:17:33 +0100 Subject: [PATCH 374/391] Fix broken None documentation references --- src/core/QCheck2.mli | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index 1c5bfb6d..14be7510 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -706,7 +706,7 @@ module Gen : sig val option : ?ratio:float -> 'a t -> 'a option t (** [option gen] is an [option] generator that uses [gen] when generating [Some] values. - Shrinks towards {!None} then towards shrinks of [gen]. + Shrinks towards [None] then towards shrinks of [gen]. @param ratio a float between [0.] and [1.] indicating the probability of a sample to be [Some _] rather than [None] (value is [0.85]). @@ -797,7 +797,7 @@ module Gen : sig val flatten_opt : 'a t option -> 'a option t (** Generate an option from an optional generator. - Shrinks towards {!None} then shrinks on the value. + Shrinks towards [None] then shrinks on the value. @since 0.13 *) From 70025b8fdf86a523e7083c649bc42cb1cbb0f727 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Sat, 8 Mar 2025 22:38:12 +0100 Subject: [PATCH 375/391] Fix broken Random documentation references --- src/core/QCheck2.mli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index 14be7510..86c5212f 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -427,7 +427,7 @@ module Gen : sig val make_primitive : gen : (Random.State.t -> 'a) -> shrink : ('a -> 'a Seq.t) -> 'a t (** [make_primitive ~gen ~shrink] creates a generator from a function [gen] that creates - a random value (this function must only use the given {!Random.State.t} for randomness) + a random value (this function must only use the given [Random.State.t] for randomness) and a function [shrink] that, given a value [a], returns a lazy list of "smaller" values (used when a test fails). From 026efe699bc3665924a3946d710b0277ed46eb48 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Sat, 8 Mar 2025 22:39:23 +0100 Subject: [PATCH 376/391] Fix broken List documentation references --- src/core/QCheck2.mli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/QCheck2.mli b/src/core/QCheck2.mli index 86c5212f..c9013365 100644 --- a/src/core/QCheck2.mli +++ b/src/core/QCheck2.mli @@ -34,7 +34,7 @@ content will appear. *) {1 Examples} - - "{!List.rev} is involutive" (the test passes so [check_exn] returns [()]): + - "[List.rev] is involutive" (the test passes so [check_exn] returns [()]): {[ let test = From 9ff240ad4b0af161712b5c406f68d704891dd187 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Sat, 8 Mar 2025 22:41:17 +0100 Subject: [PATCH 377/391] Fix missing documentation code braces in QCheck.choose --- src/core/QCheck.mli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/QCheck.mli b/src/core/QCheck.mli index ea8c80e3..d3b24e1f 100644 --- a/src/core/QCheck.mli +++ b/src/core/QCheck.mli @@ -1417,7 +1417,7 @@ val tup9 : val choose : 'a arbitrary list -> 'a arbitrary (** Choose among the given list of generators. The list must not - be empty; if it is Invalid_argument is raised. *) + be empty; if it is [Invalid_argument] is raised. *) val oneofl : ?print:'a Print.t -> ?collect:('a -> string) -> 'a list -> 'a arbitrary From ebdfa86302fb71ceb7e1661a24b7d4b07440c3da Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 10 Mar 2025 11:00:04 +0100 Subject: [PATCH 378/391] Add a CHANGELOG entry --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f477b73..af3c2989 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ workaround MinGW float printing to also pass expect tests - Fix dune snippets missing a language specifier in README.adoc causing `asciidoc` to error +- Add a note to `QCheck{,2.Gen}.small_int_corners` and `QCheck{,2}.Gen.graft_corners` + about internal state, and fix a range of documentation reference warnings ## 0.24 From 04396430c1105e2b92b8a2b620747bcbe0f6208e Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 10 Mar 2025 10:55:35 +0100 Subject: [PATCH 379/391] Reorganize and polish the front-page README --- README.adoc | 89 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 52 insertions(+), 37 deletions(-) diff --git a/README.adoc b/README.adoc index 54737209..f091175c 100644 --- a/README.adoc +++ b/README.adoc @@ -3,34 +3,64 @@ :toclevels: 4 :source-highlighter: pygments -QuickCheck inspired property-based testing for OCaml, and combinators to -generate random values to run tests on. +QuickCheck inspired property-based testing for OCaml. image::https://github.com/c-cube/qcheck/actions/workflows/main.yml/badge.svg[alt="build", link=https://github.com/c-cube/qcheck/actions/workflows/main.yml] +== Overview -The documentation can be found https://c-cube.github.io/qcheck/[here]. -This library spent some time in -https://github.com/vincent-hugot/iTeML[qtest], but is now -standalone again! +`QCheck` consists of a collection of `opam` packages and extensions: -To construct advanced random generators, the following libraries might be +- `qcheck-core` - provides the core property-based testing API and depends only + on `unix` and `dune`. + * It contains the modules `QCheck` and `QCheck2` and a `QCheck_base_runner` + module with our custom runners. +- `qcheck-ounit` - provides an integration layer for https://github.com/gildor478/ounit[`OUnit`] +- `qcheck-alcotest` - provides an integration layer with https://github.com/mirage/alcotest[`alcotest`] +- `qcheck` - provides a compatibility API with older versions of `qcheck`, + using both `qcheck-core` and `qcheck-ounit`. + * It provides `QCheck_runner` which is similar to older versions and contains + both custom and `OUnit`-based runners. +- `ppx_deriving_qcheck` - provides a preprocessor to automatically derive + generators + +In addition, the https://github.com/ocaml-multicore/multicoretests[`multicoretests`] +repository offers + +- `qcheck-stm` - for running sequential and parallel model-based tests +- `qcheck-lin` - for testing an API for sequential consistency +- `qcheck-multicoretests-util` - a small library of utility extensions, such as + properties with time outs + +To construct advanced random generators, the following libraries might also be of interest: -- https://gitlab.inria.fr/fpottier/feat/[Feat] -- @gasche's https://github.com/gasche/random-generator/[generator library] +- https://gitlab.inria.fr/fpottier/feat/[`feat`] - a library for functional + enumeration and sampling of algebraic data types +- https://github.com/gasche/random-generator/[`random-generator`] - a library + experimenting with APIs for random generation + +Earlier `qcheck` spent some time in https://github.com/vincent-hugot/iTeML[qtest], +but was since made standalone again. -Jan Midtgaard (@jmid) has http://janmidtgaard.dk/quickcheck/index.html[a lecture] about -property-based testing that relies on QCheck. -== Use +== Documentation + +The documentation for the 5 opam packages https://c-cube.github.io/qcheck/[is available here]. + +The <<examples>> below offer a brief introduction to the +library. These examples are based on an earlier +https://cedeela.fr/quickcheck-for-ocaml[blog post by Simon] that also +discusses some design choices; however, be warned that the API changed +since then, so the blog post code will not work as is. + +Jan's http://janmidtgaard.dk/quickcheck/index.html[course material on + FP and property-based testing] also offers an introduction to QCheck. + +The OCaml textbook from Cornell University also contains +https://cs3110.github.io/textbook/chapters/correctness/randomized.html[a +chapter about property-based testing with QCheck]. -See the documentation. I also wrote -https://cedeela.fr/quickcheck-for-ocaml[a blog post] that explains -how to use it and some design choices; however, be warned that the API -changed in lots of small ways (in the right direction, I hope) so the code -will not work any more. -<<examples>> is an updated version of the blog post's examples. == Build and Install @@ -47,6 +77,9 @@ To build the library from source $ make +Normally, for contributors, `opam pin https://github.com/c-cube/qcheck` +will pin the 5 opam packages from this repository. + == License @@ -128,15 +161,12 @@ failure (1 tests failed, 0 tests errored, ran 1 tests) - : int = 1 ---- - For an even nicer output `QCheck_runner.run_tests` also accepts an optional parameter `~verbose:true`. - === Mirrors and Trees - `QCheck` provides many useful combinators to write generators, especially for recursive types, algebraic types, and tuples. @@ -370,6 +400,7 @@ let () = ---- === Integration within Rely + https://reason-native.com/docs/rely/[Rely] is a Jest-inspire native reason testing framework. @reason-native/qcheck-rely is available via NPM and provides matchers for the easy use of qCheck within Rely. @@ -421,22 +452,6 @@ type tree = Leaf of int | Node of tree * tree See the according https://github.com/c-cube/qcheck/tree/master/src/ppx_deriving_qcheck/[README] for more information and examples. -=== Compatibility notes - -Starting with 0.9, the library is split into several components: - -- `qcheck-core` depends only on unix and bytes. It contains the module - `QCheck` and a `QCheck_base_runner` module with our custom runners. -- `qcheck-ounit` provides an integration layer for `OUnit` -- `qcheck` provides a compatibility API with older versions of qcheck, - using both `qcheck-core` and `qcheck-ounit`. - It provides `QCheck_runner` which is similar to older versions and contains - both custom and Ounit-based runners. -- `qcheck-alcotest` provides an integration layer with `alcotest` - -Normally, for contributors, -`opam pin https://github.com/c-cube/qcheck` will pin all these packages. - === Usage from dune From 4d34c07dec35ccffb89d823356956784e38f01c0 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 10 Mar 2025 14:11:32 +0100 Subject: [PATCH 380/391] Swap installation instructions to put qcheck-core first --- README.adoc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.adoc b/README.adoc index f091175c..5c81821e 100644 --- a/README.adoc +++ b/README.adoc @@ -64,14 +64,16 @@ chapter about property-based testing with QCheck]. == Build and Install -You can install qcheck via opam: +You can install QCheck via `opam`: - $ opam install qcheck + $ opam install qcheck-core -The `qcheck` package is offered for compatibility. -For a bare-bones installation you can use the `qcheck-core` package: +This provides a minimal installation without needless dependencies. - $ opam install qcheck-core +Install the bigger `qcheck` package instead for compatibility with qcheck.0.8 +and before: + + $ opam install qcheck To build the library from source From 67826493cdee439108ec3cb279d564a8fa63691c Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 10 Mar 2025 14:49:49 +0100 Subject: [PATCH 381/391] Rewrite examples to use 'qcheck-core' and QCheck_base_runner.run_tests --- README.adoc | 80 ++++++++++++++++++++++++++++------------------------- 1 file changed, 43 insertions(+), 37 deletions(-) diff --git a/README.adoc b/README.adoc index 5c81821e..7b581b46 100644 --- a/README.adoc +++ b/README.adoc @@ -95,7 +95,7 @@ and type the following to load QCheck: [source,OCaml] ---- -#require "qcheck";; +#require "qcheck-core";; ---- NOTE: alternatively, it is now possible to locally do: `dune utop src` @@ -140,22 +140,24 @@ When we run this test we are presented with a counterexample: ---- # QCheck.Test.check_exn test;; Exception: -QCheck.Test.Test_fail ("my_buggy_test", ["[0; 1] (after 23 shrink steps)"]). +test `my_buggy_test` failed on ≥ 1 cases: [0; 1] (after 11 shrink steps) ---- In this case QCheck found the minimal counterexample `[0;1]` to the property -`List.rev l = l` and it spent 23 steps shrinking it. +`List.rev l = l` and it spent 11 steps shrinking it. Now, let's run the buggy test with a decent runner that will print the results nicely (the exact output will change at each run, because of the random seed): ---- -# QCheck_runner.run_tests [test];; +# #require "qcheck-core.runner";; +# QCheck_base_runner.run_tests [test];; +random seed: 452768242 --- Failure -------------------------------------------------------------------- -Test my_buggy_test failed (10 shrink steps): +Test my_buggy_test failed (14 shrink steps): [0; 1] ================================================================================ @@ -163,15 +165,14 @@ failure (1 tests failed, 0 tests errored, ran 1 tests) - : int = 1 ---- -For an even nicer output `QCheck_runner.run_tests` also accepts an optional +For an even nicer output `QCheck_base_runner.run_tests` also accepts an optional parameter `~verbose:true`. === Mirrors and Trees -`QCheck` provides many useful combinators to write -generators, especially for recursive types, algebraic types, -and tuples. +`QCheck` provides many useful combinators to write generators, especially for +recursive types, algebraic types, and tuples. Let's see how to generate random trees: @@ -255,7 +256,7 @@ let test_buggy = QCheck.Test.make ~name:"buggy_mirror" ~count:200 arbitrary_tree (fun t -> t = mirror_tree t);; -QCheck_runner.run_tests [test_buggy];; +QCheck_base_runner.run_tests [test_buggy];; ---- This test fails with: @@ -293,8 +294,7 @@ let test_mirror = arbitrary_tree (fun t -> List.rev (tree_infix t) = tree_infix (mirror_tree t));; -QCheck_runner.run_tests [test_mirror];; - +QCheck_base_runner.run_tests [test_mirror];; ---- @@ -314,27 +314,35 @@ let test_hd_tl = assume (l <> []); l = List.hd l :: List.tl l));; -QCheck_runner.run_tests [test_hd_tl];; +QCheck_base_runner.run_tests [test_hd_tl];; ---- +By including a precondition QCheck will only run a property on input +satisfying `assume`'s condition, potentially generating extra test inputs. + + === Long tests It is often useful to have two version of a testsuite: a short one that runs -reasonably fast (so that it is effectively run each time a projet is built), +reasonably fast (so that it is effectively run each time a project is built), and a long one that might be more exhaustive (but whose running time makes it impossible to run at each build). To that end, each test has a 'long' version. In the long version of a test, the number of tests to run is multiplied by the `~long_factor` argument of `QCheck.Test.make`. + === Runners -The module `QCheck_runner` defines several functions to run tests, including -compatibility with `OUnit`. +The module `QCheck_base_runner` defines several functions to run tests. The easiest one is probably `run_tests`, but if you write your tests in a separate executable you can also use `run_tests_main` which parses command line arguments and exits with `0` in case of success, or an error number otherwise. +The module `QCheck_runner` from the `qcheck` opam package is similar, and +includes compatibility with `OUnit`. + + === Integration within OUnit https://github.com/gildor478/ounit[OUnit] is a popular unit-testing framework @@ -362,11 +370,8 @@ let _ = run_test_tt_main ("tests" >::: List.map QCheck_ounit.to_ounit_test [passing; failing]) - ---- -NOTE: the package `qcheck` contains the module `QCheck_runner` -which contains both custom runners and OUnit-based runners. === Integration within alcotest @@ -389,7 +394,6 @@ let failing = QCheck.(list small_int) (fun l -> l = List.sort compare l);; - let () = let suite = List.map QCheck_alcotest.to_alcotest @@ -398,14 +402,14 @@ let () = Alcotest.run "my test" [ "suite", suite ] - ---- + === Integration within Rely -https://reason-native.com/docs/rely/[Rely] is a Jest-inspire native reason testing framework. -@reason-native/qcheck-rely is available via NPM and provides matchers for the easy -use of qCheck within Rely. +https://reason-native.com/docs/rely/[Rely] is a Jest-inspire native reason +testing framework. @reason-native/qcheck-rely is available via NPM and provides +matchers for the easy use of qCheck within Rely. [source, Reason] ---- @@ -441,9 +445,11 @@ describe("qcheck-rely", ({test}) => { ---- -=== Deriver -A ppx_deriver is provided to derive QCheck generators from a type declaration. +=== Deriving generators + +The `ppx_deriving_qcheck` opam package provides a ppx_deriver to derive QCheck +generators from a type declaration: [source,OCaml] ---- @@ -457,7 +463,7 @@ for more information and examples. === Usage from dune -We can use the buggy test from above using the `qcheck` opam package: +We can use the buggy test from above using the `qcheck-core` opam package: [source,OCaml] ---- @@ -467,26 +473,27 @@ let test = QCheck.(list small_nat) (fun l -> List.rev l = l) -let _ = QCheck_runner.run_tests_main [test] +let _ = QCheck_base_runner.run_tests_main [test] ---- -with the following `dune` file: +with the following `dune` file (note the `qcheck-core.runner` sub-package): [source,lisp] ---- (test (name test) (modules test) - (libraries qcheck) + (libraries qcheck-core qcheck-core.runner) ) ---- and run it with `dune exec ./test.exe` or `dune runtest`. +We recommend using the `qcheck-core` package as it has a minimal set of +dependencies and also avoids problems with using +`(implicit_transitive_deps false)` in dune. -To keep things minimal or if you are using `(implicit_transitive_deps false)` -in dune, you may want to use the `qcheck-core` package instead. To do so, -we have to adapt the last line of the example to use `QCheck_base_runner`: +To instead use the `qcheck` opam package and its included `QCheck_runner`: [source,OCaml] ---- @@ -496,17 +503,16 @@ let test = QCheck.(list small_nat) (fun l -> List.rev l = l) -let _ = QCheck_base_runner.run_tests_main [test] +let _ = QCheck_runner.run_tests_main [test] ---- -and adjust the `dune` file accordingly to use `qcheck-core` and its -`qcheck-core.runner` sub-package: +with the following `dune` file: [source,lisp] ---- (test (name test) (modules test) - (libraries qcheck-core qcheck-core.runner) + (libraries qcheck) ) ---- From cd0f5fc526f882b6bb77d7478a906d539dc3fbda Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 10 Mar 2025 15:09:09 +0100 Subject: [PATCH 382/391] Add a QCheck2 example to the README --- README.adoc | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/README.adoc b/README.adoc index 7b581b46..30d3626d 100644 --- a/README.adoc +++ b/README.adoc @@ -211,7 +211,6 @@ let arbitrary_tree = (shrink_tree b >|= fun b' -> node a b') in QCheck.make tree_gen ~print:print_tree ~shrink:shrink_tree;; - ---- Here we write a generator of random trees, `tree_gen`, using @@ -298,6 +297,58 @@ QCheck_base_runner.run_tests [test_mirror];; ---- +=== Integrated shrinking with `QCheck2` + +You may have noticed the `shrink_tree` function above to reduce tree +counterexamples. With the newer `QCheck2` module, this is not needed +as shrinking is built into its generators. + +For example, we can rewriting the above tree generator to `QCheck2` by just +changing the `QCheck` occurrences to `QCheck2`: + +[source,OCaml] +---- +type tree = Leaf of int | Node of tree * tree + +let leaf x = Leaf x +let node x y = Node (x,y) + +let tree_gen = QCheck2.Gen.(sized @@ fix + (fun self n -> match n with + | 0 -> map leaf nat + | n -> + frequency + [1, map leaf nat; + 2, map2 node (self (n/2)) (self (n/2))] + ));; + +(* generate a few trees with QCheck2, just to check what they look like: *) +QCheck2.Gen.generate ~n:20 tree_gen;; +---- + + +`QCheck2.Test.make` has a slightly different API than `QCheck.Test.make`, +in that it accepts an optional `~print` argument and consumes generators +directly built with `QCheck2.Gen`: + +[source,OCaml] +---- +let rec print_tree = function + | Leaf i -> "Leaf " ^ (string_of_int i) + | Node (a,b) -> "Node (" ^ (print_tree a) ^ "," ^ (print_tree b) ^ ")";; + +let rec mirror_tree (t:tree) : tree = match t with + | Leaf _ -> t + | Node (a,b) -> node (mirror_tree b) (mirror_tree a);; + +let test_buggy = + QCheck2.Test.make ~name:"buggy_mirror" ~count:200 ~print:print_tree + tree_gen (fun t -> t = mirror_tree t);; + +QCheck_base_runner.run_tests [test_buggy];; +---- + + === Preconditions The functions `QCheck.assume` and `QCheck.(==>)` can be used for From 3f7bfe4a8469b855a4d61fbdb622f20d8554c413 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 10 Mar 2025 15:21:08 +0100 Subject: [PATCH 383/391] Documentation polish after seeing the GitHub rendered version and proof reading --- README.adoc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/README.adoc b/README.adoc index 30d3626d..4d6381f3 100644 --- a/README.adoc +++ b/README.adoc @@ -13,14 +13,10 @@ image::https://github.com/c-cube/qcheck/actions/workflows/main.yml/badge.svg[alt - `qcheck-core` - provides the core property-based testing API and depends only on `unix` and `dune`. - * It contains the modules `QCheck` and `QCheck2` and a `QCheck_base_runner` - module with our custom runners. - `qcheck-ounit` - provides an integration layer for https://github.com/gildor478/ounit[`OUnit`] -- `qcheck-alcotest` - provides an integration layer with https://github.com/mirage/alcotest[`alcotest`] +- `qcheck-alcotest` - provides an integration layer for https://github.com/mirage/alcotest[`alcotest`] - `qcheck` - provides a compatibility API with older versions of `qcheck`, using both `qcheck-core` and `qcheck-ounit`. - * It provides `QCheck_runner` which is similar to older versions and contains - both custom and `OUnit`-based runners. - `ppx_deriving_qcheck` - provides a preprocessor to automatically derive generators @@ -48,7 +44,7 @@ but was since made standalone again. The documentation for the 5 opam packages https://c-cube.github.io/qcheck/[is available here]. -The <<examples>> below offer a brief introduction to the +The section <<examples>> below offer a brief introduction to the library. These examples are based on an earlier https://cedeela.fr/quickcheck-for-ocaml[blog post by Simon] that also discusses some design choices; however, be warned that the API changed @@ -303,7 +299,7 @@ You may have noticed the `shrink_tree` function above to reduce tree counterexamples. With the newer `QCheck2` module, this is not needed as shrinking is built into its generators. -For example, we can rewriting the above tree generator to `QCheck2` by just +For example, we can rewrite the above tree generator to `QCheck2` by just changing the `QCheck` occurrences to `QCheck2`: [source,OCaml] From e86d909741386e31151c21a2ca86d9a009d5fc2f Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Mon, 10 Mar 2025 16:17:59 +0100 Subject: [PATCH 384/391] Add a CHANGELOG entry --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index af3c2989..c697cf34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ causing `asciidoc` to error - Add a note to `QCheck{,2.Gen}.small_int_corners` and `QCheck{,2}.Gen.graft_corners` about internal state, and fix a range of documentation reference warnings +- Reorganize and polish the `README`, rewrite it to use `qcheck-core`, and add + a `QCheck2` integrated shrinking example ## 0.24 From d33ff3f73724c5ba9de582b9a790b61fc9d69287 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 26 Mar 2025 13:00:38 +0100 Subject: [PATCH 385/391] Add apt-get update to asciidoc workflow, use apt-get over apt to silence warning --- .github/workflows/check-asciidoc.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check-asciidoc.yml b/.github/workflows/check-asciidoc.yml index 8c3d56f6..9745202b 100644 --- a/.github/workflows/check-asciidoc.yml +++ b/.github/workflows/check-asciidoc.yml @@ -11,7 +11,8 @@ jobs: name: Check asciidoc runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - run: sudo apt install asciidoc-base - - run: asciidoc README.adoc - + - uses: actions/checkout@v4 + - run: | + sudo apt-get update -y + sudo apt-get install -y asciidoc-base + - run: asciidoc README.adoc From f749c897efe53c653f436ee22a4931b191885cd8 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 26 Mar 2025 13:03:49 +0100 Subject: [PATCH 386/391] Add current ppx_deriving upper bounds --- ppx_deriving_qcheck.opam | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ppx_deriving_qcheck.opam b/ppx_deriving_qcheck.opam index 995ce767..fb116f21 100644 --- a/ppx_deriving_qcheck.opam +++ b/ppx_deriving_qcheck.opam @@ -11,8 +11,8 @@ depends: [ "dune" {>= "2.8.0"} "ocaml" {>= "4.08.0"} "qcheck-core" {>= "0.24"} - "ppxlib" {>= "0.22.0"} - "ppx_deriving" {>= "5.2.1"} + "ppxlib" {>= "0.22.0" & < "0.36.0"} + "ppx_deriving" {>= "5.2.1" & < "6.1.0"} "odoc" {with-doc} "alcotest" {with-test & >= "1.4.0" } "qcheck-alcotest" {with-test & >= "0.24"} From eb465987cb7fe35c0eeb07ff7198bee74dec41bc Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 26 Mar 2025 12:34:20 +0100 Subject: [PATCH 387/391] Document QCHECK_MSG_INTERVAL --- src/runner/QCheck_base_runner.mli | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/runner/QCheck_base_runner.mli b/src/runner/QCheck_base_runner.mli index 1495f1d7..1a2ef37f 100644 --- a/src/runner/QCheck_base_runner.mli +++ b/src/runner/QCheck_base_runner.mli @@ -50,6 +50,21 @@ val set_verbose : bool -> unit val set_long_tests : bool -> unit (** Change the value of [long_tests ()] *) + +(** {2 Console message printing} + + In verbose mode, by default [QCheck_base_runner] prints frequent sub-second + messages suitable for an interactive console test run. This behaviour can be + changed by the environment variable [QCHECK_MSG_INTERVAL]. Intervals are + given in seconds and can also be decimal numbers. For example, setting + {[ + QCHECK_MSG_INTERVAL=7.5 + ]} + will only print a console message every 7.5 seconds. This feature can be + useful in a CI context, where updates are printed on consecutive lines and + one may want to avoid overflowing the CI log files with too many lines. +*) + val get_time_between_msg : unit -> float (** Get the minimum time to wait between printing messages. @since 0.9 *) From 83dad4c9125593dac20bef0c9e2d8aaaa15b59f0 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 26 Mar 2025 12:34:44 +0100 Subject: [PATCH 388/391] Fix typo --- src/runner/QCheck_base_runner.mli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runner/QCheck_base_runner.mli b/src/runner/QCheck_base_runner.mli index 1a2ef37f..b42f335d 100644 --- a/src/runner/QCheck_base_runner.mli +++ b/src/runner/QCheck_base_runner.mli @@ -70,7 +70,7 @@ val get_time_between_msg : unit -> float @since 0.9 *) val set_time_between_msg : float -> unit -(** Set the minimum tiem between messages. +(** Set the minimum time between messages. @since 0.9 *) From b6b883772c8a09fcbfe18b65146103cbc86ad9bd Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 26 Mar 2025 12:35:58 +0100 Subject: [PATCH 389/391] Document that the time unit is seconds --- src/runner/QCheck_base_runner.mli | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runner/QCheck_base_runner.mli b/src/runner/QCheck_base_runner.mli index b42f335d..4a0e022a 100644 --- a/src/runner/QCheck_base_runner.mli +++ b/src/runner/QCheck_base_runner.mli @@ -66,11 +66,11 @@ val set_long_tests : bool -> unit *) val get_time_between_msg : unit -> float -(** Get the minimum time to wait between printing messages. +(** Get the minimum time (in seconds) to wait between printing messages. @since 0.9 *) val set_time_between_msg : float -> unit -(** Set the minimum time between messages. +(** Set the minimum time (in seconds) between messages. @since 0.9 *) From 432ab410afc13502f02585070c97a9854c7a9596 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 26 Mar 2025 12:41:20 +0100 Subject: [PATCH 390/391] Drive-by-polishing of module introduction --- src/runner/QCheck_base_runner.mli | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/runner/QCheck_base_runner.mli b/src/runner/QCheck_base_runner.mli index 4a0e022a..df68c288 100644 --- a/src/runner/QCheck_base_runner.mli +++ b/src/runner/QCheck_base_runner.mli @@ -6,9 +6,9 @@ all rights reserved. (** {1 Runners for Tests} - Once you built some tests using {!QCheck2.Test.make}, you need to - run the tests. This module contains several {b runners}, - which are designed to run every test and report the result. + Once you have built tests using {!QCheck.Test.make} or {!QCheck2.Test.make}, + you need to run them. This module contains several {b runners}, which are + designed to run every test and report the result. By default, you can use {!run_tests} in a test program as follows: {[ From 8ad15d3ea1d133d7311dfb76dee54ea44faa55f1 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard <mail@janmidtgaard.dk> Date: Wed, 26 Mar 2025 12:43:31 +0100 Subject: [PATCH 391/391] Add a CHANGELOG entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c697cf34..4ab77acd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ about internal state, and fix a range of documentation reference warnings - Reorganize and polish the `README`, rewrite it to use `qcheck-core`, and add a `QCheck2` integrated shrinking example +- Document `QCHECK_MSG_INTERVAL` introduced in 0.20 ## 0.24