[KT-4124] Fix some tests from common testData
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
// Enable for JS when it supports initializer of companion objects.
|
// Enable for JS when it supports initializer of companion objects.
|
||||||
// TARGET_BACKEND: JVM
|
// TARGET_BACKEND: JVM
|
||||||
|
// see https://youtrack.jetbrains.com/issue/KT-11086
|
||||||
var global = 0;
|
var global = 0;
|
||||||
|
|
||||||
class C {
|
class C {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Enable for JS when it supports Java class library.
|
// TODO: Enable for JS when it supports Java class library.
|
||||||
// TARGET_BACKEND: JVM
|
// TARGET_BACKEND: JVM
|
||||||
class SomeClass { companion object }
|
class SomeClass { companion object }
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
// Won't ever work with JS backend. Consider rewriting this test without using threads, since the issue
|
// Won't ever work with JS backend.
|
||||||
// is not about threads at all.
|
// TODO: Consider rewriting this test without using threads, since the issue is not about threads at all.
|
||||||
// TARGET_BACKEND: JVM
|
// TARGET_BACKEND: JVM
|
||||||
|
|
||||||
object RefreshQueue {
|
object RefreshQueue {
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// Enable when JS backend supports Java class library
|
// TODO: Enable when JS backend supports Java class library
|
||||||
// TARGET_BACKEND: JVM
|
// TARGET_BACKEND: JVM
|
||||||
public class SomeClass() : java.lang.Object() {
|
public class SomeClass() : java.lang.Object() {
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// Enable when JS backend supports Java class library, since FunctionX are required for interoperation
|
// TODO: Enable when JS backend supports Java class library, since FunctionX are required for interoperation
|
||||||
// TARGET_BACKEND: JVM
|
// TARGET_BACKEND: JVM
|
||||||
class Works() : Function0<Any> {
|
class Works() : Function0<Any> {
|
||||||
public override fun invoke():Any {
|
public override fun invoke():Any {
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
// Enable when JS backend supports Java class library, or consider replacing System.out.println with kotlin.println
|
|
||||||
// TARGET_BACKEND: JVM
|
|
||||||
class Greeter(var name : String) {
|
class Greeter(var name : String) {
|
||||||
fun greet() {
|
fun greet() {
|
||||||
name = name.plus("")
|
name = name.plus("")
|
||||||
System.out?.println("Hello, $name");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// Enable when JS backend supports Java class library
|
// TODO: Enable when JS backend supports Java class library
|
||||||
// TARGET_BACKEND: JVM
|
// TARGET_BACKEND: JVM
|
||||||
public open class Test(): java.util.RandomAccess, Cloneable, java.io.Serializable
|
public open class Test(): java.util.RandomAccess, Cloneable, java.io.Serializable
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// Enable when JS backend supports Java class library
|
// TODO: Enable when JS backend supports Java class library
|
||||||
// TARGET_BACKEND: JVM
|
// TARGET_BACKEND: JVM
|
||||||
import java.util.AbstractList
|
import java.util.AbstractList
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
// Enable when bug with when ... !in expression gets fixed
|
|
||||||
// TARGET_BACKEND: JVM
|
|
||||||
import java.util.HashSet
|
import java.util.HashSet
|
||||||
|
|
||||||
fun box() : String{
|
fun box() : String{
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// Enable when JS backend supports local classes
|
// TODO: Enable when JS backend supports local classes
|
||||||
// TARGET_BACKEND: JVM
|
// TARGET_BACKEND: JVM
|
||||||
fun box() : String {
|
fun box() : String {
|
||||||
val o = object {
|
val o = object {
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
// Enable for JS when it supports Java class library.
|
|
||||||
// TARGET_BACKEND: JVM
|
|
||||||
fun test1() : Boolean {
|
fun test1() : Boolean {
|
||||||
try {
|
try {
|
||||||
return true
|
return true
|
||||||
@@ -45,9 +43,7 @@ fun test4() : Int {
|
|||||||
|
|
||||||
fun test5() : Int {
|
fun test5() : Int {
|
||||||
var x = 0
|
var x = 0
|
||||||
System.out?.println("test 5")
|
|
||||||
while(true) {
|
while(true) {
|
||||||
System.out?.println(x)
|
|
||||||
try {
|
try {
|
||||||
if(x < 10)
|
if(x < 10)
|
||||||
x++
|
x++
|
||||||
@@ -63,9 +59,7 @@ fun test5() : Int {
|
|||||||
|
|
||||||
fun test6() : Int {
|
fun test6() : Int {
|
||||||
var x = 0
|
var x = 0
|
||||||
System.out?.println("test 6")
|
|
||||||
while(x < 10) {
|
while(x < 10) {
|
||||||
System.out?.println(x)
|
|
||||||
try {
|
try {
|
||||||
x++
|
x++
|
||||||
continue
|
continue
|
||||||
@@ -81,7 +75,6 @@ fun box() : String {
|
|||||||
if(test1()) return "test1 failed"
|
if(test1()) return "test1 failed"
|
||||||
if(test2()) return "test2 failed"
|
if(test2()) return "test2 failed"
|
||||||
if(test3() != 2) return "test3 failed"
|
if(test3() != 2) return "test3 failed"
|
||||||
System.out?.println(test4())
|
|
||||||
if(test4() != 0) return "test4 failed"
|
if(test4() != 0) return "test4 failed"
|
||||||
if(test5() != 11) return "test5 failed"
|
if(test5() != 11) return "test5 failed"
|
||||||
if(test6() != 10) return "test6 failed"
|
if(test6() != 10) return "test6 failed"
|
||||||
|
|||||||
@@ -21,8 +21,6 @@ val USER_ID_2 =
|
|||||||
fun getUserIdFromEnvironment() : Int = throw UnsupportedOperationException()
|
fun getUserIdFromEnvironment() : Int = throw UnsupportedOperationException()
|
||||||
|
|
||||||
fun box() : String {
|
fun box() : String {
|
||||||
// Probably, it's an old debugging code. JS backend still does not support this
|
|
||||||
//System.out?.println("G: " + GUEST_USER_ID + " U1:" + USER_ID + " U2: " + USER_ID_2)
|
|
||||||
if(USER_ID != 4) return "test0 failed"
|
if(USER_ID != 4) return "test0 failed"
|
||||||
if(USER_ID_2 != 4) return "test2 failed"
|
if(USER_ID_2 != 4) return "test2 failed"
|
||||||
if(GUEST_USER_ID != 5) return "test3 failed"
|
if(GUEST_USER_ID != 5) return "test3 failed"
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ class Reluctant() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Probably, it's an old debugging code. JS backend still does not support this
|
|
||||||
//fun p(o : Any?) = System.out?.println(o)
|
|
||||||
|
|
||||||
fun test1() : String {
|
fun test1() : String {
|
||||||
try {
|
try {
|
||||||
val b = Reluctant()
|
val b = Reluctant()
|
||||||
|
|||||||
+13
-14
@@ -1,18 +1,17 @@
|
|||||||
// Enable for JS when it supports Java class library.
|
package mult_constructors_3_bug
|
||||||
// TARGET_BACKEND: JVM
|
|
||||||
// BTW, this test does not seem relevant to real descsription of issue #KT-504
|
|
||||||
import java.util.HashMap
|
|
||||||
import java.io.*
|
|
||||||
|
|
||||||
operator fun <K, V> MutableMap<K, V>.set(key : K, value : V) = put(key, value)
|
public open class Identifier() {
|
||||||
|
private var myNullable : Boolean = true
|
||||||
|
companion object {
|
||||||
|
open public fun init(isNullable : Boolean) : Identifier {
|
||||||
|
val id = Identifier()
|
||||||
|
id.myNullable = isNullable
|
||||||
|
return id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun box() : String {
|
fun box() : String {
|
||||||
|
Identifier.init(true)
|
||||||
val commands : MutableMap<String, String> = HashMap()
|
return "OK"
|
||||||
|
|
||||||
commands["c1"] = "239"
|
|
||||||
if(commands["c1"] != "239") return "fail"
|
|
||||||
|
|
||||||
commands["c1"] += "932"
|
|
||||||
return if(commands["c1"] == "239932") "OK" else "fail"
|
|
||||||
}
|
}
|
||||||
|
|||||||
+13
-13
@@ -1,17 +1,17 @@
|
|||||||
package mult_constructors_3_bug
|
// TODO: Enable for JS when it supports Java class library.
|
||||||
|
// TARGET_BACKEND: JVM
|
||||||
|
import java.util.HashMap
|
||||||
|
import java.io.*
|
||||||
|
|
||||||
public open class Identifier() {
|
operator fun <K, V> MutableMap<K, V>.set(key : K, value : V) = put(key, value)
|
||||||
private var myNullable : Boolean = true
|
|
||||||
companion object {
|
|
||||||
open public fun init(isNullable : Boolean) : Identifier {
|
|
||||||
val id = Identifier()
|
|
||||||
id.myNullable = isNullable
|
|
||||||
return id
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun box() : String {
|
fun box() : String {
|
||||||
Identifier.init(true)
|
|
||||||
return "OK"
|
val commands : MutableMap<String, String> = HashMap()
|
||||||
|
|
||||||
|
commands["c1"] = "239"
|
||||||
|
if(commands["c1"] != "239") return "fail"
|
||||||
|
|
||||||
|
commands["c1"] += "932"
|
||||||
|
return if(commands["c1"] == "239932") "OK" else "fail"
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// Enable when JS backend get support of local classes
|
// TODO: Enable when JS backend get support of local classes
|
||||||
// TARGET_BACKEND: JVM
|
// TARGET_BACKEND: JVM
|
||||||
fun test1(str: String): String {
|
fun test1(str: String): String {
|
||||||
data class A(val x: Int) {
|
data class A(val x: Int) {
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// Enable for JS when it supports Java class library.
|
// TODO: Enable for JS when it supports Java class library.
|
||||||
// TARGET_BACKEND: JVM
|
// TARGET_BACKEND: JVM
|
||||||
class List<T>(val head: T, val tail: List<T>? = null)
|
class List<T>(val head: T, val tail: List<T>? = null)
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// Enable for JS when it supports local classes.
|
// TODO: Enable for JS when it supports local classes.
|
||||||
// TARGET_BACKEND: JVM
|
// TARGET_BACKEND: JVM
|
||||||
|
|
||||||
fun testFun1(str: String): String {
|
fun testFun1(str: String): String {
|
||||||
|
|||||||
+1
@@ -1,3 +1,4 @@
|
|||||||
|
// TODO: Enable when JS backed gets support of Java class library
|
||||||
// TARGET_BACKEND: JVM
|
// TARGET_BACKEND: JVM
|
||||||
fun ok(b: Boolean) = if (b) "OK" else "Fail"
|
fun ok(b: Boolean) = if (b) "OK" else "Fail"
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// Local classes are still unsupported
|
// TODO: enable when JS backend gets support of local classes
|
||||||
// TARGET_BACKEND: JVM
|
// TARGET_BACKEND: JVM
|
||||||
|
|
||||||
open class C(s: Int) {
|
open class C(s: Int) {
|
||||||
|
|||||||
Vendored
-2
@@ -1,5 +1,3 @@
|
|||||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
|
||||||
|
|
||||||
class A {
|
class A {
|
||||||
<!NATIVE_INNER_CLASS_PROHIBITED!>@native inner class B<!>
|
<!NATIVE_INNER_CLASS_PROHIBITED!>@native inner class B<!>
|
||||||
}
|
}
|
||||||
|
|||||||
-2
@@ -1,5 +1,3 @@
|
|||||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
|
||||||
|
|
||||||
fun foo() {
|
fun foo() {
|
||||||
<!NON_TOPLEVEL_CLASS_DECLARATION!>class A<!> {
|
<!NON_TOPLEVEL_CLASS_DECLARATION!>class A<!> {
|
||||||
inner <!NON_TOPLEVEL_CLASS_DECLARATION!>class E<!> {
|
inner <!NON_TOPLEVEL_CLASS_DECLARATION!>class E<!> {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010-2015 JetBrains s.r.o.
|
* Copyright 2010-2016 JetBrains s.r.o.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -67,12 +67,6 @@ public class ClassesTestGenerated extends AbstractClassesTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("kt1759.kt")
|
|
||||||
public void ignoredKt1759() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/classes/kt1759.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("kt2288.kt")
|
@TestMetadata("kt2288.kt")
|
||||||
public void ignoredKt2288() throws Exception {
|
public void ignoredKt2288() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/classes/kt2288.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/classes/kt2288.kt");
|
||||||
@@ -85,27 +79,15 @@ public class ClassesTestGenerated extends AbstractClassesTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("kt2417.kt")
|
|
||||||
public void ignoredKt2417() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/classes/kt2417.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("kt2607.kt")
|
@TestMetadata("kt2607.kt")
|
||||||
public void ignoredKt2607() throws Exception {
|
public void ignoredKt2607() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/classes/kt2607.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/classes/kt2607.kt");
|
||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("kt496.kt")
|
@TestMetadata("kt508.kt")
|
||||||
public void ignoredKt496() throws Exception {
|
public void ignoredKt508() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/classes/kt496.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/classes/kt508.kt");
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("kt504.kt")
|
|
||||||
public void ignoredKt504() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/classes/kt504.kt");
|
|
||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -353,6 +335,12 @@ public class ClassesTestGenerated extends AbstractClassesTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt1759.kt")
|
||||||
|
public void testKt1759() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/classes/kt1759.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("kt1891.kt")
|
@TestMetadata("kt1891.kt")
|
||||||
public void testKt1891() throws Exception {
|
public void testKt1891() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/classes/kt1891.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/classes/kt1891.kt");
|
||||||
@@ -401,6 +389,12 @@ public class ClassesTestGenerated extends AbstractClassesTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt2417.kt")
|
||||||
|
public void testKt2417() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/classes/kt2417.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("kt2477.kt")
|
@TestMetadata("kt2477.kt")
|
||||||
public void testKt2477() throws Exception {
|
public void testKt2477() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/classes/kt2477.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/classes/kt2477.kt");
|
||||||
@@ -515,6 +509,12 @@ public class ClassesTestGenerated extends AbstractClassesTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt496.kt")
|
||||||
|
public void testKt496() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/classes/kt496.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("kt500.kt")
|
@TestMetadata("kt500.kt")
|
||||||
public void testKt500() throws Exception {
|
public void testKt500() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/classes/kt500.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/classes/kt500.kt");
|
||||||
@@ -527,9 +527,9 @@ public class ClassesTestGenerated extends AbstractClassesTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("kt508.kt")
|
@TestMetadata("kt504.kt")
|
||||||
public void testKt508() throws Exception {
|
public void testKt504() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/classes/kt508.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/classes/kt504.kt");
|
||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010-2015 JetBrains s.r.o.
|
* Copyright 2010-2016 JetBrains s.r.o.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010-2015 JetBrains s.r.o.
|
* Copyright 2010-2016 JetBrains s.r.o.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010-2015 JetBrains s.r.o.
|
* Copyright 2010-2016 JetBrains s.r.o.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
Reference in New Issue
Block a user