From ed38cbc88a7243fce985228290bb63360ffe3c03 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard Date: Fri, 6 Dec 2024 12:11:04 +0100 Subject: [PATCH 1/9] 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 cd29f02..d67de14 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 Date: Fri, 6 Dec 2024 12:19:21 +0100 Subject: [PATCH 2/9] 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 d67de14..bc12418 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 Date: Fri, 6 Dec 2024 12:23:21 +0100 Subject: [PATCH 3/9] 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 6f2af91..0430ef8 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 6a0526f..e3a1573 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 96d6298..4b1b17c 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 18e321d..1810c2b 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 Date: Fri, 6 Dec 2024 13:08:36 +0100 Subject: [PATCH 4/9] 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 7aa93ab..73d6953 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 3cd4711..a642534 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 915f39c..3f3bf3b 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 9c26971..4e290c6 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 Date: Fri, 6 Dec 2024 12:26:34 +0100 Subject: [PATCH 5/9] Add a CHANGELOG entry --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d4d2e0..734aae9 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 Date: Sat, 7 Dec 2024 14:35:10 +0100 Subject: [PATCH 6/9] 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 bc12418..2b0e11d 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 b4e8560..0c821a0 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 Date: Sat, 7 Dec 2024 14:48:38 +0100 Subject: [PATCH 7/9] 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 73d6953..e5217c9 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 a642534..c026b98 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 3f3bf3b..1992992 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 4e290c6..c7636b1 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 Date: Sat, 7 Dec 2024 14:49:59 +0100 Subject: [PATCH 8/9] 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 e25a26e..5054a74 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): -aaaaaaaaaaaaaaaaaaaaaa +"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 9f2b7df..c04aa40 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): -aaaaaaaaaaaaaaaaaaaaaa +"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 b560f54..81879c1 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): -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +"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 7b24307..7126ca4 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): -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +"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 Date: Sat, 7 Dec 2024 15:16:25 +0100 Subject: [PATCH 9/9] Update CHANGELOG entry --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 734aae9..7c6243d 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`