[JS TESTS] Move dependency modules higher than main in test files

This commit is contained in:
Ivan Kylchik
2021-08-30 16:26:05 +03:00
parent 2bea77d4e2
commit aaab22a675
4 changed files with 35 additions and 35 deletions
+22 -22
View File
@@ -1,25 +1,4 @@
// EXPECTED_REACHABLE_NODES: 1300
// MODULE: main(module2)
// FILE: main.kt
// CHECK_CONTAINS_NO_CALLS: box except=foo;bar;toString TARGET_BACKENDS=JS
import A.test
fun box(): String {
if (A.test() != 3) return "A.test()" + A.test()
if (B.test() != 6) return "B.test()" + B.test()
if (B().foo() != 4) return "B().foo()" + B().foo()
if (test() != 3) return "[A.]test()" + test()
if (test2() != 3) return "test2()" + test2()
if (A.test2() != 3) return "A.test2()" + A.test2()
if (B.test2() != 2) return "B.test2()" + B.test2()
if (B.C.test() != 4) return "B.C.test()" + B.C.test()
if (D().foo2() != 4) return "D().foo2()" + D().foo2()
if (D.test() != 4) return "D.test()" + D.test()
return "OK"
}
// MODULE: module2
// FILE: module2.kt
@@ -56,4 +35,25 @@ class D: B() {
inline fun test2() = foo() + bar()
inline fun A.test2() = foo() + B.bar()
inline fun B.Companion.test2() = bar()
inline fun B.Companion.test2() = bar()
// MODULE: main(module2)
// FILE: main.kt
// CHECK_CONTAINS_NO_CALLS: box except=foo;bar;toString TARGET_BACKENDS=JS
import A.test
fun box(): String {
if (A.test() != 3) return "A.test()" + A.test()
if (B.test() != 6) return "B.test()" + B.test()
if (B().foo() != 4) return "B().foo()" + B().foo()
if (test() != 3) return "[A.]test()" + test()
if (test2() != 3) return "test2()" + test2()
if (A.test2() != 3) return "A.test2()" + A.test2()
if (B.test2() != 2) return "B.test2()" + B.test2()
if (B.C.test() != 4) return "B.C.test()" + B.C.test()
if (D().foo2() != 4) return "D().foo2()" + D().foo2()
if (D.test() != 4) return "D.test()" + D.test()
return "OK"
}