New
v0.26
[0.26] 2023-05-12
Changed
- Minimum supported kotlin version is 1.8.10
- Minimum supported coroutines version is 1.7.0
- When asserting on a
Throwableor failedResult, their exception is added as the cause to anyAssertionErrors which are thrown as the result of an assertion failure. - Removed second type parameter on
Any.isInstanceOfextension. In practice this would generally widen toAnywhich is what it has been replaced with.
Breaking Changes
- Previous deprecations are now errors
Added
- Added
assertFailure { }entrypoint which is a shorthand forassertThat(runCatching { .. }).isFailure() - Added
firstandsingleassertion forIterable - Added
containsMatchassertion forCharSequence. Unlike 'contains' this is a regex rather than a literal. Unlike 'matches' this looks for a subset of theCharSequenceto match rather than the entire contents. - Added reified overloads of
hasClass,doesNotHaveClass,isInstanceOf, andisNotInstanceOf. For example:isInstanceOf<String>(). - Added sequence assertions to mirror iterable
- Added array assertions for
UByteArray,UShortArray,UIntArray, andULongArray.
Deprecated
- Lambda-accepting
assertThat { }entrypoint is now deprecated. UseassertThat(T)for normal values orassertFailure { }for exception-throwing code.
Fixed
- Fixed iterable assertions that take a block that could have multiple assertions.
Includes:
none,atLeast,atMost,exactly, andany