diff --git a/generators/src/org/jetbrains/kotlin/generators/tests/GenerateTests.kt b/generators/src/org/jetbrains/kotlin/generators/tests/GenerateTests.kt index 5c5a80e0a07..5c8820eab72 100644 --- a/generators/src/org/jetbrains/kotlin/generators/tests/GenerateTests.kt +++ b/generators/src/org/jetbrains/kotlin/generators/tests/GenerateTests.kt @@ -147,6 +147,7 @@ import org.jetbrains.kotlin.lang.resolve.android.test.AbstractAndroidBytecodeSha import org.jetbrains.kotlin.lang.resolve.android.test.AbstractAndroidXml2KConversionTest import org.jetbrains.kotlin.lang.resolve.android.test.AbstractAndroidBoxTest import org.jetbrains.kotlin.android.AbstractParserResultEqualityTest +import org.jetbrains.kotlin.js.test.* import org.jetbrains.kotlin.js.test.semantics.* fun main(args: Array) { @@ -791,6 +792,18 @@ fun main(args: Array) { testClass(javaClass()) { model("multiModule/cases", extension = null, recursive=false) } + + testClass(javaClass()) { + model("inline/cases") + } + + testClass(javaClass()) { + model("labels/cases") + } + + testClass(javaClass()) { + model("jsCode/cases") + } } testGroup("js/js.tests/test", "compiler/testData") { diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/SingleFileTranslationWithDirectivesTest.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/AbstractSingleFileTranslationWithDirectivesTest.java similarity index 87% rename from js/js.tests/test/org/jetbrains/kotlin/js/test/SingleFileTranslationWithDirectivesTest.java rename to js/js.tests/test/org/jetbrains/kotlin/js/test/AbstractSingleFileTranslationWithDirectivesTest.java index 215f5b2216f..7f7e78650ca 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/SingleFileTranslationWithDirectivesTest.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/AbstractSingleFileTranslationWithDirectivesTest.java @@ -21,8 +21,8 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.kotlin.js.test.utils.DirectiveTestUtils; import org.jetbrains.kotlin.js.test.utils.JsTestUtils; -public abstract class SingleFileTranslationWithDirectivesTest extends SingleFileTranslationTest { - public SingleFileTranslationWithDirectivesTest(@NotNull String main) { +public abstract class AbstractSingleFileTranslationWithDirectivesTest extends SingleFileTranslationTest { + public AbstractSingleFileTranslationWithDirectivesTest(@NotNull String main) { super(main); } diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/AbstractInlineJsTest.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/AbstractInlineJsTest.java new file mode 100644 index 00000000000..c574bc2dae9 --- /dev/null +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/AbstractInlineJsTest.java @@ -0,0 +1,25 @@ +/* + * 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.AbstractSingleFileTranslationWithDirectivesTest; + +public abstract class AbstractInlineJsTest extends AbstractSingleFileTranslationWithDirectivesTest { + public AbstractInlineJsTest() { + super("inline/"); + } +} diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/AbstractJsCodeTest.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/AbstractJsCodeTest.java new file mode 100644 index 00000000000..4673dcf8251 --- /dev/null +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/AbstractJsCodeTest.java @@ -0,0 +1,25 @@ +/* + * 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.AbstractSingleFileTranslationWithDirectivesTest; + +public abstract class AbstractJsCodeTest extends AbstractSingleFileTranslationWithDirectivesTest { + public AbstractJsCodeTest() { + super("jsCode/"); + } +} diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/AbstractLabelTest.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/AbstractLabelTest.java new file mode 100644 index 00000000000..b44dc88a1b2 --- /dev/null +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/AbstractLabelTest.java @@ -0,0 +1,25 @@ +/* + * 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.AbstractSingleFileTranslationWithDirectivesTest; + +public abstract class AbstractLabelTest extends AbstractSingleFileTranslationWithDirectivesTest { + public AbstractLabelTest() { + super("labels/"); + } +} diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/InlineJsTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/InlineJsTestGenerated.java new file mode 100644 index 00000000000..99e8d041a1f --- /dev/null +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/InlineJsTestGenerated.java @@ -0,0 +1,344 @@ +/* + * 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 com.intellij.testFramework.TestDataPath; +import org.jetbrains.kotlin.test.InnerTestClasses; +import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; +import org.jetbrains.kotlin.test.JetTestUtils; +import org.jetbrains.kotlin.test.TestMetadata; +import org.junit.runner.RunWith; + +import java.io.File; +import java.util.regex.Pattern; + +/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("js/js.translator/testData/inline/cases") +@TestDataPath("$PROJECT_ROOT") +@RunWith(JUnit3RunnerWithInners.class) +public class InlineJsTestGenerated extends AbstractInlineJsTest { + public void testAllFilesPresentInCases() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/inline/cases"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("anonymousObjectInlineMethod.kt") + public void testAnonymousObjectInlineMethod() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/anonymousObjectInlineMethod.kt"); + doTest(fileName); + } + + @TestMetadata("arrayLiteralAliasing.kt") + public void testArrayLiteralAliasing() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/arrayLiteralAliasing.kt"); + doTest(fileName); + } + + @TestMetadata("astCopy.kt") + public void testAstCopy() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/astCopy.kt"); + doTest(fileName); + } + + @TestMetadata("callInlineFunctionOnTopLevel.kt") + public void testCallInlineFunctionOnTopLevel() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/callInlineFunctionOnTopLevel.kt"); + doTest(fileName); + } + + @TestMetadata("callInlineFunctionOnTopLevelSimple.kt") + public void testCallInlineFunctionOnTopLevelSimple() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/callInlineFunctionOnTopLevelSimple.kt"); + doTest(fileName); + } + + @TestMetadata("callableReference.kt") + public void testCallableReference() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/callableReference.kt"); + doTest(fileName); + } + + @TestMetadata("callableReferenceOfLocalInline.kt") + public void testCallableReferenceOfLocalInline() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/callableReferenceOfLocalInline.kt"); + doTest(fileName); + } + + @TestMetadata("classObject.kt") + public void testClassObject() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/classObject.kt"); + doTest(fileName); + } + + @TestMetadata("extension.kt") + public void testExtension() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/extension.kt"); + doTest(fileName); + } + + @TestMetadata("extensionWithManyArguments.kt") + public void testExtensionWithManyArguments() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/extensionWithManyArguments.kt"); + doTest(fileName); + } + + @TestMetadata("identityEquals.kt") + public void testIdentityEquals() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/identityEquals.kt"); + doTest(fileName); + } + + @TestMetadata("incrementProperty.kt") + public void testIncrementProperty() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/incrementProperty.kt"); + doTest(fileName); + } + + @TestMetadata("inlineCallNoInline.kt") + public void testInlineCallNoInline() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/inlineCallNoInline.kt"); + doTest(fileName); + } + + @TestMetadata("inlineChain.kt") + public void testInlineChain() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/inlineChain.kt"); + doTest(fileName); + } + + @TestMetadata("inlineChainWithFewStatements.kt") + public void testInlineChainWithFewStatements() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/inlineChainWithFewStatements.kt"); + doTest(fileName); + } + + @TestMetadata("inlineDefaultArgument.kt") + public void testInlineDefaultArgument() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/inlineDefaultArgument.kt"); + doTest(fileName); + } + + @TestMetadata("inlineFunctionInLambda.kt") + public void testInlineFunctionInLambda() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/inlineFunctionInLambda.kt"); + doTest(fileName); + } + + @TestMetadata("inlineGenericSimple.kt") + public void testInlineGenericSimple() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/inlineGenericSimple.kt"); + doTest(fileName); + } + + @TestMetadata("inlineIf.kt") + public void testInlineIf() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/inlineIf.kt"); + doTest(fileName); + } + + @TestMetadata("inlineInc.kt") + public void testInlineInc() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/inlineInc.kt"); + doTest(fileName); + } + + @TestMetadata("inlineIntSimple.kt") + public void testInlineIntSimple() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/inlineIntSimple.kt"); + doTest(fileName); + } + + @TestMetadata("inlineLambdaNoCapture.kt") + public void testInlineLambdaNoCapture() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/inlineLambdaNoCapture.kt"); + doTest(fileName); + } + + @TestMetadata("inlineLambdaWithCapture.kt") + public void testInlineLambdaWithCapture() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/inlineLambdaWithCapture.kt"); + doTest(fileName); + } + + @TestMetadata("inlineMethod.kt") + public void testInlineMethod() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/inlineMethod.kt"); + doTest(fileName); + } + + @TestMetadata("inlineNoReturn.kt") + public void testInlineNoReturn() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/inlineNoReturn.kt"); + doTest(fileName); + } + + @TestMetadata("inlineOrder.kt") + public void testInlineOrder() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/inlineOrder.kt"); + doTest(fileName); + } + + @TestMetadata("inlineSimpleAssignment.kt") + public void testInlineSimpleAssignment() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/inlineSimpleAssignment.kt"); + doTest(fileName); + } + + @TestMetadata("lambdaInLambda.kt") + public void testLambdaInLambda() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/lambdaInLambda.kt"); + doTest(fileName); + } + + @TestMetadata("lambdaReassignment.kt") + public void testLambdaReassignment() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/lambdaReassignment.kt"); + doTest(fileName); + } + + @TestMetadata("lambdaReassignmentWithCapture.kt") + public void testLambdaReassignmentWithCapture() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/lambdaReassignmentWithCapture.kt"); + doTest(fileName); + } + + @TestMetadata("localInlineExtensionFunction.kt") + public void testLocalInlineExtensionFunction() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/localInlineExtensionFunction.kt"); + doTest(fileName); + } + + @TestMetadata("localInlineFunction.kt") + public void testLocalInlineFunction() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/localInlineFunction.kt"); + doTest(fileName); + } + + @TestMetadata("localInlineFunctionComplex.kt") + public void testLocalInlineFunctionComplex() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/localInlineFunctionComplex.kt"); + doTest(fileName); + } + + @TestMetadata("localInlineFunctionDeclaredInLambda.kt") + public void testLocalInlineFunctionDeclaredInLambda() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/localInlineFunctionDeclaredInLambda.kt"); + doTest(fileName); + } + + @TestMetadata("localInlineFunctionNameClash.kt") + public void testLocalInlineFunctionNameClash() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/localInlineFunctionNameClash.kt"); + doTest(fileName); + } + + @TestMetadata("localInlineFunctionReference.kt") + public void testLocalInlineFunctionReference() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/localInlineFunctionReference.kt"); + doTest(fileName); + } + + @TestMetadata("noInlineLambda.kt") + public void testNoInlineLambda() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/noInlineLambda.kt"); + doTest(fileName); + } + + @TestMetadata("params.kt") + public void testParams() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/params.kt"); + doTest(fileName); + } + + @TestMetadata("rootConstructor.kt") + public void testRootConstructor() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/rootConstructor.kt"); + doTest(fileName); + } + + @TestMetadata("severalClosures.kt") + public void testSeveralClosures() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/severalClosures.kt"); + doTest(fileName); + } + + @TestMetadata("severalUsage.kt") + public void testSeveralUsage() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/severalUsage.kt"); + doTest(fileName); + } + + @TestMetadata("simpleDouble.kt") + public void testSimpleDouble() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/simpleDouble.kt"); + doTest(fileName); + } + + @TestMetadata("simpleEnum.kt") + public void testSimpleEnum() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/simpleEnum.kt"); + doTest(fileName); + } + + @TestMetadata("simpleInt.kt") + public void testSimpleInt() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/simpleInt.kt"); + doTest(fileName); + } + + @TestMetadata("simpleLambda.kt") + public void testSimpleLambda() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/simpleLambda.kt"); + doTest(fileName); + } + + @TestMetadata("simpleObject.kt") + public void testSimpleObject() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/simpleObject.kt"); + doTest(fileName); + } + + @TestMetadata("simpleReturnFunctionWithResultUnused.kt") + public void testSimpleReturnFunctionWithResultUnused() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/simpleReturnFunctionWithResultUnused.kt"); + doTest(fileName); + } + + @TestMetadata("statementsAfterReturn.kt") + public void testStatementsAfterReturn() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/statementsAfterReturn.kt"); + doTest(fileName); + } + + @TestMetadata("thisImplicitlyCaptured.kt") + public void testThisImplicitlyCaptured() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/thisImplicitlyCaptured.kt"); + doTest(fileName); + } + + @TestMetadata("thisLiteralAliasing.kt") + public void testThisLiteralAliasing() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/thisLiteralAliasing.kt"); + doTest(fileName); + } + + @TestMetadata("vararg.kt") + public void testVararg() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/vararg.kt"); + doTest(fileName); + } +} diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/InlineTest.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/InlineTest.java deleted file mode 100644 index b08d39e34ad..00000000000 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/InlineTest.java +++ /dev/null @@ -1,240 +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.inline.exception.InlineRecursionException; -import org.jetbrains.kotlin.js.test.SingleFileTranslationWithDirectivesTest; - -public final class InlineTest extends SingleFileTranslationWithDirectivesTest { - public InlineTest() { - super("inline/"); - } - - public void testInlineSimpleAssignment() throws Exception { - checkFooBoxIsOk(); - } - - public void testInlineGenericSimple() throws Exception { - checkFooBoxIsOk(); - } - - public void testInlineIntSimple() throws Exception { - checkFooBoxIsOk(); - } - - public void testInlineInc() throws Exception { - checkFooBoxIsOk(); - } - - public void testInlineCallNoInline() throws Exception { - checkFooBoxIsOk(); - } - - public void testInlineFunctionInLambda() throws Exception { - checkFooBoxIsOk(); - } - - public void testInlineLambdaNoCapture() throws Exception { - checkFooBoxIsOk(); - } - - public void testInlineLambdaWithCapture() throws Exception { - checkFooBoxIsOk(); - } - - public void testInlineChain() throws Exception { - checkFooBoxIsOk(); - } - - public void testInlineChainWithFewStatements() throws Exception { - checkFooBoxIsOk(); - } - - public void testCallInlineFunctionOnTopLevelSimple() throws Exception { - checkFooBoxIsOk(); - } - - public void testCallInlineFunctionOnTopLevel() throws Exception { - checkFooBoxIsOk(); - } - - public void testInlineIf() throws Exception { - checkFooBoxIsOk(); - } - - public void testInlineNoReturn() throws Exception { - checkFooBoxIsOk(); - } - - public void testStatementsAfterReturn() throws Exception { - checkFooBoxIsOk(); - } - - public void testLambdaReassignment() throws Exception { - checkFooBoxIsOk(); - } - - public void testLambdaReassignmentWithCapture() throws Exception { - checkFooBoxIsOk(); - } - - public void testInlineMethod() throws Exception { - checkFooBoxIsOk(); - } - - public void testThisImplicitlyCaptured() throws Exception { - checkFooBoxIsOk(); - } - - public void testAstCopy() throws Exception { - checkFooBoxIsOk(); - } - - public void testNoInlineLambda() throws Exception { - checkFooBoxIsOk(); - } - - public void testlambdaInLambda() throws Exception { - checkFooBoxIsOk(); - } - - public void testInlineDefaultArgument() throws Exception { - checkFooBoxIsOk(); - } - - public void testLocalInlineFunction() throws Exception { - checkFooBoxIsOk(); - } - - public void testLocalInlineFunctionDeclaredInLambda() throws Exception { - checkFooBoxIsOk(); - } - - public void testLocalInlineExtensionFunction() throws Exception { - checkFooBoxIsOk(); - } - - public void testLocalInlineFunctionNameClash() throws Exception { - checkFooBoxIsOk(); - } - - public void testLocalInlineFunctionComplex() throws Exception { - checkFooBoxIsOk(); - } - - public void testArrayLiteralAliasing() throws Exception { - checkFooBoxIsOk(); - } - - public void testLocalInlineFunctionReference() throws Exception { - checkFooBoxIsOk(); - } - - public void testThisLiteralAliasing() throws Exception { - checkFooBoxIsOk(); - } - - public void testIdentityEquals() throws Exception { - checkFooBoxIsOk(); - } - - public void testVararg() throws Exception { - checkFooBoxIsOk(); - } - - public void testMutualRecursion() throws Exception { - try { - checkFooBoxIsOk(); - } catch (InlineRecursionException e) { - return; - } - - throw new AssertionError("No exception was thrown for mutual recursion of inline functions"); - } - - public void testInlineOrder() throws Exception { - checkFooBoxIsOk(); - } - - public void testCallableReference() throws Exception { - checkFooBoxIsOk(); - } - - public void testCallableReferenceOfLocalInline() throws Exception { - checkFooBoxIsOk(); - } - - public void testAnonymousObjectInlineMethod() throws Exception { - checkFooBoxIsOk(); - } - - public void testClassObject() throws Exception { - checkFooBoxIsOk(); - } - - public void testExtension() throws Exception { - checkFooBoxIsOk(); - } - - public void testExtensionWithManyArguments() throws Exception { - checkFooBoxIsOk(); - } - - public void testParams() throws Exception { - checkFooBoxIsOk(); - } - - public void testRootConstructor() throws Exception { - checkFooBoxIsOk(); - } - - public void testSeveralClosures() throws Exception { - checkFooBoxIsOk(); - } - - public void testSeveralUsage() throws Exception { - checkFooBoxIsOk(); - } - - public void testSimpleDouble() throws Exception { - checkFooBoxIsOk(); - } - - public void testSimpleInt() throws Exception { - checkFooBoxIsOk(); - } - - public void testSimpleEnum() throws Exception { - checkFooBoxIsOk(); - } - - public void testSimpleLambda() throws Exception { - checkFooBoxIsOk(); - } - - public void testSimpleObject() throws Exception { - checkFooBoxIsOk(); - } - - public void testIncrementProperty() throws Exception { - checkFooBoxIsOk(); - } - - public void testSimpleReturnFunctionWithResultUnused() throws Exception { - checkFooBoxIsOk(); - } -} diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodeTest.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodeTest.java deleted file mode 100644 index 66d5ce24f2f..00000000000 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodeTest.java +++ /dev/null @@ -1,106 +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.SingleFileTranslationWithDirectivesTest; - -public final class JsCodeTest extends SingleFileTranslationWithDirectivesTest { - - public JsCodeTest() { - super("jsCode/"); - } - - public void testQuotes() throws Exception { - checkFooBoxIsOk(); - } - - public void testLiteral() throws Exception { - checkFooBoxIsOk(); - } - - public void testFunction() throws Exception { - checkFooBoxIsOk(); - } - - public void testObject() throws Exception { - checkFooBoxIsOk(); - } - - public void testOperators() throws Exception { - checkFooBoxIsOk(); - } - - public void testIf() throws Exception { - checkFooBoxIsOk(); - } - - public void testSwitch() throws Exception { - checkFooBoxIsOk(); - } - - public void testDoWhile() throws Exception { - checkFooBoxIsOk(); - } - - public void testWhile() throws Exception { - checkFooBoxIsOk(); - } - - public void testFor() throws Exception { - checkFooBoxIsOk(); - } - - public void testForIn() throws Exception { - checkFooBoxIsOk(); - } - - public void testInvocation() throws Exception { - checkFooBoxIsOk(); - } - - public void testBreak() throws Exception { - checkFooBoxIsOk(); - } - - public void testContinue() throws Exception { - checkFooBoxIsOk(); - } - - public void testLabel() throws Exception { - checkFooBoxIsOk(); - } - - public void testLabelSiblingClash() throws Exception { - checkFooBoxIsOk(); - } - - public void testLabelNestedClash() throws Exception { - checkFooBoxIsOk(); - } - - public void testTryCatchFinally() throws Exception { - checkFooBoxIsOk(); - } - - public void testCatchScope() throws Exception { - checkFooBoxIsOk(); - } - - public void testObjectScopes() throws Exception { - checkFooBoxIsOk(); - } -} diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodeTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodeTestGenerated.java new file mode 100644 index 00000000000..9fd40c69177 --- /dev/null +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodeTestGenerated.java @@ -0,0 +1,158 @@ +/* + * 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 com.intellij.testFramework.TestDataPath; +import org.jetbrains.kotlin.test.InnerTestClasses; +import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; +import org.jetbrains.kotlin.test.JetTestUtils; +import org.jetbrains.kotlin.test.TestMetadata; +import org.junit.runner.RunWith; + +import java.io.File; +import java.util.regex.Pattern; + +/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("js/js.translator/testData/jsCode/cases") +@TestDataPath("$PROJECT_ROOT") +@RunWith(JUnit3RunnerWithInners.class) +public class JsCodeTestGenerated extends AbstractJsCodeTest { + public void testAllFilesPresentInCases() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/jsCode/cases"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("break.kt") + public void testBreak() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/break.kt"); + doTest(fileName); + } + + @TestMetadata("catchScope.kt") + public void testCatchScope() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/catchScope.kt"); + doTest(fileName); + } + + @TestMetadata("continue.kt") + public void testContinue() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/continue.kt"); + doTest(fileName); + } + + @TestMetadata("doWhile.kt") + public void testDoWhile() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/doWhile.kt"); + doTest(fileName); + } + + @TestMetadata("for.kt") + public void testFor() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/for.kt"); + doTest(fileName); + } + + @TestMetadata("forIn.kt") + public void testForIn() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/forIn.kt"); + doTest(fileName); + } + + @TestMetadata("function.kt") + public void testFunction() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/function.kt"); + doTest(fileName); + } + + @TestMetadata("if.kt") + public void testIf() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/if.kt"); + doTest(fileName); + } + + @TestMetadata("invocation.kt") + public void testInvocation() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/invocation.kt"); + doTest(fileName); + } + + @TestMetadata("label.kt") + public void testLabel() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/label.kt"); + doTest(fileName); + } + + @TestMetadata("labelNestedClash.kt") + public void testLabelNestedClash() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/labelNestedClash.kt"); + doTest(fileName); + } + + @TestMetadata("labelSiblingClash.kt") + public void testLabelSiblingClash() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/labelSiblingClash.kt"); + doTest(fileName); + } + + @TestMetadata("literal.kt") + public void testLiteral() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/literal.kt"); + doTest(fileName); + } + + @TestMetadata("object.kt") + public void testObject() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/object.kt"); + doTest(fileName); + } + + @TestMetadata("objectScopes.kt") + public void testObjectScopes() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/objectScopes.kt"); + doTest(fileName); + } + + @TestMetadata("operators.kt") + public void testOperators() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/operators.kt"); + doTest(fileName); + } + + @TestMetadata("quotes.kt") + public void testQuotes() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/quotes.kt"); + doTest(fileName); + } + + @TestMetadata("switch.kt") + public void testSwitch() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/switch.kt"); + doTest(fileName); + } + + @TestMetadata("tryCatchFinally.kt") + public void testTryCatchFinally() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/tryCatchFinally.kt"); + doTest(fileName); + } + + @TestMetadata("while.kt") + public void testWhile() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/while.kt"); + doTest(fileName); + } +} diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/LabelTest.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/LabelTest.java deleted file mode 100644 index b708e39b37c..00000000000 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/LabelTest.java +++ /dev/null @@ -1,61 +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.SingleFileTranslationWithDirectivesTest; - -public class LabelTest extends SingleFileTranslationWithDirectivesTest { - public LabelTest() { - super("labels/"); - } - - public void testSimpleLabel() throws Exception { - checkFooBoxIsOk(); - } - - public void testSiblingLabels() throws Exception { - checkFooBoxIsOk(); - } - - public void testNestedLabels() throws Exception { - checkFooBoxIsOk(); - } - - public void testSimpleLabelInlined() throws Exception { - checkFooBoxIsOk(); - } - - public void testSiblingLabelsInlined() throws Exception { - checkFooBoxIsOk(); - } - - public void testSiblingLabelsInlinedClashing() throws Exception { - checkFooBoxIsOk(); - } - - public void testNestedLabelsInlinedClashing() throws Exception { - checkFooBoxIsOk(); - } - - public void testLabelWithVariableClashing() throws Exception { - checkFooBoxIsOk(); - } - - public void testNestedLabelsInlinedClashingAtFunctionsWithClosure() throws Exception { - checkFooBoxIsOk(); - } -} diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/LabelTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/LabelTestGenerated.java new file mode 100644 index 00000000000..af94ce0281e --- /dev/null +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/LabelTestGenerated.java @@ -0,0 +1,92 @@ +/* + * 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 com.intellij.testFramework.TestDataPath; +import org.jetbrains.kotlin.test.InnerTestClasses; +import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; +import org.jetbrains.kotlin.test.JetTestUtils; +import org.jetbrains.kotlin.test.TestMetadata; +import org.junit.runner.RunWith; + +import java.io.File; +import java.util.regex.Pattern; + +/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("js/js.translator/testData/labels/cases") +@TestDataPath("$PROJECT_ROOT") +@RunWith(JUnit3RunnerWithInners.class) +public class LabelTestGenerated extends AbstractLabelTest { + public void testAllFilesPresentInCases() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/labels/cases"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("labelWithVariableClashing.kt") + public void testLabelWithVariableClashing() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/labels/cases/labelWithVariableClashing.kt"); + doTest(fileName); + } + + @TestMetadata("nestedLabels.kt") + public void testNestedLabels() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/labels/cases/nestedLabels.kt"); + doTest(fileName); + } + + @TestMetadata("nestedLabelsInlinedClashing.kt") + public void testNestedLabelsInlinedClashing() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/labels/cases/nestedLabelsInlinedClashing.kt"); + doTest(fileName); + } + + @TestMetadata("nestedLabelsInlinedClashingAtFunctionsWithClosure.kt") + public void testNestedLabelsInlinedClashingAtFunctionsWithClosure() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/labels/cases/nestedLabelsInlinedClashingAtFunctionsWithClosure.kt"); + doTest(fileName); + } + + @TestMetadata("siblingLabels.kt") + public void testSiblingLabels() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/labels/cases/siblingLabels.kt"); + doTest(fileName); + } + + @TestMetadata("siblingLabelsInlined.kt") + public void testSiblingLabelsInlined() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/labels/cases/siblingLabelsInlined.kt"); + doTest(fileName); + } + + @TestMetadata("siblingLabelsInlinedClashing.kt") + public void testSiblingLabelsInlinedClashing() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/labels/cases/siblingLabelsInlinedClashing.kt"); + doTest(fileName); + } + + @TestMetadata("simpleLabel.kt") + public void testSimpleLabel() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/labels/cases/simpleLabel.kt"); + doTest(fileName); + } + + @TestMetadata("simpleLabelInlined.kt") + public void testSimpleLabelInlined() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/labels/cases/simpleLabelInlined.kt"); + doTest(fileName); + } +} diff --git a/js/js.translator/testData/inline/cases/mutualRecursion.kt b/js/js.translator/testData/inline/cases/mutualRecursion.kt deleted file mode 100644 index 78d76a82c97..00000000000 --- a/js/js.translator/testData/inline/cases/mutualRecursion.kt +++ /dev/null @@ -1,13 +0,0 @@ -package foo - -inline fun f() { g() } - -inline fun g() { h() } - -inline fun h() { f() } - -fun box(): String { - f() - - return "OK" -} \ No newline at end of file