From 0f4c550ee0529e0b5fc95768b249a13a4b40f94f Mon Sep 17 00:00:00 2001 From: Alexander Korepanov Date: Mon, 18 Sep 2023 14:58:56 +0200 Subject: [PATCH] [JS IR] Add JS BE diagnostic tests Add tests for: - EXPORTING_JS_NAME_CLASH - EXPORTING_JS_NAME_CLASH_ES ^KT-61710 --- .../exportedNamesClash/functionAndFunction.kt | 12 ++ .../exportedNamesClash/functionAndProperty.kt | 12 ++ .../functionDifferentPackages.kt | 12 ++ .../exportedNamesClash/multipleClash.diag.txt | 106 ++++++++++++++++++ .../exportedNamesClash/multipleClash.kt | 63 +++++++++++ .../multipleClashESModules.diag.txt | 55 +++++++++ .../multipleClashESModules.kt | 42 +++++++ .../exportedNamesClash/packageAndFunction.kt | 18 +++ .../exportedNamesClash/packageAndProperty.kt | 18 +++ .../exportedNamesClash/propertyAndProperty.kt | 12 ++ .../propertyDifferentPackages.kt | 12 ++ ...ndDiagnosticsWithBackendTestGenerated.java | 64 +++++++++++ ...csWithJsStdLibAndBackendTestGenerated.java | 64 +++++++++++ 13 files changed, 490 insertions(+) create mode 100644 compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/functionAndFunction.kt create mode 100644 compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/functionAndProperty.kt create mode 100644 compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/functionDifferentPackages.kt create mode 100644 compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/multipleClash.diag.txt create mode 100644 compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/multipleClash.kt create mode 100644 compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/multipleClashESModules.diag.txt create mode 100644 compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/multipleClashESModules.kt create mode 100644 compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/packageAndFunction.kt create mode 100644 compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/packageAndProperty.kt create mode 100644 compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/propertyAndProperty.kt create mode 100644 compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/propertyDifferentPackages.kt diff --git a/compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/functionAndFunction.kt b/compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/functionAndFunction.kt new file mode 100644 index 00000000000..700d98eac5e --- /dev/null +++ b/compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/functionAndFunction.kt @@ -0,0 +1,12 @@ +// FIR_IDENTICAL +// FILE: A.kt +@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH") +package foo + +@JsExport fun test() = 1 + +// FILE: B.kt +@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH") +package foo + +@JsExport @JsName("test") fun bar() = 2 diff --git a/compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/functionAndProperty.kt b/compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/functionAndProperty.kt new file mode 100644 index 00000000000..700d98eac5e --- /dev/null +++ b/compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/functionAndProperty.kt @@ -0,0 +1,12 @@ +// FIR_IDENTICAL +// FILE: A.kt +@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH") +package foo + +@JsExport fun test() = 1 + +// FILE: B.kt +@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH") +package foo + +@JsExport @JsName("test") fun bar() = 2 diff --git a/compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/functionDifferentPackages.kt b/compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/functionDifferentPackages.kt new file mode 100644 index 00000000000..68a90b0d9bf --- /dev/null +++ b/compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/functionDifferentPackages.kt @@ -0,0 +1,12 @@ +// FIR_IDENTICAL +// FILE: A.kt +@file:Suppress("OPT_IN_USAGE") +package foo + +@JsExport fun test() = 1 + +// FILE: B.kt +@file:Suppress("OPT_IN_USAGE") +package foo.bar + +@JsExport @JsName("test") fun bar() = 2 diff --git a/compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/multipleClash.diag.txt b/compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/multipleClash.diag.txt new file mode 100644 index 00000000000..1d528e462fa --- /dev/null +++ b/compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/multipleClash.diag.txt @@ -0,0 +1,106 @@ +/Function1.kt:7:1: warning: Exporting name 'test' in ES modules may clash with + exporting name 'test' from file '/Class1.kt' + exporting name 'test' from file '/Property1.kt' + +/Function1.kt:7:1: error: Exporting name 'test' clashes with + exporting name 'test' from file '/Class1.kt' + package 'foo.bar.baz.test' from file '/Package1.kt' + package 'foo.bar.baz.test' from file '/Package2.kt' + exporting name 'test' from file '/Property1.kt' + +/Function2.kt:13:1: error: Exporting name 'baz' clashes with + package 'foo.bar.baz' from file '/Class1.kt' + package 'foo.bar.baz' from file '/Function1.kt' + package 'foo.bar.baz' from file '/Package1.kt' + package 'foo.bar.baz' from file '/Package2.kt' + package 'foo.bar.baz' from file '/Property1.kt' + +/Function3.kt:18:1: warning: Exporting name 'foo' in ES modules may clash with + exporting name 'foo' from file '/Class3.kt' + exporting name 'foo' from file '/Property3.kt' + +/Function3.kt:18:1: error: Exporting name 'foo' clashes with + package 'foo' from file '/Class1.kt' + package 'foo' from file '/Class2.kt' + exporting name 'foo' from file '/Class3.kt' + package 'foo' from file '/Function1.kt' + package 'foo' from file '/Function2.kt' + package 'foo' from file '/Package1.kt' + package 'foo' from file '/Package2.kt' + package 'foo' from file '/Property1.kt' + package 'foo' from file '/Property2.kt' + exporting name 'foo' from file '/Property3.kt' + +/Property1.kt:24:1: warning: Exporting name 'test' in ES modules may clash with + exporting name 'test' from file '/Class1.kt' + exporting name 'test' from file '/Function1.kt' + +/Property1.kt:24:1: error: Exporting name 'test' clashes with + exporting name 'test' from file '/Class1.kt' + exporting name 'test' from file '/Function1.kt' + package 'foo.bar.baz.test' from file '/Package1.kt' + package 'foo.bar.baz.test' from file '/Package2.kt' + +/Property2.kt:30:1: warning: Exporting name 'bar' in ES modules may clash with exporting name 'bar' from file '/Class2.kt' + +/Property2.kt:30:1: error: Exporting name 'bar' clashes with + package 'foo.bar' from file '/Class1.kt' + exporting name 'bar' from file '/Class2.kt' + package 'foo.bar' from file '/Function1.kt' + package 'foo.bar' from file '/Function2.kt' + package 'foo.bar' from file '/Package1.kt' + package 'foo.bar' from file '/Package2.kt' + package 'foo.bar' from file '/Property1.kt' + +/Property3.kt:35:1: warning: Exporting name 'foo' in ES modules may clash with + exporting name 'foo' from file '/Class3.kt' + exporting name 'foo' from file '/Function3.kt' + +/Property3.kt:35:1: error: Exporting name 'foo' clashes with + package 'foo' from file '/Class1.kt' + package 'foo' from file '/Class2.kt' + exporting name 'foo' from file '/Class3.kt' + package 'foo' from file '/Function1.kt' + package 'foo' from file '/Function2.kt' + exporting name 'foo' from file '/Function3.kt' + package 'foo' from file '/Package1.kt' + package 'foo' from file '/Package2.kt' + package 'foo' from file '/Property1.kt' + package 'foo' from file '/Property2.kt' + +/Class1.kt:41:1: warning: Exporting name 'test' in ES modules may clash with + exporting name 'test' from file '/Function1.kt' + exporting name 'test' from file '/Property1.kt' + +/Class1.kt:41:1: error: Exporting name 'test' clashes with + exporting name 'test' from file '/Function1.kt' + package 'foo.bar.baz.test' from file '/Package1.kt' + package 'foo.bar.baz.test' from file '/Package2.kt' + exporting name 'test' from file '/Property1.kt' + +/Class2.kt:47:1: warning: Exporting name 'bar' in ES modules may clash with exporting name 'bar' from file '/Property2.kt' + +/Class2.kt:47:1: error: Exporting name 'bar' clashes with + package 'foo.bar' from file '/Class1.kt' + package 'foo.bar' from file '/Function1.kt' + package 'foo.bar' from file '/Function2.kt' + package 'foo.bar' from file '/Package1.kt' + package 'foo.bar' from file '/Package2.kt' + package 'foo.bar' from file '/Property1.kt' + exporting name 'bar' from file '/Property2.kt' + +/Class3.kt:51:1: warning: Exporting name 'foo' in ES modules may clash with + exporting name 'foo' from file '/Function3.kt' + exporting name 'foo' from file '/Property3.kt' + +/Class3.kt:51:1: error: Exporting name 'foo' clashes with + package 'foo' from file '/Class1.kt' + package 'foo' from file '/Class2.kt' + package 'foo' from file '/Function1.kt' + package 'foo' from file '/Function2.kt' + exporting name 'foo' from file '/Function3.kt' + package 'foo' from file '/Package1.kt' + package 'foo' from file '/Package2.kt' + package 'foo' from file '/Property1.kt' + package 'foo' from file '/Property2.kt' + exporting name 'foo' from file '/Property3.kt' diff --git a/compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/multipleClash.kt b/compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/multipleClash.kt new file mode 100644 index 00000000000..a223ed9b3f9 --- /dev/null +++ b/compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/multipleClash.kt @@ -0,0 +1,63 @@ +// FIR_IDENTICAL +// !RENDER_ALL_DIAGNOSTICS_FULL_TEXT +// FILE: Function1.kt +@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH") +package foo.bar.baz + +@JsExport fun test() = 1 + +// FILE: Function2.kt +@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH") +package foo.bar + +@JsExport fun baz() = 1 + +// FILE: Function3.kt +@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH") + +@JsExport fun foo() = 1 + +// FILE: Property1.kt +@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH") +package foo.bar.baz + +@JsExport @JsName("test") val bar = 2 + +// FILE: Property2.kt +@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH") +package foo + +@JsExport val bar = 2 + +// FILE: Property3.kt +@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH") + +@JsExport @JsName("foo") val bar = 3 + +// FILE: Class1.kt +@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH") +package foo.bar.baz + +@JsExport @JsName("test") class Class1 + +// FILE: Class2.kt +@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH") +package foo + +@JsExport @JsName("bar") class Class2 + +// FILE: Class3.kt +@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH") +@JsExport @JsName("foo") class Class3 + +// FILE: Package1.kt +@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH") +package foo.bar.baz.test + +@JsExport val foo1 = 1 + +// FILE: Package2.kt +@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH") +package foo.bar.baz.test.a.b.c + +@JsExport val foo2 = 1 diff --git a/compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/multipleClashESModules.diag.txt b/compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/multipleClashESModules.diag.txt new file mode 100644 index 00000000000..779a3f618f3 --- /dev/null +++ b/compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/multipleClashESModules.diag.txt @@ -0,0 +1,55 @@ +/Function1.kt:7:1: warning: Exporting name 'test' in ES modules may clash with + exporting name 'test' from file '/Class1.kt' + exporting name 'test' from file '/Class2.kt' + exporting name 'test' from file '/Function2.kt' + exporting name 'test' from file '/Function3.kt' + exporting name 'test' from file '/Property1.kt' + exporting name 'test' from file '/Property2.kt' + +/Function2.kt:13:1: warning: Exporting name 'test' in ES modules may clash with + exporting name 'test' from file '/Class1.kt' + exporting name 'test' from file '/Class2.kt' + exporting name 'test' from file '/Function1.kt' + exporting name 'test' from file '/Function3.kt' + exporting name 'test' from file '/Property1.kt' + exporting name 'test' from file '/Property2.kt' + +/Function3.kt:18:1: warning: Exporting name 'test' in ES modules may clash with + exporting name 'test' from file '/Class1.kt' + exporting name 'test' from file '/Class2.kt' + exporting name 'test' from file '/Function1.kt' + exporting name 'test' from file '/Function2.kt' + exporting name 'test' from file '/Property1.kt' + exporting name 'test' from file '/Property2.kt' + +/Property1.kt:24:1: warning: Exporting name 'test' in ES modules may clash with + exporting name 'test' from file '/Class1.kt' + exporting name 'test' from file '/Class2.kt' + exporting name 'test' from file '/Function1.kt' + exporting name 'test' from file '/Function2.kt' + exporting name 'test' from file '/Function3.kt' + exporting name 'test' from file '/Property2.kt' + +/Property2.kt:30:1: warning: Exporting name 'test' in ES modules may clash with + exporting name 'test' from file '/Class1.kt' + exporting name 'test' from file '/Class2.kt' + exporting name 'test' from file '/Function1.kt' + exporting name 'test' from file '/Function2.kt' + exporting name 'test' from file '/Function3.kt' + exporting name 'test' from file '/Property1.kt' + +/Class1.kt:36:1: warning: Exporting name 'test' in ES modules may clash with + exporting name 'test' from file '/Class2.kt' + exporting name 'test' from file '/Function1.kt' + exporting name 'test' from file '/Function2.kt' + exporting name 'test' from file '/Function3.kt' + exporting name 'test' from file '/Property1.kt' + exporting name 'test' from file '/Property2.kt' + +/Class2.kt:42:1: warning: Exporting name 'test' in ES modules may clash with + exporting name 'test' from file '/Class1.kt' + exporting name 'test' from file '/Function1.kt' + exporting name 'test' from file '/Function2.kt' + exporting name 'test' from file '/Function3.kt' + exporting name 'test' from file '/Property1.kt' + exporting name 'test' from file '/Property2.kt' diff --git a/compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/multipleClashESModules.kt b/compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/multipleClashESModules.kt new file mode 100644 index 00000000000..c27e9a2576f --- /dev/null +++ b/compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/multipleClashESModules.kt @@ -0,0 +1,42 @@ +// FIR_IDENTICAL +// !RENDER_ALL_DIAGNOSTICS_FULL_TEXT +// FILE: Function1.kt +@file:Suppress("OPT_IN_USAGE") +package Function1 + +@JsExport fun test() = 1 + +// FILE: Function2.kt +@file:Suppress("OPT_IN_USAGE") +package Function2 + +@JsExport fun test() = 1 + +// FILE: Function3.kt +@file:Suppress("OPT_IN_USAGE") + +@JsExport fun test() = 1 + +// FILE: Property1.kt +@file:Suppress("OPT_IN_USAGE") +package Property1 + +@JsExport val test = 1 + +// FILE: Property2.kt +@file:Suppress("OPT_IN_USAGE") +package Property2 + +@JsExport val test = 1 + +// FILE: Class1.kt +@file:Suppress("OPT_IN_USAGE") +package Class1 + +@JsExport class test + +// FILE: Class2.kt +@file:Suppress("OPT_IN_USAGE") +package Class2 + +@JsExport class test diff --git a/compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/packageAndFunction.kt b/compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/packageAndFunction.kt new file mode 100644 index 00000000000..5b5654a53c3 --- /dev/null +++ b/compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/packageAndFunction.kt @@ -0,0 +1,18 @@ +// FIR_IDENTICAL +// FILE: A.kt +@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH") +package foo.bar + +@JsExport +val test = 1 + +// FILE: B.kt +@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH") +package foo + +@JsExport fun bar() = 2 + +// FILE: C.kt +@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH") + +@JsExport fun foo() = 2 diff --git a/compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/packageAndProperty.kt b/compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/packageAndProperty.kt new file mode 100644 index 00000000000..91e4971d20b --- /dev/null +++ b/compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/packageAndProperty.kt @@ -0,0 +1,18 @@ +// FIR_IDENTICAL +// FILE: A.kt +@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH") +package foo.bar + +@JsExport +val test = 1 + +// FILE: B.kt +@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH") +package foo + +@JsExport val bar = 2 + +// FILE: C.kt +@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH") + +@JsExport val foo = 3 diff --git a/compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/propertyAndProperty.kt b/compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/propertyAndProperty.kt new file mode 100644 index 00000000000..f42be6bab9f --- /dev/null +++ b/compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/propertyAndProperty.kt @@ -0,0 +1,12 @@ +// FIR_IDENTICAL +// FILE: A.kt +@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH") +package foo + +@JsExport val test = 1 + +// FILE: B.kt +@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH") +package foo + +@JsExport @JsName("test") val bar = 2 diff --git a/compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/propertyDifferentPackages.kt b/compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/propertyDifferentPackages.kt new file mode 100644 index 00000000000..1540c4dc84e --- /dev/null +++ b/compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/propertyDifferentPackages.kt @@ -0,0 +1,12 @@ +// FIR_IDENTICAL +// FILE: A.kt +@file:Suppress("OPT_IN_USAGE") +package foo + +@JsExport val test = 1 + +// FILE: B.kt +@file:Suppress("OPT_IN_USAGE") +package foo.bar + +@JsExport @JsName("test") val bar = 2 diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirPsiJsOldFrontendDiagnosticsWithBackendTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirPsiJsOldFrontendDiagnosticsWithBackendTestGenerated.java index 52647a81cf1..d26f1caf48e 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirPsiJsOldFrontendDiagnosticsWithBackendTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirPsiJsOldFrontendDiagnosticsWithBackendTestGenerated.java @@ -25,6 +25,70 @@ public class FirPsiJsOldFrontendDiagnosticsWithBackendTestGenerated extends Abst KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation"), Pattern.compile("^([^_](.+))\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), TargetBackend.JS_IR, true); } + @Nested + @TestMetadata("compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash") + @TestDataPath("$PROJECT_ROOT") + public class ExportedNamesClash { + @Test + public void testAllFilesPresentInExportedNamesClash() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash"), Pattern.compile("^([^_](.+))\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), TargetBackend.JS_IR, true); + } + + @Test + @TestMetadata("functionAndFunction.kt") + public void testFunctionAndFunction() throws Exception { + runTest("compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/functionAndFunction.kt"); + } + + @Test + @TestMetadata("functionAndProperty.kt") + public void testFunctionAndProperty() throws Exception { + runTest("compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/functionAndProperty.kt"); + } + + @Test + @TestMetadata("functionDifferentPackages.kt") + public void testFunctionDifferentPackages() throws Exception { + runTest("compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/functionDifferentPackages.kt"); + } + + @Test + @TestMetadata("multipleClash.kt") + public void testMultipleClash() throws Exception { + runTest("compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/multipleClash.kt"); + } + + @Test + @TestMetadata("multipleClashESModules.kt") + public void testMultipleClashESModules() throws Exception { + runTest("compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/multipleClashESModules.kt"); + } + + @Test + @TestMetadata("packageAndFunction.kt") + public void testPackageAndFunction() throws Exception { + runTest("compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/packageAndFunction.kt"); + } + + @Test + @TestMetadata("packageAndProperty.kt") + public void testPackageAndProperty() throws Exception { + runTest("compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/packageAndProperty.kt"); + } + + @Test + @TestMetadata("propertyAndProperty.kt") + public void testPropertyAndProperty() throws Exception { + runTest("compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/propertyAndProperty.kt"); + } + + @Test + @TestMetadata("propertyDifferentPackages.kt") + public void testPropertyDifferentPackages() throws Exception { + runTest("compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/propertyDifferentPackages.kt"); + } + } + @Nested @TestMetadata("compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/inline") @TestDataPath("$PROJECT_ROOT") diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/DiagnosticsWithJsStdLibAndBackendTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/DiagnosticsWithJsStdLibAndBackendTestGenerated.java index 16d5cf35ed9..3ebe8330e88 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/DiagnosticsWithJsStdLibAndBackendTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/DiagnosticsWithJsStdLibAndBackendTestGenerated.java @@ -25,6 +25,70 @@ public class DiagnosticsWithJsStdLibAndBackendTestGenerated extends AbstractDiag KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation"), Pattern.compile("^([^_](.+))\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), TargetBackend.JS_IR, true); } + @Nested + @TestMetadata("compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash") + @TestDataPath("$PROJECT_ROOT") + public class ExportedNamesClash { + @Test + public void testAllFilesPresentInExportedNamesClash() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash"), Pattern.compile("^([^_](.+))\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), TargetBackend.JS_IR, true); + } + + @Test + @TestMetadata("functionAndFunction.kt") + public void testFunctionAndFunction() throws Exception { + runTest("compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/functionAndFunction.kt"); + } + + @Test + @TestMetadata("functionAndProperty.kt") + public void testFunctionAndProperty() throws Exception { + runTest("compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/functionAndProperty.kt"); + } + + @Test + @TestMetadata("functionDifferentPackages.kt") + public void testFunctionDifferentPackages() throws Exception { + runTest("compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/functionDifferentPackages.kt"); + } + + @Test + @TestMetadata("multipleClash.kt") + public void testMultipleClash() throws Exception { + runTest("compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/multipleClash.kt"); + } + + @Test + @TestMetadata("multipleClashESModules.kt") + public void testMultipleClashESModules() throws Exception { + runTest("compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/multipleClashESModules.kt"); + } + + @Test + @TestMetadata("packageAndFunction.kt") + public void testPackageAndFunction() throws Exception { + runTest("compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/packageAndFunction.kt"); + } + + @Test + @TestMetadata("packageAndProperty.kt") + public void testPackageAndProperty() throws Exception { + runTest("compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/packageAndProperty.kt"); + } + + @Test + @TestMetadata("propertyAndProperty.kt") + public void testPropertyAndProperty() throws Exception { + runTest("compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/propertyAndProperty.kt"); + } + + @Test + @TestMetadata("propertyDifferentPackages.kt") + public void testPropertyDifferentPackages() throws Exception { + runTest("compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/exportedNamesClash/propertyDifferentPackages.kt"); + } + } + @Nested @TestMetadata("compiler/testData/diagnostics/testsWithJsStdLibAndBackendCompilation/inline") @TestDataPath("$PROJECT_ROOT")