TEST: spread element test

This commit is contained in:
Konstantin Anisimov
2016-12-07 17:59:33 +03:00
committed by vvlevchenko
parent 6fb4b47cb1
commit d8fe22cfb8
2 changed files with 17 additions and 0 deletions
+5
View File
@@ -655,6 +655,11 @@ task args0(type: RunKonanTest) {
source = "runtime/basic/args0.kt"
}
task spread_operator_0(type: RunKonanTest) {
goldValue = "[K, o, t, l, i, n, , i, s, , c, o, o, l, , l, a, n, g, u, a, g, e]\n"
source = "codegen/basics/spread_operator_0.kt"
}
task main_exception(type: RunKonanTest) {
// TODO: cannot currently check the output because the exact stacktrace strings are unpredictable.
// goldValue = "Uncaught exception from Kotlin's main: Throwable\n"
@@ -0,0 +1,12 @@
fun main(arg:Array<String>) {
val list0 = _arrayOf("K", "o", "t", "l", "i", "n")
val list1 = _arrayOf("l", "a","n", "g", "u", "a", "g", "e")
val list = foo(list0, list1)
println(list.toString())
}
fun foo(a:Array<out String>, b:Array<out String>) = listOf(*a," ", "i", "s", " ", "c", "o", "o", "l", " ", *b)
fun _arrayOf(vararg arg:String) = arg