Tags: kotest/kotest
Tags
Add primitive array support for containAll matcher (#4354) (#5776) ## Summary - Adds `shouldContainAll` and `shouldNotContainAll` extension functions for all 8 Kotlin primitive array types: `BooleanArray`, `ByteArray`, `ShortArray`, `CharArray`, `IntArray`, `LongArray`, `FloatArray`, `DoubleArray` - Each type gets both a vararg overload (e.g. `intArrayOf(1,2,3).shouldContainAll(1, 2)`) and an infix array overload (e.g. `intArrayOf(1,2,3).shouldContainAll(intArrayOf(1, 2))`) - Implementations delegate to the existing `Collection`-based matchers via `asList()` Fixes #4354 ## Test plan - [ ] Vararg version passes when all expected elements are present - [ ] Array version passes when all expected elements are present - [ ] `shouldNotContainAll` passes when at least one expected element is absent - [ ] Both overloads throw `AssertionError` on failure - Tests added for all 8 primitive array types in `ShouldContainAllTest` 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Fix power assert applied unconditionally with wrong dependency scope (#… …5747) ## Summary Fixes #5745 — `kotest-assertions-core` was being added as an `api` dependency in test source sets, causing a Kotlin warning about unsupported API dependency types in test source sets. Three bugs were fixed in `configurePowerAssert`: - The `enablePowerAssert` property was passed in but never checked — power assert was always applied. Added an early return when `enablePowerAssert` is `false` (the default). - The call to `configurePowerAssert` was moved into `project.afterEvaluate` so the property value is finalized before it is read. - Dependency scope changed from `commonTestApi` to `commonTestImplementation` to avoid the Kotlin warning about API dependencies in test source sets. ## Test plan - [x] Apply the Kotest Gradle plugin without setting `enablePowerAssert` — verify the power assert plugin is NOT applied and `kotest-assertions-core` is NOT added as a dependency. - [x] Set `kotest { enablePowerAssert = true }` — verify the power assert plugin is applied and `kotest-assertions-core` is added as a `commonTestImplementation` dependency (no warning about API dependency types in test source sets). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
PreviousNext