sageserpent-open / americium

Generation of test case data for Scala and Java, in the spirit of QuickCheck. When your test fails, it gives you a minimised failing test case and a way of reproducing the failure immediately.
MIT License
15 stars 1 forks source link

Add bells and whistles to @TestTrials #40

Closed sageserpent-open closed 2 years ago

sageserpent-open commented 2 years ago
  1. Support configuration of the shrinkage stop.
  2. Support use of externally conjoined trials instances built with the and combinator to drive test methods with multiple arguments; allow mixing of this technique with the use of multiple trials fields. Should the conjoined trials' cases be flattened to join the rest of the arguments passed to the test method? Should the use of a tuple as a test method argument be detected and suppress that flattening where it aligns with a conjoined trials?
sageserpent-open commented 2 years ago
  1. WON'T DO - at least, for now.
  2. DONE. Conjoined trials instances can be used to drive test methods that either take tupled arguments, or individual arguments (or a mixture of the two). Where the mixed approach is used, then any formal argument that has a tuple type has to align correctly with the corresponding conjoined trials.

Where one or more of the conjoined trials instance would yield null cases, these can be either passed in to a tupled argument embedded in the tuple value, or unpicked as a null to bind to an individual argument, as long as it is of a reference type.

It is also possible to use this technique to pass single trials whose cases are tuples, again these support both binding to tupled arguments and to individual arguments. These can be intermixed with conjoined trials and simple trials too.

Passing a trials of nullable tuples is only supported if the formal argument type is a tuple too - there is no concept of expanding a null tuple into multiple individual null argument bindings; rather this is taken to mean that there is no tuple to supply in the first place - null is used as a sentinel for this.

sageserpent-open commented 2 years ago

This has gone out in release 1.4.0, commit SHA of f8c9f6a1ed04e45620e2f4464dcda852c5767907 .