JS: move expressions test to box tests

This commit is contained in:
Alexey Andreev
2016-08-26 19:32:17 +03:00
parent 2bf0199959
commit b159049be8
314 changed files with 2380 additions and 2185 deletions
@@ -0,0 +1,45 @@
package foo
public class A
internal fun A(a: Int){}
public class B(a: Int)
internal fun B(){}
internal fun C(a: Int){}
public class C
internal fun D(){}
public class D(a: Int)
//Testing
internal fun testClass(name: String, f: () -> Unit) {
val fs = f.toString()
if ("$name(" !in fs) throw Exception("Name of class '$name' unexpectedly mangled: $fs")
}
internal fun testFun(name: String, f: () -> Unit) {
val fs = f.toString()
if ("$name(" in fs) throw Exception("Name of fun '$name' unexpectedly not mangled: $fs")
}
fun box(): String {
testClass("A") { A() }
testFun("A") { A(1) }
testFun("B") { B() }
testClass("B") { B(1) }
testClass("C") { C() }
testFun("C") { C(1) }
testFun("D") { D() }
testClass("D") { D(1) }
return "OK"
}