Skip to content

Commit c8ada3c

Browse files
authored
dataconnect: testing: freeze mutable lists in tests to improve readability (#7630)
1 parent f6f500b commit c8ada3c

File tree

1 file changed

+2
-2
lines changed
  • firebase-dataconnect/testutil/src/test/kotlin/com/google/firebase/dataconnect/testutil

1 file changed

+2
-2
lines changed

firebase-dataconnect/testutil/src/test/kotlin/com/google/firebase/dataconnect/testutil/ProtoDiffUnitTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class ProtoDiffUnitTest {
8585
checkAll(propTestConfig, structArb, Arb.int(1..5)) { struct1, keyCount ->
8686
val mutableDifferences = mutableListOf<DifferencePathPair<*>>()
8787
val struct2 = prepare(struct1, keyCount, mutableDifferences)
88-
val expectedDifferences = mutableDifferences
88+
val expectedDifferences = mutableDifferences.toList()
8989

9090
structFastEqual(struct1, struct2) shouldBe false
9191
structFastEqual(struct2, struct1) shouldBe false
@@ -245,7 +245,7 @@ class ProtoDiffUnitTest {
245245
checkAll(propTestConfig, listValueArb, Arb.int(1..5)) { listValue1, itemCount ->
246246
val mutableDifferences = mutableListOf<DifferencePathPair<*>>()
247247
val listValue2 = prepare(listValue1, itemCount, mutableDifferences)
248-
val expectedDifferences = mutableDifferences
248+
val expectedDifferences = mutableDifferences.toList()
249249

250250
listValueFastEqual(listValue1, listValue2) shouldBe false
251251
listValueFastEqual(listValue2, listValue1) shouldBe false

0 commit comments

Comments
 (0)