KT-2752: add basic tests for JsName

This commit is contained in:
Alexey Andreev
2016-05-30 14:26:24 +03:00
parent 5e3aa33b13
commit 5ce158f297
44 changed files with 300 additions and 157 deletions
@@ -0,0 +1,20 @@
package foo
open class A {
@JsName("js_f") open fun f(x: Int) = "A.f($x)"
}
class B : A() {
override fun f(x: Int) = "B.f($x)"
}
fun test() = js("""
var module = Kotlin.modules.JS_TESTS.foo;
return new (module.A)().js_f(23) + ";" + new (module.B)().js_f(42);
""")
fun box(): String {
val result = test()
assertEquals("A.f(23);B.f(42)", result);
return "OK"
}