[KT-4124] Fix test compatibility between JS and Java backed for several tests
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
// Enable for JS when it supports initializer of companion objects.
|
||||
// TARGET_BACKEND: JVM
|
||||
var global = 0;
|
||||
|
||||
class C {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// Enable for JS when it supports Java class library.
|
||||
// TARGET_BACKEND: JVM
|
||||
class SomeClass { companion object }
|
||||
|
||||
fun box() =
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// Enable for JS when it supports Java class library.
|
||||
// TARGET_BACKEND: JVM
|
||||
|
||||
class TestJava(r : Runnable) : Runnable by r {}
|
||||
class TestRunnable() : Runnable {
|
||||
public override fun run() = System.out.println("foobar")
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// Won't ever work with JS backend. Consider rewriting this test without using threads, since the issue
|
||||
// is not about threads at all.
|
||||
// TARGET_BACKEND: JVM
|
||||
|
||||
object RefreshQueue {
|
||||
val any = Any()
|
||||
val workerThread: Thread = Thread(object : Runnable {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// Enable when JS backend supports Java class library
|
||||
// TARGET_BACKEND: JVM
|
||||
public class SomeClass() : java.lang.Object() {
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// Enable when JS backend supports Java class library, since FunctionX are required for interoperation
|
||||
// TARGET_BACKEND: JVM
|
||||
class Works() : Function0<Any> {
|
||||
public override fun invoke():Any {
|
||||
return "Works" as Any
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// 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) {
|
||||
fun greet() {
|
||||
name = name.plus("")
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// Enable when JS backend supports Java class library
|
||||
// TARGET_BACKEND: JVM
|
||||
public open class Test(): java.util.RandomAccess, Cloneable, java.io.Serializable
|
||||
{
|
||||
public override fun clone(): Test = Test() // Override 'clone()' with more precise type 'Test'
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// Enable when JS backend supports Java class library
|
||||
// TARGET_BACKEND: JVM
|
||||
import java.util.AbstractList
|
||||
|
||||
class MyList(): AbstractList<String>() {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// Enable when bug with when ... !in expression gets fixed
|
||||
// TARGET_BACKEND: JVM
|
||||
import java.util.HashSet
|
||||
|
||||
fun box() : String{
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// Enable when JS backend supports local classes
|
||||
// TARGET_BACKEND: JVM
|
||||
fun box() : String {
|
||||
val o = object {
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// Enable for JS when it supports Java class library.
|
||||
// TARGET_BACKEND: JVM
|
||||
fun test1() : Boolean {
|
||||
try {
|
||||
return true
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@ val USER_ID_2 =
|
||||
fun getUserIdFromEnvironment() : Int = throw UnsupportedOperationException()
|
||||
|
||||
fun box() : String {
|
||||
System.out?.println("G: " + GUEST_USER_ID + " U1:" + USER_ID + " U2: " + USER_ID_2)
|
||||
// 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_2 != 4) return "test2 failed"
|
||||
if(GUEST_USER_ID != 5) return "test3 failed"
|
||||
|
||||
+2
-1
@@ -4,7 +4,8 @@ class Reluctant() {
|
||||
}
|
||||
}
|
||||
|
||||
fun p(o : Any?) = System.out?.println(o)
|
||||
// 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 {
|
||||
try {
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// Enable for JS when it supports Java class library.
|
||||
// TARGET_BACKEND: JVM
|
||||
// BTW, this test does not seem relevant to real descsription of issue #KT-504
|
||||
import java.util.HashMap
|
||||
import java.io.*
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// Enable when JS backend get support of local classes
|
||||
// TARGET_BACKEND: JVM
|
||||
fun test1(str: String): String {
|
||||
data class A(val x: Int) {
|
||||
fun foo() = str
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// Enable for JS when it supports Java class library.
|
||||
// TARGET_BACKEND: JVM
|
||||
class List<T>(val head: T, val tail: List<T>? = null)
|
||||
|
||||
fun <T> List<T>.mapHead(f: (T)-> T): List<T> = List<T>(f(head), null)
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// Enable for JS when it supports local classes.
|
||||
// TARGET_BACKEND: JVM
|
||||
|
||||
fun testFun1(str: String): String {
|
||||
val capture = str
|
||||
|
||||
|
||||
Reference in New Issue
Block a user