From 464ee8c3bbd2bf96833c20493cac52f55c43936d Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Thu, 26 Mar 2020 01:01:10 +0300 Subject: [PATCH] assertFailsWith: set unexpected exception as a cause of assertion error #KT-23514 (cherry picked from commit 3c4b86fc79f9dbb6053057fad012544ae330c00f) --- runtime/src/main/kotlin/kotlin/test/Assertions.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/src/main/kotlin/kotlin/test/Assertions.kt b/runtime/src/main/kotlin/kotlin/test/Assertions.kt index 98d6b295de9..87660c4595c 100644 --- a/runtime/src/main/kotlin/kotlin/test/Assertions.kt +++ b/runtime/src/main/kotlin/kotlin/test/Assertions.kt @@ -33,7 +33,7 @@ internal actual fun checkResultIsFailure(exceptionClass: KClass< @Suppress("UNCHECKED_CAST") return e as T } - asserter.fail(messagePrefix(message) + "Expected an exception of ${exceptionClass.qualifiedName} to be thrown, but was $e") + asserter.fail(messagePrefix(message) + "Expected an exception of ${exceptionClass.qualifiedName} to be thrown, but was $e", e) } ) }