File tree 1 file changed +6
-6
lines changed
kotlinx-coroutines-core/jvm/test/internal
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ import org.junit.*
12
12
class ConcurrentWeakMapTest : TestBase () {
13
13
@Test
14
14
fun testSimple () {
15
- val expect = (1 .. 1000 ).associateWith { it.toString() }
16
- val m = ConcurrentWeakMap <Int , String >()
15
+ val expect = (1 .. 1000 ).associate { it.toString(). let { it to it } }
16
+ val m = ConcurrentWeakMap <String , String >()
17
17
// repeat adding/removing a few times
18
18
repeat(5 ) {
19
19
assertEquals(0 , m.size)
@@ -27,7 +27,7 @@ class ConcurrentWeakMapTest : TestBase() {
27
27
assertEquals(expect.keys, m.keys)
28
28
assertEquals(expect.entries, m.entries)
29
29
for ((k, v) in expect) {
30
- assertEquals(v, m.get(k) )
30
+ assertEquals(v, m[k] )
31
31
}
32
32
assertEquals(expect.size, m.size)
33
33
if (it % 2 == 0 ) {
@@ -38,9 +38,9 @@ class ConcurrentWeakMapTest : TestBase() {
38
38
m.clear()
39
39
}
40
40
assertEquals(0 , m.size)
41
- for ((k, v ) in expect) {
42
- assertNull(m.get(k) )
41
+ for ((k, _ ) in expect) {
42
+ assertNull(m[k] )
43
43
}
44
44
}
45
45
}
46
- }
46
+ }
You can’t perform that action at this time.
0 commit comments