JS: move more test to box tests
This commit is contained in:
@@ -1144,18 +1144,6 @@ fun main(args: Array<String>) {
|
||||
testClass<AbstractReservedWordTest>() {
|
||||
model("reservedWords/cases")
|
||||
}
|
||||
|
||||
testClass<AbstractReifiedTest>() {
|
||||
model("reified/cases")
|
||||
}
|
||||
|
||||
testClass<AbstractRttiTest>() {
|
||||
model("rtti/cases")
|
||||
}
|
||||
|
||||
testClass<AbstractLightReflectionTest>() {
|
||||
model("reflection/light/cases")
|
||||
}
|
||||
}
|
||||
|
||||
testGroup("js/js.tests/test", "compiler/testData") {
|
||||
|
||||
@@ -233,10 +233,10 @@ abstract class BasicBoxTest(
|
||||
if (moduleKindMatcher.find()) {
|
||||
module.moduleKind = ModuleKind.valueOf(moduleKindMatcher.group(1))
|
||||
}
|
||||
}
|
||||
|
||||
if (NO_INLINE_PATTERN.matcher(text).find()) {
|
||||
module.inliningDisabled = true
|
||||
}
|
||||
if (NO_INLINE_PATTERN.matcher(text).find()) {
|
||||
(module ?: defaultModule).inliningDisabled = true
|
||||
}
|
||||
|
||||
val temporaryFile = File(tmpDir, fileName)
|
||||
|
||||
@@ -1,21 +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
|
||||
|
||||
abstract class AbstractReifiedTest : SingleFileTranslationTest("reified/")
|
||||
@@ -5719,4 +5719,584 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("js/js.translator/testData/box/reflection")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Reflection extends AbstractBoxJsTest {
|
||||
public void testAllFilesPresentInReflection() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/box/reflection"), Pattern.compile("^([^_](.+))\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("js/js.translator/testData/box/reflection/light")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Light extends AbstractBoxJsTest {
|
||||
public void testAllFilesPresentInLight() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/box/reflection/light"), Pattern.compile("^([^_](.+))\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("jsClass.kt")
|
||||
public void testJsClass() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reflection/light/jsClass.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("jsClassName.kt")
|
||||
public void testJsClassName() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reflection/light/jsClassName.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("jsClassOnReifiedType.kt")
|
||||
public void testJsClassOnReifiedType() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reflection/light/jsClassOnReifiedType.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("js/js.translator/testData/box/regression")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Regression extends AbstractBoxJsTest {
|
||||
public void testAllFilesPresentInRegression() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/box/regression"), Pattern.compile("^([^_](.+))\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("kt2470.kt")
|
||||
public void testKt2470() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/regression/kt2470.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("tmpInsidePrimaryConstructor.kt")
|
||||
public void testTmpInsidePrimaryConstructor() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/regression/tmpInsidePrimaryConstructor.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("js/js.translator/testData/box/reified")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Reified extends AbstractBoxJsTest {
|
||||
public void testAllFilesPresentInReified() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/box/reified"), Pattern.compile("^([^_](.+))\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("callChain.kt")
|
||||
public void testCallChain() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reified/callChain.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("extensionFun.kt")
|
||||
public void testExtensionFun() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reified/extensionFun.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("extensionLambda.kt")
|
||||
public void testExtensionLambda() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reified/extensionLambda.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("extensionMethod.kt")
|
||||
public void testExtensionMethod() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reified/extensionMethod.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("innerObject.kt")
|
||||
public void testInnerObject() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reified/innerObject.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("isBool.kt")
|
||||
public void testIsBool() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reified/isBool.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("isChar.kt")
|
||||
public void testIsChar() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reified/isChar.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("isClass.kt")
|
||||
public void testIsClass() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reified/isClass.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("isNumber.kt")
|
||||
public void testIsNumber() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reified/isNumber.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("isString.kt")
|
||||
public void testIsString() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reified/isString.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("isTNullable.kt")
|
||||
public void testIsTNullable() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reified/isTNullable.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("lambda.kt")
|
||||
public void testLambda() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reified/lambda.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("lambdaNameClash.kt")
|
||||
public void testLambdaNameClash() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reified/lambdaNameClash.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("method.kt")
|
||||
public void testMethod() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reified/method.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("multipleTypeParameters.kt")
|
||||
public void testMultipleTypeParameters() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reified/multipleTypeParameters.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("noValueParameters.kt")
|
||||
public void testNoValueParameters() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reified/noValueParameters.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("parameterSwap.kt")
|
||||
public void testParameterSwap() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reified/parameterSwap.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("vararg.kt")
|
||||
public void testVararg() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reified/vararg.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("withInlineTurnedOff.kt")
|
||||
public void testWithInlineTurnedOff() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reified/withInlineTurnedOff.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("js/js.translator/testData/box/rtti")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Rtti extends AbstractBoxJsTest {
|
||||
public void testAllFilesPresentInRtti() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/box/rtti"), Pattern.compile("^([^_](.+))\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("js/js.translator/testData/box/rtti/cases")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Cases extends AbstractBoxJsTest {
|
||||
public void testAllFilesPresentInCases() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/box/rtti/cases"), Pattern.compile("^([^_](.+))\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("collectionClassesIsCheck.kt")
|
||||
public void testCollectionClassesIsCheck() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/rtti/cases/collectionClassesIsCheck.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("isComparable.kt")
|
||||
public void testIsComparable() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/rtti/cases/isComparable.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("isJsPrimitiveType.kt")
|
||||
public void testIsJsPrimitiveType() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/rtti/cases/isJsPrimitiveType.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("isObject.kt")
|
||||
public void testIsObject() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/rtti/cases/isObject.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("isSameClass.kt")
|
||||
public void testIsSameClass() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/rtti/cases/isSameClass.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("notIsOtherClass.kt")
|
||||
public void testNotIsOtherClass() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/rtti/cases/notIsOtherClass.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("objectExpression.kt")
|
||||
public void testObjectExpression() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/rtti/cases/objectExpression.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("onNativeObject.kt")
|
||||
public void testOnNativeObject() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/rtti/cases/onNativeObject.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("rttiForClass.kt")
|
||||
public void testRttiForClass() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/rtti/cases/rttiForClass.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("rttiForTrait.kt")
|
||||
public void testRttiForTrait() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/rtti/cases/rttiForTrait.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("rttiForTrait2.kt")
|
||||
public void testRttiForTrait2() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/rtti/cases/rttiForTrait2.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("sideEffectMethod.kt")
|
||||
public void testSideEffectMethod() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/rtti/cases/sideEffectMethod.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("sideEffectProperty.kt")
|
||||
public void testSideEffectProperty() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/rtti/cases/sideEffectProperty.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("stdlibEmptyListClass.kt")
|
||||
public void testStdlibEmptyListClass() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/rtti/cases/stdlibEmptyListClass.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@TestMetadata("js/js.translator/testData/box/safeCall")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class SafeCall extends AbstractBoxJsTest {
|
||||
public void testAllFilesPresentInSafeCall() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/box/safeCall"), Pattern.compile("^([^_](.+))\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("safeAccess.kt")
|
||||
public void testSafeAccess() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/safeCall/safeAccess.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("safeCall.kt")
|
||||
public void testSafeCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/safeCall/safeCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("safeCallAndIntrinsic.kt")
|
||||
public void testSafeCallAndIntrinsic() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/safeCall/safeCallAndIntrinsic.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("safeCallAndSideEffect.kt")
|
||||
public void testSafeCallAndSideEffect() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/safeCall/safeCallAndSideEffect.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("safeCallReturnsNullIfFails.kt")
|
||||
public void testSafeCallReturnsNullIfFails() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/safeCall/safeCallReturnsNullIfFails.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("safeExtensionFunctionCall.kt")
|
||||
public void testSafeExtensionFunctionCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/safeCall/safeExtensionFunctionCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("js/js.translator/testData/box/simple")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Simple extends AbstractBoxJsTest {
|
||||
public void testAllFilesPresentInSimple() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/box/simple"), Pattern.compile("^([^_](.+))\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("assign.kt")
|
||||
public void testAssign() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/simple/assign.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("breakDoWhile.kt")
|
||||
public void testBreakDoWhile() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/simple/breakDoWhile.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("breakWhile.kt")
|
||||
public void testBreakWhile() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/simple/breakWhile.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("classInstantiation.kt")
|
||||
public void testClassInstantiation() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/simple/classInstantiation.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("comparison.kt")
|
||||
public void testComparison() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/simple/comparison.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("complexExpressionAsConstructorParameter.kt")
|
||||
public void testComplexExpressionAsConstructorParameter() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/simple/complexExpressionAsConstructorParameter.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("constructorWithParameter.kt")
|
||||
public void testConstructorWithParameter() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/simple/constructorWithParameter.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("constructorWithPropertiesAsParameters.kt")
|
||||
public void testConstructorWithPropertiesAsParameters() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/simple/constructorWithPropertiesAsParameters.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("continueDoWhile.kt")
|
||||
public void testContinueDoWhile() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/simple/continueDoWhile.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("continueWhile.kt")
|
||||
public void testContinueWhile() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/simple/continueWhile.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("doWhile.kt")
|
||||
public void testDoWhile() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/simple/doWhile.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("doWhile2.kt")
|
||||
public void testDoWhile2() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/simple/doWhile2.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("elseif.kt")
|
||||
public void testElseif() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/simple/elseif.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("if.kt")
|
||||
public void testIf() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/simple/if.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("ifElseAsExpression.kt")
|
||||
public void testIfElseAsExpression() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/simple/ifElseAsExpression.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("methodDeclarationAndCall.kt")
|
||||
public void testMethodDeclarationAndCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/simple/methodDeclarationAndCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("minusAssignOnProperty.kt")
|
||||
public void testMinusAssignOnProperty() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/simple/minusAssignOnProperty.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("notBoolean.kt")
|
||||
public void testNotBoolean() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/simple/notBoolean.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("plusAssign.kt")
|
||||
public void testPlusAssign() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/simple/plusAssign.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("positiveAndNegativeNumbers.kt")
|
||||
public void testPositiveAndNegativeNumbers() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/simple/positiveAndNegativeNumbers.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("postfixIntOperations.kt")
|
||||
public void testPostfixIntOperations() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/simple/postfixIntOperations.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("prefixIntOperations.kt")
|
||||
public void testPrefixIntOperations() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/simple/prefixIntOperations.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("propertiesAsParametersInitialized.kt")
|
||||
public void testPropertiesAsParametersInitialized() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/simple/propertiesAsParametersInitialized.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("propertyAccess.kt")
|
||||
public void testPropertyAccess() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/simple/propertyAccess.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("simpleInitializer.kt")
|
||||
public void testSimpleInitializer() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/simple/simpleInitializer.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("while.kt")
|
||||
public void testWhile() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/simple/while.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("while2.kt")
|
||||
public void testWhile2() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/simple/while2.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("js/js.translator/testData/box/standardClasses")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class StandardClasses extends AbstractBoxJsTest {
|
||||
public void testAllFilesPresentInStandardClasses() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/box/standardClasses"), Pattern.compile("^([^_](.+))\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("array.kt")
|
||||
public void testArray() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/standardClasses/array.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("arrayAccess.kt")
|
||||
public void testArrayAccess() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/standardClasses/arrayAccess.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("arrayConstructorsWithLambda.kt")
|
||||
public void testArrayConstructorsWithLambda() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/standardClasses/arrayConstructorsWithLambda.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("arrayFactoryMethods.kt")
|
||||
public void testArrayFactoryMethods() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/standardClasses/arrayFactoryMethods.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("arrayFunctionConstructor.kt")
|
||||
public void testArrayFunctionConstructor() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/standardClasses/arrayFunctionConstructor.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("arrayIsFilledWithNulls.kt")
|
||||
public void testArrayIsFilledWithNulls() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/standardClasses/arrayIsFilledWithNulls.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("arraySize.kt")
|
||||
public void testArraySize() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/standardClasses/arraySize.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("arraysIterator.kt")
|
||||
public void testArraysIterator() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/standardClasses/arraysIterator.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("hashMapTypeOfElement.kt")
|
||||
public void testHashMapTypeOfElement() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/standardClasses/hashMapTypeOfElement.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("hashSetTypeOfElement.kt")
|
||||
public void testHashSetTypeOfElement() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/standardClasses/hashSetTypeOfElement.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("mutableMapRemoveWithCollision.kt")
|
||||
public void testMutableMapRemoveWithCollision() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/standardClasses/mutableMapRemoveWithCollision.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("stringBuilder.kt")
|
||||
public void testStringBuilder() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/standardClasses/stringBuilder.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-55
@@ -1,55 +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/reflection/light/cases")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public class LightReflectionTestGenerated extends AbstractLightReflectionTest {
|
||||
public void testAllFilesPresentInCases() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/reflection/light/cases"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("jsClass.kt")
|
||||
public void testJsClass() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/reflection/light/cases/jsClass.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("jsClassName.kt")
|
||||
public void testJsClassName() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/reflection/light/cases/jsClassName.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("jsClassOnReifiedType.kt")
|
||||
public void testJsClassOnReifiedType() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/reflection/light/cases/jsClassOnReifiedType.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
@@ -1,34 +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 RegressionTest extends SingleFileTranslationTest {
|
||||
|
||||
public RegressionTest() {
|
||||
super("regression/");
|
||||
}
|
||||
|
||||
public void testKt2470() throws Exception {
|
||||
checkFooBoxIsOk();
|
||||
}
|
||||
|
||||
public void testTmpInsidePrimaryConstructor() throws Exception {
|
||||
checkFooBoxIsOk();
|
||||
}
|
||||
}
|
||||
@@ -1,151 +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/reified/cases")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public class ReifiedTestGenerated extends AbstractReifiedTest {
|
||||
public void testAllFilesPresentInCases() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/reified/cases"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("callChain.kt")
|
||||
public void testCallChain() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/reified/cases/callChain.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("extensionFun.kt")
|
||||
public void testExtensionFun() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/reified/cases/extensionFun.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("extensionLambda.kt")
|
||||
public void testExtensionLambda() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/reified/cases/extensionLambda.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("extensionMethod.kt")
|
||||
public void testExtensionMethod() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/reified/cases/extensionMethod.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("innerObject.kt")
|
||||
public void testInnerObject() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/reified/cases/innerObject.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("isBool.kt")
|
||||
public void testIsBool() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/reified/cases/isBool.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("isChar.kt")
|
||||
public void testIsChar() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/reified/cases/isChar.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("isClass.kt")
|
||||
public void testIsClass() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/reified/cases/isClass.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("isNumber.kt")
|
||||
public void testIsNumber() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/reified/cases/isNumber.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("isString.kt")
|
||||
public void testIsString() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/reified/cases/isString.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("isTNullable.kt")
|
||||
public void testIsTNullable() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/reified/cases/isTNullable.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("lambda.kt")
|
||||
public void testLambda() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/reified/cases/lambda.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("lambdaNameClash.kt")
|
||||
public void testLambdaNameClash() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/reified/cases/lambdaNameClash.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("method.kt")
|
||||
public void testMethod() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/reified/cases/method.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("multipleTypeParameters.kt")
|
||||
public void testMultipleTypeParameters() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/reified/cases/multipleTypeParameters.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("noValueParameters.kt")
|
||||
public void testNoValueParameters() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/reified/cases/noValueParameters.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("parameterSwap.kt")
|
||||
public void testParameterSwap() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/reified/cases/parameterSwap.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("vararg.kt")
|
||||
public void testVararg() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/reified/cases/vararg.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("withInlineTurnedOff.kt")
|
||||
public void testWithInlineTurnedOff() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/reified/cases/withInlineTurnedOff.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 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/rtti/cases")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public class RttiTestGenerated extends AbstractRttiTest {
|
||||
public void testAllFilesPresentInCases() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/rtti/cases"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("collectionClassesIsCheck.kt")
|
||||
public void testCollectionClassesIsCheck() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/rtti/cases/collectionClassesIsCheck.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("isComparable.kt")
|
||||
public void testIsComparable() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/rtti/cases/isComparable.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("isJsPrimitiveType.kt")
|
||||
public void testIsJsPrimitiveType() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/rtti/cases/isJsPrimitiveType.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("isObject.kt")
|
||||
public void testIsObject() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/rtti/cases/isObject.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("isReifiedObject.kt")
|
||||
public void testIsReifiedObject() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/rtti/cases/isReifiedObject.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("isSameClass.kt")
|
||||
public void testIsSameClass() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/rtti/cases/isSameClass.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("notIsOtherClass.kt")
|
||||
public void testNotIsOtherClass() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/rtti/cases/notIsOtherClass.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("objectExpression.kt")
|
||||
public void testObjectExpression() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/rtti/cases/objectExpression.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("onNativeObject.kt")
|
||||
public void testOnNativeObject() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/rtti/cases/onNativeObject.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("rttiForClass.kt")
|
||||
public void testRttiForClass() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/rtti/cases/rttiForClass.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("rttiForTrait.kt")
|
||||
public void testRttiForTrait() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/rtti/cases/rttiForTrait.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("rttiForTrait2.kt")
|
||||
public void testRttiForTrait2() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/rtti/cases/rttiForTrait2.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("sideEffectMethod.kt")
|
||||
public void testSideEffectMethod() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/rtti/cases/sideEffectMethod.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("sideEffectProperty.kt")
|
||||
public void testSideEffectProperty() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/rtti/cases/sideEffectProperty.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("stdlibEmptyListClass.kt")
|
||||
public void testStdlibEmptyListClass() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/rtti/cases/stdlibEmptyListClass.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
@@ -1,50 +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 SafeCallTest extends SingleFileTranslationTest {
|
||||
|
||||
public SafeCallTest() {
|
||||
super("safeCall/");
|
||||
}
|
||||
|
||||
public void testSafeAccess() throws Exception {
|
||||
fooBoxTest();
|
||||
}
|
||||
|
||||
public void testSafeExtensionFunctionCall() throws Exception {
|
||||
checkFooBoxIsOk("safeExtensionFunctionCall.kt");
|
||||
}
|
||||
|
||||
public void testSafeCall() throws Exception {
|
||||
fooBoxTest();
|
||||
}
|
||||
|
||||
public void testSafeCallReturnsNullIfFails() throws Exception {
|
||||
fooBoxTest();
|
||||
}
|
||||
|
||||
public void testSafeCallAndSideEffect() throws Exception {
|
||||
checkFooBoxIsOk();
|
||||
}
|
||||
|
||||
public void testSafeCallAndIntrinsic() throws Exception {
|
||||
checkFooBoxIsOk();
|
||||
}
|
||||
}
|
||||
@@ -1,52 +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 junit.framework.Test;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.kotlin.js.test.SingleFileTranslationTest;
|
||||
|
||||
@SuppressWarnings("JUnitTestCaseWithNoTests")
|
||||
public final class SimpleTest extends SingleFileTranslationTest {
|
||||
|
||||
@NotNull
|
||||
private final String filename;
|
||||
|
||||
@SuppressWarnings("JUnitTestCaseWithNonTrivialConstructors")
|
||||
public SimpleTest(@NotNull String filename) {
|
||||
super("simple/");
|
||||
this.filename = filename;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void runTest() throws Exception {
|
||||
checkFooBoxIsTrue(filename);
|
||||
}
|
||||
|
||||
public static Test suite() throws Exception {
|
||||
return TranslatorTestCaseBuilder
|
||||
.suiteForDirectory(TEST_DATA_DIR_PATH + "simple/cases/", new TranslatorTestCaseBuilder.NamedTestFactory() {
|
||||
@NotNull
|
||||
@Override
|
||||
public Test createTest(@NotNull String filename) {
|
||||
SimpleTest examplesTest = new SimpleTest(filename);
|
||||
examplesTest.setName(filename);
|
||||
return examplesTest;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
-6
@@ -60,9 +60,3 @@ abstract class AbstractSuperTest : JsBasicBoxTest("super/")
|
||||
abstract class AbstractLocalClassesTest : JsBasicBoxTest("localClasses/")
|
||||
|
||||
abstract class AbstractNonLocalReturnsTest : JsBasicBoxTest("inline.generated/nonLocalReturns/")
|
||||
|
||||
abstract class AbstractRttiTest : JsBasicBoxTest("rtti/")
|
||||
|
||||
abstract class AbstractLightReflectionTest : JsBasicBoxTest("reflection/light/")
|
||||
|
||||
abstract class AbstractTypeAliasesTests : JsBasicBoxTest("typealiases/")
|
||||
+1
-1
@@ -6,4 +6,4 @@ class A() {
|
||||
val a1 = Array<Int>(3)
|
||||
val a2 = Array<A>(2)
|
||||
|
||||
fun box() = (a1[4] == null)
|
||||
fun box() = if (a1[4] == null) "OK" else "fail"
|
||||
Vendored
Vendored
Vendored
Vendored
Vendored
+7
-3
@@ -4,15 +4,19 @@ class A() {
|
||||
var c = 3
|
||||
}
|
||||
|
||||
fun box(): Boolean {
|
||||
fun box(): String {
|
||||
var a1: A? = A()
|
||||
var a2: A? = null
|
||||
a1?.c = 4
|
||||
a2?.c = 5
|
||||
if (a1?.c != 4) {
|
||||
return false;
|
||||
return "fail1"
|
||||
}
|
||||
a2 = a1
|
||||
a2?.c = 5
|
||||
return (a2?.c == 5) && (a1?.c == 5)
|
||||
|
||||
if (a2?.c != 5) return "fail2"
|
||||
if (a1?.c != 5) return "fail3"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+2
-2
@@ -5,8 +5,8 @@ class A() {
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): Boolean {
|
||||
fun box(): String {
|
||||
var a: A? = null;
|
||||
a?.doSomething()
|
||||
return true;
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package foo
|
||||
|
||||
class A() {
|
||||
val x = 4
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
var a: A? = null;
|
||||
return if (a?.x == null) "OK" else "fail"
|
||||
}
|
||||
Vendored
+1
-1
@@ -6,4 +6,4 @@ fun f(): Int {
|
||||
return x
|
||||
}
|
||||
|
||||
fun box() = f() == 2
|
||||
fun box() = if (f() == 2) "OK" else "fail"
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
package foo
|
||||
|
||||
fun box(): Boolean {
|
||||
fun box(): String {
|
||||
var i = 0
|
||||
do {
|
||||
if (i == 3) {
|
||||
@@ -8,7 +8,7 @@ fun box(): Boolean {
|
||||
}
|
||||
++i;
|
||||
}
|
||||
while ( i < 100)
|
||||
while (i < 100)
|
||||
|
||||
return i == 3
|
||||
return if (i == 3) "OK" else "fail: $i"
|
||||
}
|
||||
+3
-3
@@ -1,13 +1,13 @@
|
||||
package foo
|
||||
|
||||
fun box(): Boolean {
|
||||
fun box(): String {
|
||||
var i = 0
|
||||
while ( i < 100) {
|
||||
while (i < 100) {
|
||||
if (i == 3) {
|
||||
break;
|
||||
}
|
||||
++i;
|
||||
}
|
||||
|
||||
return i == 3
|
||||
return if (i == 3) "OK" else "fail: $i"
|
||||
}
|
||||
+2
-2
@@ -3,7 +3,7 @@ package foo
|
||||
class Test() {
|
||||
}
|
||||
|
||||
fun box(): Boolean {
|
||||
fun box(): String {
|
||||
var test = Test()
|
||||
return true
|
||||
return "OK"
|
||||
}
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
package foo
|
||||
|
||||
fun box(): Boolean {
|
||||
fun box(): String {
|
||||
val a = 2;
|
||||
val b = 3;
|
||||
var c = 4;
|
||||
return (a < c)
|
||||
return if (a < c) "OK" else "fail"
|
||||
}
|
||||
|
||||
+5
-2
@@ -5,7 +5,10 @@ class Test(a: Int, b: Int) {
|
||||
val d = b
|
||||
}
|
||||
|
||||
fun box(): Boolean {
|
||||
fun box(): String {
|
||||
val test = Test(1 + 6 * 3, 10 % 2)
|
||||
return (test.c == 19) && (test.d == 0)
|
||||
if (test.c != 19) return "fail1"
|
||||
if (test.d != 0) return "fail2"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+2
-2
@@ -4,7 +4,7 @@ class Test(a: Int) {
|
||||
val b = a
|
||||
}
|
||||
|
||||
fun box(): Boolean {
|
||||
fun box(): String {
|
||||
var test = Test(1)
|
||||
return (test.b == 1)
|
||||
return if (test.b == 1) "OK" else "fail"
|
||||
}
|
||||
+2
-2
@@ -4,9 +4,9 @@ class A(var b: Int, var a: String) {
|
||||
|
||||
}
|
||||
|
||||
fun box(): Boolean {
|
||||
fun box(): String {
|
||||
val c = A(1, "1")
|
||||
c.b = 2
|
||||
c.a = "2"
|
||||
return (c.b == 2 && c.a == "2")
|
||||
return if (c.b == 2 && c.a == "2") "OK" else "fail"
|
||||
}
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package foo
|
||||
|
||||
fun box(): Boolean {
|
||||
fun box(): String {
|
||||
var i = 0
|
||||
var b = true
|
||||
do {
|
||||
@@ -12,5 +12,5 @@ fun box(): Boolean {
|
||||
}
|
||||
while (i < 100)
|
||||
|
||||
return b
|
||||
return if (b) "OK" else "fail"
|
||||
}
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package foo
|
||||
|
||||
fun box(): Boolean {
|
||||
fun box(): String {
|
||||
var i = 0
|
||||
var b = true
|
||||
while (i < 100) {
|
||||
@@ -11,5 +11,5 @@ fun box(): Boolean {
|
||||
b = false;
|
||||
}
|
||||
|
||||
return b
|
||||
return if (b) "OK" else "fail"
|
||||
}
|
||||
Vendored
+3
-3
@@ -1,6 +1,6 @@
|
||||
package foo
|
||||
|
||||
fun box(): Boolean {
|
||||
fun box(): String {
|
||||
|
||||
val a = 50;
|
||||
var b = 0;
|
||||
@@ -11,8 +11,8 @@ fun box(): Boolean {
|
||||
}
|
||||
while (b < a)
|
||||
if (c == 100) {
|
||||
return true;
|
||||
return "OK"
|
||||
}
|
||||
return false;
|
||||
return "fail: $c"
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,14 +1,14 @@
|
||||
package foo
|
||||
|
||||
fun box(): Boolean {
|
||||
fun box(): String {
|
||||
var x = 2;
|
||||
do {
|
||||
x = 1;
|
||||
}
|
||||
while (3 < 2)
|
||||
if (x == 1) {
|
||||
return true;
|
||||
return "OK"
|
||||
}
|
||||
return false;
|
||||
return "fail: $x"
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -18,4 +18,4 @@ fun bor(): Int {
|
||||
}
|
||||
}
|
||||
|
||||
fun box() = bor() == 5
|
||||
fun box() = if (bor() == 5) "OK" else "fail"
|
||||
+1
-1
@@ -18,5 +18,5 @@ fun bol(): Int {
|
||||
}
|
||||
}
|
||||
|
||||
fun box() = bol() == 5
|
||||
fun box() = if (bol() == 5) "OK" else "fail"
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
package foo
|
||||
|
||||
fun box(): String {
|
||||
val a = 2;
|
||||
return if (a == 2) "OK" else "fail"
|
||||
}
|
||||
+3
-3
@@ -1,12 +1,12 @@
|
||||
package foo
|
||||
|
||||
class Test() {
|
||||
fun method(): Boolean {
|
||||
return true;
|
||||
fun method(): String {
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): Boolean {
|
||||
fun box(): String {
|
||||
var test = Test()
|
||||
return test.method()
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package foo
|
||||
|
||||
var a = 3
|
||||
|
||||
fun box(): String {
|
||||
a -= 10
|
||||
|
||||
return if (a == -7) "OK" else "fail"
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package foo
|
||||
|
||||
fun box(): String {
|
||||
return if (!false) "OK" else "fail"
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package foo
|
||||
|
||||
|
||||
fun box(): String {
|
||||
var a = 3
|
||||
a += 3
|
||||
return if (a == 6) "OK" else "fail"
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package foo
|
||||
|
||||
fun box(): String {
|
||||
val b = -3
|
||||
val c = +3
|
||||
return if ((c - b) == 6) "OK" else "fail"
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package foo
|
||||
|
||||
fun box(): String {
|
||||
var a = 3;
|
||||
val b = a++;
|
||||
a--;
|
||||
a--;
|
||||
return if ((a++ == 2) && (b == 3)) "OK" else "fail"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package foo
|
||||
|
||||
fun box(): String {
|
||||
var a = 3;
|
||||
val b = ++a;
|
||||
--a;
|
||||
--a;
|
||||
return if ((--a == 1) && (b == 4)) "OK" else "fail"
|
||||
}
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@ class A(var b: Int, var a: String) {
|
||||
|
||||
}
|
||||
|
||||
fun box(): Boolean {
|
||||
fun box(): String {
|
||||
val c = A(2, "2")
|
||||
return (c.b == 2 && c.a == "2")
|
||||
return if (c.b == 2 && c.a == "2") "OK" else "fail"
|
||||
}
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
package foo
|
||||
|
||||
class Test() {
|
||||
val p = true
|
||||
val p = "OK"
|
||||
}
|
||||
|
||||
fun box(): Boolean {
|
||||
fun box(): String {
|
||||
return Test().p
|
||||
}
|
||||
+2
-2
@@ -7,6 +7,6 @@ class Test() {
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): Boolean {
|
||||
return (Test().a == 3);
|
||||
fun box(): String {
|
||||
return if (Test().a == 3) "OK" else "fail"
|
||||
}
|
||||
Vendored
+3
-3
@@ -1,6 +1,6 @@
|
||||
package foo
|
||||
|
||||
fun box(): Boolean {
|
||||
fun box(): String {
|
||||
|
||||
val a = 50;
|
||||
var b = 0;
|
||||
@@ -10,8 +10,8 @@ fun box(): Boolean {
|
||||
c = c + 2;
|
||||
}
|
||||
if (c == 100) {
|
||||
return true;
|
||||
return "OK"
|
||||
}
|
||||
return false;
|
||||
return "fail: $c"
|
||||
}
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package foo
|
||||
|
||||
fun box(): String {
|
||||
|
||||
while (2 < 1) {
|
||||
return "fail"
|
||||
}
|
||||
return "OK"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package foo
|
||||
|
||||
fun box(): String {
|
||||
|
||||
val a = arrayOfNulls<Int>(2)
|
||||
a.set(1, 2)
|
||||
return if (a.get(1) == 2) "OK" else "fail"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
package foo
|
||||
|
||||
fun box(): String {
|
||||
val a = arrayOfNulls<Int>(4)
|
||||
a[1] = 2
|
||||
a[2] = 3
|
||||
return if ((a[1] == 2) && (a[2] == 3)) "OK" else "fail"
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package foo
|
||||
|
||||
val f = { i: Int -> i + 1 }
|
||||
|
||||
val a = Array(3, f)
|
||||
|
||||
fun box() = if (a[0] == 1 && a[2] == 3 && a[1] == 2) "OK" else "fail"
|
||||
@@ -0,0 +1,5 @@
|
||||
package foo
|
||||
|
||||
val a = arrayOfNulls<Int>(3)
|
||||
|
||||
fun box() = if (a[0] == null && a[1] == null && a[2] == null) "OK" else "fail"
|
||||
+1
-1
@@ -6,4 +6,4 @@ class A() {
|
||||
val a1 = arrayOfNulls<Int>(3)
|
||||
val a2 = arrayOfNulls<A>(2)
|
||||
|
||||
fun box() = (a1.size == 3 && a2.size == 2)
|
||||
fun box() = if (a1.size == 3 && a2.size == 2) "OK" else "fail"
|
||||
@@ -0,0 +1,16 @@
|
||||
package foo
|
||||
|
||||
val a1 = Array<Int>(3, { i: Int -> i })
|
||||
|
||||
fun box(): String {
|
||||
val i = a1.iterator()
|
||||
if (i.hasNext() != true) return "fail1"
|
||||
if (i.next() != 0) return "fail2"
|
||||
if (i.hasNext() != true) return "fail3"
|
||||
if (i.next() != 1) return "fail4"
|
||||
if (i.hasNext() != true) return "fail5"
|
||||
if (i.next() != 2) return "fail6"
|
||||
if (i.hasNext() != false) return "fail7"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package foo
|
||||
|
||||
class A() {
|
||||
val x = 4
|
||||
}
|
||||
|
||||
fun box(): Boolean {
|
||||
var a: A? = null;
|
||||
return (a?.x == null);
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
package foo
|
||||
|
||||
fun box(): Boolean {
|
||||
val a = 2;
|
||||
return if (a == 2) true else false;
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package foo
|
||||
|
||||
var a = 3
|
||||
|
||||
fun box(): Boolean {
|
||||
a -= 10
|
||||
|
||||
return (a == -7)
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user