mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-10 00:21:35 +00:00
25 lines
570 B
Kotlin
25 lines
570 B
Kotlin
import kotlin.reflect.jvm.internal.pcollections.HashPMap
|
|
import kotlin.test.*
|
|
|
|
fun box(): String {
|
|
var map = HashPMap.empty<String, Any>()!!
|
|
|
|
map = map.plus("lol", 42)!!
|
|
|
|
assertEquals(1, map.size())
|
|
assertTrue(map.containsKey("lol"))
|
|
assertFalse(map.containsKey(""))
|
|
assertEquals(42, map["lol"])
|
|
assertEquals(null, map[""])
|
|
|
|
map = map.plus("", 0)!!
|
|
|
|
assertEquals(2, map.size())
|
|
assertTrue(map.containsKey("lol"))
|
|
assertTrue(map.containsKey(""))
|
|
assertEquals(42, map["lol"])
|
|
assertEquals(0, map[""])
|
|
|
|
return "OK"
|
|
}
|