diff --git a/kotlinx-coroutines-core/jvm/test/internal/ConcurrentWeakMapTest.kt b/kotlinx-coroutines-core/jvm/test/internal/ConcurrentWeakMapTest.kt index ae4b5fce30..e4fa5e9bfe 100644 --- a/kotlinx-coroutines-core/jvm/test/internal/ConcurrentWeakMapTest.kt +++ b/kotlinx-coroutines-core/jvm/test/internal/ConcurrentWeakMapTest.kt @@ -12,8 +12,8 @@ import org.junit.* class ConcurrentWeakMapTest : TestBase() { @Test fun testSimple() { - val expect = (1..1000).associateWith { it.toString() } - val m = ConcurrentWeakMap() + val expect = (1..1000).associate { it.toString().let { it to it } } + val m = ConcurrentWeakMap() // repeat adding/removing a few times repeat(5) { assertEquals(0, m.size) @@ -27,7 +27,7 @@ class ConcurrentWeakMapTest : TestBase() { assertEquals(expect.keys, m.keys) assertEquals(expect.entries, m.entries) for ((k, v) in expect) { - assertEquals(v, m.get(k)) + assertEquals(v, m[k]) } assertEquals(expect.size, m.size) if (it % 2 == 0) { @@ -38,9 +38,9 @@ class ConcurrentWeakMapTest : TestBase() { m.clear() } assertEquals(0, m.size) - for ((k, v) in expect) { - assertNull(m.get(k)) + for ((k, _) in expect) { + assertNull(m[k]) } } } -} \ No newline at end of file +}