Skip to content

Commit 1965542

Browse files
authored
Merge pull request #491 from ocaml-multicore/require-qcheck-0-23
Require qcheck-core.0.23
2 parents f5f284f + 2684c1b commit 1965542

12 files changed

+30
-32
lines changed

.github/workflows/common.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ jobs:
8787
uses: actions/checkout@v4
8888
with:
8989
repository: c-cube/qcheck
90-
ref: v0.22
90+
ref: v0.23
9191
path: multicoretests/qcheck
9292

9393
- name: Pre-Setup

CHANGES.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Next release
44

5+
- #491: Require `qcheck.0.23`, simplify show functions by utilizing it, and update
6+
expect outputs accordingly
57
- #486: Add `Util.Pp.pp_fun_` printer for generated `QCheck.fun_` functions
68

79
## 0.4

dune-project

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ the multicore run-time of OCaml 5.0.")
1717
(tags ("test" "test suite" "property" "qcheck" "quickcheck" "multicore" "non-determinism"))
1818
(depends
1919
base-domains
20-
(qcheck-core (>= "0.20"))
20+
(qcheck-core (>= "0.23"))
2121
(qcheck-lin (= :version))
2222
(qcheck-stm (= :version))))
2323

@@ -31,7 +31,7 @@ sequential and parallel tests against a declarative model.")
3131
(depopts base-domains)
3232
(depends
3333
(ocaml (>= 4.12))
34-
(qcheck-core (>= "0.20"))
34+
(qcheck-core (>= "0.23"))
3535
(qcheck-multicoretests-util (= :version))))
3636

3737
(package
@@ -46,7 +46,7 @@ and explained by some sequential interleaving.")
4646
(depopts base-domains)
4747
(depends
4848
(ocaml (>= 4.12))
49-
(qcheck-core (>= "0.20"))
49+
(qcheck-core (>= "0.23"))
5050
(qcheck-multicoretests-util (= :version))))
5151

5252
(package
@@ -57,4 +57,4 @@ multicore programs.")
5757
(tags ("test" "property" "qcheck" "quickcheck" "multicore" "non-determinism"))
5858
(depends
5959
(ocaml (>= 4.12))
60-
(qcheck-core (>= "0.20"))))
60+
(qcheck-core (>= "0.23"))))

lib/STM.ml

+7-7
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ type _ ty +=
2323

