0.19
This release brings a range of new features and improvements, detailed below.
-
new features and feature extensions
- add optional
debug_shrinkparameters in alcotest interface and expose defaultdebug_shrinking_choicesin test runners - add missing
?handlerparameter toTest.check_cell_exn - add an option
retriesparameter toTest.makeet al. for checking a property repeatedly while shrinking.
This can be useful when testing non-deterministic code. #212 - add
tup2totup9for generators - add
Test.make_negfor negative property-based tests, that are expected not to satisfy the tested property. - add environment variable
QCHECK_LONG_FACTORsimilar toQCHECK_COUNT#220 - rename
Gen.opttoGen.optionbut keep the old binding for compatibility. - shrinker changes
- recursive
listshrinker with better complexity stringshrinker reuses improvedlistshrinker and addscharshrinking- function shrinker now shrinks default entry first and benefits from
listshrinker improvements - replacing the linear-time
charshrinker with a faster one reusing the bisectingintshrinker algorithm - add
Shrink.char_numeralandShrink.char_printable - add shrinking for
char arbitraryschar,printable_char, andnumeral_char
- recursive
- add optional
-
bug fixes
- fix function generation affecting reproducability #236
- fix distribution of
QCheck2.printablewhich would omit certain characters - use
Float.equalfor comparingfloats in theObservablemodule underlying function generators.
-
documentation updates:
- clarify upper bound inclusion in
Gen.int_boundandGen.int_range - clarify
printable_charandGen.printabledistributions - add missing
string_gen_of_sizeandsmall_printable_stringdocumentation - document
QCheck_alcotest.to_alcotest - fix documented size distribution for
arbitrarygeneratorsstring_gen,string,printable_string,numeral_string,list, andarray - fix exception documentation for
check_result,check_cell_exn, andcheck_exn - fix documentation for the distribution of
Gen.printableandprintable_char - fix documentation for the shrinking behaviour of
QCheck2.printable
- clarify upper bound inclusion in
-
internal and test suite changes
- add additional expect and unit tests and refactor expect test suite
- add a shrinker performance benchmark #177
- remove
--no-bufferoption ondune runtestto avoid garbling the test output - make test suite run on 32-bit architectures