mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-12-28 03:27:15 +00:00
refactor and add mixed
This commit is contained in:
parent
34d8c18a46
commit
61ea85ac1b
@ -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() {
|
||||||
|
Loading…
Reference in New Issue
Block a user