Skip to content

After Failure Handling Redone

Compare
Choose a tag to compare
@jlink jlink released this 18 Dec 10:03
· 991 commits to main since this release

New and Enhanced Features

  • Complete Rework of after-failure handling:

    • AfterFailureMode.SAMPLE_FIRST and AfterFailureMode.SAMPLE_ONLY no longer depends on serializability of generated parameters.
    • If random seed is manually changed after a failing test run using Property.seed=<new random seed>
      the configured after-failure-mode does not apply for the next test run.
    • SAMPLE_FIRST and SAMPLE_ONLY now also work for data-driven properties and exhaustive generation.
      I recommend now to use SAMPLE_FIRST as
      default configuration value for most projects.
  • Added PropertyDefaults.maxDiscardRatio

  • Added two Kotlin convenience functions:

    • fun <T> frequency(vararg frequencies: Pair<Int, T>)
    • fun <T> frequencyOf(vararg frequencies: Pair<Int, Arbitrary<out T>>)
  • Maximum size of generated collections and arrays is now generated regularly, if no size distribution is specified

Breaking Changes

  • Parameter annotations on array types (e.g. @WithNull String[])
    are no longer applied to the component type.

  • The jqwik database no longer stores test run data for succeeding tests and properties.
    This means that the file .jqwik-database in now much smaller in most cases.

Bug Fixes

  • Using @WithNull on primitive array types no longer leads to an IllegalArgumentException.
    See #270.

  • Generic array types in parameters can now be properly resolved

  • After-failure handling now (hopefully) works as expected