Releases: jqwik-team/jqwik
JqwikSession Enhancements
New and Enhanced Features
-
Introduced API to handle random seeds outside jqwik's lifecycle.
See issue 581.- Added
JqwikSession.getRandom()
- Added
JqwikSession.start(String randomSeed)
- Added
JqwikSession.run(String randomSeed, Runnable runnable)
- Added
Breaking Changes
No breaking changes
Dependency Upgrades and Bug Fixes
- Upgrade to Gradle 8.10.2
- Upgraded to JUnit Platform 1.11.1
- Upgraded to KotlinX 1.9.0
Kotlin 2.0 and Nullability Annotations
New and Enhanced Features
-
Upgraded to Kotlin 2.0.0
-
Upgraded to JUnit Platform 1.10.3
Breaking Changes
-
StatisticsCoverage.checkQuery(Predicate<? super List<?>> query)
:
query
is now of typePredicate<? super List<?>>
instead ofPredicate<? super List<Object>>
. -
Nullability annotations have been added to many API methods and interfaces.
This could lead to compile-time warnings or errors in your code if you are using tool chains that validate those. -
UniqueElements.by()
now requires aClass<? extends Function<? extends @Nullable Object, ?>>
instead of aClass<? extends Function<?, Object>>
.
Bug Fixes
-
Tools like CheckerFramework did not play well with jqwik's (wrong) usage of
@Nullable
on type variables.
This has been fixed. See issue 575 for details.
Thanks to vlsi for working out all the nitty, gritty details! -
Fixed type matching bug as revealed in this comment
Bug Fix
Some Kotlin Care
Platform Upgrade and a few Fixes
New and Enhanced Features
-
Upgraded to KotlinX 1.8.0
-
Upgraded to JUnit Platform 1.10.2
-
Upgraded to Kotlin 1.9.22
Breaking Changes
No breaking changes
Bug Fixes
Important Fixes for Java >= 18
New and Enhanced Features
- Upgraded to JUnit Platform 1.10.0
Breaking Changes
No breaking changes
Bug Fixes
-
Nested test containers using
@Group
have not been working properly with JDK >= 18.
Now they do. See issue 528. -
Fixed stack overflow exception while shrinking.
See issue 526. -
Fixed out of memory error while shrinking.
See issue 527.
Many thanks to Juhan Oskar Hennoste for providing a fix.
Just Fixing Bugs
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)
.
Bug Fixes
Lifecycle Enhancements for Micronaut Extension
New and Enhanced Features
-
Upgraded to KotlinX 1.7.2
-
Upgraded to JUnit Platform 1.9.3
-
Upgraded to Kotlin 1.8.22
-
Added interface method
LifecycleContext.findRepeatableAnnotations(annotationClass)
and implementations in all subtypes. -
Performance improvement for
@UniqueElements
. Many thanks to DirkToewe.
See #491. -
Added interface
MethodLifecycleContext
as a supertype of both
PropertyLifecycleContext
andTryLifecycleContext
.
Breaking Changes
- The new interface
MethodLifecycleContext
is a supertype of both
PropertyLifecycleContext
andTryLifecycleContext
.
This could lead to compile-time errors in rare cases of self-implemented
context classes.
Bug Fixes
- Fixed bug in
AroundPropertyHook
extensions combined with@AfterProperty
methods.
See Issue 473.
Stabilizations and Small Features
New and Enhanced Features
-
Upgraded to JUnit Platform 1.9.2
-
uniqueElements(..)
methods are now part ofStreamableArbitrary
interface.
See #466. -
Added
Arbitrary.ignoreException(int maxThrows, Class<? extends Throwable> exceptionType)
and
Arbitrary.ignoreExceptions(maxThrows, Class<? extends Throwable> ... exceptionTypes)
Breaking Changes
no breaking changes
Bug Fixes
-
Fixed timezone-related bug in time module.
-
Fixed "Shrink&Grow" bug: #439