Update box tests to 1.2.0-rc-39

This commit is contained in:
Pavel Punegov
2017-11-09 20:27:53 +03:00
committed by Pavel Punegov
parent 0121b6a185
commit ffa1ffa659
442 changed files with 20811 additions and 165 deletions
@@ -0,0 +1,19 @@
var subjectEvaluated = 0
fun String.foo() = length.also { ++subjectEvaluated }
fun test(s: String?) =
when (s?.foo()) {
0 -> "zero"
1 -> "one"
2 -> "two"
else -> "other"
}
fun box(): String {
val t = test("12")
if (t != "two") return "Fail: $t"
if (subjectEvaluated != 1) return "Fail: subjectEvaluated=$subjectEvaluated"
return "OK"
}