QuickCheck inspired property-based testing for OCaml.
base-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-core
This is a bugfix release to fix a regression:
Shrink.list_spine
fix, as it was utilizing polymorphic equality that can raise an exception on function comparison.This release offers better negative test integration and furthermore fixes a couple of bugs in QCheck.Shrink
and in ppx_deriving_qcheck
:
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 duplicatesThis release comes with a few new features and bug fixes, along with several new bytes
and string
combinators in an attempt to stream-line their names
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_small_of,bytes_of_size,bytes_printable}
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}
Shrink.string
QCheck.{printable_string,printable_string_of_size,small_printable_string,numeral_string,numeral_string_of_size}
#257
QCheck2.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_msg
qtest
Bugfix release:
~count
in Test.make
to be 0~long_factor
in Test.make
to be 0This release brings a range of new features and improvements, detailed below.
new features and feature extensions
debug_shrink
parameters in alcotest interface and expose default debug_shrinking_choices
in test runners?handler
parameter to Test.check_cell_exn
retries
parameter to Test.make
et al. for checking a property repeatedly while shrinking.
This can be useful when testing non-deterministic code. #212
tup2
to tup9
for generatorsTest.make_neg
for negative property-based tests, that are expected not to satisfy the tested property.QCHECK_LONG_FACTOR
similar to QCHECK_COUNT
#220
Gen.opt
to Gen.option
but keep the old binding for compatibility.list
shrinker with better complexitystring
shrinker reuses improved list
shrinker and adds char
shrinkinglist
shrinker improvementschar
shrinker with a faster one reusing the bisecting int
shrinker algorithmShrink.char_numeral
and Shrink.char_printable
char arbitrary
s char
, printable_char
, and numeral_char
bug fixes
QCheck2.printable
which would omit certain charactersFloat.equal
for comparing float
s in the Observable
module underlying function generators.documentation updates:
Gen.int_bound
and Gen.int_range
printable_char
and Gen.printable
distributionsstring_gen_of_size
and small_printable_string
documentationQCheck_alcotest.to_alcotest
arbitrary
generators string_gen
, string
, printable_string
, numeral_string
, list
, and array
check_result
, check_cell_exn
, and check_exn
Gen.printable
and printable_char
QCheck2.printable
internal and test suite changes
--no-buffer
option on dune runtest
to avoid garbling the test outputbugfix release.
Gen.{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.oneof
Gen.string_readable
in favor of Gen.(string_of char)
or the new Gen.string_printable
other changes:
small_int_corners
?ratio
to opt
, to modify random distribution of optionsmany bugfixes, and addition of Gen.delay
.