refactor and add mixed

This commit is contained in:
akkkihi 2023-05-12 22:42:24 +03:00
parent 34d8c18a46
commit 61ea85ac1b

View File

@ -211,6 +211,24 @@ class MapDiffUtilsTests {
) )
} }
@Test
@OptIn(Warning::class)
fun testMapDiffMixed() {
val originalMap = mutableMapOf("a" to 1, "b" to 2, "c" to 3)
val diff = MapDiff(mapOf("b" to 2), mapOf("c" to (3 to 5)), mapOf("d" to 4))
originalMap.remove("b")
// change value
originalMap["c"] = 5
// add value
originalMap["d"] = 4
assertEquals(
mapOf("a" to 1, "c" to 5, "d" to 4),
originalMap
)
}
@Test @Test
@OptIn(Warning::class) @OptIn(Warning::class)
fun testApplyMapDiffMixed() { fun testApplyMapDiffMixed() {