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 0d3b0a6efb3..d033575cbfe 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 @@ -6537,6 +6537,45 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest { } } + @TestMetadata("js/js.translator/testData/box/package") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Package extends AbstractBoxJsTest { + public void testAllFilesPresentInPackage() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/box/package"), Pattern.compile("^([^_](.+))\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("classCreatedInDeeplyNestedPackage.kt") + public void testClassCreatedInDeeplyNestedPackage() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/package/classCreatedInDeeplyNestedPackage.kt"); + doTest(fileName); + } + + @TestMetadata("deeplyNestedPackage.kt") + public void testDeeplyNestedPackage() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/package/deeplyNestedPackage.kt"); + doTest(fileName); + } + + @TestMetadata("deeplyNestedPackageFunctionCalled.kt") + public void testDeeplyNestedPackageFunctionCalled() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/package/deeplyNestedPackageFunctionCalled.kt"); + doTest(fileName); + } + + @TestMetadata("initializersOfNestedPackagesExecute.kt") + public void testInitializersOfNestedPackagesExecute() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/package/initializersOfNestedPackagesExecute.kt"); + doTest(fileName); + } + + @TestMetadata("nestedPackage.kt") + public void testNestedPackage() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/package/nestedPackage.kt"); + doTest(fileName); + } + } + @TestMetadata("js/js.translator/testData/box/propertyAccess") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/PackageTest.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/PackageTest.java deleted file mode 100644 index c94a46e1a4d..00000000000 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/PackageTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2010-2015 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.kotlin.js.test.semantics; - -import org.jetbrains.kotlin.js.test.SingleFileTranslationTest; - -public final class PackageTest extends SingleFileTranslationTest { - public PackageTest() { - super("package/"); - } - - public void testNestedPackage() throws Exception { - runFunctionOutputTest("nestedPackage.kt", "foo.bar", TEST_FUNCTION, true); - } - - public void testDeeplyNestedPackage() throws Exception { - runFunctionOutputTest("deeplyNestedPackage.kt", "foo1.foo2.foo3.foo5.foo6.foo7.foo8", TEST_FUNCTION, true); - } - - public void testDeeplyNestedPackageFunctionCalled() throws Exception { - runFunctionOutputTest("deeplyNestedPackageFunctionCalled.kt", "foo1.foo2.foo3.foo5.foo6.foo7.foo8", TEST_FUNCTION, true); - } - - public void testClassCreatedInDeeplyNestedPackage() throws Exception { - runFunctionOutputTest("classCreatedInDeeplyNestedPackage.kt", "foo1.foo2.foo3.foo5.foo6.foo7.foo8", TEST_FUNCTION, true); - } - - public void testInitializersOfNestedPackagesExecute() throws Exception { - runFunctionOutputTest("initializersOfNestedPackagesExecute.kt", "foo1.foo2.foo3.foo5.foo6.foo7.foo8", TEST_FUNCTION, true); - } - - public void testMainFunInNestedPackage() throws Exception { - checkOutput("mainFunInNestedPackage.kt", "ayee"); - } -} diff --git a/js/js.translator/testData/package/cases/classCreatedInDeeplyNestedPackage.kt b/js/js.translator/testData/box/package/classCreatedInDeeplyNestedPackage.kt similarity index 78% rename from js/js.translator/testData/package/cases/classCreatedInDeeplyNestedPackage.kt rename to js/js.translator/testData/box/package/classCreatedInDeeplyNestedPackage.kt index 5c6abc900b3..9ca3aa40f68 100644 --- a/js/js.translator/testData/package/cases/classCreatedInDeeplyNestedPackage.kt +++ b/js/js.translator/testData/box/package/classCreatedInDeeplyNestedPackage.kt @@ -3,5 +3,5 @@ package foo1.foo2.foo3.foo5.foo6.foo7.foo8 fun box() = A().doBox() class A() { - fun doBox() = true + fun doBox() = "OK" } \ No newline at end of file diff --git a/js/js.translator/testData/package/cases/deeplyNestedPackage.kt b/js/js.translator/testData/box/package/deeplyNestedPackage.kt similarity index 73% rename from js/js.translator/testData/package/cases/deeplyNestedPackage.kt rename to js/js.translator/testData/box/package/deeplyNestedPackage.kt index b6a614f2b79..0f4366d66b4 100644 --- a/js/js.translator/testData/package/cases/deeplyNestedPackage.kt +++ b/js/js.translator/testData/box/package/deeplyNestedPackage.kt @@ -1,3 +1,3 @@ package foo1.foo2.foo3.foo5.foo6.foo7.foo8 -fun box() = true \ No newline at end of file +fun box() = "OK" \ No newline at end of file diff --git a/js/js.translator/testData/package/cases/deeplyNestedPackageFunctionCalled.kt b/js/js.translator/testData/box/package/deeplyNestedPackageFunctionCalled.kt similarity index 81% rename from js/js.translator/testData/package/cases/deeplyNestedPackageFunctionCalled.kt rename to js/js.translator/testData/box/package/deeplyNestedPackageFunctionCalled.kt index 050ef609347..d162e7f095c 100644 --- a/js/js.translator/testData/package/cases/deeplyNestedPackageFunctionCalled.kt +++ b/js/js.translator/testData/box/package/deeplyNestedPackageFunctionCalled.kt @@ -1,4 +1,4 @@ package foo1.foo2.foo3.foo5.foo6.foo7.foo8 fun box() = f() -fun f() = true \ No newline at end of file +fun f() = "OK" \ No newline at end of file diff --git a/js/js.translator/testData/package/cases/initializersOfNestedPackagesExecute.kt b/js/js.translator/testData/box/package/initializersOfNestedPackagesExecute.kt similarity index 81% rename from js/js.translator/testData/package/cases/initializersOfNestedPackagesExecute.kt rename to js/js.translator/testData/box/package/initializersOfNestedPackagesExecute.kt index 2baad84fc00..7ec85a33696 100644 --- a/js/js.translator/testData/package/cases/initializersOfNestedPackagesExecute.kt +++ b/js/js.translator/testData/box/package/initializersOfNestedPackagesExecute.kt @@ -1,5 +1,5 @@ package foo1.foo2.foo3.foo5.foo6.foo7.foo8 -val f = true +val f = "OK" fun box() = f \ No newline at end of file diff --git a/js/js.translator/testData/package/cases/nestedPackage.kt b/js/js.translator/testData/box/package/nestedPackage.kt similarity index 51% rename from js/js.translator/testData/package/cases/nestedPackage.kt rename to js/js.translator/testData/box/package/nestedPackage.kt index 7b0e526ef52..534a58a7347 100644 --- a/js/js.translator/testData/package/cases/nestedPackage.kt +++ b/js/js.translator/testData/box/package/nestedPackage.kt @@ -1,3 +1,3 @@ package foo.bar -fun box() = true \ No newline at end of file +fun box() = "OK" \ No newline at end of file diff --git a/js/js.translator/testData/package/cases/mainFunInNestedPackage.kt b/js/js.translator/testData/package/cases/mainFunInNestedPackage.kt deleted file mode 100644 index 54ff3ab92cd..00000000000 --- a/js/js.translator/testData/package/cases/mainFunInNestedPackage.kt +++ /dev/null @@ -1,5 +0,0 @@ -package a.b.c - -fun main(args: Array) { - println("ayee") -}