assertFailsWith: set unexpected exception as a cause of assertion error

#KT-23514
This commit is contained in:
Ilya Gorbunov
2020-03-26 00:19:53 +03:00
parent 2bb36899da
commit 96ed87d81b
3 changed files with 9 additions and 5 deletions
@@ -34,7 +34,7 @@ internal actual fun <T : Throwable> checkResultIsFailure(exceptionClass: KClass<
@Suppress("UNCHECKED_CAST")
return e as T
}
asserter.fail(messagePrefix(message) + "Expected an exception of $exceptionClass to be thrown, but was $e")
asserter.fail(messagePrefix(message) + "Expected an exception of $exceptionClass to be thrown, but was $e", e)
}
)
}