Migrate boxInline tests to new multi-file framework
This commit is contained in:
committed by
Alexander Udalov
parent
fa1f7d988e
commit
cc84aabdcf
@@ -1,7 +0,0 @@
|
||||
import test.*
|
||||
|
||||
fun box() : String {
|
||||
val call = call(A(11), A::calc)
|
||||
return if (call == 11) "OK" else "fail"
|
||||
}
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
package test
|
||||
|
||||
class A(val z: Int) {
|
||||
fun calc() = z
|
||||
}
|
||||
|
||||
inline fun call(p: A, s: A.() -> Int): Int {
|
||||
return p.s()
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
class A(val z: Int) {
|
||||
fun calc() = z
|
||||
}
|
||||
|
||||
inline fun call(p: A, s: A.() -> Int): Int {
|
||||
return p.s()
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box() : String {
|
||||
val call = call(A(11), A::calc)
|
||||
return if (call == 11) "OK" else "fail"
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
import test.*
|
||||
|
||||
fun box() : String {
|
||||
val call = A(11).test()
|
||||
return if (call == 11) "OK" else "fail"
|
||||
}
|
||||
|
||||
+11
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
class A(val z: Int) {
|
||||
@@ -9,3 +11,12 @@ class A(val z: Int) {
|
||||
inline fun call(p: A, s: A.() -> Int): Int {
|
||||
return p.s()
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box() : String {
|
||||
val call = A(11).test()
|
||||
return if (call == 11) "OK" else "fail"
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
import test.*
|
||||
|
||||
fun box() : String {
|
||||
val call = call(11, ::A)
|
||||
return if (call == 11) "OK" else "fail"
|
||||
}
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
package test
|
||||
|
||||
class A(val z: Int) {
|
||||
fun calc() = z
|
||||
}
|
||||
|
||||
inline fun call(p: Int, s: (Int) -> A): Int {
|
||||
return s(p).z
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
class A(val z: Int) {
|
||||
fun calc() = z
|
||||
}
|
||||
|
||||
inline fun call(p: Int, s: (Int) -> A): Int {
|
||||
return s(p).z
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box() : String {
|
||||
val call = call(11, ::A)
|
||||
return if (call == 11) "OK" else "fail"
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
import test.*
|
||||
|
||||
fun box() : String {
|
||||
return if (call("123", String::length) == 3) "OK" else "fail"
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package test
|
||||
|
||||
inline fun call(p: String, s: String.() -> Int): Int {
|
||||
return p.s()
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
inline fun call(p: String, s: String.() -> Int): Int {
|
||||
return p.s()
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box() : String {
|
||||
return if (call("123", String::length) == 3) "OK" else "fail"
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package test
|
||||
|
||||
inline fun call(p: Int, s: (Int) -> Int): Int {
|
||||
return s(p)
|
||||
}
|
||||
+11
-1
@@ -1,3 +1,13 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
inline fun call(p: Int, s: (Int) -> Int): Int {
|
||||
return s(p)
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box() : String {
|
||||
@@ -6,4 +16,4 @@ fun box() : String {
|
||||
|
||||
fun calc(p: Int) : Int {
|
||||
return p / 2
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package test
|
||||
|
||||
inline fun call(p: Int, s: Int.(Int) -> Int): Int {
|
||||
return p.s(p)
|
||||
}
|
||||
+11
-1
@@ -1,3 +1,13 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
inline fun call(p: Int, s: Int.(Int) -> Int): Int {
|
||||
return p.s(p)
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box() : String {
|
||||
@@ -6,4 +16,4 @@ fun box() : String {
|
||||
|
||||
fun Int.calc(p: Int) : Int {
|
||||
return p * this
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user