Make lazy version of assert accept function with Any return value, #KT-6459 Fixed

This commit is contained in:
Ilya Ryzhenkov
2014-12-15 13:13:56 +03:00
parent 47da114599
commit 053586f481
3 changed files with 36 additions and 20 deletions
@@ -117,6 +117,17 @@ class PreconditionsTest() {
}
}
test fun error() {
val error = fails {
error("There was a problem")
}
if (error is IllegalStateException) {
assertEquals("There was a problem", error.getMessage())
} else {
fail("Invalid exception type: " + error)
}
}
test fun passingAssertWithMessage() {
assert(true, "Hello")
}