KT-846: better (and correct) names for shared vars

This commit is contained in:
Alex Tkachman
2011-12-16 10:45:46 +02:00
committed by Nikolay Krasko
parent fb27805c68
commit a984b609bc
7 changed files with 31 additions and 10 deletions
@@ -0,0 +1,13 @@
fun <T> T.mustBe(t : T) {
assert("$this must be $t") {this == t}
}
inline fun assert(message : String, condition : fun() : Boolean) {
if (!condition())
throw AssertionError(message)
}
fun box() : String {
"lala" mustBe "lala"
return "OK"
}