push
github
14 of 23 new or added lines in 2 files covered. (60.87%)
3645 of 4221 relevant lines covered (86.35%)
22.91 hits per line
1 |
package org.jesperancinha.ktd.crums3 |
|
2 |
|
|
NEW
|
class Whenever { |
× |
4 |
// https://kotlinlang.org/docs/whatsnew21.html
|
|
5 |
companion object { |
|
|
@JvmStatic
|
28✔ |
|
fun main(args: Array<String> = emptyArray()) { |
12✔ |
|
runCatching { |
60✔ |
|
val x = 5
|
8✔ |
|
when (x) { |
8✔ |
NEW
|
1 -> println("One") |
× |
NEW
|
2 -> println("Two") |
× |
13 |
} |
|
|
} .onFailure { |
28✔ |
NEW
|
println(it) |
× |
NEW
|
} |
× |
17 |
|
|
|
runCatching { |
60✔ |
|
val x = 5
|
8✔ |
|
val result = when (x) { |
12✔ |
NEW
|
1 -> "One" |
× |
NEW
|
2 -> "Two" |
× |
|
else -> "Other" |
4✔ |
24 |
} |
|
|
println(result) |
12✔ |
|
}.onFailure { |
28✔ |
NEW
|
println(it) |
× |
NEW
|
} |
× |
|
} |
4✔ |
30 |
} |
|
31 |
} |