JS: move inline test to box tests
This commit is contained in:
@@ -1149,18 +1149,6 @@ fun main(args: Array<String>) {
|
|||||||
model("multiModule/cases")
|
model("multiModule/cases")
|
||||||
}
|
}
|
||||||
|
|
||||||
testClass<AbstractInlineJsStdlibTest>() {
|
|
||||||
model("inlineStdlib/cases")
|
|
||||||
}
|
|
||||||
|
|
||||||
testClass<AbstractInlineEvaluationOrderTest>() {
|
|
||||||
model("inlineEvaluationOrder/cases")
|
|
||||||
}
|
|
||||||
|
|
||||||
testClass<AbstractInlineMultiModuleTest>() {
|
|
||||||
model("inlineMultiModule/cases")
|
|
||||||
}
|
|
||||||
|
|
||||||
testClass<AbstractLabelTest>() {
|
testClass<AbstractLabelTest>() {
|
||||||
model("labels/cases")
|
model("labels/cases")
|
||||||
}
|
}
|
||||||
@@ -1169,10 +1157,6 @@ fun main(args: Array<String>) {
|
|||||||
model("jsCode/cases")
|
model("jsCode/cases")
|
||||||
}
|
}
|
||||||
|
|
||||||
testClass<AbstractInlineSizeReductionTest>() {
|
|
||||||
model("inlineSizeReduction/cases")
|
|
||||||
}
|
|
||||||
|
|
||||||
testClass<AbstractReifiedTest>() {
|
testClass<AbstractReifiedTest>() {
|
||||||
model("reified/cases")
|
model("reified/cases")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
package org.jetbrains.kotlin.js.test
|
package org.jetbrains.kotlin.js.test
|
||||||
|
|
||||||
import com.google.dart.compiler.backend.js.ast.JsProgram
|
import com.google.dart.compiler.backend.js.ast.JsProgram
|
||||||
|
import com.intellij.openapi.util.io.FileUtil
|
||||||
import com.intellij.openapi.vfs.StandardFileSystems
|
import com.intellij.openapi.vfs.StandardFileSystems
|
||||||
import com.intellij.openapi.vfs.VirtualFileManager
|
import com.intellij.openapi.vfs.VirtualFileManager
|
||||||
import com.intellij.psi.PsiManager
|
import com.intellij.psi.PsiManager
|
||||||
@@ -240,7 +241,7 @@ abstract class BasicBoxTest(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun close() {
|
override fun close() {
|
||||||
tmpDir.delete()
|
FileUtil.delete(tmpDir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
-25
@@ -1,25 +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.AbstractSingleFileTranslationWithDirectivesTest;
|
|
||||||
|
|
||||||
public abstract class AbstractInlineSizeReductionTest extends AbstractSingleFileTranslationWithDirectivesTest {
|
|
||||||
public AbstractInlineSizeReductionTest() {
|
|
||||||
super("inlineSizeReduction/");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -3604,4 +3604,715 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("js/js.translator/testData/box/inlineEvaluationOrder")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
public static class InlineEvaluationOrder extends AbstractBoxJsTest {
|
||||||
|
public void testAllFilesPresentInInlineEvaluationOrder() throws Exception {
|
||||||
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/box/inlineEvaluationOrder"), Pattern.compile("^([^_](.+))\\.kt$"), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("argumentOfCall.kt")
|
||||||
|
public void testArgumentOfCall() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/argumentOfCall.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("argumentOfCallMultipleInlineCalls.kt")
|
||||||
|
public void testArgumentOfCallMultipleInlineCalls() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/argumentOfCallMultipleInlineCalls.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("argumentOfInlineCall.kt")
|
||||||
|
public void testArgumentOfInlineCall() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/argumentOfInlineCall.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("argumentOfNew.kt")
|
||||||
|
public void testArgumentOfNew() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/argumentOfNew.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("arrayAccess1.kt")
|
||||||
|
public void testArrayAccess1() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/arrayAccess1.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("arrayAccess2.kt")
|
||||||
|
public void testArrayAccess2() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/arrayAccess2.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("arrayAccess3.kt")
|
||||||
|
public void testArrayAccess3() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/arrayAccess3.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("arrayAccessLhsDecomposed.kt")
|
||||||
|
public void testArrayAccessLhsDecomposed() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/arrayAccessLhsDecomposed.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("arrayLiteral.kt")
|
||||||
|
public void testArrayLiteral() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/arrayLiteral.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("arrayLiteralMultipleInlineCalls.kt")
|
||||||
|
public void testArrayLiteralMultipleInlineCalls() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/arrayLiteralMultipleInlineCalls.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("arrayLiteralNested.kt")
|
||||||
|
public void testArrayLiteralNested() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/arrayLiteralNested.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("assignment.kt")
|
||||||
|
public void testAssignment() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/assignment.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("binaryOperator.kt")
|
||||||
|
public void testBinaryOperator() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/binaryOperator.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("binaryOperatorMultipleInlineCalls.kt")
|
||||||
|
public void testBinaryOperatorMultipleInlineCalls() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/binaryOperatorMultipleInlineCalls.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("callQualifier.kt")
|
||||||
|
public void testCallQualifier() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/callQualifier.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("callQualifierComplex.kt")
|
||||||
|
public void testCallQualifierComplex() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/callQualifierComplex.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("conditional.kt")
|
||||||
|
public void testConditional() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/conditional.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("conditionalElvis.kt")
|
||||||
|
public void testConditionalElvis() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/conditionalElvis.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("conditionalNested.kt")
|
||||||
|
public void testConditionalNested() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/conditionalNested.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("conditionalTestExpression.kt")
|
||||||
|
public void testConditionalTestExpression() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/conditionalTestExpression.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("conditionalTestExpressionElvis.kt")
|
||||||
|
public void testConditionalTestExpressionElvis() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/conditionalTestExpressionElvis.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("continueInExtractedDoWhile.kt")
|
||||||
|
public void testContinueInExtractedDoWhile() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/continueInExtractedDoWhile.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("doWhile.kt")
|
||||||
|
public void testDoWhile() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/doWhile.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("doWhileComplex.kt")
|
||||||
|
public void testDoWhileComplex() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/doWhileComplex.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("for.kt")
|
||||||
|
public void testFor() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/for.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("if.kt")
|
||||||
|
public void testIf() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/if.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("inlineFunctionAsParameterOfQualifiedCall.kt")
|
||||||
|
public void testInlineFunctionAsParameterOfQualifiedCall() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/inlineFunctionAsParameterOfQualifiedCall.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("lambdaPropertyExtracted.kt")
|
||||||
|
public void testLambdaPropertyExtracted() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/lambdaPropertyExtracted.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("lambdaWithClosure.kt")
|
||||||
|
public void testLambdaWithClosure() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/lambdaWithClosure.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("logicalAnd.kt")
|
||||||
|
public void testLogicalAnd() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/logicalAnd.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("logicalAndOrMultipleInlineCalls.kt")
|
||||||
|
public void testLogicalAndOrMultipleInlineCalls() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/logicalAndOrMultipleInlineCalls.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("logicalOr.kt")
|
||||||
|
public void testLogicalOr() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/logicalOr.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("methodCallQualifierWithSideEffect.kt")
|
||||||
|
public void testMethodCallQualifierWithSideEffect() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/methodCallQualifierWithSideEffect.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("methodDecomposedWithBind.kt")
|
||||||
|
public void testMethodDecomposedWithBind() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/methodDecomposedWithBind.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("methodInlineCallQualifierWithSideEffect.kt")
|
||||||
|
public void testMethodInlineCallQualifierWithSideEffect() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/methodInlineCallQualifierWithSideEffect.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("multiDeclaration.kt")
|
||||||
|
public void testMultiDeclaration() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/multiDeclaration.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("multiDeclarationComplex.kt")
|
||||||
|
public void testMultiDeclarationComplex() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/multiDeclarationComplex.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("nestedContinueInExtractedDoWhile.kt")
|
||||||
|
public void testNestedContinueInExtractedDoWhile() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/nestedContinueInExtractedDoWhile.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("nestedInlineCall.kt")
|
||||||
|
public void testNestedInlineCall() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/nestedInlineCall.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("propertiesInitializationOrder.kt")
|
||||||
|
public void testPropertiesInitializationOrder() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/propertiesInitializationOrder.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("propertiesInitializationOrderSimple.kt")
|
||||||
|
public void testPropertiesInitializationOrderSimple() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/propertiesInitializationOrderSimple.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("propertyAccessAfterModification.kt")
|
||||||
|
public void testPropertyAccessAfterModification() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/propertyAccessAfterModification.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("propertyAccessAndInitializer.kt")
|
||||||
|
public void testPropertyAccessAndInitializer() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/propertyAccessAndInitializer.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("propertyAccessWithSideEffect.kt")
|
||||||
|
public void testPropertyAccessWithSideEffect() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/propertyAccessWithSideEffect.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("propertyWithSideEffectExtracted.kt")
|
||||||
|
public void testPropertyWithSideEffectExtracted() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/propertyWithSideEffectExtracted.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("propertyWithSideEffectPassedToInlineFunction.kt")
|
||||||
|
public void testPropertyWithSideEffectPassedToInlineFunction() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/propertyWithSideEffectPassedToInlineFunction.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("ternaryConditional.kt")
|
||||||
|
public void testTernaryConditional() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/ternaryConditional.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("while.kt")
|
||||||
|
public void testWhile() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/while.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("whileComplex.kt")
|
||||||
|
public void testWhileComplex() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/whileComplex.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("whileConditionExtracted.kt")
|
||||||
|
public void testWhileConditionExtracted() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/whileConditionExtracted.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("js/js.translator/testData/box/inlineMultiFile")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
public static class InlineMultiFile extends AbstractBoxJsTest {
|
||||||
|
public void testAllFilesPresentInInlineMultiFile() throws Exception {
|
||||||
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/box/inlineMultiFile"), Pattern.compile("^([^_](.+))\\.kt$"), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("anonymousObjectOnCallSite.kt")
|
||||||
|
public void testAnonymousObjectOnCallSite() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiFile/anonymousObjectOnCallSite.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("anonymousObjectOnCallSiteSuperParams.kt")
|
||||||
|
public void testAnonymousObjectOnCallSiteSuperParams() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiFile/anonymousObjectOnCallSiteSuperParams.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("anonymousObjectOnDeclarationSite.kt")
|
||||||
|
public void testAnonymousObjectOnDeclarationSite() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiFile/anonymousObjectOnDeclarationSite.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("anonymousObjectOnDeclarationSiteSuperParams.kt")
|
||||||
|
public void testAnonymousObjectOnDeclarationSiteSuperParams() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiFile/anonymousObjectOnDeclarationSiteSuperParams.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("builders.kt")
|
||||||
|
public void testBuilders() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiFile/builders.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("buildersAndLambdaCapturing.kt")
|
||||||
|
public void testBuildersAndLambdaCapturing() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiFile/buildersAndLambdaCapturing.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("captureInlinable.kt")
|
||||||
|
public void testCaptureInlinable() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiFile/captureInlinable.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("captureInlinableAndOther.kt")
|
||||||
|
public void testCaptureInlinableAndOther() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiFile/captureInlinableAndOther.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("captureThisAndReceiver.kt")
|
||||||
|
public void testCaptureThisAndReceiver() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiFile/captureThisAndReceiver.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("closureChain.kt")
|
||||||
|
public void testClosureChain() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiFile/closureChain.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("defaultMethod.kt")
|
||||||
|
public void testDefaultMethod() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiFile/defaultMethod.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("generics.kt")
|
||||||
|
public void testGenerics() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiFile/generics.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("inlineInDefaultParameter.kt")
|
||||||
|
public void testInlineInDefaultParameter() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiFile/inlineInDefaultParameter.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("inlineMultiFileSimple.kt")
|
||||||
|
public void testInlineMultiFileSimple() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiFile/inlineMultiFileSimple.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("lambdaCloning.kt")
|
||||||
|
public void testLambdaCloning() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiFile/lambdaCloning.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("lambdaInLambda2.kt")
|
||||||
|
public void testLambdaInLambda2() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiFile/lambdaInLambda2.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("lambdaInLambdaNoInline.kt")
|
||||||
|
public void testLambdaInLambdaNoInline() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiFile/lambdaInLambdaNoInline.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("regeneratedLambdaName.kt")
|
||||||
|
public void testRegeneratedLambdaName() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiFile/regeneratedLambdaName.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("sameCaptured.kt")
|
||||||
|
public void testSameCaptured() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiFile/sameCaptured.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("simpleCapturingInClass.kt")
|
||||||
|
public void testSimpleCapturingInClass() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiFile/simpleCapturingInClass.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("simpleCapturingInPackage.kt")
|
||||||
|
public void testSimpleCapturingInPackage() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiFile/simpleCapturingInPackage.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("simpleDefaultMethod.kt")
|
||||||
|
public void testSimpleDefaultMethod() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiFile/simpleDefaultMethod.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("trait.kt")
|
||||||
|
public void testTrait() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiFile/trait.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("tryCatch.kt")
|
||||||
|
public void testTryCatch() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiFile/tryCatch.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("tryCatch2.kt")
|
||||||
|
public void testTryCatch2() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiFile/tryCatch2.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("tryCatchFinally.kt")
|
||||||
|
public void testTryCatchFinally() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiFile/tryCatchFinally.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("use.kt")
|
||||||
|
public void testUse() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiFile/use.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("with.kt")
|
||||||
|
public void testWith() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiFile/with.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("js/js.translator/testData/box/inlineMultiModule")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
public static class InlineMultiModule extends AbstractBoxJsTest {
|
||||||
|
public void testAllFilesPresentInInlineMultiModule() throws Exception {
|
||||||
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/box/inlineMultiModule"), Pattern.compile("^([^_](.+))\\.kt$"), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("anotherModuleValInClosure.kt")
|
||||||
|
public void testAnotherModuleValInClosure() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiModule/anotherModuleValInClosure.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("callableReference.kt")
|
||||||
|
public void testCallableReference() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiModule/callableReference.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("calledByFqName.kt")
|
||||||
|
public void testCalledByFqName() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiModule/calledByFqName.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("extensionLambda.kt")
|
||||||
|
public void testExtensionLambda() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiModule/extensionLambda.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("externalInlineCallDecomposed.kt")
|
||||||
|
public void testExternalInlineCallDecomposed() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiModule/externalInlineCallDecomposed.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("externalInlineNewDecomposed.kt")
|
||||||
|
public void testExternalInlineNewDecomposed() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiModule/externalInlineNewDecomposed.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("lambda.kt")
|
||||||
|
public void testLambda() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiModule/lambda.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("lambdaCalledInObjectLiteral.kt")
|
||||||
|
public void testLambdaCalledInObjectLiteral() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiModule/lambdaCalledInObjectLiteral.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("lambdaWithClosure.kt")
|
||||||
|
public void testLambdaWithClosure() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiModule/lambdaWithClosure.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("localNameClash.kt")
|
||||||
|
public void testLocalNameClash() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiModule/localNameClash.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("method.kt")
|
||||||
|
public void testMethod() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiModule/method.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("parameterWithDefaultValue.kt")
|
||||||
|
public void testParameterWithDefaultValue() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiModule/parameterWithDefaultValue.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("simple.kt")
|
||||||
|
public void testSimple() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineMultiModule/simple.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("js/js.translator/testData/box/inlineSizeReduction")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
public static class InlineSizeReduction extends AbstractBoxJsTest {
|
||||||
|
public void testAllFilesPresentInInlineSizeReduction() throws Exception {
|
||||||
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/box/inlineSizeReduction"), Pattern.compile("^([^_](.+))\\.kt$"), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("inlineOrder.kt")
|
||||||
|
public void testInlineOrder() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineSizeReduction/inlineOrder.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("lastBreak.kt")
|
||||||
|
public void testLastBreak() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineSizeReduction/lastBreak.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("noDuplicateVariableDeclaration.kt")
|
||||||
|
public void testNoDuplicateVariableDeclaration() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineSizeReduction/noDuplicateVariableDeclaration.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("oneTopLevelReturn.kt")
|
||||||
|
public void testOneTopLevelReturn() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineSizeReduction/oneTopLevelReturn.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("propertyAssignment.kt")
|
||||||
|
public void testPropertyAssignment() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineSizeReduction/propertyAssignment.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("propertyReferenceDoesNotProduceSideEffect.kt")
|
||||||
|
public void testPropertyReferenceDoesNotProduceSideEffect() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineSizeReduction/propertyReferenceDoesNotProduceSideEffect.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("returnInlineCall.kt")
|
||||||
|
public void testReturnInlineCall() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineSizeReduction/returnInlineCall.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("simpleReturnFunction.kt")
|
||||||
|
public void testSimpleReturnFunction() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineSizeReduction/simpleReturnFunction.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("ternaryConditional.kt")
|
||||||
|
public void testTernaryConditional() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineSizeReduction/ternaryConditional.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("this.kt")
|
||||||
|
public void testThis() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineSizeReduction/this.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("valAssignment.kt")
|
||||||
|
public void testValAssignment() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineSizeReduction/valAssignment.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("valDeclaration.kt")
|
||||||
|
public void testValDeclaration() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineSizeReduction/valDeclaration.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("js/js.translator/testData/box/inlineStdlib")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
public static class InlineStdlib extends AbstractBoxJsTest {
|
||||||
|
public void testAllFilesPresentInInlineStdlib() throws Exception {
|
||||||
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/box/inlineStdlib"), Pattern.compile("^([^_](.+))\\.kt$"), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("callNameClash.kt")
|
||||||
|
public void testCallNameClash() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineStdlib/callNameClash.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("callableRefToFunInCurrentModule.kt")
|
||||||
|
public void testCallableRefToFunInCurrentModule() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineStdlib/callableRefToFunInCurrentModule.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("closure.kt")
|
||||||
|
public void testClosure() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineStdlib/closure.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("closureInObjectLiteral.kt")
|
||||||
|
public void testClosureInObjectLiteral() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineStdlib/closureInObjectLiteral.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("closureNested.kt")
|
||||||
|
public void testClosureNested() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineStdlib/closureNested.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("localNamesClash.kt")
|
||||||
|
public void testLocalNamesClash() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineStdlib/localNamesClash.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("simple.kt")
|
||||||
|
public void testSimple() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineStdlib/simple.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("thisInExtension.kt")
|
||||||
|
public void testThisInExtension() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineStdlib/thisInExtension.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
-337
@@ -1,337 +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/inlineEvaluationOrder/cases")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public class InlineEvaluationOrderTestGenerated extends AbstractInlineEvaluationOrderTest {
|
|
||||||
public void testAllFilesPresentInCases() throws Exception {
|
|
||||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/inlineEvaluationOrder/cases"), Pattern.compile("^(.+)\\.kt$"), true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("argumentOfCall.kt")
|
|
||||||
public void testArgumentOfCall() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/argumentOfCall.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("argumentOfCallMultipleInlineCalls.kt")
|
|
||||||
public void testArgumentOfCallMultipleInlineCalls() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/argumentOfCallMultipleInlineCalls.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("argumentOfInlineCall.kt")
|
|
||||||
public void testArgumentOfInlineCall() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/argumentOfInlineCall.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("argumentOfNew.kt")
|
|
||||||
public void testArgumentOfNew() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/argumentOfNew.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("arrayAccess1.kt")
|
|
||||||
public void testArrayAccess1() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/arrayAccess1.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("arrayAccess2.kt")
|
|
||||||
public void testArrayAccess2() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/arrayAccess2.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("arrayAccess3.kt")
|
|
||||||
public void testArrayAccess3() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/arrayAccess3.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("arrayAccessLhsDecomposed.kt")
|
|
||||||
public void testArrayAccessLhsDecomposed() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/arrayAccessLhsDecomposed.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("arrayLiteral.kt")
|
|
||||||
public void testArrayLiteral() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/arrayLiteral.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("arrayLiteralMultipleInlineCalls.kt")
|
|
||||||
public void testArrayLiteralMultipleInlineCalls() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/arrayLiteralMultipleInlineCalls.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("arrayLiteralNested.kt")
|
|
||||||
public void testArrayLiteralNested() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/arrayLiteralNested.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("assignment.kt")
|
|
||||||
public void testAssignment() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/assignment.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("binaryOperator.kt")
|
|
||||||
public void testBinaryOperator() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/binaryOperator.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("binaryOperatorMultipleInlineCalls.kt")
|
|
||||||
public void testBinaryOperatorMultipleInlineCalls() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/binaryOperatorMultipleInlineCalls.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("callQualifier.kt")
|
|
||||||
public void testCallQualifier() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/callQualifier.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("callQualifierComplex.kt")
|
|
||||||
public void testCallQualifierComplex() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/callQualifierComplex.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("conditional.kt")
|
|
||||||
public void testConditional() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/conditional.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("conditionalElvis.kt")
|
|
||||||
public void testConditionalElvis() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/conditionalElvis.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("conditionalNested.kt")
|
|
||||||
public void testConditionalNested() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/conditionalNested.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("conditionalTestExpression.kt")
|
|
||||||
public void testConditionalTestExpression() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/conditionalTestExpression.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("conditionalTestExpressionElvis.kt")
|
|
||||||
public void testConditionalTestExpressionElvis() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/conditionalTestExpressionElvis.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("continueInExtractedDoWhile.kt")
|
|
||||||
public void testContinueInExtractedDoWhile() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/continueInExtractedDoWhile.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("doWhile.kt")
|
|
||||||
public void testDoWhile() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/doWhile.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("doWhileComplex.kt")
|
|
||||||
public void testDoWhileComplex() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/doWhileComplex.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("for.kt")
|
|
||||||
public void testFor() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/for.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("if.kt")
|
|
||||||
public void testIf() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/if.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("inlineFunctionAsParameterOfQualifiedCall.kt")
|
|
||||||
public void testInlineFunctionAsParameterOfQualifiedCall() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/inlineFunctionAsParameterOfQualifiedCall.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("lambdaPropertyExtracted.kt")
|
|
||||||
public void testLambdaPropertyExtracted() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/lambdaPropertyExtracted.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("lambdaWithClosure.kt")
|
|
||||||
public void testLambdaWithClosure() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/lambdaWithClosure.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("logicalAnd.kt")
|
|
||||||
public void testLogicalAnd() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/logicalAnd.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("logicalAndOrMultipleInlineCalls.kt")
|
|
||||||
public void testLogicalAndOrMultipleInlineCalls() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/logicalAndOrMultipleInlineCalls.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("logicalOr.kt")
|
|
||||||
public void testLogicalOr() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/logicalOr.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("methodCallQualifierWithSideEffect.kt")
|
|
||||||
public void testMethodCallQualifierWithSideEffect() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/methodCallQualifierWithSideEffect.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("methodDecomposedWithBind.kt")
|
|
||||||
public void testMethodDecomposedWithBind() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/methodDecomposedWithBind.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("methodInlineCallQualifierWithSideEffect.kt")
|
|
||||||
public void testMethodInlineCallQualifierWithSideEffect() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/methodInlineCallQualifierWithSideEffect.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("multiDeclaration.kt")
|
|
||||||
public void testMultiDeclaration() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/multiDeclaration.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("multiDeclarationComplex.kt")
|
|
||||||
public void testMultiDeclarationComplex() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/multiDeclarationComplex.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("nestedContinueInExtractedDoWhile.kt")
|
|
||||||
public void testNestedContinueInExtractedDoWhile() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/nestedContinueInExtractedDoWhile.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("nestedInlineCall.kt")
|
|
||||||
public void testNestedInlineCall() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/nestedInlineCall.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("propertiesInitializationOrder.kt")
|
|
||||||
public void testPropertiesInitializationOrder() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/propertiesInitializationOrder.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("propertiesInitializationOrderSimple.kt")
|
|
||||||
public void testPropertiesInitializationOrderSimple() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/propertiesInitializationOrderSimple.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("propertyAccessAfterModification.kt")
|
|
||||||
public void testPropertyAccessAfterModification() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/propertyAccessAfterModification.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("propertyAccessAndInitializer.kt")
|
|
||||||
public void testPropertyAccessAndInitializer() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/propertyAccessAndInitializer.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("propertyAccessWithSideEffect.kt")
|
|
||||||
public void testPropertyAccessWithSideEffect() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/propertyAccessWithSideEffect.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("propertyWithSideEffectExtracted.kt")
|
|
||||||
public void testPropertyWithSideEffectExtracted() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/propertyWithSideEffectExtracted.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("propertyWithSideEffectPassedToInlineFunction.kt")
|
|
||||||
public void testPropertyWithSideEffectPassedToInlineFunction() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/propertyWithSideEffectPassedToInlineFunction.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("ternaryConditional.kt")
|
|
||||||
public void testTernaryConditional() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/ternaryConditional.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("while.kt")
|
|
||||||
public void testWhile() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/while.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("whileComplex.kt")
|
|
||||||
public void testWhileComplex() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/whileComplex.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("whileConditionExtracted.kt")
|
|
||||||
public void testWhileConditionExtracted() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/whileConditionExtracted.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-85
@@ -1,85 +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/inlineStdlib/cases")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public class InlineJsStdlibTestGenerated extends AbstractInlineJsStdlibTest {
|
|
||||||
public void testAllFilesPresentInCases() throws Exception {
|
|
||||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/inlineStdlib/cases"), Pattern.compile("^(.+)\\.kt$"), true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("callNameClash.kt")
|
|
||||||
public void testCallNameClash() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineStdlib/cases/callNameClash.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("callableRefToFunInCurrentModule.kt")
|
|
||||||
public void testCallableRefToFunInCurrentModule() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineStdlib/cases/callableRefToFunInCurrentModule.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("closure.kt")
|
|
||||||
public void testClosure() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineStdlib/cases/closure.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("closureInObjectLiteral.kt")
|
|
||||||
public void testClosureInObjectLiteral() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineStdlib/cases/closureInObjectLiteral.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("closureNested.kt")
|
|
||||||
public void testClosureNested() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineStdlib/cases/closureNested.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("localNamesClash.kt")
|
|
||||||
public void testLocalNamesClash() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineStdlib/cases/localNamesClash.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("simple.kt")
|
|
||||||
public void testSimple() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineStdlib/cases/simple.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("thisInExtension.kt")
|
|
||||||
public void testThisInExtension() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineStdlib/cases/thisInExtension.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-115
@@ -1,115 +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/inlineMultiModule/cases")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public class InlineMultiModuleTestGenerated extends AbstractInlineMultiModuleTest {
|
|
||||||
public void testAllFilesPresentInCases() throws Exception {
|
|
||||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/inlineMultiModule/cases"), Pattern.compile("^(.+)\\.kt$"), true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("anotherModuleValInClosure.kt")
|
|
||||||
public void testAnotherModuleValInClosure() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineMultiModule/cases/anotherModuleValInClosure.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("callableReference.kt")
|
|
||||||
public void testCallableReference() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineMultiModule/cases/callableReference.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("calledByFqName.kt")
|
|
||||||
public void testCalledByFqName() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineMultiModule/cases/calledByFqName.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("extensionLambda.kt")
|
|
||||||
public void testExtensionLambda() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineMultiModule/cases/extensionLambda.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("externalInlineCallDecomposed.kt")
|
|
||||||
public void testExternalInlineCallDecomposed() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineMultiModule/cases/externalInlineCallDecomposed.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("externalInlineNewDecomposed.kt")
|
|
||||||
public void testExternalInlineNewDecomposed() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineMultiModule/cases/externalInlineNewDecomposed.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("lambda.kt")
|
|
||||||
public void testLambda() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineMultiModule/cases/lambda.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("lambdaCalledInObjectLiteral.kt")
|
|
||||||
public void testLambdaCalledInObjectLiteral() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineMultiModule/cases/lambdaCalledInObjectLiteral.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("lambdaWithClosure.kt")
|
|
||||||
public void testLambdaWithClosure() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineMultiModule/cases/lambdaWithClosure.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("localNameClash.kt")
|
|
||||||
public void testLocalNameClash() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineMultiModule/cases/localNameClash.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("method.kt")
|
|
||||||
public void testMethod() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineMultiModule/cases/method.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("parameterWithDefaultValue.kt")
|
|
||||||
public void testParameterWithDefaultValue() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineMultiModule/cases/parameterWithDefaultValue.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("simple.kt")
|
|
||||||
public void testSimple() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineMultiModule/cases/simple.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-109
@@ -1,109 +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/inlineSizeReduction/cases")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public class InlineSizeReductionTestGenerated extends AbstractInlineSizeReductionTest {
|
|
||||||
public void testAllFilesPresentInCases() throws Exception {
|
|
||||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/inlineSizeReduction/cases"), Pattern.compile("^(.+)\\.kt$"), true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("inlineOrder.kt")
|
|
||||||
public void testInlineOrder() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineSizeReduction/cases/inlineOrder.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("lastBreak.kt")
|
|
||||||
public void testLastBreak() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineSizeReduction/cases/lastBreak.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("noDuplicateVariableDeclaration.kt")
|
|
||||||
public void testNoDuplicateVariableDeclaration() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineSizeReduction/cases/noDuplicateVariableDeclaration.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("oneTopLevelReturn.kt")
|
|
||||||
public void testOneTopLevelReturn() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineSizeReduction/cases/oneTopLevelReturn.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("propertyAssignment.kt")
|
|
||||||
public void testPropertyAssignment() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineSizeReduction/cases/propertyAssignment.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("propertyReferenceDoesNotProduceSideEffect.kt")
|
|
||||||
public void testPropertyReferenceDoesNotProduceSideEffect() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineSizeReduction/cases/propertyReferenceDoesNotProduceSideEffect.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("returnInlineCall.kt")
|
|
||||||
public void testReturnInlineCall() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineSizeReduction/cases/returnInlineCall.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("simpleReturnFunction.kt")
|
|
||||||
public void testSimpleReturnFunction() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineSizeReduction/cases/simpleReturnFunction.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("ternaryConditional.kt")
|
|
||||||
public void testTernaryConditional() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineSizeReduction/cases/ternaryConditional.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("this.kt")
|
|
||||||
public void testThis() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineSizeReduction/cases/this.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("valAssignment.kt")
|
|
||||||
public void testValAssignment() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineSizeReduction/cases/valAssignment.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("valDeclaration.kt")
|
|
||||||
public void testValDeclaration() throws Exception {
|
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineSizeReduction/cases/valDeclaration.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-6
@@ -47,18 +47,12 @@ abstract class AbstractCompanionObjectTest : JsBasicBoxTest("objectIntrinsics/")
|
|||||||
|
|
||||||
abstract class AbstractFunctionExpressionTest : JsBasicBoxTest("functionExpression/")
|
abstract class AbstractFunctionExpressionTest : JsBasicBoxTest("functionExpression/")
|
||||||
|
|
||||||
abstract class AbstractInlineEvaluationOrderTest : JsBasicBoxTest("inlineEvaluationOrder/")
|
|
||||||
|
|
||||||
abstract class AbstractInlineJsStdlibTest : JsBasicBoxTest("inlineStdlib/")
|
|
||||||
|
|
||||||
abstract class AbstractJsCodeTest : JsBasicBoxTest("jsCode/")
|
abstract class AbstractJsCodeTest : JsBasicBoxTest("jsCode/")
|
||||||
|
|
||||||
abstract class AbstractLabelTest : JsBasicBoxTest("labels/")
|
abstract class AbstractLabelTest : JsBasicBoxTest("labels/")
|
||||||
|
|
||||||
abstract class AbstractMultiModuleTest : JsBasicBoxTest("multiModule/")
|
abstract class AbstractMultiModuleTest : JsBasicBoxTest("multiModule/")
|
||||||
|
|
||||||
abstract class AbstractInlineMultiModuleTest : JsBasicBoxTest("inlineMultiModule/")
|
|
||||||
|
|
||||||
abstract class AbstractReservedWordTest : JsBasicBoxTest("reservedWords/")
|
abstract class AbstractReservedWordTest : JsBasicBoxTest("reservedWords/")
|
||||||
|
|
||||||
abstract class AbstractSecondaryConstructorTest : JsBasicBoxTest("secondaryConstructors/")
|
abstract class AbstractSecondaryConstructorTest : JsBasicBoxTest("secondaryConstructors/")
|
||||||
|
|||||||
+16
@@ -3,6 +3,7 @@
|
|||||||
* Found at: compiler/testData/codegen/boxInline/anonymousObject/anonymousObjectOnCallSite.1.kt
|
* Found at: compiler/testData/codegen/boxInline/anonymousObject/anonymousObjectOnCallSite.1.kt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// FILE: foo.kt
|
||||||
package foo
|
package foo
|
||||||
|
|
||||||
import test.*
|
import test.*
|
||||||
@@ -33,3 +34,18 @@ fun box() : String {
|
|||||||
return "OK"
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// FILE: test.kt
|
||||||
|
package test
|
||||||
|
|
||||||
|
abstract class A<R> {
|
||||||
|
abstract fun getO() : R
|
||||||
|
|
||||||
|
abstract fun getK() : R
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline fun <R> doWork(job: ()-> R) : R {
|
||||||
|
return job()
|
||||||
|
}
|
||||||
|
|
||||||
+15
@@ -3,6 +3,7 @@
|
|||||||
* Found at: compiler/testData/codegen/boxInline/anonymousObject/anonymousObjectOnCallSiteSuperParams.1.kt
|
* Found at: compiler/testData/codegen/boxInline/anonymousObject/anonymousObjectOnCallSiteSuperParams.1.kt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// FILE: foo.kt
|
||||||
package foo
|
package foo
|
||||||
|
|
||||||
import test.*
|
import test.*
|
||||||
@@ -29,3 +30,17 @@ fun box() : String {
|
|||||||
return "OK"
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// FILE: test.kt
|
||||||
|
package test
|
||||||
|
|
||||||
|
abstract class A<R>(val param: R) {
|
||||||
|
abstract fun getO() : R
|
||||||
|
|
||||||
|
abstract fun getK() : R
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline fun <R> doWork(job: ()-> R) : R {
|
||||||
|
return job()
|
||||||
|
}
|
||||||
+35
-1
@@ -1,9 +1,43 @@
|
|||||||
/*
|
/*
|
||||||
* Copy of JVM-backend test
|
* Copy of JVM-backend test
|
||||||
* Found at: compiler/testData/codegen/boxInline/anonymousObject/anonymousObjectOnDeclarationSite.2.kt
|
* Found at: compiler/testData/codegen/boxInline/anonymousObject/anonymousObjectOnDeclarationSite.1.kt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// FILE: foo.kt
|
||||||
|
package foo
|
||||||
|
|
||||||
|
import test.*
|
||||||
|
|
||||||
|
fun test1(): String {
|
||||||
|
val o = "O"
|
||||||
|
|
||||||
|
val result = doWork ({o}, {"K"}, "GOOD")
|
||||||
|
|
||||||
|
return result.getO() + result.getK() + result.getParam()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test2() : String {
|
||||||
|
//same names as in object
|
||||||
|
val o1 = "O"
|
||||||
|
val k1 = "K"
|
||||||
|
|
||||||
|
val result = doWorkInConstructor ({o1}, {k1}, "GOOD")
|
||||||
|
|
||||||
|
return result.getO() + result.getK() + result.getParam()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box() : String {
|
||||||
|
val result1 = test1();
|
||||||
|
if (result1 != "OKGOOD") return "fail1 $result1"
|
||||||
|
|
||||||
|
val result2 = test2();
|
||||||
|
if (result2 != "OKGOOD") return "fail2 $result2"
|
||||||
|
|
||||||
|
return "OK"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// FILE: test.kt
|
||||||
package test
|
package test
|
||||||
|
|
||||||
|
|
||||||
+35
@@ -3,6 +3,41 @@
|
|||||||
* Found at: compiler/testData/codegen/boxInline/anonymousObject/anonymousObjectOnDeclarationSiteSuperParams.1.kt
|
* Found at: compiler/testData/codegen/boxInline/anonymousObject/anonymousObjectOnDeclarationSiteSuperParams.1.kt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// FILE: foo.kt
|
||||||
|
package foo
|
||||||
|
|
||||||
|
import test.*
|
||||||
|
|
||||||
|
fun test1(): String {
|
||||||
|
val o = "O"
|
||||||
|
|
||||||
|
val result = doWork ({o}, {"K"}, "11")
|
||||||
|
|
||||||
|
return result.getO() + result.getK() + result.param
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test2() : String {
|
||||||
|
//same names as in object
|
||||||
|
val o1 = "O"
|
||||||
|
val k1 = "K"
|
||||||
|
val param = "11"
|
||||||
|
val result = doWorkInConstructor ({o1}, {k1}, {param})
|
||||||
|
|
||||||
|
return result.getO() + result.getK() + result.param
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box() : String {
|
||||||
|
val result1 = test1();
|
||||||
|
if (result1 != "OK11") return "fail1 $result1"
|
||||||
|
|
||||||
|
val result2 = test2();
|
||||||
|
if (result2 != "OK11") return "fail2 $result2"
|
||||||
|
|
||||||
|
return "OK"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// FILE: test.kt
|
||||||
package test
|
package test
|
||||||
|
|
||||||
|
|
||||||
+113
@@ -3,6 +3,8 @@
|
|||||||
* Found at: compiler/testData/codegen/boxInline/builders/builders.1.kt
|
* Found at: compiler/testData/codegen/boxInline/builders/builders.1.kt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
// FILE: foo.kt
|
||||||
package foo
|
package foo
|
||||||
|
|
||||||
fun testAllInline() : String {
|
fun testAllInline() : String {
|
||||||
@@ -176,3 +178,114 @@ fun box(): String {
|
|||||||
|
|
||||||
return "OK"
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// FILE: bar.kt
|
||||||
|
package foo
|
||||||
|
|
||||||
|
import java.util.ArrayList
|
||||||
|
import java.util.HashMap
|
||||||
|
|
||||||
|
abstract class Element {
|
||||||
|
abstract fun render(builder: StringBuilder, indent: String)
|
||||||
|
|
||||||
|
override fun toString(): String {
|
||||||
|
val builder = StringBuilder()
|
||||||
|
render(builder, "")
|
||||||
|
return builder.toString()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class TextElement(val text: String) : Element() {
|
||||||
|
override fun render(builder: StringBuilder, indent: String) {
|
||||||
|
builder.append("$indent$text\n")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class Tag(val name: String) : Element() {
|
||||||
|
val children = ArrayList<Element>()
|
||||||
|
val attributes = HashMap<String, String>()
|
||||||
|
|
||||||
|
inline protected fun <T : Element> initTag(tag: T, init: T.() -> Unit): T {
|
||||||
|
tag.init()
|
||||||
|
children.add(tag)
|
||||||
|
return tag
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun render(builder: StringBuilder, indent: String) {
|
||||||
|
builder.append("$indent<$name${renderAttributes()}>\n")
|
||||||
|
for (c in children) {
|
||||||
|
c.render(builder, indent + " ")
|
||||||
|
}
|
||||||
|
builder.append("$indent</$name>\n")
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun renderAttributes(): String? {
|
||||||
|
val builder = StringBuilder()
|
||||||
|
for (a in attributes.keys) {
|
||||||
|
builder.append(" $a=\"${attributes[a]}\"")
|
||||||
|
}
|
||||||
|
return builder.toString()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class TagWithText(name: String) : Tag(name) {
|
||||||
|
operator fun String.unaryPlus() {
|
||||||
|
children.add(TextElement(this))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class HTML() : TagWithText("html") {
|
||||||
|
inline fun head(init: Head.() -> Unit) = initTag(Head(), init)
|
||||||
|
|
||||||
|
inline fun body(init: Body.() -> Unit) = initTag(Body(), init)
|
||||||
|
|
||||||
|
fun bodyNoInline(init: Body.() -> Unit) = initTag(Body(), init)
|
||||||
|
}
|
||||||
|
|
||||||
|
class Head() : TagWithText("head") {
|
||||||
|
inline fun title(init: Title.() -> Unit) = initTag(Title(), init)
|
||||||
|
}
|
||||||
|
|
||||||
|
class Title() : TagWithText("title")
|
||||||
|
|
||||||
|
abstract class BodyTag(name: String) : TagWithText(name) {
|
||||||
|
inline fun b(init: B.() -> Unit) = initTag(B(), init)
|
||||||
|
inline fun p(init: P.() -> Unit) = initTag(P(), init)
|
||||||
|
inline fun pNoInline(init: P.() -> Unit) = initTag(P(), init)
|
||||||
|
inline fun h1(init: H1.() -> Unit) = initTag(H1(), init)
|
||||||
|
inline fun ul(init: UL.() -> Unit) = initTag(UL(), init)
|
||||||
|
inline fun a(href: String, init: A.() -> Unit) {
|
||||||
|
val a = initTag(A(), init)
|
||||||
|
a.href = href
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Body() : BodyTag("body")
|
||||||
|
class UL() : BodyTag("ul") {
|
||||||
|
inline fun li(init: LI.() -> Unit) = initTag(LI(), init)
|
||||||
|
}
|
||||||
|
|
||||||
|
class B() : BodyTag("b")
|
||||||
|
class LI() : BodyTag("li")
|
||||||
|
class P() : BodyTag("p")
|
||||||
|
class H1() : BodyTag("h1")
|
||||||
|
class A() : BodyTag("a") {
|
||||||
|
public var href: String
|
||||||
|
get() = attributes["href"]!!
|
||||||
|
set(value) {
|
||||||
|
attributes["href"] = value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
inline fun html(init: HTML.() -> Unit): HTML {
|
||||||
|
val html = HTML()
|
||||||
|
html.init()
|
||||||
|
return html
|
||||||
|
}
|
||||||
|
|
||||||
|
fun htmlNoInline(init: HTML.() -> Unit): HTML {
|
||||||
|
val html = HTML()
|
||||||
|
html.init()
|
||||||
|
return html
|
||||||
|
}
|
||||||
+112
@@ -3,6 +3,7 @@
|
|||||||
* Found at: compiler/testData/codegen/boxInline/builders/buildersAndLambdaCapturing.1.kt
|
* Found at: compiler/testData/codegen/boxInline/builders/buildersAndLambdaCapturing.1.kt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// FILE: foo.kt
|
||||||
package foo
|
package foo
|
||||||
|
|
||||||
|
|
||||||
@@ -181,3 +182,114 @@ fun box(): String {
|
|||||||
|
|
||||||
return "OK"
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// FILE: bar.kt
|
||||||
|
package foo
|
||||||
|
|
||||||
|
import java.util.ArrayList
|
||||||
|
import java.util.HashMap
|
||||||
|
|
||||||
|
abstract class Element {
|
||||||
|
abstract fun render(builder: StringBuilder, indent: String)
|
||||||
|
|
||||||
|
override fun toString(): String {
|
||||||
|
val builder = StringBuilder()
|
||||||
|
render(builder, "")
|
||||||
|
return builder.toString()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class TextElement(val text: String) : Element() {
|
||||||
|
override fun render(builder: StringBuilder, indent: String) {
|
||||||
|
builder.append("$indent$text\n")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class Tag(val name: String) : Element() {
|
||||||
|
val children = ArrayList<Element>()
|
||||||
|
val attributes = HashMap<String, String>()
|
||||||
|
|
||||||
|
inline protected fun <T : Element> initTag(tag: T, init: T.() -> Unit): T {
|
||||||
|
tag.init()
|
||||||
|
children.add(tag)
|
||||||
|
return tag
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun render(builder: StringBuilder, indent: String) {
|
||||||
|
builder.append("$indent<$name${renderAttributes()}>\n")
|
||||||
|
for (c in children) {
|
||||||
|
c.render(builder, indent + " ")
|
||||||
|
}
|
||||||
|
builder.append("$indent</$name>\n")
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun renderAttributes(): String? {
|
||||||
|
val builder = StringBuilder()
|
||||||
|
for (a in attributes.keys) {
|
||||||
|
builder.append(" $a=\"${attributes[a]}\"")
|
||||||
|
}
|
||||||
|
return builder.toString()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class TagWithText(name: String) : Tag(name) {
|
||||||
|
operator fun String.unaryPlus() {
|
||||||
|
children.add(TextElement(this))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class HTML() : TagWithText("html") {
|
||||||
|
inline fun head(init: Head.() -> Unit) = initTag(Head(), init)
|
||||||
|
|
||||||
|
inline fun body(init: Body.() -> Unit) = initTag(Body(), init)
|
||||||
|
|
||||||
|
fun bodyNoInline(init: Body.() -> Unit) = initTag(Body(), init)
|
||||||
|
}
|
||||||
|
|
||||||
|
class Head() : TagWithText("head") {
|
||||||
|
inline fun title(init: Title.() -> Unit) = initTag(Title(), init)
|
||||||
|
}
|
||||||
|
|
||||||
|
class Title() : TagWithText("title")
|
||||||
|
|
||||||
|
abstract class BodyTag(name: String) : TagWithText(name) {
|
||||||
|
inline fun b(init: B.() -> Unit) = initTag(B(), init)
|
||||||
|
inline fun p(init: P.() -> Unit) = initTag(P(), init)
|
||||||
|
fun pNoInline(init: P.() -> Unit) = initTag(P(), init)
|
||||||
|
inline fun h1(init: H1.() -> Unit) = initTag(H1(), init)
|
||||||
|
inline fun ul(init: UL.() -> Unit) = initTag(UL(), init)
|
||||||
|
inline fun a(href: String, init: A.() -> Unit) {
|
||||||
|
val a = initTag(A(), init)
|
||||||
|
a.href = href
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Body() : BodyTag("body")
|
||||||
|
class UL() : BodyTag("ul") {
|
||||||
|
inline fun li(init: LI.() -> Unit) = initTag(LI(), init)
|
||||||
|
}
|
||||||
|
|
||||||
|
class B() : BodyTag("b")
|
||||||
|
class LI() : BodyTag("li")
|
||||||
|
class P() : BodyTag("p")
|
||||||
|
class H1() : BodyTag("h1")
|
||||||
|
class A() : BodyTag("a") {
|
||||||
|
public var href: String
|
||||||
|
get() = attributes["href"]!!
|
||||||
|
set(value) {
|
||||||
|
attributes["href"] = value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
inline fun html(init: HTML.() -> Unit): HTML {
|
||||||
|
val html = HTML()
|
||||||
|
html.init()
|
||||||
|
return html
|
||||||
|
}
|
||||||
|
|
||||||
|
fun htmlNoInline(init: HTML.() -> Unit): HTML {
|
||||||
|
val html = HTML()
|
||||||
|
html.init()
|
||||||
|
return html
|
||||||
|
}
|
||||||
+15
@@ -3,6 +3,7 @@
|
|||||||
* Found at: compiler/testData/codegen/boxInline/capture/captureInlinable.1.kt
|
* Found at: compiler/testData/codegen/boxInline/capture/captureInlinable.1.kt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// FILE: foo.kt
|
||||||
package foo
|
package foo
|
||||||
|
|
||||||
import test.*
|
import test.*
|
||||||
@@ -16,3 +17,17 @@ fun box(): String {
|
|||||||
|
|
||||||
return "OK"
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// FILE: test.kt
|
||||||
|
package test
|
||||||
|
|
||||||
|
|
||||||
|
inline fun <R> doWork(crossinline job: ()-> R) : R {
|
||||||
|
return notInline({job()})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun <R> notInline(job: ()-> R) : R {
|
||||||
|
return job()
|
||||||
|
}
|
||||||
|
|
||||||
+15
@@ -3,6 +3,7 @@
|
|||||||
* Found at: compiler/testData/codegen/boxInline/capture/captureInlinableAndOther.1.kt
|
* Found at: compiler/testData/codegen/boxInline/capture/captureInlinableAndOther.1.kt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// FILE: foo.kt
|
||||||
package foo
|
package foo
|
||||||
|
|
||||||
import test.*
|
import test.*
|
||||||
@@ -16,3 +17,17 @@ fun box(): String {
|
|||||||
|
|
||||||
return "OK"
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// FILE: test.kt
|
||||||
|
package test
|
||||||
|
|
||||||
|
|
||||||
|
inline fun <R> doWork(crossinline job: ()-> R) : R {
|
||||||
|
val k = 10;
|
||||||
|
return notInline({k; job()})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun <R> notInline(job: ()-> R) : R {
|
||||||
|
return job()
|
||||||
|
}
|
||||||
+12
@@ -3,6 +3,7 @@
|
|||||||
* Found at: compiler/testData/codegen/boxInline/capture/captureThisAndReceiver.1.kt
|
* Found at: compiler/testData/codegen/boxInline/capture/captureThisAndReceiver.1.kt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// FILE: foo.kt
|
||||||
package foo
|
package foo
|
||||||
|
|
||||||
fun test1() : Int {
|
fun test1() : Int {
|
||||||
@@ -33,3 +34,14 @@ fun box(): String {
|
|||||||
|
|
||||||
return "OK"
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// FILE: bar.kt
|
||||||
|
package foo
|
||||||
|
|
||||||
|
class My(val value: Int)
|
||||||
|
|
||||||
|
inline fun <T, R> T.perform(job: (T)-> R) : R {
|
||||||
|
return job(this)
|
||||||
|
}
|
||||||
|
|
||||||
+12
@@ -3,6 +3,7 @@
|
|||||||
* Found at: compiler/testData/codegen/boxInline/complex/closureChain.1.kt
|
* Found at: compiler/testData/codegen/boxInline/complex/closureChain.1.kt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// FILE: foo.kt
|
||||||
package foo
|
package foo
|
||||||
|
|
||||||
fun test1(): Int {
|
fun test1(): Int {
|
||||||
@@ -15,3 +16,14 @@ fun box(): String {
|
|||||||
|
|
||||||
return "OK"
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// FILE: bar.kt
|
||||||
|
package foo
|
||||||
|
|
||||||
|
class Inline() {
|
||||||
|
|
||||||
|
inline fun foo(closure1 : (l: Int) -> String, param: Int, closure2: String.() -> Int) : Int {
|
||||||
|
return closure1(param).closure2()
|
||||||
|
}
|
||||||
|
}
|
||||||
+13
@@ -3,6 +3,7 @@
|
|||||||
* Found at: compiler/testData/codegen/boxInline/defaultValues/defaultMethod.1.kt
|
* Found at: compiler/testData/codegen/boxInline/defaultValues/defaultMethod.1.kt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// FILE: foo.kt
|
||||||
package foo
|
package foo
|
||||||
|
|
||||||
import test.*
|
import test.*
|
||||||
@@ -27,3 +28,15 @@ fun box(): String {
|
|||||||
|
|
||||||
return "OK"
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// FILE: test.kt
|
||||||
|
package test
|
||||||
|
|
||||||
|
inline fun <T> simpleFun(arg: String = "O", lambda: (String) -> T): T {
|
||||||
|
return lambda(arg)
|
||||||
|
}
|
||||||
|
|
||||||
|
inline fun <T> simpleFunR(lambda: (String) -> T, arg: String = "O"): T {
|
||||||
|
return lambda(arg)
|
||||||
|
}
|
||||||
+13
@@ -3,6 +3,7 @@
|
|||||||
* Found at: compiler/testData/codegen/boxInline/capture/generics.1.kt
|
* Found at: compiler/testData/codegen/boxInline/capture/generics.1.kt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// FILE: foo.kt
|
||||||
package foo
|
package foo
|
||||||
|
|
||||||
import test.*
|
import test.*
|
||||||
@@ -22,3 +23,15 @@ fun box(): String {
|
|||||||
|
|
||||||
return "OK"
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// FILE: test.kt
|
||||||
|
package test
|
||||||
|
|
||||||
|
inline fun <T, R> mfun(arg: T, f: (T) -> R) : R {
|
||||||
|
return f(arg)
|
||||||
|
}
|
||||||
|
|
||||||
|
inline fun <T> doSmth(a: T): String {
|
||||||
|
return a.toString()
|
||||||
|
}
|
||||||
+9
@@ -3,6 +3,7 @@
|
|||||||
* Found at: compiler/testData/codegen/boxInline/defaultValues/inlineInDefaultParameter.1.kt
|
* Found at: compiler/testData/codegen/boxInline/defaultValues/inlineInDefaultParameter.1.kt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// FILE: foo.kt
|
||||||
package foo
|
package foo
|
||||||
|
|
||||||
import test.*
|
import test.*
|
||||||
@@ -31,3 +32,11 @@ fun box(): String {
|
|||||||
|
|
||||||
return "OK"
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// FILE: test.kt
|
||||||
|
package test
|
||||||
|
|
||||||
|
inline fun getStringInline(): String {
|
||||||
|
return "OK"
|
||||||
|
}
|
||||||
+9
@@ -1,3 +1,12 @@
|
|||||||
|
// FILE: a.kt
|
||||||
|
package foo
|
||||||
|
|
||||||
|
inline fun sum(a: Int, b: Int): Int {
|
||||||
|
return a + b
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// FILE: b.kt
|
||||||
package foo
|
package foo
|
||||||
|
|
||||||
// CHECK_NOT_CALLED: sum
|
// CHECK_NOT_CALLED: sum
|
||||||
+13
@@ -3,6 +3,7 @@
|
|||||||
* Found at: compiler/testData/codegen/boxInline/lambdaTransformation/lambdaCloning.1.kt
|
* Found at: compiler/testData/codegen/boxInline/lambdaTransformation/lambdaCloning.1.kt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// FILE: foo.kt
|
||||||
package foo
|
package foo
|
||||||
|
|
||||||
import test.*
|
import test.*
|
||||||
@@ -24,3 +25,15 @@ fun box(): String {
|
|||||||
|
|
||||||
return "OK"
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// FILE: test.kt
|
||||||
|
package test
|
||||||
|
|
||||||
|
inline fun <T> doSmth(a: T) : String {
|
||||||
|
return {a.toString()}()
|
||||||
|
}
|
||||||
|
|
||||||
|
inline fun <T> doSmth2(a: T) : String {
|
||||||
|
return {{a.toString()}()}()
|
||||||
|
}
|
||||||
+13
@@ -3,6 +3,7 @@
|
|||||||
* Found at: compiler/testData/codegen/boxInline/lambdaTransformation/lambdaInLambda2.1.kt
|
* Found at: compiler/testData/codegen/boxInline/lambdaTransformation/lambdaInLambda2.1.kt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// FILE: foo.kt
|
||||||
package foo
|
package foo
|
||||||
|
|
||||||
import test.*
|
import test.*
|
||||||
@@ -26,3 +27,15 @@ fun box(): String {
|
|||||||
|
|
||||||
return "OK"
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// FILE: test.kt
|
||||||
|
package test
|
||||||
|
|
||||||
|
inline fun <R> mfun(f: () -> R) {
|
||||||
|
f()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun concat(suffix: String, l: (s: String) -> Unit) {
|
||||||
|
l(suffix)
|
||||||
|
}
|
||||||
+17
@@ -3,6 +3,7 @@
|
|||||||
* Found at: compiler/testData/codegen/boxInline/lambdaTransformation/lambdaInLambdaNoInline.1.kt
|
* Found at: compiler/testData/codegen/boxInline/lambdaTransformation/lambdaInLambdaNoInline.1.kt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// FILE: foo.kt
|
||||||
package foo
|
package foo
|
||||||
|
|
||||||
import test.*
|
import test.*
|
||||||
@@ -58,3 +59,19 @@ fun box(): String {
|
|||||||
|
|
||||||
return "OK"
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// FILE: test.kt
|
||||||
|
package test
|
||||||
|
|
||||||
|
fun concat(suffix: String, l: (s: String) -> Unit) {
|
||||||
|
l(suffix)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun <T> noInlineFun(arg: T, f: (T) -> Unit) {
|
||||||
|
f(arg)
|
||||||
|
}
|
||||||
|
|
||||||
|
inline fun doSmth(a: String): String {
|
||||||
|
return a.toString()
|
||||||
|
}
|
||||||
+10
@@ -3,6 +3,7 @@
|
|||||||
* Found at: compiler/testData/codegen/boxInline/lambdaTransformation/regeneratedLambdaName.1.kt
|
* Found at: compiler/testData/codegen/boxInline/lambdaTransformation/regeneratedLambdaName.1.kt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// FILE: foo.kt
|
||||||
package foo
|
package foo
|
||||||
|
|
||||||
import test.*
|
import test.*
|
||||||
@@ -28,3 +29,12 @@ fun box(): String {
|
|||||||
|
|
||||||
return "OK"
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// FILE: test.kt
|
||||||
|
package test
|
||||||
|
|
||||||
|
|
||||||
|
inline fun <R> call(crossinline f: () -> R) : R {
|
||||||
|
return {f()} ()
|
||||||
|
}
|
||||||
+20
@@ -3,6 +3,7 @@
|
|||||||
* Found at: compiler/testData/codegen/boxInline/lambdaTransformation/sameCaptured.1.kt
|
* Found at: compiler/testData/codegen/boxInline/lambdaTransformation/sameCaptured.1.kt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// FILE: foo.kt
|
||||||
package foo
|
package foo
|
||||||
|
|
||||||
import test.*
|
import test.*
|
||||||
@@ -27,3 +28,22 @@ fun box(): String {
|
|||||||
|
|
||||||
return "OK"
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// FILE: test.kt
|
||||||
|
package test
|
||||||
|
|
||||||
|
|
||||||
|
inline fun <R> doWork(crossinline job: ()-> R) : R {
|
||||||
|
val k = 10;
|
||||||
|
return notInline({k; job()})
|
||||||
|
}
|
||||||
|
|
||||||
|
inline fun <R> doWork(crossinline job: ()-> R, crossinline job2: () -> R) : R {
|
||||||
|
val k = 10;
|
||||||
|
return notInline({k; job(); job2()})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun <R> notInline(job: ()-> R) : R {
|
||||||
|
return job()
|
||||||
|
}
|
||||||
+13
@@ -3,6 +3,7 @@
|
|||||||
* Found at: compiler/testData/codegen/boxInline/capture/simpleCapturingInClass.1.kt
|
* Found at: compiler/testData/codegen/boxInline/capture/simpleCapturingInClass.1.kt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// FILE: a.kt
|
||||||
package foo
|
package foo
|
||||||
|
|
||||||
fun testAll(): String {
|
fun testAll(): String {
|
||||||
@@ -75,3 +76,15 @@ fun box(): String {
|
|||||||
if (testAllWithCapturedValAndVar() != "112.513.514152122.523.52425H262728.5") return "testAllWithCapturedVal: ${testAllWithCapturedValAndVar()}"
|
if (testAllWithCapturedValAndVar() != "112.513.514152122.523.52425H262728.5") return "testAllWithCapturedVal: ${testAllWithCapturedValAndVar()}"
|
||||||
return "OK"
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// FILE: b.kt
|
||||||
|
package foo
|
||||||
|
|
||||||
|
class InlineAll {
|
||||||
|
|
||||||
|
inline fun inline(s: (Int, Double, Double, String, Long) -> String,
|
||||||
|
a1: Int, a2: Double, a3: Double, a4: String, a5: Long): String {
|
||||||
|
return s(a1, a2, a3, a4, a5)
|
||||||
|
}
|
||||||
|
}
|
||||||
+10
@@ -3,6 +3,7 @@
|
|||||||
* Found at: compiler/testData/codegen/boxInline/capture/simpleCapturingInPackage.1.kt
|
* Found at: compiler/testData/codegen/boxInline/capture/simpleCapturingInPackage.1.kt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// FILE: a.kt
|
||||||
package foo
|
package foo
|
||||||
|
|
||||||
fun testAll(): String {
|
fun testAll(): String {
|
||||||
@@ -67,3 +68,12 @@ fun box(): String {
|
|||||||
if (testAllWithCapturedValAndVar() != "112.513.514152122.523.52425H262728.5") return "testAllWithCapturedVal: ${testAllWithCapturedValAndVar()}"
|
if (testAllWithCapturedValAndVar() != "112.513.514152122.523.52425H262728.5") return "testAllWithCapturedVal: ${testAllWithCapturedValAndVar()}"
|
||||||
return "OK"
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// FILE: b.kt
|
||||||
|
package foo
|
||||||
|
|
||||||
|
inline fun inline(s: (Int, Double, Double, String, Long) -> String,
|
||||||
|
a1: Int, a2: Double, a3: Double, a4: String, a5: Long): String {
|
||||||
|
return s(a1, a2, a3, a4, a5)
|
||||||
|
}
|
||||||
+14
@@ -3,6 +3,7 @@
|
|||||||
* Found at: compiler/testData/codegen/boxInline/defaultValues/simpleDefaultMethod.1.kt
|
* Found at: compiler/testData/codegen/boxInline/defaultValues/simpleDefaultMethod.1.kt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// FILE: foo.kt
|
||||||
package foo
|
package foo
|
||||||
|
|
||||||
import test.*
|
import test.*
|
||||||
@@ -27,3 +28,16 @@ fun box(): String {
|
|||||||
|
|
||||||
return "OK"
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// FILE: test.kt
|
||||||
|
package test
|
||||||
|
|
||||||
|
inline fun emptyFun(arg: String = "O") {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
inline fun simpleFun(arg: String = "O"): String {
|
||||||
|
val r = arg;
|
||||||
|
return r;
|
||||||
|
}
|
||||||
+22
@@ -3,6 +3,7 @@
|
|||||||
* Found at: compiler/testData/codegen/boxInline/trait/trait.1.kt
|
* Found at: compiler/testData/codegen/boxInline/trait/trait.1.kt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// FILE: foo.kt
|
||||||
package foo
|
package foo
|
||||||
|
|
||||||
import test.*
|
import test.*
|
||||||
@@ -28,3 +29,24 @@ fun box(): String {
|
|||||||
|
|
||||||
return "OK"
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// FILE: test.kt
|
||||||
|
package test
|
||||||
|
|
||||||
|
internal interface InlineTrait {
|
||||||
|
|
||||||
|
public fun finalInline(s: () -> String): String {
|
||||||
|
return s()
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
public inline final fun finalInline(s: () -> String): String {
|
||||||
|
return s()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Z: InlineTrait {
|
||||||
|
|
||||||
|
}
|
||||||
+14
@@ -3,6 +3,7 @@
|
|||||||
* Found at: compiler/testData/codegen/boxInline/tryCatchFinally/tryCatch.1.kt
|
* Found at: compiler/testData/codegen/boxInline/tryCatchFinally/tryCatch.1.kt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// FILE: a.kt
|
||||||
package foo
|
package foo
|
||||||
|
|
||||||
fun test1() : Int {
|
fun test1() : Int {
|
||||||
@@ -58,3 +59,16 @@ fun box(): String {
|
|||||||
|
|
||||||
return "OK"
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FILE: b.kt
|
||||||
|
package foo
|
||||||
|
|
||||||
|
class My(val value: Int)
|
||||||
|
|
||||||
|
inline fun <T, R> T.perform(job: (T)-> R) : R {
|
||||||
|
return job(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
inline fun String.toInt2() : Int = parseInt(this)
|
||||||
|
|
||||||
|
class RuntimeExceptionWithValue(val value: String) : RuntimeException()
|
||||||
+31
@@ -3,6 +3,7 @@
|
|||||||
* Found at: compiler/testData/codegen/boxInline/tryCatchFinally/tryCatch2.1.kt
|
* Found at: compiler/testData/codegen/boxInline/tryCatchFinally/tryCatch2.1.kt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// FILE: a.kt
|
||||||
package foo
|
package foo
|
||||||
|
|
||||||
fun test1(): Int {
|
fun test1(): Int {
|
||||||
@@ -112,3 +113,33 @@ fun box(): String {
|
|||||||
|
|
||||||
return "OK"
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// FILE: b.kt
|
||||||
|
package foo
|
||||||
|
|
||||||
|
class My(val value: Int)
|
||||||
|
|
||||||
|
inline fun <T, R> T.performWithFail(job: (T)-> R, failJob: (T) -> R): R {
|
||||||
|
try {
|
||||||
|
return job(this)
|
||||||
|
} catch (e: RuntimeExceptionWithValue) {
|
||||||
|
return failJob(this)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
inline fun <T, R> T.performWithFail2(job: (T)-> R, failJob: (e: RuntimeExceptionWithValue, T) -> R): R {
|
||||||
|
try {
|
||||||
|
return job(this)
|
||||||
|
} catch (e: RuntimeExceptionWithValue) {
|
||||||
|
return failJob(e, this)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@native object Number {
|
||||||
|
fun parseInt(str: String): Int = noImpl
|
||||||
|
}
|
||||||
|
|
||||||
|
inline fun String.toInt2(): Int = parseInt(this)
|
||||||
|
|
||||||
|
class RuntimeExceptionWithValue(val value: String = "") : RuntimeException()
|
||||||
+27
@@ -3,6 +3,7 @@
|
|||||||
* Found at: compiler/testData/codegen/boxInline/tryCatchFinally/tryCatchFinally.1.kt
|
* Found at: compiler/testData/codegen/boxInline/tryCatchFinally/tryCatchFinally.1.kt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// FILE: a.kt
|
||||||
package foo
|
package foo
|
||||||
|
|
||||||
fun test1(): Int {
|
fun test1(): Int {
|
||||||
@@ -78,3 +79,29 @@ fun box(): String {
|
|||||||
|
|
||||||
return "OK"
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// FILE: b.kt
|
||||||
|
package foo
|
||||||
|
|
||||||
|
class My(val value: Int)
|
||||||
|
|
||||||
|
inline fun <T, R> T.performWithFinally(job: (T)-> R, finallyFun: (T) -> R) : R {
|
||||||
|
try {
|
||||||
|
job(this)
|
||||||
|
} finally {
|
||||||
|
return finallyFun(this)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
inline fun <T, R> T.performWithFailFinally(job: (T)-> R, failJob : (e: RuntimeException, T) -> R, finallyFun: (T) -> R) : R {
|
||||||
|
try {
|
||||||
|
job(this)
|
||||||
|
} catch (e: RuntimeException) {
|
||||||
|
failJob(e, this)
|
||||||
|
} finally {
|
||||||
|
return finallyFun(this)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
inline fun String.toInt2() : Int = parseInt(this)
|
||||||
+28
-4
@@ -1,8 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* Copy of JVM-backend test
|
* Copy of JVM-backend test
|
||||||
* Found at: compiler/testData/codegen/boxInline/complex/use.2.kt
|
* Found at: compiler/testData/codegen/boxInline/complex/use.1.kt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// FILE: foo.kt
|
||||||
|
package foo
|
||||||
|
|
||||||
|
import test.*
|
||||||
|
|
||||||
|
fun Data.test1(d: Data) : Int {
|
||||||
|
val input2 = Input(this)
|
||||||
|
val input = Input(this)
|
||||||
|
return input.use<Input, Int>{
|
||||||
|
val output = Output(d)
|
||||||
|
output.use<Output,Int>{
|
||||||
|
input.copyTo(output, 10)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
|
||||||
|
val result = Data().test1(Data())
|
||||||
|
if (result != 100) return "test1: ${result}"
|
||||||
|
|
||||||
|
return "OK"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// FILE: test.kt
|
||||||
package test
|
package test
|
||||||
|
|
||||||
public class Data()
|
public class Data()
|
||||||
@@ -41,6 +68,3 @@ public inline fun <T: Closeable, R> T.use(block: (T)-> R) : R {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
+34
@@ -3,6 +3,7 @@
|
|||||||
* Found at: compiler/testData/codegen/boxInline/complex/with.1.kt
|
* Found at: compiler/testData/codegen/boxInline/complex/with.1.kt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// FILE: foo.kt
|
||||||
package foo
|
package foo
|
||||||
|
|
||||||
import test.*
|
import test.*
|
||||||
@@ -47,3 +48,36 @@ fun box(): String {
|
|||||||
|
|
||||||
return "OK"
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// FILE: test.kt
|
||||||
|
package test
|
||||||
|
|
||||||
|
|
||||||
|
public class Data()
|
||||||
|
|
||||||
|
public class Input(val d: Data) : Closeable {
|
||||||
|
public fun data() : Int = 100
|
||||||
|
}
|
||||||
|
public class Output(val d: Data) : Closeable {
|
||||||
|
public fun doOutput(data: Int): Int = data
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface Closeable {
|
||||||
|
open public fun close() {}
|
||||||
|
}
|
||||||
|
|
||||||
|
public inline fun <R> use(block: ()-> R) : R {
|
||||||
|
return block()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun <R> useNoInline(block: ()-> R) : R {
|
||||||
|
return block()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public fun Input.copyTo(output: Output, size: Int): Int {
|
||||||
|
return output.doOutput(this.data())
|
||||||
|
}
|
||||||
|
|
||||||
|
public inline fun <T> with2(receiver : T, crossinline body : T.() -> Unit) : Unit = {receiver.body()}()
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user