From 7956b038fd34f5c77946790e5294521de23d2f24 Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Tue, 12 Jul 2016 15:46:56 +0300 Subject: [PATCH] KT-2752: add test to prove that KT-13024 is no longer reproducible with new implementation of name mangling --- .../js/test/semantics/BoxJsTestGenerated.java | 6 +++++ .../multiFile/importedDeclarationMangling.kt | 27 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 js/js.translator/testData/box/multiFile/importedDeclarationMangling.kt diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/BoxJsTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/BoxJsTestGenerated.java index 3ad7a1b43c6..df2c6c06a99 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/BoxJsTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/BoxJsTestGenerated.java @@ -4933,6 +4933,12 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest { doTest(fileName); } + @TestMetadata("importedDeclarationMangling.kt") + public void testImportedDeclarationMangling() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/multiFile/importedDeclarationMangling.kt"); + doTest(fileName); + } + @TestMetadata("packageAndMangledMethodDoNotClash.kt") public void testPackageAndMangledMethodDoNotClash() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/multiFile/packageAndMangledMethodDoNotClash.kt"); diff --git a/js/js.translator/testData/box/multiFile/importedDeclarationMangling.kt b/js/js.translator/testData/box/multiFile/importedDeclarationMangling.kt new file mode 100644 index 00000000000..1f85879e07d --- /dev/null +++ b/js/js.translator/testData/box/multiFile/importedDeclarationMangling.kt @@ -0,0 +1,27 @@ +// FILE: a.kt +package foo + +import bar.* +import bar.Some.importedFunc + +fun box(): String { + Some.justFunc() + importedFunc() + assertEquals("justFunc();importedFunc();", log) + return "OK" +} + +// FILE: b.kt +package bar + +var log = "" + +object Some { + fun justFunc() { + log += "justFunc();" + } + + fun importedFunc() { + log += "importedFunc();" + } +} \ No newline at end of file