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,35 @@
// WITH_RUNTIME
fun exhaustive(x: Int): Int {
var r: Int
when (x) {
1 -> r = 1
2 -> r = 2
3 -> r = 3
else -> r = 4
}
return r
}
fun nonExhaustive(x: Int): Int {
var r: Int = 4
when (x) {
1 -> r = 1
2 -> r = 2
3 -> r = 3
}
return r
}
fun box(): String {
var result = (0..3).map(::exhaustive).joinToString()
if (result != "4, 1, 2, 3") return "exhaustive:" + result
result = (0..3).map(::nonExhaustive).joinToString()
if (result != "4, 1, 2, 3") return "non-exhaustive:" + result
return "OK"
}