From de84cb8038c2e354af33c590c9f10f5c8a5613df Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Wed, 15 Feb 2023 12:27:58 +0200 Subject: [PATCH] [Test] Don't compare descriptors dump if there is no expected .txt file Descriptors dump has not much sense, because at this point diagnostic tests for FE 1.0 mostly used only to compare diagnostics with FIR --- .../when/intersectionExhaustivenessSimple.txt | 30 ------------------- .../handlers/DeclarationsDumpHandler.kt | 7 ++++- 2 files changed, 6 insertions(+), 31 deletions(-) delete mode 100644 compiler/testData/diagnostics/tests/when/intersectionExhaustivenessSimple.txt diff --git a/compiler/testData/diagnostics/tests/when/intersectionExhaustivenessSimple.txt b/compiler/testData/diagnostics/tests/when/intersectionExhaustivenessSimple.txt deleted file mode 100644 index 3aa3a134538..00000000000 --- a/compiler/testData/diagnostics/tests/when/intersectionExhaustivenessSimple.txt +++ /dev/null @@ -1,30 +0,0 @@ -package - -public fun foo(/*0*/ symbol: KtClassifierSymbol): kotlin.Unit - -public sealed class KtClassLikeSymbol : KtClassifierSymbol { - protected constructor KtClassLikeSymbol() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public sealed class KtClassifierSymbol { - protected constructor KtClassifierSymbol() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public interface KtNamedSymbol { - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public abstract class KtTypeParameterSymbol : KtClassifierSymbol { - public constructor KtTypeParameterSymbol() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/classic/handlers/DeclarationsDumpHandler.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/classic/handlers/DeclarationsDumpHandler.kt index 483518b46e8..0d5239ca833 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/classic/handlers/DeclarationsDumpHandler.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/classic/handlers/DeclarationsDumpHandler.kt @@ -32,6 +32,11 @@ import org.jetbrains.kotlin.utils.keysToMap import java.util.function.Predicate import java.util.regex.Pattern +/** + * Compares dump of descriptors if with expected + * Dump lays in file testName.txt + * If there is no .txt file than handler does nothing + */ class DeclarationsDumpHandler( testServices: TestServices ) : ClassicFrontendAnalysisHandler(testServices) { @@ -62,10 +67,10 @@ class DeclarationsDumpHandler( } val expectedFileName = "${testDataFile.nameWithoutExtension}$prefix.txt" val expectedFile = testDataFile.parentFile.resolve(expectedFileName) + if (!expectedFile.exists()) return assertions.assertEqualsToFile(expectedFile, resultDump) } - @OptIn(ExperimentalStdlibApi::class) override fun processModule(module: TestModule, info: ClassicFrontendOutputArtifact) { if (DiagnosticsDirectives.SKIP_TXT in module.directives) return val moduleDescriptor = info.analysisResult.moduleDescriptor