Make some tests JVM only

This commit is contained in:
Ilya Gorbunov
2016-11-17 00:13:18 +03:00
parent 38840bb529
commit 0899a0fdda
38 changed files with 52 additions and 523 deletions
+4 -7
View File
@@ -1,14 +1,11 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
// TARGET_BACKEND: JVM
// WITH_RUNTIME
import java.util.Arrays
class MyCollection<T>(val delegate: Collection<T>): Collection<T> by delegate
fun box(): String {
val collection = MyCollection(Arrays.asList(2, 3, 9)) as java.util.Collection<*>
val collection = MyCollection(listOf(2, 3, 9)) as java.util.Collection<*>
val array1 = collection.toArray()
val array2 = collection.toArray(arrayOfNulls<Int>(3) as Array<Int>)
@@ -16,8 +13,8 @@ fun box(): String {
if (!array1.isArrayOf<Any>()) return (array1 as Object).getClass().toString()
if (!array2.isArrayOf<Int>()) return (array2 as Object).getClass().toString()
val s1 = Arrays.toString(array1)
val s2 = Arrays.toString(array2)
val s1 = array1.contentToString()
val s2 = array2.contentToString()
if (s1 != "[2, 3, 9]") return "s1 = $s1"
if (s2 != "[2, 3, 9]") return "s2 = $s2"