KT-4349 Make jet.Boolean implement Comparable

#KT-4349
This commit is contained in:
Evgeny Gerashchenko
2013-12-25 21:07:55 +04:00
parent c616b4baa0
commit 513be47544
38 changed files with 38 additions and 32 deletions
@@ -0,0 +1,11 @@
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"
x compareTo y >= 0 -> "Fail $x compareTo $y >= 0"
else -> "OK"
}
fun box() = checkLess(false, true)