collect statistics and also add a percentageQCheck{,2}.Gen.float generator which would only generate numbers with an exponent between 2^{-21} and 2^22QCheck/QCheck2 situation in READMEdescription field to the *.opam filesShrink invariants in the QCheck modulefloat_range operator which would fail on negative boundsQCHECK_MSG_INTERVAL not being applied to the first in-progress messageTest.make's max_fail parameter which was accidentally broken in 0.18stats computation of average and standard deviation to limit precision loss, print both using scientific notation, and workaround MinGW float printing to also pass expect testsasciidoc to errorQCheck{,2.Gen}.small_int_corners and QCheck{,2}.Gen.graft_corners about internal state, and fix a range of documentation reference warningsREADME, rewrite it to use qcheck-core, and add a QCheck2 integrated shrinking exampleQCHECK_MSG_INTERVAL introduced in 0.20QCheck{,2}.Gen.map{4,5} combinatorsppxlib.0.36.0 based on the OCaml 5.2 ASTspeed_level parameter to to_alcotestQCheck2.Gen.list shrinker to produce minimal counterexamples at size 3 tooQCheck2 OCaml 4 Random.State.split hack with a faster oneQCheck2.Gen.list shrinker heuristic and utilize the improved shrinker in other QCheck2 {list,array,bytes,string,function}* shrinkerssplit and copy in Random.State underlying QCheck2 to avoid non-deterministic shrinking behaviourQCheck.{Print,Iter,Shrink,Gen} and QCheck2.Gen.result combinators to QCheck, QCheck.{Gen,Print,Shrink,Observable}, and QCheck2.{Gen,Print,Observable}.QCheck{,2}.Print.int{32,64}, QCheck.Gen.int{32,64}, QCheck{,2}.Observable.int{32,64}, and deprecate QCheck.Gen.{ui32,ui64}dune usage in READMEPrint.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.QCheck and QCheck2 documentation pagesexponential generator to QCheck, QCheck.Gen, and QCheck2.GenShrink.bool and use it in QCheck.boolfun_gen field from QCheck2's fun_repr_tbl type thereby silencing a compiler warningQCheck2.TestResult.get_instances as retaining previous test inputs cause memory leaksQCheck2.state.res immutable, silencing a compilation warningbase-bytes as it is provided in all supported versions of the OCaml compilerShrink.list_spine fix by catching Invalid_argument and falling back on an address comparison.ppx_deriving_qcheck's qcheck dependency to qcheck-coreShrink.list_spine fix, as it was utilizing polymorphic equality that can raise an exception on function comparison.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.ppx_deriving_qcheck deriving a generator with unbound gen for recursive types #269 and a related issue when deriving a generator for a record typeQCheck.Shrink.int* to emit duplicates, also affecting QCheck.Shrink.{char,string}Shrink.list_spine would emit duplicatesadd several new bytes combinators:
{QCheck,QCheck2}.Gen.{bytes_size,bytes,bytes_of,bytes_printable,bytes_small,bytes_small_of}QCheck.{Print,Shrink,Observable}.bytesQCheck2.{Print,Shrink}.bytesQCheck.{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_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 - reverted again due to backwards incompatibility)Shrink.stringQCheck.{printable_string,printable_string_of_size,small_printable_string,numeral_string,numeral_string_of_size} #257QCheck2.Gen.set_shrink to modify the generator's shrinkerQCheck2.Gen.no_shrink to build a generator with no shrinkingQCHECK_MSG_INTERVAL to control QCheck_base_runner.time_between_msgqtest~count in Test.make to be 0~long_factor in Test.make to be 0Float.equal for comparing floats in the Observable module underlying function generators.debug_shrink parameters in alcotest interface and expose default debug_shrinking_choices in test runners?handler parameter to Test.check_cell_exn--no-buffer option on dune runtest to avoid garbling the test outputretries parameter to Test.make et al. for checking a property repeatedly while shrinking. This can be useful when testing non-deterministic code. #212tup2 to tup9 for generatorsTest.make_neg for negative property-based tests, that are expected not to satisfy the tested property.Gen.opt to Gen.option but keep the old binding for compatibility.QCheck2.printable which would omit certain charactersshrinker changes
Shrink.char_numeral and Shrink.char_printablechar arbitrarys char, printable_char, and numeral_chardocumentation updates:
Gen.int_bound and Gen.int_rangeprintable_char and Gen.printable distributionsstring_gen_of_size and small_printable_string documentationQCheck_alcotest.to_alcotestarbitrary generators string_gen, string, printable_string, numeral_string, list, and arraycheck_result, check_cell_exn, and check_exnGen.printable and printable_charQCheck2.printableQCHECK_LONG_FACTOR similar to QCHECK_COUNT #220Gen.{nat,pos}_split{2,}This releases marks the addition of QCheck2, a module where generation and shrinking are better integrated. See #109 and #116.
This API is still experimental. The normal QCheck module is still there and hasn't changed much.
deprecations and breakges:
QCheck.Test_result.t abstract and add missing gettersQCheck.oneofGen.string_readable in favor of Gen.(string_of char) or the new Gen.string_printableother changes:
small_int_corners?ratio to opt, to modify random distribution of optionsGen.delaymin_int issuescolors=falseint_range when a<0colors=false>=4.08, provide let operatorsint_range to make it accept ranges bigger than max_int.int{32,64} shrinkers to arbitrary gensint{32,int64} shrinkersQCheck_ounitgenGen.char_range and Gen.(<$>) (credit @spewspews)QCheck.Gen.{string_of,string_readable}int_bound bound inclusiveness problemint_bound to generate values using Random.State.int for bound < 2^30float_range to generate a floating-point number in the given range (inclusive)float_bound_inclusive and float_bound_exclusive to generate floating-point numbers between 0 and a given boundShrink: decompose Shrink.list into Shrink.list_spine and Shrink.list_elemsGen.fix has a more general and useful typeRely section (qcheck now available for reason-native!)big_natsmall_array, modify distributionsqcheck-ounit sublibraryqcheck-alcotest testsqcheck.ounit tests verbose by defaultqcheck is a compatibility library, depends on qcheck-coreqcheck and qcheck.ounitTestResult.is_success helpertime_between_msg in runneradd_statQCheck.Shrink.int_aggressive and make default int shrinker fastermap_keep_inputQCheck.set_gen, missing for some reasonfind_example and find_example_gen to synthesize values from properties (see #31)QCheck.gen for accessing the random generator easily--no-colors to disable themObservable and an efficient internal representation using heterogeneous tuples, printing, and shrinking. deprecate old hacks.Shrink.{array,list} (see #32)Invalid_arg (following the doc), and update docGen.{int_bount,int_range} to support up to 2^62collect)@since tagsGen.char (close #23)test and doc to opamsmall_list generator~long_factor to tests and runner, for long testsTest.get_count on test cellsQCheck_runnersmall_int a deprecated alias to small_natsmall_signed_intQCheck_runnerlength specification for to_ounit2_testsmall_nat, change small_int semantics (close #10)QCheck.assume_failQCheck.assume; explain preconditions a bit (close #9)qtest: big changes in API, shrinking, use 'a arbitrary type that combines printer, generator, shrinker, etc. (see git log)_oasis, .merlin, etc.fix_fuelQCheck.run_mainQCheck_ounit.~::(>:::)qcheck_ounit ml{lib,dylib}test_cell.name optionalArbitrary.fix_fuel(_gen): add a recursive caseArbitrary.fix_fuel_gen, similar to fix_fuel but threading a state bottom-up to make choices depend on the pathArbitrary.fail_fix to fail in a fixpointArbitrary.fix_fuelgeneratorArbitrary.fix_fuel, to generate complex recursive structuresGenerator into QCheck|||Prop.raisesQCheck.ArbitraryQCheck.mk_test takes more arguments