diff --git a/apis/infix/atrium-api-infix/src/commonMain/kotlin/ch/tutteli/atrium/api/infix/en_GB/mapLikeToContainInAnyOrderCreators.kt b/apis/infix/atrium-api-infix/src/commonMain/kotlin/ch/tutteli/atrium/api/infix/en_GB/mapLikeToContainInAnyOrderCreators.kt index cc79bf2768..67bd4d66fb 100644 --- a/apis/infix/atrium-api-infix/src/commonMain/kotlin/ch/tutteli/atrium/api/infix/en_GB/mapLikeToContainInAnyOrderCreators.kt +++ b/apis/infix/atrium-api-infix/src/commonMain/kotlin/ch/tutteli/atrium/api/infix/en_GB/mapLikeToContainInAnyOrderCreators.kt @@ -43,6 +43,8 @@ infix fun EntryPointStep * * @return an [Expect] for the subject of `this` expectation. * + * @sample ch.tutteli.atrium.api.infix.en_GB.samples.MapLikeToContainInAnyOrderCreatorSamples.entries + * * @since 0.15.0 */ infix fun EntryPointStep.the( diff --git a/apis/infix/atrium-api-infix/src/commonMain/kotlin/ch/tutteli/atrium/api/infix/en_GB/mapLikeToContainInAnyOrderOnlyCreators.kt b/apis/infix/atrium-api-infix/src/commonMain/kotlin/ch/tutteli/atrium/api/infix/en_GB/mapLikeToContainInAnyOrderOnlyCreators.kt index 494b514c58..7c02d2b288 100644 --- a/apis/infix/atrium-api-infix/src/commonMain/kotlin/ch/tutteli/atrium/api/infix/en_GB/mapLikeToContainInAnyOrderOnlyCreators.kt +++ b/apis/infix/atrium-api-infix/src/commonMain/kotlin/ch/tutteli/atrium/api/infix/en_GB/mapLikeToContainInAnyOrderOnlyCreators.kt @@ -40,6 +40,8 @@ infix fun EntryPointStep EntryPointStep.the( diff --git a/apis/infix/atrium-api-infix/src/commonMain/kotlin/ch/tutteli/atrium/api/infix/en_GB/mapLikeToContainInOrderOnlyCreators.kt b/apis/infix/atrium-api-infix/src/commonMain/kotlin/ch/tutteli/atrium/api/infix/en_GB/mapLikeToContainInOrderOnlyCreators.kt index ecf03a43a8..076f52af4d 100644 --- a/apis/infix/atrium-api-infix/src/commonMain/kotlin/ch/tutteli/atrium/api/infix/en_GB/mapLikeToContainInOrderOnlyCreators.kt +++ b/apis/infix/atrium-api-infix/src/commonMain/kotlin/ch/tutteli/atrium/api/infix/en_GB/mapLikeToContainInOrderOnlyCreators.kt @@ -44,6 +44,8 @@ infix fun EntryPointStep EntryPointStep.the( diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/samples/MapLikeToContainInAnyOrderCreatorSamples.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/samples/MapLikeToContainInAnyOrderCreatorSamples.kt index 4901d1165a..b103e2fd58 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/samples/MapLikeToContainInAnyOrderCreatorSamples.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/samples/MapLikeToContainInAnyOrderCreatorSamples.kt @@ -28,6 +28,17 @@ class MapLikeToContainInAnyOrderCreatorSamples { } } + @Test + fun entries() { + expect(mapOf(1 to "a", 2 to "b")) toContain o inAny order the pairs( + 2 to "b" + ) + + fails { // because the value ("b") of key 1 (which exists in the subject) is not "b" + expect(mapOf(1 to "a", 2 to "b")) toContain o inAny order the pairs(1 to "b") + } + } + @Test fun entriesKeyValue() { expect(mapOf(1 to "a", 2 to "b")) toContain o inAny order the entries(keyValue(2) { this toEqual "b" }) diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/samples/MapLikeToContainInAnyOrderOnlyCreatorSamples.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/samples/MapLikeToContainInAnyOrderOnlyCreatorSamples.kt index 28bcaa6600..7fd8c1cd6b 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/samples/MapLikeToContainInAnyOrderOnlyCreatorSamples.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/samples/MapLikeToContainInAnyOrderOnlyCreatorSamples.kt @@ -15,6 +15,17 @@ class MapLikeToContainInAnyOrderOnlyCreatorSamples { } } + @Test + fun entries() { + expect(mapOf(1 to "a", 2 to "b")) toContain o inAny order but only the pairs( + 2 to "b", 1 to "a" + ) + + fails { // because subject has additional entries + expect(mapOf(1 to "a", 2 to "b")) toContain o inAny order but only the pairs(1 to "a") + } + } + @Test fun entryKeyValue() { expect(mapOf(1 to "apple")) toContain o inAny order but only entry( diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/samples/MapLikeToContainInOrderOnlyCreatorSamples.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/samples/MapLikeToContainInOrderOnlyCreatorSamples.kt index 4ffbe48868..86d09d9f6d 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/samples/MapLikeToContainInOrderOnlyCreatorSamples.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/samples/MapLikeToContainInOrderOnlyCreatorSamples.kt @@ -28,6 +28,20 @@ class MapLikeToContainInOrderOnlyCreatorSamples { } } + @Test + fun entries() { + expect(mapOf(1 to "a", 2 to "b")) toContain o inGiven order and only the pairs( + 1 to "a", 2 to "b" + ) + + fails { // because the pair entries (which all exist in the subject) do not have the same order + expect(mapOf(1 to "a", 2 to "b")) toContain o inGiven order and only the pairs( + 2 to "b", + 1 to "a", + ) + } + } + @Test fun entriesKeyValue() { expect(mapOf(1 to "a", 2 to "b")) toContain o inGiven order and only the entries(