Consolidate and Move Kotlin forward
New and Enhanced Features
-
Upgraded to KotlinX 1.7.3
-
Upgraded to JUnit Platform 1.10.0
-
Upgraded to Kotlin 1.9.10
-
Added
StringArbitrary.uniqueChars()
to generate strings with unique characters.
Discussion in issue 506.
This is an experimental feature. -
Added constraint annotation
@UniqueChars
for String parameters.
This is an experimental feature. -
Added
Arbitraries.fromGeneratorWithSize(..)
.
See issue 494.
This is an experimental feature. -
The Kotlin module got a brand new Combinator DSL.
-
Configurators that are based on
ArbitraryConfiguratorBase
will now consider
any public method the name of which starts withconfigure
as a configuration method candidate.
This allows heterogeneous arbitrary configurators
that differ in arbitrary type only. -
Multiple
@CharRange
annotations are now also possible for@ForAll char
parameters. -
EXPERIMENTAL
APIs promoted toMAINTAINED
:Arbitrary.edgeCases(Consumer<EdgeCases.Config<T>> configurator)
Arbitrary.withoutEdgeCases()
@Property.edgeCases()
@ForAll.supplier()
@From.supplier()
@Provide.ignoreExceptions()
Combinator[2-8].filter(..)
ListCombinator.filter(..)
NumericalArbitrary.withDistribution(..)
TraverseArbitrary
TypeArbitrary.enableRecursion()
@UseType.enableRecursion()
DomainContext.getReportingFormats()
JqwikSession
Breaking Changes
-
Configurators that are based on
ArbitraryConfiguratorBase
must mark their
configure()
methods aspublic
.
Private and package-scope methods are no longer supported considered as
configuration method candidates. -
TypeUsage.canBeAssignedTo(TypeUsage)
behaves now closer to the Java compiler's rules
about allowing assignments - including co- and contravariance.
This has the potential to break domains, arbitrary providers, and lifecycle hooks
that depend on the old, more loose, behaviour. -
@Provide
methods are now matched more strictly, based on assignability of returned arbitrary type.
That means that potential mismatches of generated values and the corresponding@ForAll
parameters will show up already at property setup time through aCannotFindArbitraryException
. -
StringArbitrary.repeatChars(0.0)
will now redirect toStringArbitrary.uniqueChars()
.
Previously it used to just make the probability of repeating characters very low.
See discussion in issue 506. -
Removed deprecated method
TypeArbitrary.use(Executable)
. -
Removed deprecated methods
ActionChainArbitrary.addAction(action)
andActionChainArbitrary.addAction(weight, action)
.