From 49756a897e56a5f7d78309893664777d3a33067f Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Thu, 17 Nov 2016 02:14:52 +0300 Subject: [PATCH] Just refactor tests that require further investigation --- compiler/testData/codegen/box/classes/kt508.kt | 3 +-- .../closureInsideClosure/propertyAndFunctionNameClash.kt | 3 +-- compiler/testData/codegen/box/dataClasses/doubleParam.kt | 4 +--- compiler/testData/codegen/box/dataClasses/floatParam.kt | 4 +--- compiler/testData/codegen/box/regressions/kt1172.kt | 6 ++---- compiler/testData/codegen/box/toArray/toTypedArray.kt | 9 ++++----- compiler/testData/codegen/box/traits/kt2399.kt | 3 +-- 7 files changed, 11 insertions(+), 21 deletions(-) diff --git a/compiler/testData/codegen/box/classes/kt508.kt b/compiler/testData/codegen/box/classes/kt508.kt index 533c25bdd17..d26dfafd6c0 100644 --- a/compiler/testData/codegen/box/classes/kt508.kt +++ b/compiler/testData/codegen/box/classes/kt508.kt @@ -1,7 +1,6 @@ // TODO: Enable for JS when it supports Java class library. // IGNORE_BACKEND: JS -import java.util.HashMap -import java.io.* +// fails on JS with TypeError: imported$plus is not a function, it is undefined. operator fun MutableMap.set(key : K, value : V) = put(key, value) diff --git a/compiler/testData/codegen/box/closures/closureInsideClosure/propertyAndFunctionNameClash.kt b/compiler/testData/codegen/box/closures/closureInsideClosure/propertyAndFunctionNameClash.kt index f18ffb00e93..fdd8763322e 100644 --- a/compiler/testData/codegen/box/closures/closureInsideClosure/propertyAndFunctionNameClash.kt +++ b/compiler/testData/codegen/box/closures/closureInsideClosure/propertyAndFunctionNameClash.kt @@ -1,10 +1,9 @@ // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS +// on JS item local variable clashes with ListTag.item() extension function package d -import java.util.ArrayList - fun box(): String { ListTag().test(listOf("a", "b")) return "OK" diff --git a/compiler/testData/codegen/box/dataClasses/doubleParam.kt b/compiler/testData/codegen/box/dataClasses/doubleParam.kt index a5b4548240f..7c4f6be1a75 100644 --- a/compiler/testData/codegen/box/dataClasses/doubleParam.kt +++ b/compiler/testData/codegen/box/dataClasses/doubleParam.kt @@ -1,9 +1,7 @@ // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS -import java.util.HashSet - -val NAN = java.lang.Double.NaN +val NAN = Double.NaN data class A(val x: Double) diff --git a/compiler/testData/codegen/box/dataClasses/floatParam.kt b/compiler/testData/codegen/box/dataClasses/floatParam.kt index b15c56b757f..aaa8f2b5e2f 100644 --- a/compiler/testData/codegen/box/dataClasses/floatParam.kt +++ b/compiler/testData/codegen/box/dataClasses/floatParam.kt @@ -1,9 +1,7 @@ // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS -import java.util.HashSet - -val NAN = java.lang.Float.NaN +val NAN = Float.NaN data class A(val x: Float) diff --git a/compiler/testData/codegen/box/regressions/kt1172.kt b/compiler/testData/codegen/box/regressions/kt1172.kt index 465ea63e44d..b4fa90465a2 100644 --- a/compiler/testData/codegen/box/regressions/kt1172.kt +++ b/compiler/testData/codegen/box/regressions/kt1172.kt @@ -1,15 +1,13 @@ // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS +// not sure if it's ok to change Object to Any // WITH_RUNTIME package test.regressions.kt1172 -import kotlin.concurrent.* -import java.util.* - public fun scheduleRefresh(vararg files : Object) { - java.util.ArrayList(files.map{ it }) + ArrayList(files.map { it }) } fun box(): String { diff --git a/compiler/testData/codegen/box/toArray/toTypedArray.kt b/compiler/testData/codegen/box/toArray/toTypedArray.kt index 3da816ac4d9..694f4905d8b 100644 --- a/compiler/testData/codegen/box/toArray/toTypedArray.kt +++ b/compiler/testData/codegen/box/toArray/toTypedArray.kt @@ -1,15 +1,14 @@ // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS +// missing isArrayOf on JS // WITH_RUNTIME -import java.util.Arrays - fun box(): String { - val array = Arrays.asList(2, 3, 9).toTypedArray() - if (!array.isArrayOf()) return array.javaClass.toString() + val array = listOf(2, 3, 9).toTypedArray() + if (!array.isArrayOf()) return "fail: is not Array" - val str = Arrays.toString(array) + val str = array.contentToString() if (str != "[2, 3, 9]") return str return "OK" diff --git a/compiler/testData/codegen/box/traits/kt2399.kt b/compiler/testData/codegen/box/traits/kt2399.kt index 3a4798c9da9..9b59cb8cab1 100644 --- a/compiler/testData/codegen/box/traits/kt2399.kt +++ b/compiler/testData/codegen/box/traits/kt2399.kt @@ -1,7 +1,6 @@ // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS - -import java.util.ArrayList +// on JS Parser.parse and MultiParser.parse clash in ProjectInfoJsonParser class JsonObject { }