JS: move more test to box tests

This commit is contained in:
Alexey Andreev
2016-08-29 14:51:32 +03:00
parent a18f5eca2d
commit 9bf124af3f
129 changed files with 766 additions and 685 deletions
@@ -4176,6 +4176,12 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiModule/simple.kt");
doTest(fileName);
}
@TestMetadata("typealiases.kt")
public void testTypealiases() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiModule/typealiases.kt");
doTest(fileName);
}
}
@TestMetadata("js/js.translator/testData/box/inlineSizeReduction")
@@ -4673,6 +4679,69 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest {
}
}
@TestMetadata("js/js.translator/testData/box/multiPackage")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class MultiPackage extends AbstractBoxJsTest {
public void testAllFilesPresentInMultiPackage() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/box/multiPackage"), Pattern.compile("^([^_](.+))\\.kt$"), true);
}
@TestMetadata("classesInheritedFromOtherPackage.kt")
public void testClassesInheritedFromOtherPackage() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/multiPackage/classesInheritedFromOtherPackage.kt");
doTest(fileName);
}
@TestMetadata("createClassFromOtherPackage.kt")
public void testCreateClassFromOtherPackage() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/multiPackage/createClassFromOtherPackage.kt");
doTest(fileName);
}
@TestMetadata("createClassFromOtherPackageUsingImport.kt")
public void testCreateClassFromOtherPackageUsingImport() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/multiPackage/createClassFromOtherPackageUsingImport.kt");
doTest(fileName);
}
@TestMetadata("functionsVisibleFromOtherPackage.kt")
public void testFunctionsVisibleFromOtherPackage() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/multiPackage/functionsVisibleFromOtherPackage.kt");
doTest(fileName);
}
@TestMetadata("nestedPackageFunctionCalledFromOtherPackage.kt")
public void testNestedPackageFunctionCalledFromOtherPackage() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/multiPackage/nestedPackageFunctionCalledFromOtherPackage.kt");
doTest(fileName);
}
@TestMetadata("packageVariableVisibleFromOtherPackage.kt")
public void testPackageVariableVisibleFromOtherPackage() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/multiPackage/packageVariableVisibleFromOtherPackage.kt");
doTest(fileName);
}
@TestMetadata("reflectionFromOtherPackage.kt")
public void testReflectionFromOtherPackage() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/multiPackage/reflectionFromOtherPackage.kt");
doTest(fileName);
}
@TestMetadata("subpackagesWithClashingNames.kt")
public void testSubpackagesWithClashingNames() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/multiPackage/subpackagesWithClashingNames.kt");
doTest(fileName);
}
@TestMetadata("subpackagesWithClashingNamesUsingImport.kt")
public void testSubpackagesWithClashingNamesUsingImport() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/multiPackage/subpackagesWithClashingNamesUsingImport.kt");
doTest(fileName);
}
}
@TestMetadata("js/js.translator/testData/box/multideclaration")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -4724,6 +4793,456 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest {
}
}
@TestMetadata("js/js.translator/testData/box/nameClashes")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class NameClashes extends AbstractBoxJsTest {
public void testAllFilesPresentInNameClashes() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/box/nameClashes"), Pattern.compile("^([^_](.+))\\.kt$"), true);
}
@TestMetadata("differenceInCapitalization.kt")
public void testDifferenceInCapitalization() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/nameClashes/differenceInCapitalization.kt");
doTest(fileName);
}
@TestMetadata("extensionFunctionAndProperty.kt")
public void testExtensionFunctionAndProperty() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/nameClashes/extensionFunctionAndProperty.kt");
doTest(fileName);
}
@TestMetadata("methodOverload.kt")
public void testMethodOverload() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/nameClashes/methodOverload.kt");
doTest(fileName);
}
@TestMetadata("methodOverloadInClassWithTwoUpperBounds.kt")
public void testMethodOverloadInClassWithTwoUpperBounds() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/nameClashes/methodOverloadInClassWithTwoUpperBounds.kt");
doTest(fileName);
}
@TestMetadata("overloadExtension.kt")
public void testOverloadExtension() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/nameClashes/overloadExtension.kt");
doTest(fileName);
}
}
@TestMetadata("js/js.translator/testData/box/native")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Native extends AbstractBoxJsTest {
public void testAllFilesPresentInNative() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/box/native"), Pattern.compile("^([^_](.+))\\.kt$"), true);
}
@TestMetadata("class.kt")
public void testClass() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/native/class.kt");
doTest(fileName);
}
@TestMetadata("classObject.kt")
public void testClassObject() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/native/classObject.kt");
doTest(fileName);
}
@TestMetadata("eval.kt")
public void testEval() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/native/eval.kt");
doTest(fileName);
}
@TestMetadata("inheritanceFromNativeClass.kt")
public void testInheritanceFromNativeClass() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/native/inheritanceFromNativeClass.kt");
doTest(fileName);
}
@TestMetadata("inheritanceFromNativeTrait.kt")
public void testInheritanceFromNativeTrait() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/native/inheritanceFromNativeTrait.kt");
doTest(fileName);
}
@TestMetadata("kt1519.kt")
public void testKt1519() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/native/kt1519.kt");
doTest(fileName);
}
@TestMetadata("kt2209.kt")
public void testKt2209() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/native/kt2209.kt");
doTest(fileName);
}
@TestMetadata("kt2323.kt")
public void testKt2323() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/native/kt2323.kt");
doTest(fileName);
}
@TestMetadata("library.kt")
public void testLibrary() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/native/library.kt");
doTest(fileName);
}
@TestMetadata("nativeExtensionLikeMember.kt")
public void testNativeExtensionLikeMember() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/native/nativeExtensionLikeMember.kt");
doTest(fileName);
}
@TestMetadata("nativeGetterAndNativeSetter.kt")
public void testNativeGetterAndNativeSetter() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/native/nativeGetterAndNativeSetter.kt");
doTest(fileName);
}
@TestMetadata("nativeInvoke.kt")
public void testNativeInvoke() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/native/nativeInvoke.kt");
doTest(fileName);
}
@TestMetadata("nativePropertyWithCustomName.kt")
public void testNativePropertyWithCustomName() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/native/nativePropertyWithCustomName.kt");
doTest(fileName);
}
@TestMetadata("nestedElements.kt")
public void testNestedElements() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/native/nestedElements.kt");
doTest(fileName);
}
@TestMetadata("passExtLambdaFromNative.kt")
public void testPassExtLambdaFromNative() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/native/passExtLambdaFromNative.kt");
doTest(fileName);
}
@TestMetadata("passExtLambdaToNative.kt")
public void testPassExtLambdaToNative() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/native/passExtLambdaToNative.kt");
doTest(fileName);
}
@TestMetadata("passMemberOrExtFromNative.kt")
public void testPassMemberOrExtFromNative() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/native/passMemberOrExtFromNative.kt");
doTest(fileName);
}
@TestMetadata("passMemberOrExtToNative.kt")
public void testPassMemberOrExtToNative() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/native/passMemberOrExtToNative.kt");
doTest(fileName);
}
@TestMetadata("passTopLevelFunctionFromNative.kt")
public void testPassTopLevelFunctionFromNative() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/native/passTopLevelFunctionFromNative.kt");
doTest(fileName);
}
@TestMetadata("passTopLevelOrLocalFunctionToNative.kt")
public void testPassTopLevelOrLocalFunctionToNative() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/native/passTopLevelOrLocalFunctionToNative.kt");
doTest(fileName);
}
@TestMetadata("print.kt")
public void testPrint() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/native/print.kt");
doTest(fileName);
}
@TestMetadata("secondaryConstructor.kt")
public void testSecondaryConstructor() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/native/secondaryConstructor.kt");
doTest(fileName);
}
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/native/simple.kt");
doTest(fileName);
}
@TestMetadata("simpleUndefined.kt")
public void testSimpleUndefined() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/native/simpleUndefined.kt");
doTest(fileName);
}
@TestMetadata("typeof.kt")
public void testTypeof() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/native/typeof.kt");
doTest(fileName);
}
@TestMetadata("undefined.kt")
public void testUndefined() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/native/undefined.kt");
doTest(fileName);
}
@TestMetadata("vararg.kt")
public void testVararg() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/native/vararg.kt");
doTest(fileName);
}
}
@TestMetadata("js/js.translator/testData/box/nestedTypes")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class NestedTypes extends AbstractBoxJsTest {
public void testAllFilesPresentInNestedTypes() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/box/nestedTypes"), Pattern.compile("^([^_](.+))\\.kt$"), true);
}
@TestMetadata("implicitOuterThisFromLambda.kt")
public void testImplicitOuterThisFromLambda() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/nestedTypes/implicitOuterThisFromLambda.kt");
doTest(fileName);
}
@TestMetadata("implicitOuterThisFromLocalClass.kt")
public void testImplicitOuterThisFromLocalClass() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/nestedTypes/implicitOuterThisFromLocalClass.kt");
doTest(fileName);
}
@TestMetadata("inheritanceFromNestedBuiltIn.kt")
public void testInheritanceFromNestedBuiltIn() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/nestedTypes/inheritanceFromNestedBuiltIn.kt");
doTest(fileName);
}
@TestMetadata("inner.kt")
public void testInner() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/nestedTypes/inner.kt");
doTest(fileName);
}
@TestMetadata("innerObjectRefFromConstructor.kt")
public void testInnerObjectRefFromConstructor() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/nestedTypes/innerObjectRefFromConstructor.kt");
doTest(fileName);
}
@TestMetadata("innerReferenceFromChild.kt")
public void testInnerReferenceFromChild() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/nestedTypes/innerReferenceFromChild.kt");
doTest(fileName);
}
@TestMetadata("nested.kt")
public void testNested() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/nestedTypes/nested.kt");
doTest(fileName);
}
@TestMetadata("nestedInInterface.kt")
public void testNestedInInterface() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/nestedTypes/nestedInInterface.kt");
doTest(fileName);
}
@TestMetadata("nestedNative.kt")
public void testNestedNative() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/nestedTypes/nestedNative.kt");
doTest(fileName);
}
@TestMetadata("nestedObjectLazyInitialized.kt")
public void testNestedObjectLazyInitialized() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/nestedTypes/nestedObjectLazyInitialized.kt");
doTest(fileName);
}
@TestMetadata("outerClassReferenceFromSecondaryConstructor.kt")
public void testOuterClassReferenceFromSecondaryConstructor() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/nestedTypes/outerClassReferenceFromSecondaryConstructor.kt");
doTest(fileName);
}
@TestMetadata("outerCompanion.kt")
public void testOuterCompanion() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/nestedTypes/outerCompanion.kt");
doTest(fileName);
}
@TestMetadata("outerNative.kt")
public void testOuterNative() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/nestedTypes/outerNative.kt");
doTest(fileName);
}
@TestMetadata("outerObject.kt")
public void testOuterObject() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/nestedTypes/outerObject.kt");
doTest(fileName);
}
@TestMetadata("outerThis.kt")
public void testOuterThis() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/nestedTypes/outerThis.kt");
doTest(fileName);
}
@TestMetadata("privateFieldNotOverridenInNestedSubclass.kt")
public void testPrivateFieldNotOverridenInNestedSubclass() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/nestedTypes/privateFieldNotOverridenInNestedSubclass.kt");
doTest(fileName);
}
@TestMetadata("receivers.kt")
public void testReceivers() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/nestedTypes/receivers.kt");
doTest(fileName);
}
}
@TestMetadata("js/js.translator/testData/box/number")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Number extends AbstractBoxJsTest {
public void testAllFilesPresentInNumber() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/box/number"), Pattern.compile("^([^_](.+))\\.kt$"), true);
}
@TestMetadata("byteAndShortConversions.kt")
public void testByteAndShortConversions() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/number/byteAndShortConversions.kt");
doTest(fileName);
}
@TestMetadata("conversionsWithTruncation.kt")
public void testConversionsWithTruncation() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/number/conversionsWithTruncation.kt");
doTest(fileName);
}
@TestMetadata("conversionsWithoutTruncation.kt")
public void testConversionsWithoutTruncation() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/number/conversionsWithoutTruncation.kt");
doTest(fileName);
}
@TestMetadata("division.kt")
public void testDivision() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/number/division.kt");
doTest(fileName);
}
@TestMetadata("doubleConversions.kt")
public void testDoubleConversions() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/number/doubleConversions.kt");
doTest(fileName);
}
@TestMetadata("hexadecimalConstant.kt")
public void testHexadecimalConstant() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/number/hexadecimalConstant.kt");
doTest(fileName);
}
@TestMetadata("intConversions.kt")
public void testIntConversions() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/number/intConversions.kt");
doTest(fileName);
}
@TestMetadata("intDivFloat.kt")
public void testIntDivFloat() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/number/intDivFloat.kt");
doTest(fileName);
}
@TestMetadata("kt2342.kt")
public void testKt2342() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/number/kt2342.kt");
doTest(fileName);
}
@TestMetadata("longArray.kt")
public void testLongArray() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/number/longArray.kt");
doTest(fileName);
}
@TestMetadata("longBinaryOperations.kt")
public void testLongBinaryOperations() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/number/longBinaryOperations.kt");
doTest(fileName);
}
@TestMetadata("longBitOperations.kt")
public void testLongBitOperations() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/number/longBitOperations.kt");
doTest(fileName);
}
@TestMetadata("longCompareToIntrinsic.kt")
public void testLongCompareToIntrinsic() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/number/longCompareToIntrinsic.kt");
doTest(fileName);
}
@TestMetadata("longEqualsIntrinsic.kt")
public void testLongEqualsIntrinsic() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/number/longEqualsIntrinsic.kt");
doTest(fileName);
}
@TestMetadata("longHashCode.kt")
public void testLongHashCode() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/number/longHashCode.kt");
doTest(fileName);
}
@TestMetadata("longUnaryOperations.kt")
public void testLongUnaryOperations() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/number/longUnaryOperations.kt");
doTest(fileName);
}
@TestMetadata("numberCompareTo.kt")
public void testNumberCompareTo() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/number/numberCompareTo.kt");
doTest(fileName);
}
@TestMetadata("numberConversions.kt")
public void testNumberConversions() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/number/numberConversions.kt");
doTest(fileName);
}
@TestMetadata("numberIncDec.kt")
public void testNumberIncDec() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/number/numberIncDec.kt");
doTest(fileName);
}
@TestMetadata("numberIsCheck.kt")
public void testNumberIsCheck() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/number/numberIsCheck.kt");
doTest(fileName);
}
}
@TestMetadata("js/js.translator/testData/box/operatorOverloading")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -1,65 +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.MultipleFilesTranslationTest;
public class MultiPackageTest extends MultipleFilesTranslationTest {
public MultiPackageTest() {
super("multiPackage/");
}
public void testFunctionsVisibleFromOtherPackage() throws Exception {
checkFooBoxIsTrue("functionsVisibleFromOtherPackage");
}
//TODO: fails on centos-1 build agent, can't reproduce
public void TODO_testClassesInheritedFromOtherPackage() throws Exception {
checkFooBoxIsTrue("classesInheritedFromOtherPackage");
}
public void testPackageVariableVisibleFromOtherPackage() throws Exception {
checkFooBoxIsTrue("packageVariableVisibleFromOtherPackage");
}
public void testReflectionFromOtherPackage() throws Exception {
checkFooBoxIsTrue("reflectionFromOtherPackage");
}
public void testNestedPackageFunctionCalledFromOtherPackage() throws Exception {
runMultiFileTest("nestedPackageFunctionCalledFromOtherPackage", "a.foo", TEST_FUNCTION, true);
}
public void testSubpackagesWithClashingNames() throws Exception {
runMultiFileTest("subpackagesWithClashingNames", "a.foo", TEST_FUNCTION, true);
}
public void testSubpackagesWithClashingNamesUsingImport() throws Exception {
runMultiFileTest("subpackagesWithClashingNamesUsingImport", "a.foo", TEST_FUNCTION, true);
}
public void testCreateClassFromOtherPackage() throws Exception {
runMultiFileTest("createClassFromOtherPackage", "a.foo", TEST_FUNCTION, true);
}
public void testCreateClassFromOtherPackageUsingImport() throws Exception {
runMultiFileTest("createClassFromOtherPackageUsingImport", "a.foo", TEST_FUNCTION, true);
}
}
@@ -1,47 +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 NameClashesTest extends SingleFileTranslationTest {
public NameClashesTest() {
super("nameClashes/");
}
public void testMethodOverload() throws Exception {
fooBoxTest();
}
public void testOverloadExtension() throws Exception {
checkFooBoxIsOk();
}
public void testDifferenceInCapitalization() throws Exception {
checkFooBoxIsOk();
}
public void testMethodOverloadInClassWithTwoUpperBounds() throws Exception {
checkFooBoxIsOk();
}
public void testExtensionFunctionAndProperty() throws Exception {
checkFooBoxIsOk();
}
}
@@ -1,158 +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.common.collect.Lists;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.js.JavaScript;
import org.jetbrains.kotlin.js.config.EcmaVersion;
import org.jetbrains.kotlin.js.test.SingleFileTranslationTest;
import java.io.File;
import java.util.List;
public final class NativeInteropTest extends SingleFileTranslationTest {
@NotNull
private static final String NATIVE = "native/";
public NativeInteropTest() {
super(NATIVE);
}
@NotNull
@Override
protected List<String> additionalJsFiles(@NotNull EcmaVersion ecmaVersion) {
List<String> result = Lists.newArrayList(super.additionalJsFiles(ecmaVersion));
String jsFilePath = pathToTestDir() + NATIVE + "/" + getTestName(true) + JavaScript.DOT_EXTENSION;
File jsFile = new File(jsFilePath);
if (jsFile.exists() && jsFile.isFile()) {
result.add(jsFilePath);
}
return result;
}
public void testSimple() throws Exception {
fooBoxTest();
}
public void testInheritanceFromNativeClass() throws Exception {
checkFooBoxIsOk();
}
public void testInheritanceFromNativeTrait() throws Exception {
checkFooBoxIsOk();
}
public void testClass() throws Exception {
fooBoxTest();
}
public void testVararg() throws Exception {
checkFooBoxIsOk();
}
public void testKt1519() throws Exception {
fooBoxTest();
}
public void testClassObject() throws Exception {
fooBoxTest();
}
public void testSimpleUndefined() throws Exception {
fooBoxTest();
}
public void testLibrary() throws Exception {
fooBoxTest();
}
public void testKt2209() throws Exception {
fooBoxTest();
}
public void testKt2323() throws Exception {
fooBoxTest();
}
public void testNativePropertyWithCustomName() throws Exception {
checkFooBoxIsOk();
}
public void testNativeExtensionLikeMember() throws Exception {
checkFooBoxIsOk();
}
public void testPassExtLambdaToNative() throws Exception {
checkFooBoxIsOk();
}
public void testPassMemberOrExtToNative() throws Exception {
checkFooBoxIsOk();
}
public void testPassExtLambdaFromNative() throws Exception {
checkFooBoxIsOk();
}
public void testPassMemberOrExtFromNative() throws Exception {
checkFooBoxIsOk();
}
public void testPassTopLevelOrLocalFunctionToNative() throws Exception {
checkFooBoxIsOk();
}
public void testPassTopLevelFunctionFromNative() throws Exception {
checkFooBoxIsOk();
}
public void testNestedElements() throws Exception {
checkFooBoxIsOk();
}
public void testPrint() throws Exception {
checkFooBoxIsOk();
}
public void testNativeInvoke() throws Exception {
checkFooBoxIsOk();
}
public void testNativeGetterAndNativeSetter() throws Exception {
checkFooBoxIsOk();
}
public void testEval() throws Exception {
checkFooBoxIsOk();
}
public void testUndefined() throws Exception {
checkFooBoxIsOk();
}
public void testTypeof() throws Exception {
checkFooBoxIsOk();
}
public void testSecondaryConstructor() throws Exception {
checkFooBoxIsOk();
}
}
@@ -1,114 +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.google.common.collect.Lists;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.js.JavaScript;
import org.jetbrains.kotlin.js.config.EcmaVersion;
import org.jetbrains.kotlin.js.test.SingleFileTranslationTest;
import java.io.File;
import java.util.List;
public class NestedTypesTest extends SingleFileTranslationTest {
public NestedTypesTest() {
super("nestedTypes/");
}
public void testNested() throws Exception {
checkFooBoxIsOk();
}
public void testNestedInInterface() throws Exception {
checkFooBoxIsOk();
}
public void testInner() throws Exception {
checkFooBoxIsOk();
}
public void testOuterThis() throws Exception {
checkFooBoxIsOk();
}
public void testOuterCompanion() throws Exception {
checkFooBoxIsOk();
}
public void testOuterObject() throws Exception {
checkFooBoxIsOk();
}
public void testNestedNative() throws Exception {
checkFooBoxIsOk();
}
public void testOuterNative() throws Exception {
checkFooBoxIsOk();
}
public void testInnerReferenceFromChild() throws Exception {
checkFooBoxIsOk();
}
public void testInheritanceFromNestedBuiltIn() throws Exception {
checkFooBoxIsOk();
}
public void testInnerObjectRefFromConstructor() throws Exception {
checkFooBoxIsOk();
}
public void testNestedObjectLazyInitialized() throws Exception {
checkFooBoxIsOk();
}
public void testImplicitOuterThisFromLambda() throws Exception {
checkFooBoxIsOk();
}
public void testImplicitOuterThisFromLocalClass() throws Exception {
checkFooBoxIsOk();
}
public void testPrivateFieldNotOverridenInNestedSubclass() throws Exception {
checkFooBoxIsOk();
}
public void testOuterClassReferenceFromSecondaryConstructor() throws Exception {
checkFooBoxIsOk();
}
public void testReceivers() throws Exception {
checkFooBoxIsOk();
}
@NotNull
@Override
protected List<String> additionalJsFiles(@NotNull EcmaVersion ecmaVersion) {
List<String> result = Lists.newArrayList(super.additionalJsFiles(ecmaVersion));
String jsFilePath = pathToTestDir() + "native/" + getTestName(true) + JavaScript.DOT_EXTENSION;
File jsFile = new File(jsFilePath);
if (jsFile.exists() && jsFile.isFile()) {
result.add(jsFilePath);
}
return result;
}
}
@@ -1,107 +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 NumberTest extends SingleFileTranslationTest {
public NumberTest() {
super("number/");
}
public void testIntConversions() throws Exception {
fooBoxTest();
}
public void testDoubleConversions() throws Exception {
fooBoxTest();
}
public void testNumberConversions() throws Exception {
fooBoxTest();
}
public void testByteAndShortConversions() throws Exception {
fooBoxTest();
}
public void testDivision() throws Exception {
checkFooBoxIsOk();
}
// KT-2342 Type mismatch on Int division (JavaScript back-end)
public void testKt2342() throws Exception {
checkFooBoxIsOk();
}
// KT-5345 Type mismatch on Int / Float division
public void testIntDivFloat() throws Exception {
checkFooBoxIsOk();
}
public void testHexadecimalConstant() throws Exception {
fooBoxTest();
}
public void testNumberCompareTo() throws Exception {
checkFooBoxIsOk();
}
public void testNumberIsCheck() throws Exception {
checkFooBoxIsOk();
}
public void testNumberIncDec() throws Exception {
checkFooBoxIsOk();
}
public void testConversionsWithoutTruncation() throws Exception {
checkFooBoxIsOk();
}
public void testConversionsWithTruncation() throws Exception {
checkFooBoxIsOk();
}
public void testLongEqualsIntrinsic() throws Exception {
checkFooBoxIsOk();
}
public void testLongHashCode() throws Exception {
checkFooBoxIsOk();
}
public void testLongArray() throws Exception {
checkFooBoxIsOk();
}
public void testLongCompareToIntrinsic() throws Exception {
checkFooBoxIsOk();
}
public void testLongBinaryOperations() throws Exception {
checkFooBoxIsOk();
}
public void testLongUnaryOperations() throws Exception {
checkFooBoxIsOk();
}
public void testLongBitOperations() throws Exception {
checkFooBoxIsOk();
}
}
@@ -0,0 +1,30 @@
// FILE: a.kt
package foo
import bar.*
open class A() {
open fun f() = 3;
}
open class C() : B() {
override fun f() = 5
}
fun box(): String {
if (A().f() != 3) return "fail1"
if (B().f() != 4) return "fail2"
if (C().f() != 5) return "fail3"
return "OK"
}
// FILE: b.kt
package bar
import foo.A
open class B() : A() {
override fun f() = 4
}
@@ -0,0 +1,12 @@
// FILE: a.kt
package a.foo
fun box() = (b.foo.A().tadada(b.foo.A()))
// FILE: b.kt
package b.foo
class A() {
fun tadada(a: A) = "OK"
}
@@ -0,0 +1,14 @@
// FILE: a.kt
package a.foo
import b.foo.*
fun box() = (A().tadada(A()))
// FILE: b.kt
package b.foo
class A() {
fun tadada(a: A) = "OK"
}
@@ -0,0 +1,12 @@
// FILE: a.kt
package bar
fun f() = 3;
// FILE: b.kt
package foo
import bar.*
fun box() = if (f() == 3) "OK" else "fail"
@@ -0,0 +1,10 @@
// FILE: a.kt
package a.foo
fun box() = b.bar.f()
// FILE: b.kt
package b.bar
fun f() = "OK"
@@ -0,0 +1,12 @@
// FILE: a.kt
package foo
val a = 2
fun box() = if ((a + bar.a) == 5) "OK" else "fail"
// FILE: b.kt
package bar
val a = 3
@@ -1,10 +1,36 @@
// FILE: a.kt
package bar
fun topLevelFun(s: String) = "topLevelFun: ${s}";
var topLevelVar = 100
val topLevelVal = 200
class A(val v: String) {
fun memA(s: String) = "memA: ${v} ${s}"
var propVar: Int = 1000
val propVal: Int = 2000
var text: String = "text"
}
fun A.ext1(s: String): String = "A.ext1: ${this.v} ${s}"
var A.extProp: String
get() = "${this.text}"
set(value) {
this.text = value
}
// FILE: b.kt
package foo
import bar.*
fun A.ext2(s: String): String = "A.ext2: ${this.v} ${s}"
fun box(): Boolean {
fun box(): String {
assertEquals("topLevelFun: A", (::topLevelFun)("A"))
assertEquals("A.ext1: test B", (A::ext1)(A("test"), "B"))
@@ -25,5 +51,5 @@ fun box(): Boolean {
(A::extProp).set(a, "new text")
assertEquals("new text", (A::extProp).get(a))
return true
return "OK"
}
@@ -0,0 +1,10 @@
// FILE: a.kt
package a.foo
fun box() = if (b.foo.f() == 1) "OK" else "fail"
// FILE: b.kt
package b.foo
fun f() = 1
@@ -0,0 +1,12 @@
// FILE: a.kt
package a.foo
import b.foo.f
fun box() = if (f() == 1) "OK" else "fail"
// FILE: b.kt
package b.foo
fun f() = 1
@@ -0,0 +1,20 @@
package foo
class A() {
fun eval() = 3
fun eval(a: Int) = 4
fun eval(a: String) = 5
fun eval(a: String, b: Int) = 6
}
fun box(): String {
if (A().eval() != 3) return "fail1"
if (A().eval(2) != 4) return "fail2"
if (A().eval("3") != 5) return "fail3"
if (A().eval("a", 3) != 6) return "fail4"
return "OK"
}
@@ -7,19 +7,19 @@ class A(b: Int) {
}
fun box(): Boolean {
fun box(): String {
if (A(2).g() != 4) {
return false;
return "fail1"
}
if (A(3).m() != 2) {
return false;
return "fail2"
}
val a = A(100)
if (a.g() != 200) {
return false;
return "fail3"
}
if (a.m() != 99) {
return false;
return "fail4"
}
return true;
return "OK"
}
@@ -9,10 +9,10 @@ class A(val c: Int) {
}
}
fun box(): Boolean {
if (A.g != 3) return false
if (A.c != "hoooray") return false
if (A(2).c != 2) return false
fun box(): String {
if (A.g != 3) return "fail1"
if (A.c != "hoooray") return "fail2"
if (A(2).c != 2) return "fail3"
return true
return "OK"
}
@@ -14,6 +14,6 @@ fun Wow.dblSum(): Int {
}
fun box(): Boolean {
return (Wow().dblSum() == 6)
fun box(): String {
return if (Wow().dblSum() == 6) "OK" else "fail"
}
@@ -18,7 +18,7 @@ interface LastError {
@native
val chrome: Chrome = noImpl
fun box(): Boolean {
fun box(): String {
val lastError = chrome.extension.lastError?.message
return lastError == null
return if (lastError == null) "OK" else "fail"
}
@@ -7,7 +7,7 @@ val classes: Map<String, Any> = noImpl
@native
val classesMutable: HashMap<String, String> = noImpl
fun box(): Boolean {
fun box(): String {
classesMutable.set("why", "?")
return classes.get("answer") == 42 && classesMutable.get("why") == "?"
return if (classes.get("answer") == 42 && classesMutable.get("why") == "?") "OK" else "fail"
}
@@ -9,9 +9,9 @@ package foo
@library fun getResult() = false
fun box(): Boolean {
fun box(): String {
val a = A()
a.f()
a.f(2)
return getResult()
return if (getResult()) "OK" else "fail"
}
@@ -3,4 +3,4 @@ package foo
@native
fun returnFalse(): Boolean = noImpl
fun box() = !returnFalse()
fun box() = if (!returnFalse()) "OK" else "fail"
@@ -0,0 +1,9 @@
package foo
@native
val c: Any? = noImpl
fun box(): String {
if (c != null) return "fail1"
return if (c == null) "OK" else "fail2"
}
@@ -38,4 +38,8 @@ fun testByteConversions(c: Byte): Boolean {
return true
}
fun box() = testShortConversions(3) && testByteConversions(3)
fun box(): String {
if (!testShortConversions(3)) return "fail: testShortConversions"
if (!testByteConversions(3)) return "fail: testByteConversions"
return "OK"
}
@@ -1,44 +1,44 @@
package foo
fun box(): Any? {
fun box(): String {
if (3 / 4 != 0) {
return "1"
return "fail11"
}
if (-5 / 4 != -1) {
return -5 / 4
return "fail2"
}
if ((3.0 / 4.0 - 0.75) > 0.01) {
return "3"
return "fail3"
}
if ((-10.0 / 4.0 + 2.5) > 0.01) {
return "4"
return "fail44"
}
val i1: Int = 5
val i2: Int = 2
if (i1 / i2 != 2) {
return "5"
return "fail55"
}
val i3: Short = 5
val i4: Short = 2
if (i3 / i4 != 2) {
return "6"
return "fail6"
}
val i5: Byte = 5
val i6: Byte = 2
if (i5 / i6 != 2) {
return "7"
return "fail7"
}
val f1: Double = 5.0
val f2: Double = 2.0
if ((f1 / f2 - 2.5) > 0.01) {
return "8"
return "fail8"
}
val f3: Float = 5.0.toFloat()
val f4: Float = 2.0.toFloat()
if ((f3 / f4 - 2.5.toFloat()) > 0.01) {
return "9"
return "fail9"
}
return "OK"
}
@@ -1,72 +1,73 @@
package foo
fun box(): Boolean {
fun box(): String {
val c: Double = 3.6
if (c.toDouble() != 3.6) {
return false
return "fail1"
}
if (c.toFloat() != 3.6.toFloat()) {
return false
return "fail2"
}
if (c.toByte() != 3.toByte()) {
return false
return "fail3"
}
if (c.toInt() != 3) {
return false
return "fail4"
}
if (c.toShort() != 3.toShort()) {
return false
return "fail5"
}
val cn: Double = -3.6
if (cn.toDouble() != -3.6) {
return false
return "fail6"
}
if (cn.toFloat() != -3.6.toFloat()) {
return false
return "fail7"
}
if (cn.toByte() != (-3).toByte()) {
return false
return "fail8"
}
if (cn.toInt() != -3) {
return false
return "fail9"
}
if (cn.toShort() != (-3).toShort()) {
return false
return "fail10"
}
val f: Float = 3.6.toFloat()
if (f.toDouble() != 3.6) {
return false
return "fail11"
}
if (f.toFloat() != 3.6.toFloat()) {
return false
return "fail12"
}
if (f.toByte() != 3.toByte()) {
return false
return "fail13"
}
if (f.toInt() != 3) {
return false
return "fail14"
}
if (f.toShort() != 3.toShort()) {
return false
return "fail15"
}
val fn: Float = -3.6.toFloat()
if (fn.toDouble() != -3.6) {
return false
return "fail16"
}
if (fn.toFloat() != -3.6.toFloat()) {
return false
return "fail17"
}
if (fn.toByte() != (-3).toByte()) {
return false
return "fail18"
}
if (fn.toInt() != -3) {
return false
return "fail19"
}
if (fn.toShort() != (-3).toShort()) {
return false
return "fail20"
}
return true
return "OK"
}
@@ -1,6 +1,6 @@
package foo
fun box(): Boolean {
fun box(): String {
val i = 0x80000000 + 0x8000000
return true
return "OK"
}
@@ -1,28 +1,28 @@
package foo
fun box(): Boolean {
fun box(): String {
val c: Int = 3
if (c.toDouble() != 3.0) {
return false
return "fail1"
}
if (c.toFloat() != 3.toFloat()) {
return false
return "fail2"
}
if (c.toByte() != 3.toByte()) {
return false
return "fail3"
}
if (c.toInt() != 3) {
return false
return "fail4"
}
if (c.toShort() != 3.toShort()) {
return false
return "fail5"
}
val c2: Int = -5
if (c2.toShort() != (-5).toShort()) {
return false
return "fail6"
}
if (c2.toFloat() != -5.toFloat()) {
return false
return "fail7"
}
return true
return "OK"
}

Some files were not shown because too many files have changed in this diff Show More