JS: move expressions test to box tests

This commit is contained in:
Alexey Andreev
2016-08-26 19:32:17 +03:00
parent 2bf0199959
commit b159049be8
314 changed files with 2380 additions and 2185 deletions
@@ -1145,10 +1145,6 @@ fun main(args: Array<String>) {
model("reservedWords/cases")
}
testClass<AbstractDynamicTest>() {
model("dynamic/cases")
}
testClass<AbstractMultiModuleTest>() {
model("multiModule/cases")
}
@@ -1185,10 +1181,6 @@ fun main(args: Array<String>) {
model("rtti/cases")
}
testClass<AbstractCastTest>() {
model("expression/cast/cases")
}
testClass<AbstractLightReflectionTest>() {
model("reflection/light/cases")
}
File diff suppressed because it is too large Load Diff
@@ -1,199 +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/expression/cast/cases")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public class CastTestGenerated extends AbstractCastTest {
public void testAllFilesPresentInCases() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/expression/cast/cases"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("castExtensionToKMutableProperty.kt")
public void testCastExtensionToKMutableProperty() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/expression/cast/cases/castExtensionToKMutableProperty.kt");
doTest(fileName);
}
@TestMetadata("castExtensionToKProperty1.kt")
public void testCastExtensionToKProperty1() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/expression/cast/cases/castExtensionToKProperty1.kt");
doTest(fileName);
}
@TestMetadata("castToAny.kt")
public void testCastToAny() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/expression/cast/cases/castToAny.kt");
doTest(fileName);
}
@TestMetadata("castToArray.kt")
public void testCastToArray() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/expression/cast/cases/castToArray.kt");
doTest(fileName);
}
@TestMetadata("castToFunction.kt")
public void testCastToFunction() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/expression/cast/cases/castToFunction.kt");
doTest(fileName);
}
@TestMetadata("castToGenericType.kt")
public void testCastToGenericType() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/expression/cast/cases/castToGenericType.kt");
doTest(fileName);
}
@TestMetadata("castToGenericTypeWithMultipleUpperBounds.kt")
public void testCastToGenericTypeWithMultipleUpperBounds() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/expression/cast/cases/castToGenericTypeWithMultipleUpperBounds.kt");
doTest(fileName);
}
@TestMetadata("castToGenericTypeWithUpperBound.kt")
public void testCastToGenericTypeWithUpperBound() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/expression/cast/cases/castToGenericTypeWithUpperBound.kt");
doTest(fileName);
}
@TestMetadata("castToKMutableProperty0.kt")
public void testCastToKMutableProperty0() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/expression/cast/cases/castToKMutableProperty0.kt");
doTest(fileName);
}
@TestMetadata("castToKMutableProperty1.kt")
public void testCastToKMutableProperty1() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/expression/cast/cases/castToKMutableProperty1.kt");
doTest(fileName);
}
@TestMetadata("castToKProperty0.kt")
public void testCastToKProperty0() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/expression/cast/cases/castToKProperty0.kt");
doTest(fileName);
}
@TestMetadata("castToKProperty1.kt")
public void testCastToKProperty1() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/expression/cast/cases/castToKProperty1.kt");
doTest(fileName);
}
@TestMetadata("castToNotNull.kt")
public void testCastToNotNull() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/expression/cast/cases/castToNotNull.kt");
doTest(fileName);
}
@TestMetadata("castToNullable.kt")
public void testCastToNullable() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/expression/cast/cases/castToNullable.kt");
doTest(fileName);
}
@TestMetadata("implicitCastToLong.kt")
public void testImplicitCastToLong() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/expression/cast/cases/implicitCastToLong.kt");
doTest(fileName);
}
@TestMetadata("noRuntimeTypeCheck.kt")
public void testNoRuntimeTypeCheck() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/expression/cast/cases/noRuntimeTypeCheck.kt");
doTest(fileName);
}
@TestMetadata("primitiveToClass.kt")
public void testPrimitiveToClass() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/expression/cast/cases/primitiveToClass.kt");
doTest(fileName);
}
@TestMetadata("reifiedToNotNull.kt")
public void testReifiedToNotNull() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/expression/cast/cases/reifiedToNotNull.kt");
doTest(fileName);
}
@TestMetadata("reifiedToNullable1.kt")
public void testReifiedToNullable1() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/expression/cast/cases/reifiedToNullable1.kt");
doTest(fileName);
}
@TestMetadata("reifiedToNullable2.kt")
public void testReifiedToNullable2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/expression/cast/cases/reifiedToNullable2.kt");
doTest(fileName);
}
@TestMetadata("safeCastToGenericTypeWithUpperBound.kt")
public void testSafeCastToGenericTypeWithUpperBound() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/expression/cast/cases/safeCastToGenericTypeWithUpperBound.kt");
doTest(fileName);
}
@TestMetadata("safeCastToNotNull.kt")
public void testSafeCastToNotNull() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/expression/cast/cases/safeCastToNotNull.kt");
doTest(fileName);
}
@TestMetadata("safeCastToNullable.kt")
public void testSafeCastToNullable() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/expression/cast/cases/safeCastToNullable.kt");
doTest(fileName);
}
@TestMetadata("safeCastToReifiedNotNull.kt")
public void testSafeCastToReifiedNotNull() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/expression/cast/cases/safeCastToReifiedNotNull.kt");
doTest(fileName);
}
@TestMetadata("safeCastToReifiedNullable.kt")
public void testSafeCastToReifiedNullable() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/expression/cast/cases/safeCastToReifiedNullable.kt");
doTest(fileName);
}
@TestMetadata("smartCastInExtensionFunction.kt")
public void testSmartCastInExtensionFunction() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/expression/cast/cases/smartCastInExtensionFunction.kt");
doTest(fileName);
}
@TestMetadata("smartCastInFunction.kt")
public void testSmartCastInFunction() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/expression/cast/cases/smartCastInFunction.kt");
doTest(fileName);
}
}
@@ -1,28 +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;
public final class CompareToTest extends AbstractExpressionTest {
public CompareToTest() {
super("compareTo/");
}
public void testCustomCompareToMethod() throws Exception {
checkFooBoxIsOk();
}
}
@@ -1,28 +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;
public final class DollarParameterTest extends AbstractExpressionTest {
public DollarParameterTest() {
super("dollarParameter/");
}
public void testDollarParameter() throws Exception {
checkFooBoxIsOk();
}
}
@@ -1,157 +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/dynamic/cases")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public class DynamicTestGenerated extends AbstractDynamicTest {
public void testAllFilesPresentInCases() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/dynamic/cases"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("binaryOperations.kt")
public void testBinaryOperations() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/dynamic/cases/binaryOperations.kt");
doTest(fileName);
}
@TestMetadata("callGetMethod.kt")
public void testCallGetMethod() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/dynamic/cases/callGetMethod.kt");
doTest(fileName);
}
@TestMetadata("callMethods.kt")
public void testCallMethods() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/dynamic/cases/callMethods.kt");
doTest(fileName);
}
@TestMetadata("callSetMethod.kt")
public void testCallSetMethod() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/dynamic/cases/callSetMethod.kt");
doTest(fileName);
}
@TestMetadata("compareTo.kt")
public void testCompareTo() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/dynamic/cases/compareTo.kt");
doTest(fileName);
}
@TestMetadata("equals.kt")
public void testEquals() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/dynamic/cases/equals.kt");
doTest(fileName);
}
@TestMetadata("getByBrackets.kt")
public void testGetByBrackets() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/dynamic/cases/getByBrackets.kt");
doTest(fileName);
}
@TestMetadata("identityEquals.kt")
public void testIdentityEquals() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/dynamic/cases/identityEquals.kt");
doTest(fileName);
}
@TestMetadata("in.kt")
public void testIn() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/dynamic/cases/in.kt");
doTest(fileName);
}
@TestMetadata("incrementAndDecrement.kt")
public void testIncrementAndDecrement() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/dynamic/cases/incrementAndDecrement.kt");
doTest(fileName);
}
@TestMetadata("infixCall.kt")
public void testInfixCall() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/dynamic/cases/infixCall.kt");
doTest(fileName);
}
@TestMetadata("invoke.kt")
public void testInvoke() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/dynamic/cases/invoke.kt");
doTest(fileName);
}
@TestMetadata("is.kt")
public void testIs() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/dynamic/cases/is.kt");
doTest(fileName);
}
@TestMetadata("isJsPrimitiveType.kt")
public void testIsJsPrimitiveType() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/dynamic/cases/isJsPrimitiveType.kt");
doTest(fileName);
}
@TestMetadata("iterator.kt")
public void testIterator() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/dynamic/cases/iterator.kt");
doTest(fileName);
}
@TestMetadata("nameClashing.kt")
public void testNameClashing() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/dynamic/cases/nameClashing.kt");
doTest(fileName);
}
@TestMetadata("operationsWithAssignment.kt")
public void testOperationsWithAssignment() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/dynamic/cases/operationsWithAssignment.kt");
doTest(fileName);
}
@TestMetadata("propertyAccess.kt")
public void testPropertyAccess() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/dynamic/cases/propertyAccess.kt");
doTest(fileName);
}
@TestMetadata("setByBrackets.kt")
public void testSetByBrackets() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/dynamic/cases/setByBrackets.kt");
doTest(fileName);
}
@TestMetadata("unaryOperations.kt")
public void testUnaryOperations() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/dynamic/cases/unaryOperations.kt");
doTest(fileName);
}
}
@@ -1,76 +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;
public final class EqualsTest extends AbstractExpressionTest {
public EqualsTest() {
super("equals/");
}
public void testCustomEqualsMethodOnAny() throws Exception {
fooBoxTest();
}
public void testCustomEqualsMethod() throws Exception {
fooBoxTest();
}
public void testExplicitEqualsMethod() throws Exception {
fooBoxTest();
}
public void testExplicitEqualsMethodForPrimitives() throws Exception {
fooBoxTest();
}
public void testStringsEqual() throws Exception {
fooBoxTest();
}
public void testKt2370() throws Exception {
fooBoxTest();
}
public void testEqualsNullOrUndefined() throws Exception {
checkFooBoxIsOk();
}
public void testCompareNullableListWithNull() throws Exception {
checkFooBoxIsOk();
}
public void testCompareToNullWithCustomEquals() throws Exception {
checkFooBoxIsOk();
}
public void testCompareNullablesWithCustomEquals() throws Exception {
checkFooBoxIsOk();
}
public void testEqualsBehaviorOnNull() throws Exception {
checkFooBoxIsOk();
}
public void testSuperEquals() throws Exception {
checkFooBoxIsOk();
}
public void testArrays() throws Exception {
checkFooBoxIsOk();
}
}
@@ -1,143 +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;
public class EvaluationOrderTest extends AbstractExpressionTest {
public EvaluationOrderTest() {
super("evaluationOrder/");
}
public void test2dangerousInExpression() throws Exception {
fooBoxTest();
}
public void testAndAndWithSideEffect() throws Exception {
checkFooBoxIsOk();
}
public void testOrOrWithSideEffect() throws Exception {
checkFooBoxIsOk();
}
public void testAssignToDotQualifiedWithSideEffect() throws Exception {
checkFooBoxIsOk();
}
public void testAssignToArrayElementWithSideEffect() throws Exception {
checkFooBoxIsOk();
}
public void testCallArgs() throws Exception {
checkFooBoxIsOk();
}
public void testCallVarargs() throws Exception {
checkFooBoxIsOk();
}
public void testCompareToIntrinsicWithSideEffect() throws Exception {
checkFooBoxIsOk();
}
public void testDangerousInsideDangerous() throws Exception {
fooBoxTest();
}
public void testDangerousInline() throws Exception {
fooBoxTest();
}
public void testElvisComplex() throws Exception {
checkFooBoxIsOk();
}
public void testEvaluationOrder1() throws Exception {
fooBoxTest();
}
public void testEqualsIntrinsicWithSideEffect() throws Exception {
checkFooBoxIsOk();
}
public void testEvaluationOrder2() throws Exception {
checkFooBoxIsOk();
}
public void testIfAsFunArgument() throws Exception {
fooBoxTest();
}
public void testIfAsPlusArgument() throws Exception {
fooBoxTest();
}
public void testIfWithComplex() throws Exception {
checkFooBoxIsOk();
}
public void testIntrinsicComplex() throws Exception {
checkFooBoxIsOk();
}
public void testWhenAsMinusArgument() throws Exception {
fooBoxTest();
}
public void testWhenWithComplexConditions() throws Exception {
checkFooBoxIsOk();
}
public void testElvisWithBreakContinueReturn() throws Exception {
checkFooBoxIsOk();
}
public void testAndAndWithBreakContinueReturn() throws Exception {
checkFooBoxIsOk();
}
public void testOrOrWithBreakContinueReturn() throws Exception {
checkFooBoxIsOk();
}
public void testWhenJsLiteralWithSideEffect() throws Exception {
checkFooBoxIsOk();
}
public void testLiteralFunctionAsArgumentWithSideEffect() throws Exception {
checkFooBoxIsOk();
}
public void testIntrinsicWithBreakContinueReturn() throws Exception {
checkFooBoxIsOk();
}
public void testCallWithBreakContinueReturn() throws Exception {
checkFooBoxIsOk();
}
public void testLoopWithBreakContinueReturnInCondition() throws Exception {
checkFooBoxIsOk();
}
public void testCastWithBreakContinueReturn() throws Exception {
checkFooBoxIsOk();
}
public void testReassignmentLhsCaching() throws Exception {
checkFooBoxIsOk();
}
}
@@ -1,68 +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;
public final class ForeachTest extends AbstractExpressionTest {
public ForeachTest() {
super("for/");
}
public void testForIteratesOverArray() throws Exception {
fooBoxTest();
}
public void testForOnEmptyArray() throws Exception {
fooBoxTest();
}
public void testLabeledFor() throws Exception {
fooBoxTest();
}
public void testLabeledForWithContinue() throws Exception {
checkFooBoxIsOk();
}
public void testForWithComplexOneStatement() throws Exception {
checkFooBoxIsOk();
}
public void testForIteratesOverLiteralRange() throws Exception {
checkFooBoxIsOk();
}
public void testForIteratesOverNonLiteralRange() throws Exception {
checkFooBoxIsOk();
}
public void testForIteratesOverSomethingWithIterator() throws Exception {
checkFooBoxIsOk();
}
public void testLabeledForWithWhile() throws Exception {
checkFooBoxIsOk();
}
public void testForWithEmptyBody() throws Exception {
checkFooBoxIsOk();
}
public void testForWithSideEffectImElementAccessAndWithEmptyBody() throws Exception {
checkFooBoxIsOk();
}
}
@@ -1,157 +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;
public class FunctionTest extends AbstractExpressionTest {
public FunctionTest() {
super("function/");
}
public void testFunctionUsedBeforeDeclaration() throws Exception {
fooBoxTest();
}
public void testFunctionWithTwoParametersCall() throws Exception {
fooBoxTest();
}
public void testWhenFunction() throws Exception {
checkFooBoxIsOk();
}
public void testFunctionLiteral() throws Exception {
fooBoxTest();
}
public void testAdderClosure() throws Exception {
fooBoxTest();
}
public void testLoopClosure() throws Exception {
fooBoxTest();
}
public void testFunctionLiteralAsParameter() throws Exception {
fooBoxTest();
}
public void testClosureWithParameter() throws Exception {
checkFooBoxIsOk();
}
public void testClosureWithParameterAndBoxing() throws Exception {
checkFooBoxIsOk();
}
public void testEnclosingThis() throws Exception {
checkFooBoxIsOk();
}
public void testImplicitItParameter() throws Exception {
fooBoxTest();
}
public void testDefaultParameters() throws Exception {
fooBoxTest();
}
public void testFunctionLiteralAsLastParameter() throws Exception {
fooBoxTest();
}
public void testNamedArguments() throws Exception {
fooBoxTest();
}
public void testFunctionExpression() throws Exception {
checkFooBoxIsOk();
}
public void testExpressionAsFunction() throws Exception {
fooBoxTest();
}
public void testExpressionAsExtFunction() throws Exception {
checkFooBoxIsOk();
}
public void testVararg() throws Exception {
checkFooBoxIsOk();
}
public void testKT921() throws Exception {
checkOutput("KT-921.kt", "1, end\n" +
"1, 2, end\n" +
"1, 2, 3, end\n" +
"2, 3, end\n" +
"!\n" +
"3, end\n" +
"!\n" +
"end\n" +
"!");
}
public void testFunctionInsideFunction() throws Exception {
fooBoxTest();
}
public void testCallFunInInit() throws Exception {
fooBoxTest();
}
public void testMangling() throws Exception {
checkFooBoxIsOk();
}
public void testManglingStability() throws Exception {
checkFooBoxIsOk();
}
public void testOverloadingWithInheritance() throws Exception {
checkFooBoxIsOk();
}
public void testOverloadOverridenFun() throws Exception {
checkFooBoxIsOk();
}
public void testOverloadClassConstructorByFactoryMethod() throws Exception {
checkFooBoxIsOk();
}
public void testManglingAnyMethods() throws Exception {
checkFooBoxIsOk();
}
public void testManglingClashWithFunctionsWithoutParameters() throws Exception {
checkFooBoxIsOk();
}
public void testLocalExtFunction() throws Exception {
checkFooBoxIsOk();
}
public void testLambdaOrLocalFunInsideEnumMethod() throws Exception {
checkFooBoxIsOk();
}
public void testManglingClashFunctionsAndClasses() throws Exception {
checkFooBoxIsOk();
}
}
@@ -1,32 +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;
public final class IdentifierClashTest extends AbstractExpressionTest {
public IdentifierClashTest() {
super("identifierClash/");
}
public void testUseVariableOfNameOfFunction() throws Exception {
fooBoxTest();
}
public void testOverloadedFun() throws Exception {
fooBoxTest();
}
}
@@ -1,31 +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;
public class IdentityEqualsTest extends AbstractExpressionTest {
public IdentityEqualsTest() {
super("identityEquals/");
}
public void testIdentityEqualsMethod() throws Exception {
checkFooBoxIsOk();
}
public void testIdentityEqualsMethodForPrimitives() throws Exception {
checkFooBoxIsOk();
}
}
@@ -1,48 +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.mozilla.javascript.JavaScriptException;
public class IfExpressionTest extends AbstractExpressionTest {
public IfExpressionTest() {
super("if/");
}
public void testIfElseAsExpressionWithThrow() throws Exception {
try {
fooBoxTest();
fail();
}
catch (JavaScriptException e) {
// Ignored
}
}
public void testIfInsideLambda() throws Exception {
checkFooBoxIsOk();
}
public void testNestedIf() throws Exception {
checkFooBoxIsOk();
}
public void testWithEmptyBlocks() throws Exception {
checkFooBoxIsOk();
}
}
@@ -1,68 +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;
public final class InvokeConventionTest extends AbstractExpressionTest {
public InvokeConventionTest() {
super("invoke/");
}
public void testInvokeMethod() throws Exception {
checkFooBoxIsOk();
}
public void testExplicitInvokeLambda() throws Exception {
checkFooBoxIsOk();
}
public void testInvokeOnExprByConvention() throws Exception {
checkFooBoxIsOk();
}
public void testInvokeInExtensionFunctionLiteral() throws Exception {
fooBoxTest();
}
public void testInvokeInFunctionLiteral() throws Exception {
fooBoxTest();
}
public void testInvokeWithExtensionReceiver() throws Exception {
fooBoxTest();
}
public void testInvokeWithDispatchReceiver() throws Exception {
fooBoxTest();
}
public void testInvokeWithDispatchAndExtensionReceivers() throws Exception {
fooBoxTest();
}
public void testInheritFromFunctionTraits() throws Exception {
checkFooBoxIsOk();
}
public void testInvokeWithImplicitDispatchReceiverAndExtensionReceiver() throws Exception {
checkFooBoxIsOk();
}
public void testExtensionInvoke() throws Exception {
checkFooBoxIsOk();
}
}
@@ -1,204 +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.translate.context.Namer;
import org.mozilla.javascript.JavaScriptException;
/**
* A messy class where all new tests go before they are sorted which never happens.
*/
public final class MiscTest extends AbstractExpressionTest {
public MiscTest() {
super("misc/");
}
public void testLocalProperty() throws Exception {
checkFooBoxIsOk();
}
public void testIntRange() throws Exception {
fooBoxTest();
}
public void testSafeCallComputesExpressionOnlyOnce() throws Exception {
fooBoxTest();
}
public void testClassWithoutPackage() throws Exception {
runFunctionOutputTest("classWithoutPackage.kt", Namer.getRootPackageName(), TEST_FUNCTION, true);
}
public void testKt1052_2() throws Exception {
checkFooBoxIsTrue("KT-1052-2.kt");
}
public void testKt2314() throws Exception {
checkFooBoxIsTrue("KT-2314.kt");
}
public void testKt1052() throws Exception {
checkOutput("KT-1052.kt", "true\n");
}
public void testKt9443() throws Exception {
checkFooBoxIsOk("kt9443.kt");
}
public void testKt740_1() throws Exception {
checkFooBoxIsTrue("KT-740.kt");
}
public void testKt740_2() throws Exception {
checkFooBoxIsOk("KT-740-2.kt");
}
public void testKt1361_1() throws Exception {
checkFooBoxIsTrue("KT-1361-1.kt");
}
public void testKt1361_2() throws Exception {
checkFooBoxIsTrue("KT-1361-2.kt");
}
public void testKt817() throws Exception {
checkFooBoxIsTrue("KT-817.kt");
}
public void testKt740_3() throws Exception {
checkFooBoxIsOk("KT-740-3.kt");
}
public void testFunInConstructor() throws Exception {
fooBoxTest();
}
public void testFunInConstructorBlock() throws Exception {
fooBoxTest();
}
public void testPropertyAsFunCalledOnConstructor() throws Exception {
fooBoxTest();
}
public void testPackagePropertyCalledAsFun() throws Exception {
fooBoxTest();
}
public void testExtensionLiteralCreatedAtPackageLevel() throws Exception {
fooBoxTest();
}
public void testTemporaryVariableCreatedInPackageInitializer() throws Exception {
fooBoxTest();
}
public void testWhenReturnedWithoutBlock() throws Exception {
fooBoxTest();
}
public void testElvis() throws Exception {
fooBoxTest();
}
public void testElvisReturnSimple() throws Exception {
checkFooBoxIsOk();
}
public void testElvisReturnNested() throws Exception {
checkFooBoxIsOk();
}
public void testElvisWithThrow() throws Exception {
checkFooBoxIsOk();
}
public void testExtensionLiteralCalledInsideExtensionFunction() throws Exception {
fooBoxTest();
}
public void testKt1865() throws Exception {
checkFooBoxIsTrue("KT-1865.kt");
}
public void testMainFunInNestedPackage() throws Exception {
checkOutput("mainFunInNestedPackage.kt", "ayee");
}
public void testPropertiesWithExplicitlyDefinedAccessorsWithoutBodies() throws Exception {
fooBoxTest();
}
public void testExclExcl() throws Exception {
fooBoxTest();
}
public void testExclExclResultIsComputedOnce() throws Exception {
fooBoxTest();
}
public void testPackageLevelVarInPackage() throws Exception {
checkFooBoxIsOk();
}
public void testPackageLevelVarInRoot() throws Exception {
runFunctionOutputTest("packageLevelVarInRoot.kt", Namer.getRootPackageName(), TEST_FUNCTION, "OK");
}
public void testLazyPropertyGetterNotCalledOnStart() throws Exception {
checkOutput("lazyProperty.kt", "Hello, world! Gotcha 3");
}
public void testLocalVarAsFunction() throws Exception {
checkFooBoxIsOk();
}
public void testExclExclThrows() throws Exception {
try {
fooBoxTest();
fail();
}
catch (JavaScriptException e) {
// ignore
}
}
public void testInheritFromJetIterator() throws Exception {
fooBoxTest();
}
public void testStringInterpolationEvaluationOrder() throws Exception {
fooBoxTest();
}
public void testKt5058() throws Exception {
checkFooBoxIsTrue("KT-5058.kt");
}
public void testRightAssocForGeneratedConditionalOperator() throws Exception {
checkFooBoxIsOk();
}
public void testToGeneratorInStdlib() throws Exception {
checkFooBoxIsOk();
}
public void testThrowThrow() throws Exception {
checkFooBoxIsOk();
}
}
@@ -1,32 +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;
public final class StringTemplatesTest extends AbstractExpressionTest {
public StringTemplatesTest() {
super("stringTemplates/");
}
public void testObjectWithToString() throws Exception {
checkFooBoxIsOk();
}
public void testStringValues() throws Exception {
fooBoxTest();
}
}
@@ -1,80 +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;
public final class StringTest extends AbstractExpressionTest {
public StringTest() {
super("string/");
}
public void testStringConstant() throws Exception {
fooBoxTest();
}
public void testStringAssignment() throws Exception {
fooBoxTest();
}
public void testIntInTemplate() throws Exception {
checkFooBoxIsOk();
}
public void testStringInTemplate() throws Exception {
checkFooBoxIsOk();
}
public void testMultipleExpressionsInTemplate() throws Exception {
checkFooBoxIsOk();
}
public void testObjectToStringCallInTemplate() throws Exception {
fooBoxTest();
}
public void testStringNotEqualToNumber() throws Exception {
fooBoxTest();
}
public void testKt2227() throws Exception {
fooBoxTest();
}
public void testKt2227_2() throws Exception {
fooBoxTest();
}
public void testNumbersInTemplate() throws Exception {
checkFooBoxIsOk();
}
public void testStringSplit() throws Exception {
checkFooBoxIsOk();
}
public void testExtensionMethods() throws Exception {
checkFooBoxIsOk();
}
public void testNullableTypeInStringTemplate() throws Exception {
checkFooBoxIsOk();
}
public void testSubSequence() 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;
public class TryCatchTest extends AbstractExpressionTest {
public TryCatchTest() {
super("try/");
}
public void testTryCatchExpr() throws Exception {
checkFooBoxIsOk();
}
public void testTryCatchThrowable() throws Exception {
checkFooBoxIsOk();
}
public void testTryCatchCorrectForSubclasses() throws Exception {
checkFooBoxIsOk();
}
public void testTryCatchExpressionWithMessage() throws Exception {
checkFooBoxIsOk();
}
public void testMultipleCatchBlocks() throws Exception {
checkFooBoxIsOk();
}
public void testTryCatchWithDifferentParameterNames() throws Exception {
checkFooBoxIsOk();
}
public void testRethrowExceptionIfNotCaught() throws Exception {
checkFooBoxIsOk();
}
}
@@ -1,152 +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.mozilla.javascript.JavaScriptException;
public final class WhenTest extends AbstractExpressionTest {
public WhenTest() {
super("when/");
}
public void testWhenType() throws Exception {
fooBoxTest();
}
public void testWhenNotType() throws Exception {
fooBoxTest();
}
public void testWhenExecutesOnlyOnce() throws Exception {
fooBoxTest();
}
public void testWhenEvaluatesArgumentOnlyOnce() throws Exception {
fooBoxTest();
}
public void testWhenValue() throws Exception {
fooBoxTest();
}
public void testWhenValueOrType() throws Exception {
fooBoxTest();
}
public void testWhenWithIf() throws Exception {
fooBoxTest();
}
public void testMultipleCases() throws Exception {
checkFooBoxIsOk();
}
public void testMatchNullableType() throws Exception {
fooBoxTest();
}
public void testWhenAsExpression() throws Exception {
fooBoxTest();
}
public void testWhenAsExpressionWithThrow() throws Exception {
try {
fooBoxTest();
fail();
}
catch (JavaScriptException e) {
// Ignored
}
}
public void testKt1665() throws Exception {
checkFooBoxIsOk();
}
public void testWhenWithoutExpression() throws Exception {
fooBoxTest();
}
public void testWhenWithOnlyElse() throws Exception {
fooBoxTest();
}
public void testIfInWhen() throws Exception {
checkFooBoxIsOk();
}
public void testForWithOneStmWhen() throws Exception {
fooBoxTest();
}
public void testWhileWithOneStmWhen() throws Exception {
fooBoxTest();
}
public void testDoWhileWithOneStmWhen() throws Exception {
fooBoxTest();
}
public void testIfWithOneStmWhen() throws Exception {
fooBoxTest();
}
public void testWhenWithOneStmWhen() throws Exception {
fooBoxTest();
}
public void testIfInWhenDanglingElseIssue() throws Exception {
checkFooBoxIsOk();
}
public void testWhenWithRangeClause() throws Exception {
checkFooBoxIsOk();
}
public void testWhenWithLongRangeClause() throws Exception {
checkFooBoxIsOk();
}
public void testWhenWithCharRangeClause() throws Exception {
checkFooBoxIsOk();
}
public void testWhenWithCustomRangeClause() throws Exception {
checkFooBoxIsOk();
}
public void testWhenStatementWithRangeClause() throws Exception {
checkFooBoxIsOk();
}
public void testEmpty() throws Exception {
checkFooBoxIsOk();
}
public void testWhenEqualsPattern() throws Exception {
checkFooBoxIsOk();
}
public void testWhenWithIfConditionAndOnlyElse() throws Exception {
checkFooBoxIsOk();
}
public void testWhenConditionWithReturn() throws Exception {
checkFooBoxIsOk();
}
}
@@ -1,44 +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;
public class WhileTest extends AbstractExpressionTest {
public WhileTest() {
super("while/");
}
public void testWhileWithComplexOneStatement() throws Exception {
checkFooBoxIsOk();
}
public void testWhileWithComplexCondition() throws Exception {
checkFooBoxIsOk();
}
public void testWhileWithComplexConditionAndContinue() throws Exception {
checkFooBoxIsOk();
}
public void testDoWhileWithComplexCondition() throws Exception {
checkFooBoxIsOk();
}
public void testDoWhileWithComplexConditionAndContinue() throws Exception {
checkFooBoxIsOk();
}
}
@@ -45,8 +45,6 @@ abstract class AbstractBridgeTest : BorrowedTest("bridges/")
abstract class AbstractCompanionObjectTest : JsBasicBoxTest("objectIntrinsics/")
abstract class AbstractDynamicTest : JsBasicBoxTest("dynamic/")
abstract class AbstractFunctionExpressionTest : JsBasicBoxTest("functionExpression/")
abstract class AbstractInlineEvaluationOrderTest : JsBasicBoxTest("inlineEvaluationOrder/")
@@ -77,8 +75,6 @@ abstract class AbstractNonLocalReturnsTest : JsBasicBoxTest("inline.generated/no
abstract class AbstractRttiTest : JsBasicBoxTest("rtti/")
abstract class AbstractCastTest : JsBasicBoxTest("expression/cast/")
abstract class AbstractLightReflectionTest : JsBasicBoxTest("reflection/light/")
abstract class AbstractTypeAliasesTests : JsBasicBoxTest("typealiases/")
@@ -13,12 +13,12 @@ fun callEqualsMethod(v1: Foo?, v2: Foo?): Boolean {
return v1 == v2
}
fun box(): Boolean {
fun box(): String {
val a = Foo("abc")
val b = Foo("abc")
val c = Foo("def")
if (!callEqualsMethod(a, b)) return false
if (callEqualsMethod(a, c)) return false
return true
if (!callEqualsMethod(a, b)) return "fail1"
if (callEqualsMethod(a, c)) return "fail2"
return "OK"
}
@@ -13,12 +13,12 @@ fun callEqualsMethod(v1: Any?, v2: Any?): Boolean {
return v1 == v2
}
fun box(): Boolean {
fun box(): String {
val a = Foo("abc")
val b = Foo("abc")
val c = Foo("def")
if (!callEqualsMethod(a, b)) return false
if (callEqualsMethod(a, c)) return false
return true
if (!callEqualsMethod(a, b)) return "fail1"
if (callEqualsMethod(a, c)) return "fail2"
return "OK"
}
@@ -13,16 +13,16 @@ class Bar() {
}
fun box(): Boolean {
fun box(): String {
val a = Foo("abc")
val b = Foo("abc")
val c = Foo("def")
if (!(a.equals(b))) return false
if (a.equals(c)) return false
if (Bar().equals(Bar())) return false
if (!(a.equals(b))) return "fail1"
if (a.equals(c)) return "fail2"
if (Bar().equals(Bar())) return "fail3"
val g = Bar()
if (!(g.equals(g))) return false
if (g.equals(Bar())) return false
return true
if (!(g.equals(g))) return "fail4"
if (g.equals(Bar())) return "fail5"
return "OK"
}
@@ -0,0 +1,21 @@
package foo
fun box(): String {
val a = 2
if (!(a.equals(a))) return "fail1"
if (!(a.equals(2))) return "fail2"
if (!(a.equals(2.0))) return "fail3"
val c = "a"
if (!("a".equals(c))) return "fail4"
if (!((null as Any?)?.equals(null) ?: true)) return "fail5"
val d = 5.6
if (!(d.toShort().equals(5.toShort()))) return "fail6"
if (!(d.toByte().equals(5.toByte()))) return "fail7"
if (!(d.toFloat().equals(5.6.toFloat()))) return "fail8"
if (!(d.toInt().equals(5))) return "fail9"
if (true.equals(false)) return "fail10"
val n: Number = 3
if (!(n.equals(3.3.toInt()))) return "fail11"
return "OK"
}
@@ -2,12 +2,12 @@ package foo
import java.util.*
fun box(): Boolean {
fun box(): String {
val data = ArrayList<String>()
data.add("foo")
data.add("bar")
data.add("whatnot")
val data2 = ArrayList<String>()
data2.addAll(data)
return data.equals(data2)
return if (data.equals(data2)) "OK" else "fail"
}
@@ -0,0 +1,12 @@
package foo
fun box(): String {
val a = "abc"
val b = "abc"
val c = "def"
if (a != b) return "fail1"
if (a == c) return "fail2"
return "OK"
}
@@ -1,23 +1,23 @@
package foo
fun box(): Boolean {
fun box(): String {
if (f(0) != -3) {
return false
return "fail1"
}
if (f(102) != 201) {
return false;
return "fail2"
}
if (f(103) != 100) {
return false
return "fail3"
}
if (f(-100) != -100) {
return false
return "fail4"
}
if (f(-99) != -201) {
return false
return "fail5"
}
return true
return "OK"
}
fun f(i: Int): Int {
@@ -0,0 +1,9 @@
package foo
var i = 0
inline fun f() = i * 2
fun box(): String {
return if ((++i + f()) == 3) "OK" else "fail"
}
@@ -1,16 +1,16 @@
package foo
fun box(): Boolean {
fun box(): String {
if (f(0) != 201) {
return false
return "fail1"
}
if (f(1) != 104) {
return false
return "fail2"
}
if (f(-2) != -100) {
return false
return "fail3"
}
return true
return "OK"
}
fun f(i: Int): Int {

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