JS: move more test to box tests

This commit is contained in:
Alexey Andreev
2016-08-29 12:37:13 +03:00
parent efb82a044f
commit cdf2212c73
70 changed files with 484 additions and 749 deletions
@@ -1,30 +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;
import org.jetbrains.annotations.NotNull;
public abstract class AbstractSingleFileTranslationWithDirectivesTest extends SingleFileTranslationTest {
public AbstractSingleFileTranslationWithDirectivesTest(@NotNull String main) {
super(main);
}
@Override
public void setUp() throws Exception {
super.setUp();
}
}
@@ -1,60 +0,0 @@
/*
* Copyright 2010-2016 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
import com.intellij.openapi.util.io.FileUtil
import org.jetbrains.kotlin.psi.KtNamedFunction
import org.jetbrains.kotlin.psi.KtPsiFactory
import org.jetbrains.kotlin.test.KotlinTestUtils
import org.jetbrains.kotlin.test.KotlinTestUtils.TestFileFactory
import java.io.File
abstract class KotlinJSMultiFileTest(path: String) : SingleFileTranslationTest(path) {
var tempDir: File? = null
override fun doTest(filename: String) {
tempDir = FileUtil.createTempDirectory("test", "src")
tempDir!!.deleteOnExit()
try {
val file = File(filename)
val expectedText = KotlinTestUtils.doLoadFile(file)
var testPackage: String? = null
val inputFiles = KotlinTestUtils.createTestFiles(file.name, expectedText, object : TestFileFactory<String, String> {
override fun createFile(module: String?, fileName: String, text: String, directives: Map<String, String>): String? {
val output = File(tempDir!!, fileName)
KotlinTestUtils.mkdirs(file.parentFile)
output.writeText(text, Charsets.UTF_8)
val ktFile = KtPsiFactory(project).createFile(text)
val boxFunction = ktFile.declarations.find { it is KtNamedFunction && it.name == TEST_FUNCTION }
if (boxFunction != null) {
testPackage = getPackageName(ktFile)
}
return output.path
}
override fun createModule(name: String, dependencies: List<String>): String? = error("Multi-module tests not supported")
})
runFunctionOutputTestByPaths(BasicTest.DEFAULT_ECMA_VERSIONS, inputFiles, testPackage!!, BasicTest.TEST_FUNCTION, "OK")
}
finally {
tempDir!!.deleteRecursively()
}
}
}
@@ -4315,4 +4315,361 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest {
doTest(fileName);
}
}
@TestMetadata("js/js.translator/testData/box/jsCode")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class JsCode extends AbstractBoxJsTest {
public void testAllFilesPresentInJsCode() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/box/jsCode"), Pattern.compile("^([^_](.+))\\.kt$"), true);
}
@TestMetadata("break.kt")
public void testBreak() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/jsCode/break.kt");
doTest(fileName);
}
@TestMetadata("catchScope.kt")
public void testCatchScope() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/jsCode/catchScope.kt");
doTest(fileName);
}
@TestMetadata("codeFromVariable.kt")
public void testCodeFromVariable() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/jsCode/codeFromVariable.kt");
doTest(fileName);
}
@TestMetadata("continue.kt")
public void testContinue() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/jsCode/continue.kt");
doTest(fileName);
}
@TestMetadata("doWhile.kt")
public void testDoWhile() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/jsCode/doWhile.kt");
doTest(fileName);
}
@TestMetadata("for.kt")
public void testFor() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/jsCode/for.kt");
doTest(fileName);
}
@TestMetadata("forIn.kt")
public void testForIn() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/jsCode/forIn.kt");
doTest(fileName);
}
@TestMetadata("function.kt")
public void testFunction() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/jsCode/function.kt");
doTest(fileName);
}
@TestMetadata("if.kt")
public void testIf() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/jsCode/if.kt");
doTest(fileName);
}
@TestMetadata("invocation.kt")
public void testInvocation() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/jsCode/invocation.kt");
doTest(fileName);
}
@TestMetadata("label.kt")
public void testLabel() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/jsCode/label.kt");
doTest(fileName);
}
@TestMetadata("labelNestedClash.kt")
public void testLabelNestedClash() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/jsCode/labelNestedClash.kt");
doTest(fileName);
}
@TestMetadata("labelNestedClashWithKotlin.kt")
public void testLabelNestedClashWithKotlin() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/jsCode/labelNestedClashWithKotlin.kt");
doTest(fileName);
}
@TestMetadata("labelSiblingClash.kt")
public void testLabelSiblingClash() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/jsCode/labelSiblingClash.kt");
doTest(fileName);
}
@TestMetadata("literal.kt")
public void testLiteral() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/jsCode/literal.kt");
doTest(fileName);
}
@TestMetadata("object.kt")
public void testObject() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/jsCode/object.kt");
doTest(fileName);
}
@TestMetadata("objectScopes.kt")
public void testObjectScopes() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/jsCode/objectScopes.kt");
doTest(fileName);
}
@TestMetadata("operators.kt")
public void testOperators() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/jsCode/operators.kt");
doTest(fileName);
}
@TestMetadata("quotes.kt")
public void testQuotes() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/jsCode/quotes.kt");
doTest(fileName);
}
@TestMetadata("switch.kt")
public void testSwitch() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/jsCode/switch.kt");
doTest(fileName);
}
@TestMetadata("tryCatchFinally.kt")
public void testTryCatchFinally() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/jsCode/tryCatchFinally.kt");
doTest(fileName);
}
@TestMetadata("while.kt")
public void testWhile() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/jsCode/while.kt");
doTest(fileName);
}
}
@TestMetadata("js/js.translator/testData/box/labels")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Labels extends AbstractBoxJsTest {
public void testAllFilesPresentInLabels() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/box/labels"), Pattern.compile("^([^_](.+))\\.kt$"), true);
}
@TestMetadata("labelOnExpression.kt")
public void testLabelOnExpression() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/labels/labelOnExpression.kt");
doTest(fileName);
}
@TestMetadata("labelWithVariableClashing.kt")
public void testLabelWithVariableClashing() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/labels/labelWithVariableClashing.kt");
doTest(fileName);
}
@TestMetadata("nestedInlineLabels.kt")
public void testNestedInlineLabels() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/labels/nestedInlineLabels.kt");
doTest(fileName);
}
@TestMetadata("nestedLabels.kt")
public void testNestedLabels() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/labels/nestedLabels.kt");
doTest(fileName);
}
@TestMetadata("nestedLabelsInlinedClashing.kt")
public void testNestedLabelsInlinedClashing() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/labels/nestedLabelsInlinedClashing.kt");
doTest(fileName);
}
@TestMetadata("nestedLabelsInlinedClashingAtFunctionsWithClosure.kt")
public void testNestedLabelsInlinedClashingAtFunctionsWithClosure() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/labels/nestedLabelsInlinedClashingAtFunctionsWithClosure.kt");
doTest(fileName);
}
@TestMetadata("siblingLabels.kt")
public void testSiblingLabels() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/labels/siblingLabels.kt");
doTest(fileName);
}
@TestMetadata("siblingLabelsInlined.kt")
public void testSiblingLabelsInlined() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/labels/siblingLabelsInlined.kt");
doTest(fileName);
}
@TestMetadata("siblingLabelsInlinedClashing.kt")
public void testSiblingLabelsInlinedClashing() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/labels/siblingLabelsInlinedClashing.kt");
doTest(fileName);
}
@TestMetadata("simpleLabel.kt")
public void testSimpleLabel() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/labels/simpleLabel.kt");
doTest(fileName);
}
@TestMetadata("simpleLabelInlined.kt")
public void testSimpleLabelInlined() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/labels/simpleLabelInlined.kt");
doTest(fileName);
}
}
@TestMetadata("js/js.translator/testData/box/operatorOverloading")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class OperatorOverloading extends AbstractBoxJsTest {
public void testAllFilesPresentInOperatorOverloading() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/box/operatorOverloading"), Pattern.compile("^([^_](.+))\\.kt$"), true);
}
@TestMetadata("binaryDivOverload.kt")
public void testBinaryDivOverload() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/operatorOverloading/binaryDivOverload.kt");
doTest(fileName);
}
@TestMetadata("compareTo.kt")
public void testCompareTo() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/operatorOverloading/compareTo.kt");
doTest(fileName);
}
@TestMetadata("compareToByName.kt")
public void testCompareToByName() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/operatorOverloading/compareToByName.kt");
doTest(fileName);
}
@TestMetadata("lambdaRhs.kt")
public void testLambdaRhs() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/operatorOverloading/lambdaRhs.kt");
doTest(fileName);
}
@TestMetadata("notOverload.kt")
public void testNotOverload() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/operatorOverloading/notOverload.kt");
doTest(fileName);
}
@TestMetadata("operatorOverloadOnPropertyCallGetterAndSetterOnlyOnce.kt")
public void testOperatorOverloadOnPropertyCallGetterAndSetterOnlyOnce() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/operatorOverloading/operatorOverloadOnPropertyCallGetterAndSetterOnlyOnce.kt");
doTest(fileName);
}
@TestMetadata("overloadPlusAssignArrayList.kt")
public void testOverloadPlusAssignArrayList() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/operatorOverloading/overloadPlusAssignArrayList.kt");
doTest(fileName);
}
@TestMetadata("overloadPlusAssignViaExtensionFunction.kt")
public void testOverloadPlusAssignViaExtensionFunction() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/operatorOverloading/overloadPlusAssignViaExtensionFunction.kt");
doTest(fileName);
}
@TestMetadata("overloadPlusAssignViaPlusExtensionFunction.kt")
public void testOverloadPlusAssignViaPlusExtensionFunction() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/operatorOverloading/overloadPlusAssignViaPlusExtensionFunction.kt");
doTest(fileName);
}
@TestMetadata("overloadPlusViaExtensionFunction.kt")
public void testOverloadPlusViaExtensionFunction() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/operatorOverloading/overloadPlusViaExtensionFunction.kt");
doTest(fileName);
}
@TestMetadata("overloadUnaryOperationsViaExtensionFunctions.kt")
public void testOverloadUnaryOperationsViaExtensionFunctions() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/operatorOverloading/overloadUnaryOperationsViaExtensionFunctions.kt");
doTest(fileName);
}
@TestMetadata("overloadedCallOnProperty.kt")
public void testOverloadedCallOnProperty() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/operatorOverloading/overloadedCallOnProperty.kt");
doTest(fileName);
}
@TestMetadata("plusAndMinusAsAnExpression.kt")
public void testPlusAndMinusAsAnExpression() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/operatorOverloading/plusAndMinusAsAnExpression.kt");
doTest(fileName);
}
@TestMetadata("plusAssignNoReassign.kt")
public void testPlusAssignNoReassign() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/operatorOverloading/plusAssignNoReassign.kt");
doTest(fileName);
}
@TestMetadata("plusOverload.kt")
public void testPlusOverload() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/operatorOverloading/plusOverload.kt");
doTest(fileName);
}
@TestMetadata("postfixInc.kt")
public void testPostfixInc() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/operatorOverloading/postfixInc.kt");
doTest(fileName);
}
@TestMetadata("postfixOnProperty.kt")
public void testPostfixOnProperty() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/operatorOverloading/postfixOnProperty.kt");
doTest(fileName);
}
@TestMetadata("prefixDecOverload.kt")
public void testPrefixDecOverload() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/operatorOverloading/prefixDecOverload.kt");
doTest(fileName);
}
@TestMetadata("prefixIncReturnsCorrectValue.kt")
public void testPrefixIncReturnsCorrectValue() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/operatorOverloading/prefixIncReturnsCorrectValue.kt");
doTest(fileName);
}
@TestMetadata("unaryOnIntProperty.kt")
public void testUnaryOnIntProperty() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/operatorOverloading/unaryOnIntProperty.kt");
doTest(fileName);
}
@TestMetadata("unaryOnIntPropertyAsStatement.kt")
public void testUnaryOnIntPropertyAsStatement() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/operatorOverloading/unaryOnIntPropertyAsStatement.kt");
doTest(fileName);
}
@TestMetadata("usingModInCaseModAssignNotAvailable.kt")
public void testUsingModInCaseModAssignNotAvailable() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/operatorOverloading/usingModInCaseModAssignNotAvailable.kt");
doTest(fileName);
}
}
}
@@ -1,150 +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 com.google.dart.compiler.backend.js.ast.JsProgram;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.js.test.MultipleFilesTranslationTest;
import org.jetbrains.kotlin.js.test.utils.DirectiveTestUtils;
import org.jetbrains.kotlin.js.test.utils.JsTestUtils;
import java.util.List;
import static org.jetbrains.kotlin.js.test.utils.JsTestUtils.getAllFilesInDir;
public final class InlineMultiFileTest extends MultipleFilesTranslationTest {
public InlineMultiFileTest() {
super("inlineMultiFile/");
}
@Override
public void setUp() throws Exception {
super.setUp();
}
public void testInlineMultiFileSimple() throws Exception {
checkFooBoxIsOk();
}
public void testBuilders() throws Exception {
checkFooBoxIsOk();
}
public void testBuildersAndLambdaCapturing() throws Exception {
checkFooBoxIsOk();
}
public void testAnonymousObjectOnCallSite() throws Exception {
checkFooBoxIsOk();
}
public void testAnonymousObjectOnCallSiteSuperParams() throws Exception {
checkFooBoxIsOk();
}
public void testAnonymousObjectOnDeclarationSite() throws Exception {
checkFooBoxIsOk();
}
public void testAnonymousObjectOnDeclarationSiteSuperParams() throws Exception {
checkFooBoxIsOk();
}
public void testTrait() throws Exception {
checkFooBoxIsOk();
}
public void testUse() throws Exception {
checkFooBoxIsOk();
}
public void testWith() throws Exception {
checkFooBoxIsOk();
}
public void testTryCatch() throws Exception {
checkFooBoxIsOk();
}
public void testTryCatch2() throws Exception {
checkFooBoxIsOk();
}
public void testTryCatchFinally() throws Exception {
checkFooBoxIsOk();
}
public void testLambdaCloning() throws Exception {
checkFooBoxIsOk();
}
public void testLambdaInLambda2() throws Exception {
checkFooBoxIsOk();
}
public void testLambdaInLambdaNoInline() throws Exception {
checkFooBoxIsOk();
}
public void testRegeneratedLambdaName() throws Exception {
checkFooBoxIsOk();
}
public void testSameCaptured() throws Exception {
checkFooBoxIsOk();
}
public void testClosureChain() throws Exception {
checkFooBoxIsOk();
}
public void testInlineInDefaultParameter() throws Exception {
checkFooBoxIsOk();
}
public void testDefaultMethod() throws Exception {
checkFooBoxIsOk();
}
public void testSimpleDefaultMethod() throws Exception {
checkFooBoxIsOk();
}
public void testCaptureInlinable() throws Exception {
checkFooBoxIsOk();
}
public void testCaptureInlinableAndOther() throws Exception {
checkFooBoxIsOk();
}
public void testCaptureThisAndReceiver() throws Exception {
checkFooBoxIsOk();
}
public void testGenerics() throws Exception {
checkFooBoxIsOk();
}
public void testSimpleCapturingInClass() throws Exception {
checkFooBoxIsOk();
}
public void testSimpleCapturingInPackage() throws Exception {
checkFooBoxIsOk();
}
}
@@ -1,169 +0,0 @@
/*
* Copyright 2010-2016 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.JUnit3RunnerWithInners;
import org.jetbrains.kotlin.test.KotlinTestUtils;
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 {
KotlinTestUtils.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 = KotlinTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/break.kt");
doTest(fileName);
}
@TestMetadata("catchScope.kt")
public void testCatchScope() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/catchScope.kt");
doTest(fileName);
}
@TestMetadata("codeFromVariable.kt")
public void testCodeFromVariable() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/codeFromVariable.kt");
doTest(fileName);
}
@TestMetadata("continue.kt")
public void testContinue() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/continue.kt");
doTest(fileName);
}
@TestMetadata("doWhile.kt")
public void testDoWhile() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/doWhile.kt");
doTest(fileName);
}
@TestMetadata("for.kt")
public void testFor() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/for.kt");
doTest(fileName);
}
@TestMetadata("forIn.kt")
public void testForIn() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/forIn.kt");
doTest(fileName);
}
@TestMetadata("function.kt")
public void testFunction() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/function.kt");
doTest(fileName);
}
@TestMetadata("if.kt")
public void testIf() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/if.kt");
doTest(fileName);
}
@TestMetadata("invocation.kt")
public void testInvocation() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/invocation.kt");
doTest(fileName);
}
@TestMetadata("label.kt")
public void testLabel() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/label.kt");
doTest(fileName);
}
@TestMetadata("labelNestedClash.kt")
public void testLabelNestedClash() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/labelNestedClash.kt");
doTest(fileName);
}
@TestMetadata("labelNestedClashWithKotlin.kt")
public void testLabelNestedClashWithKotlin() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/labelNestedClashWithKotlin.kt");
doTest(fileName);
}
@TestMetadata("labelSiblingClash.kt")
public void testLabelSiblingClash() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/labelSiblingClash.kt");
doTest(fileName);
}
@TestMetadata("literal.kt")
public void testLiteral() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/literal.kt");
doTest(fileName);
}
@TestMetadata("object.kt")
public void testObject() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/object.kt");
doTest(fileName);
}
@TestMetadata("objectScopes.kt")
public void testObjectScopes() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/objectScopes.kt");
doTest(fileName);
}
@TestMetadata("operators.kt")
public void testOperators() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/operators.kt");
doTest(fileName);
}
@TestMetadata("quotes.kt")
public void testQuotes() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/quotes.kt");
doTest(fileName);
}
@TestMetadata("switch.kt")
public void testSwitch() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/switch.kt");
doTest(fileName);
}
@TestMetadata("tryCatchFinally.kt")
public void testTryCatchFinally() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/tryCatchFinally.kt");
doTest(fileName);
}
@TestMetadata("while.kt")
public void testWhile() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/jsCode/cases/while.kt");
doTest(fileName);
}
}
@@ -1,103 +0,0 @@
/*
* Copyright 2010-2016 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.JUnit3RunnerWithInners;
import org.jetbrains.kotlin.test.KotlinTestUtils;
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 {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/labels/cases"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("labelOnExpression.kt")
public void testLabelOnExpression() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/labels/cases/labelOnExpression.kt");
doTest(fileName);
}
@TestMetadata("labelWithVariableClashing.kt")
public void testLabelWithVariableClashing() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/labels/cases/labelWithVariableClashing.kt");
doTest(fileName);
}
@TestMetadata("nestedInlineLabels.kt")
public void testNestedInlineLabels() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/labels/cases/nestedInlineLabels.kt");
doTest(fileName);
}
@TestMetadata("nestedLabels.kt")
public void testNestedLabels() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/labels/cases/nestedLabels.kt");
doTest(fileName);
}
@TestMetadata("nestedLabelsInlinedClashing.kt")
public void testNestedLabelsInlinedClashing() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/labels/cases/nestedLabelsInlinedClashing.kt");
doTest(fileName);
}
@TestMetadata("nestedLabelsInlinedClashingAtFunctionsWithClosure.kt")
public void testNestedLabelsInlinedClashingAtFunctionsWithClosure() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/labels/cases/nestedLabelsInlinedClashingAtFunctionsWithClosure.kt");
doTest(fileName);
}
@TestMetadata("siblingLabels.kt")
public void testSiblingLabels() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/labels/cases/siblingLabels.kt");
doTest(fileName);
}
@TestMetadata("siblingLabelsInlined.kt")
public void testSiblingLabelsInlined() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/labels/cases/siblingLabelsInlined.kt");
doTest(fileName);
}
@TestMetadata("siblingLabelsInlinedClashing.kt")
public void testSiblingLabelsInlinedClashing() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/labels/cases/siblingLabelsInlinedClashing.kt");
doTest(fileName);
}
@TestMetadata("simpleLabel.kt")
public void testSimpleLabel() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/labels/cases/simpleLabel.kt");
doTest(fileName);
}
@TestMetadata("simpleLabelInlined.kt")
public void testSimpleLabelInlined() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/labels/cases/simpleLabelInlined.kt");
doTest(fileName);
}
}
@@ -1,127 +0,0 @@
/*
* Copyright 2010-2016 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 OperatorOverloadingTest extends SingleFileTranslationTest {
public OperatorOverloadingTest() {
super("operatorOverloading/");
}
public void testPlusOverload() throws Exception {
fooBoxTest();
}
public void testPostfixInc() throws Exception {
fooBoxTest();
}
public void testPrefixDecOverload() throws Exception {
fooBoxTest();
}
public void testPrefixIncReturnsCorrectValue() throws Exception {
fooBoxTest();
}
public void testOverloadedCallOnProperty() throws Exception {
fooBoxTest();
}
public void testPostfixOnProperty() throws Exception {
fooBoxTest();
}
public void testOperatorOverloadOnPropertyCallGetterAndSetterOnlyOnce() throws Exception {
fooBoxTest();
}
public void testUnaryOnIntProperty() throws Exception {
fooBoxTest();
}
public void testUnaryOnIntPropertyAsStatement() throws Exception {
fooBoxTest();
}
public void testBinaryDivOverload() throws Exception {
fooBoxTest();
}
public void testPlusAssignNoReassign() throws Exception {
fooBoxTest();
}
public void testNotOverload() throws Exception {
fooBoxTest();
}
public void testCompareTo() throws Exception {
fooBoxTest();
}
public void testCompareToByName() throws Exception {
fooBoxTest();
}
public void testPlusAndMinusAsAnExpression() throws Exception {
fooBoxTest();
}
public void testUsingModInCaseModAssignNotAvailable() throws Exception {
fooBoxTest();
}
public void testOverloadPlusAssignArrayList() throws Exception {
checkFooBoxIsOk("overloadPlusAssignArrayList.kt");
}
public void testOverloadPlusAssignViaExtensionFunction() throws Exception {
fooBoxTest();
}
public void testOverloadPlusViaExtensionFunction() throws Exception {
fooBoxTest();
}
public void testOverloadPlusAssignViaPlusExtensionFunction() throws Exception {
fooBoxTest();
}
public void testOverloadUnaryOperationsViaExtensionFunctions() throws Exception {
fooBoxTest();
}
public void testLambdaRhs() throws Exception {
checkFooBoxIsOk();
}
}
@@ -47,10 +47,6 @@ abstract class AbstractCompanionObjectTest : JsBasicBoxTest("objectIntrinsics/")
abstract class AbstractFunctionExpressionTest : JsBasicBoxTest("functionExpression/")
abstract class AbstractJsCodeTest : JsBasicBoxTest("jsCode/")
abstract class AbstractLabelTest : JsBasicBoxTest("labels/")
abstract class AbstractMultiModuleTest : JsBasicBoxTest("multiModule/")
abstract class AbstractReservedWordTest : JsBasicBoxTest("reservedWords/")