Migrate boxInline tests to new multi-file framework
This commit is contained in:
committed by
Alexander Udalov
parent
fa1f7d988e
commit
cc84aabdcf
@@ -1,5 +0,0 @@
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return IntentionsBundle.message()
|
||||
}
|
||||
+8
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
class IntentionsBundle {
|
||||
@@ -11,4 +13,10 @@ class IntentionsBundle {
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return IntentionsBundle.message()
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return call()
|
||||
}
|
||||
+10
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
fun call() = inlineFun2 { stub()}
|
||||
@@ -17,3 +19,11 @@ private fun test() = "OK"
|
||||
inline internal fun inlineFun(p: () -> String): String {
|
||||
return p()
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return call()
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return A().call()
|
||||
}
|
||||
+10
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
class A {
|
||||
@@ -21,3 +23,11 @@ class A {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return A().call()
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
import test.*
|
||||
|
||||
fun box() : String {
|
||||
return Test().run()
|
||||
}
|
||||
+11
-1
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
class Test {
|
||||
@@ -18,4 +20,12 @@ class Test {
|
||||
fun run(): String {
|
||||
return Extender().doSomething();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box() : String {
|
||||
return Test().run()
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
var r = "fail"
|
||||
A().foo { r = it }
|
||||
return r
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package test
|
||||
|
||||
class A() {
|
||||
private val x = "OK"
|
||||
internal inline fun foo(p: (String) -> Unit) {
|
||||
p(x)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
class A() {
|
||||
private val x = "OK"
|
||||
internal inline fun foo(p: (String) -> Unit) {
|
||||
p(x)
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
var r = "fail"
|
||||
A().foo { r = it }
|
||||
return r
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
var r = "fail"
|
||||
X.g { r = "OK" }
|
||||
|
||||
return r;
|
||||
}
|
||||
+13
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
object X {
|
||||
@@ -8,3 +10,14 @@ object X {
|
||||
f()
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
var r = "fail"
|
||||
X.g { r = "OK" }
|
||||
|
||||
return r;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
var r = "fail"
|
||||
C("OK").g { r = it }
|
||||
return r
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package test
|
||||
|
||||
class C(private val a : String) {
|
||||
internal inline fun g(x: (s: String) -> Unit) {
|
||||
x(a)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
class C(private val a : String) {
|
||||
internal inline fun g(x: (s: String) -> Unit) {
|
||||
x(a)
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
var r = "fail"
|
||||
C("OK").g { r = it }
|
||||
return r
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return call {
|
||||
"O"
|
||||
}
|
||||
}
|
||||
+13
-1
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
private class S public constructor() {
|
||||
@@ -15,4 +17,14 @@ internal inline fun call(s: () -> String): String {
|
||||
|
||||
private fun test(): S.Z {
|
||||
return S.Z()
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return call {
|
||||
"O"
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return call {
|
||||
"O"
|
||||
}
|
||||
}
|
||||
+13
-1
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
private class S {
|
||||
@@ -20,4 +22,14 @@ private fun test(): S {
|
||||
|
||||
private fun test2(s: S): String {
|
||||
return s.a()
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return call {
|
||||
"O"
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return call()
|
||||
}
|
||||
+11
-1
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
private class S {
|
||||
@@ -22,4 +24,12 @@ internal fun call(): String {
|
||||
return S().call {
|
||||
"O"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return call()
|
||||
}
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return A().call();
|
||||
}
|
||||
+10
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
@file:kotlin.jvm.JvmMultifileClass
|
||||
@file:kotlin.jvm.JvmName("TestKt")
|
||||
package test
|
||||
@@ -13,3 +15,11 @@ inline internal fun inlineFun(): String {
|
||||
class A () {
|
||||
fun call() = inlineFun()
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return A().call();
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
import test.*
|
||||
fun box(): String {
|
||||
return A().call();
|
||||
}
|
||||
+8
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
private val prop = "O"
|
||||
@@ -12,3 +14,9 @@ class A () {
|
||||
fun call() = inlineFun()
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
fun box(): String {
|
||||
return A().call();
|
||||
}
|
||||
Reference in New Issue
Block a user