From c80e6be6582fdf5f5cf013cf4374348755858bdb Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Thu, 26 Mar 2020 01:00:53 +0300 Subject: [PATCH] Introduce 'fail' method to throw AssertionError with cause #KT-37804 (cherry picked from commit 0449df5f64b1c2f639786d1865979662331f56d6) --- runtime/src/main/kotlin/kotlin/test/Assertions.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/runtime/src/main/kotlin/kotlin/test/Assertions.kt b/runtime/src/main/kotlin/kotlin/test/Assertions.kt index bddcf004857..98d6b295de9 100644 --- a/runtime/src/main/kotlin/kotlin/test/Assertions.kt +++ b/runtime/src/main/kotlin/kotlin/test/Assertions.kt @@ -38,4 +38,10 @@ internal actual fun checkResultIsFailure(exceptionClass: KClass< ) } +/** Platform-specific construction of AssertionError with cause */ +@Suppress("NOTHING_TO_INLINE") +internal actual inline fun AssertionErrorWithCause(message: String?, cause: Throwable?): AssertionError = + AssertionError(message, cause) + + internal actual fun lookupAsserter(): Asserter = DefaultAsserter \ No newline at end of file