[JS IR BE] Fix and refactor interop tests

This commit is contained in:
Svyatoslav Kuzmich
2019-02-14 19:43:22 +03:00
parent 569187a751
commit a736756ceb
37 changed files with 54 additions and 58 deletions
+1 -3
View File
@@ -1,6 +1,4 @@
// IGNORE_BACKEND: JS_IR
// EXPECTED_REACHABLE_NODES: 1290
package foo
object A {
@JsName("js_method") fun f() = "method"
@@ -9,7 +7,7 @@ object A {
}
fun test() = js("""
var a = JS_TESTS.foo.A;
var a = JS_TESTS.A;
return a.js_method() + ";" + a.js_property;
""")
+2 -4
View File
@@ -1,6 +1,4 @@
// IGNORE_BACKEND: JS_IR
// EXPECTED_REACHABLE_NODES: 1294
package foo
@JsName("AA") object A {
@JsName("foo") fun bar() = "A.foo"
@@ -11,12 +9,12 @@ package foo
}
fun testA() = js("""
var a = JS_TESTS.foo.AA;
var a = JS_TESTS.AA;
return a.foo();
""")
fun testB() = js("""
var b = new JS_TESTS.foo.BB();
var b = new JS_TESTS.BB();
return b.foo();
""")
+1 -3
View File
@@ -1,6 +1,4 @@
// IGNORE_BACKEND: JS_IR
// EXPECTED_REACHABLE_NODES: 1295
package foo
open class A {
@JsName("js_f") open fun f(x: Int) = "A.f($x)"
@@ -11,7 +9,7 @@ class B : A() {
}
fun test() = js("""
var module = JS_TESTS.foo;
var module = JS_TESTS;
return new (module.A)().js_f(23) + ";" + new (module.B)().js_f(42);
""")
@@ -1,6 +1,4 @@
// IGNORE_BACKEND: JS_IR
// EXPECTED_REACHABLE_NODES: 1290
package foo
interface A {
@JsName("js_f") fun f(x: Int): String
@@ -11,7 +9,7 @@ class B : A {
}
fun test() = js("""
var module = JS_TESTS.foo;
var module = JS_TESTS;
return new (module.B)().js_f(23);
""")
+1 -2
View File
@@ -1,13 +1,12 @@
// IGNORE_BACKEND: JS_IR
// EXPECTED_REACHABLE_NODES: 1290
package foo
object A {
@JsName("js_f") private fun f(x: Int) = "f($x)"
}
fun test() = js("""
return JS_TESTS.foo.A.js_f(23);
return JS_TESTS.A.js_f(23);
""")
fun box(): String {
@@ -1,13 +1,12 @@
// IGNORE_BACKEND: JS_IR
// EXPECTED_REACHABLE_NODES: 1288
package foo
class A(val x: String) {
@JsName("A_int") constructor(x: Int) : this("int $x")
}
fun test() = js("""
return JS_TESTS.foo.A_int(23).x;
return JS_TESTS.A_int(23).x;
""")
fun box(): String {
+1 -3
View File
@@ -1,6 +1,4 @@
// IGNORE_BACKEND: JS_IR
// EXPECTED_REACHABLE_NODES: 1291
package foo
object A {
@JsName("js_f") fun f(x: Int) = "f($x)"
@@ -13,7 +11,7 @@ object A {
}
fun test() = js("""
var a = JS_TESTS.foo.A;
var a = JS_TESTS.A;
return a.js_f(23) + ";" + a.js_g(42) + ";" + a.js_p + ";" + a.js_q;
""")