2424
type 'a ty_show = 'a ty * ('a -> string)
2525

26-
let unit = (Unit, fun () -> "()")
27-
let bool = (Bool, string_of_bool)
28-
let char = (Char, fun c -> Printf.sprintf "%C" c)
29-
let int = (Int, string_of_int)
26+
let unit = (Unit, QCheck.Print.unit)
27+
let bool = (Bool, QCheck.Print.bool)
28+
let char = (Char, QCheck.Print.char)
29+
let int = (Int, QCheck.Print.int)
3030
let int32 = (Int32, Int32.to_string)
3131
let int64 = (Int64, Int64.to_string)
32-
let float = (Float, Float.to_string)
33-
let string = (String, fun s -> Printf.sprintf "%S" s)
34-
let bytes = (Bytes, fun b -> Printf.sprintf "%S" (Bytes.to_string b))
32+
let float = (Float, QCheck.Print.float)
33+
let string = (String, QCheck.Print.string)
34+
let bytes = (Bytes, QCheck.Print.bytes)
3535
let option spec =
3636
let (ty,show) = spec in
3737
(Option ty, QCheck.Print.option show)

lib/lin.ml

+9-13
Original file line numberDiff line numberDiff line change
@@ -155,16 +155,12 @@ let gen_deconstructible gen print eq = GenDeconstr (gen,print,eq)
155155

156156
let qcheck_nat64_small = QCheck.(map Int64.of_int small_nat)
157157

158-
let print_char c = Printf.sprintf "%C" c
159-
let print_string s = Printf.sprintf "%S" s
160-
let print_bytes b = print_string (Bytes.to_string b)
161-
162158
let bytes_small_printable = QCheck.bytes_small_of QCheck.Gen.printable
163159

164160
let unit = GenDeconstr (QCheck.unit, QCheck.Print.unit, (=))
165161
let bool = GenDeconstr (QCheck.bool, QCheck.Print.bool, (=))
166-
let char = GenDeconstr (QCheck.char, print_char, (=))
167-
let char_printable = GenDeconstr (QCheck.printable_char, print_char, (=))
162+
let char = GenDeconstr (QCheck.char, QCheck.Print.char, (=))
163+
let char_printable = GenDeconstr (QCheck.printable_char, QCheck.Print.char, (=))
168164
let nat_small = GenDeconstr (QCheck.small_nat, QCheck.Print.int, (=))
169165
let int = GenDeconstr (QCheck.int, QCheck.Print.int, (=))
170166
let int_small = GenDeconstr (QCheck.small_int, QCheck.Print.int, (=))
@@ -173,13 +169,13 @@ let int_bound b = GenDeconstr (QCheck.int_bound b, QCheck.Print.int, (=))
173169
let int32 = GenDeconstr (QCheck.int32, Int32.to_string, Int32.equal)
174170
let int64 = GenDeconstr (QCheck.int64, Int64.to_string, Int64.equal)
175171
let nat64_small = GenDeconstr (qcheck_nat64_small, Int64.to_string, Int64.equal)
176-
let float = GenDeconstr (QCheck.float, Float.to_string, Float.equal)
177-
let string = GenDeconstr (QCheck.string, print_string, String.equal)
178-
let string_small = GenDeconstr (QCheck.small_string, print_string, String.equal)
179-
let string_small_printable = GenDeconstr (QCheck.small_printable_string, print_string, String.equal)
180-
let bytes = GenDeconstr (QCheck.bytes, print_bytes, Bytes.equal)
181-
let bytes_small = GenDeconstr (QCheck.bytes_small, print_bytes, Bytes.equal)
182-
let bytes_small_printable = GenDeconstr (bytes_small_printable, print_bytes, Bytes.equal)
172+
let float = GenDeconstr (QCheck.float, QCheck.Print.float, Float.equal)
173+
let string = GenDeconstr (QCheck.string, QCheck.Print.string, String.equal)
174+
let string_small = GenDeconstr (QCheck.small_string, QCheck.Print.string, String.equal)
175+
let string_small_printable = GenDeconstr (QCheck.small_printable_string, QCheck.Print.string, String.equal)
176+
let bytes = GenDeconstr (QCheck.bytes, QCheck.Print.bytes, Bytes.equal)
177+
let bytes_small = GenDeconstr (QCheck.bytes_small, QCheck.Print.bytes, Bytes.equal)
178+
let bytes_small_printable = GenDeconstr (bytes_small_printable, QCheck.Print.bytes, Bytes.equal)
183179

184180
let option : type a c s. ?ratio:float -> (a, c, s, combinable) ty -> (a option, c, s, combinable) ty =
185181
fun ?ratio ty ->

multicoretests.opam

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ bug-reports: "https://github.com/ocaml-multicore/multicoretests/issues"
2222
depends: [
2323
"dune" {>= "3.0"}
2424
"base-domains"
25-
"qcheck-core" {>= "0.20"}
25+
"qcheck-core" {>= "0.23"}
2626
"qcheck-lin" {= version}
2727
"qcheck-stm" {= version}
2828
"odoc" {with-doc}

qcheck-lin.opam

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ bug-reports: "https://github.com/ocaml-multicore/multicoretests/issues"
2323
depends: [
2424
"dune" {>= "3.0"}
2525
"ocaml" {>= "4.12"}
26-
"qcheck-core" {>= "0.20"}
26+
"qcheck-core" {>= "0.23"}
2727
"qcheck-multicoretests-util" {= version}
2828
"odoc" {with-doc}
2929
]

qcheck-multicoretests-util.opam

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ bug-reports: "https://github.com/ocaml-multicore/multicoretests/issues"
1515
depends: [
1616
"dune" {>= "3.0"}
1717
"ocaml" {>= "4.12"}
18-
"qcheck-core" {>= "0.20"}
18+
"qcheck-core" {>= "0.23"}
1919
"odoc" {with-doc}
2020
]
2121
build: [

qcheck-stm.opam

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ bug-reports: "https://github.com/ocaml-multicore/multicoretests/issues"
2323
depends: [
2424
"dune" {>= "3.0"}
2525
"ocaml" {>= "4.12"}
26-
"qcheck-core" {>= "0.20"}
26+
"qcheck-core" {>= "0.23"}
2727
"qcheck-multicoretests-util" {= version}
2828
"odoc" {with-doc}
2929
]

test/util_pp.expected

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,5 @@ Test of pp_record:
7474
{ key = 123; value = "content" }
7575

7676
Test of pp_fun_:
77-
{(Some (-123456), a, xyz) -> true; (None, b, ) -> true; _ -> true}
77+
{(Some (-123456), 'a', "xyz") -> true; (None, 'b', "") -> true; _ -> true}
7878

test/util_pp_trunc150.expected

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,5 @@ Test of pp_record:
7474
{ key = 123; value = "content" }
7575

7676
Test of pp_fun_:
77-
{(Some (-123456), a, xyz) -> true; (None, b, ) -> true; _ -> true}
77+
{(Some (-123456), 'a', "xyz") -> true; (None, 'b', "") -> true; _ -> true}
7878

test/util_pp_trunc79.expected

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,5 @@ Test of pp_record:
7474
{ key = 123; value = "content" }
7575

7676
Test of pp_fun_:
77-
{(Some (-123456), a, xyz) -> true; (None, b, ) -> true; _ -> true}
77+
{(Some (-123456), 'a', "xyz") -> true; (None, 'b', "") -> true; _ -> true}
7878

0 commit comments

Comments
 (0)