mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
10 lines
217 B
Kotlin
Vendored
10 lines
217 B
Kotlin
Vendored
fun baz(s: String?): Int {
|
|
if (s == null) return 0
|
|
return when(s) {
|
|
"abc" -> s
|
|
else -> "xyz"
|
|
}.length
|
|
}
|
|
|
|
fun box() = if (baz("abc") == 3 && baz("") == 3 && baz(null) == 0) "OK" else "FAIL"
|