From 725832a28187f0dd49c4ddca555a644eef9191e1 Mon Sep 17 00:00:00 2001 From: "victor.petukhov" Date: Thu, 13 Dec 2018 12:36:12 +0300 Subject: [PATCH] Fix incomplete printing of exceptions (of the all types) in tests --- .../jetbrains/kotlin/TestExceptionsComparator.kt | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/TestExceptionsComparator.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/TestExceptionsComparator.kt index 216e9a968f5..45490069438 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/TestExceptionsComparator.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/TestExceptionsComparator.kt @@ -19,19 +19,18 @@ enum class TestsExceptionFilePostfix(val text: String) { INFRASTRUCTURE_ERROR("infrastructure") } -sealed class TestsError(val postfix: TestsExceptionFilePostfix) : Error() { - abstract val original: Throwable +sealed class TestsError(val original: Throwable, val postfix: TestsExceptionFilePostfix) : Error() { override fun toString() = original.toString() override fun getStackTrace() = original.stackTrace -} - -class TestsCompilerError(override val original: Throwable) : TestsError(TestsExceptionFilePostfix.COMPILER_ERROR) -class TestsInfrastructureError(override val original: Throwable) : TestsError(TestsExceptionFilePostfix.INFRASTRUCTURE_ERROR) -class TestsCompiletimeError(override val original: Throwable) : TestsError(TestsExceptionFilePostfix.COMPILETIME_ERROR) -class TestsRuntimeError(override val original: Throwable) : TestsError(TestsExceptionFilePostfix.RUNTIME_ERROR) { + override fun initCause(cause: Throwable?) = original.initCause(cause) override val cause = original.cause } +class TestsCompilerError(original: Throwable) : TestsError(original, TestsExceptionFilePostfix.COMPILER_ERROR) +class TestsInfrastructureError(original: Throwable) : TestsError(original, TestsExceptionFilePostfix.INFRASTRUCTURE_ERROR) +class TestsCompiletimeError(original: Throwable) : TestsError(original, TestsExceptionFilePostfix.COMPILETIME_ERROR) +class TestsRuntimeError(original: Throwable) : TestsError(original, TestsExceptionFilePostfix.RUNTIME_ERROR) + private enum class ExceptionType { ANALYZING_EXPRESSION, UNKNOWN