mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
This patch mutes the following test categories:
* Tests with java dependencies (System class,
java stdlib, jvm-oriented annotations etc).
* Coroutines tests.
* Reflection tests.
* Tests with an inheritance from the standard
collections.
32 lines
987 B
Kotlin
Vendored
32 lines
987 B
Kotlin
Vendored
// TODO: muted automatically, investigate should it be ran for JS or not
|
|
// IGNORE_BACKEND: JS, NATIVE
|
|
|
|
class MyMap<K, V>: Map<K, V> {
|
|
override val size: Int get() = 0
|
|
override fun isEmpty(): Boolean = true
|
|
override fun containsKey(key: K): Boolean = false
|
|
override fun containsValue(value: V): Boolean = false
|
|
override fun get(key: K): V? = null
|
|
override val keys: Set<K> get() = throw UnsupportedOperationException()
|
|
override val values: Collection<V> get() = throw UnsupportedOperationException()
|
|
override val entries: Set<Map.Entry<K, V>> get() = throw UnsupportedOperationException()
|
|
|
|
public fun put(key: K, value: V): V? = null
|
|
public fun remove(key: K): V? = null
|
|
public fun putAll(m: Map<out K, V>) {}
|
|
public fun clear() {}
|
|
}
|
|
|
|
fun box(): String {
|
|
val myMap = MyMap<String, Int>()
|
|
val map = myMap as java.util.Map<String, Int>
|
|
|
|
map.put("", 1)
|
|
map.remove("")
|
|
map.putAll(myMap)
|
|
map.clear()
|
|
|
|
return "OK"
|
|
}
|
|
|