Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes #252 to prepare for the forthcoming OCaml5 release.
Since OCaml5 comes with a new, splittable LXM PRNG (ocaml/ocaml#10742), the output distribution from
Random.State.*
changes - and so affects our QCheck expect tests. This PR adds.ocaml5
output-files similar to the current.32
and.64
files for OCaml<5.0 on 32-bit and 64-bit, respectively. The meta-programming indune
-files is then extended to account for the.ocaml5
-case. OCaml5 will not support 32-bit in the foreseeable future (if ever) which eliminates a case.There are two nits with the approach:
Sys.ocaml_version
requires a bit of leg-work to work on earlier OCaml versions (Sys.ocaml_release
was only recently added)char
depend on the PRNG - which then need to account for the two cases. This is an unfortunate consequence of how the QCheck2 code is structured, not allowing us to testchar
shrinking independently.Another solution to the above would be to use https://github.com/ocaml/randomV - a backward port of OCaml5's LXM PRNG.
Overall I therefore believe this PR is a reasonable first step to get expect tests running on OCaml5.
I've tested the PR code locally on
While doing the latter I spotted the missing 32-bit update fixed in #261