Merge boxWithStdlib testData into box, delete BoxWithStdlib test

This commit is contained in:
Alexander Udalov
2016-03-07 13:36:14 +03:00
committed by Alexander Udalov
parent 22bfc9786a
commit 06a67e6602
535 changed files with 3520 additions and 3871 deletions
@@ -0,0 +1,16 @@
// WITH_RUNTIME
import kotlin.test.assertEquals
inline fun bar(x: Int, y: Long, z: Byte, s: String) = x.toString() + y.toString() + z.toString() + s
fun foobar(x: Int, y: Long, s: String, z: Byte) = x.toString() + y.toString() + s + z.toString()
fun foo() : String {
return foobar(1, 2L, bar(3, 4L, 5.toByte(), "6"), 7.toByte())
}
fun box() : String {
assertEquals("1234567", foo())
return "OK"
}
@@ -0,0 +1,18 @@
// WITH_RUNTIME
import kotlin.test.assertEquals
fun bar() : Boolean = true
fun foobar1(x: Boolean, y: String, z: String) = x.toString() + y + z
fun foobar2(x: Any, y: String, z: String) = x.toString() + y + z
inline fun foo() = "-"
fun box(): String {
val result1 = foobar1(if (1 == 1) true else bar(), foo(), "OK")
val result2 = foobar2(if (1 == 1) "true" else arrayOf("false"), foo(), "OK")
assertEquals("true-OK", result1)
assertEquals("true-OK", result2)
return "OK"
}
@@ -0,0 +1,18 @@
// WITH_RUNTIME
import kotlin.test.assertEquals
inline fun bar(x: Int) : Int {
return x
}
fun foobar(x: Int, y: Int, z: Int) = x + y + z
fun foo() : Int {
return foobar(1, bar(2), 3)
}
fun box() : String {
assertEquals(6, foo())
return "OK"
}
@@ -0,0 +1,26 @@
// WITH_RUNTIME
import kotlin.test.assertEquals
inline fun bar(block: () -> String) : String {
return block()
}
inline fun bar2() : String {
return bar { return "def" }
}
fun foobar(x: String, y: String, z: String) = x + y + z
fun foo() : String {
return foobar(
"abc",
bar2(),
"ghi"
)
}
fun box() : String {
assertEquals("abcdefghi", foo())
return "OK"
}
@@ -0,0 +1,15 @@
// WITH_RUNTIME
import kotlin.test.assertEquals
inline fun bar(x: String, block: (String) -> String) = "def" + block(x)
fun foobar(x: String, y: String, z: String) = x + y + z
fun foo() : String {
return foobar("abc", bar("ghi") { x -> x + "jkl" }, "mno")
}
fun box() : String {
assertEquals("abcdefghijklmno", foo())
return "OK"
}