Files
kotlin/compiler/testData/codegen/box/operatorConventions/compareTo/boolean.kt
2016-11-09 21:41:12 +03:00

14 lines
390 B
Kotlin
Vendored

// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
fun checkLess(x: Boolean, y: Boolean) = when {
x >= y -> "Fail $x >= $y"
!(x < y) -> "Fail !($x < $y)"
!(x <= y) -> "Fail !($x <= $y)"
x > y -> "Fail $x > $y"
x.compareTo(y) >= 0 -> "Fail $x.compareTo($y) >= 0"
else -> "OK"
}
fun box() = checkLess(false, true)