KT-846: better (and correct) names for shared vars
This commit is contained in:
committed by
Nikolay Krasko
parent
fb27805c68
commit
a984b609bc
@@ -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"
|
||||
}
|
||||
Reference in New Issue
Block a user