From cf9ad635e1f25d614d386739bff35b0a86e7902d Mon Sep 17 00:00:00 2001 From: Anton Bannykh Date: Sun, 8 Jul 2018 22:46:01 +0300 Subject: [PATCH] JS: add more tests --- .../suspend/inlineSuspendContinuation.kt | 1 + .../inlineSuspendOfCrossinlineOrdinary.kt | 7 +- .../inlineSuspendOfNoinlineOrdinary.kt | 7 +- .../boxInline/suspend/multipleLocals.kt | 6 +- .../inlineOrdinaryOfCrossinlineSuspend.kt | 2 +- .../inlineOrdinaryOfNoinlineSuspend.kt | 2 +- .../inlineSuspendOfCrossinlineOrdinary.kt | 7 +- .../inlineSuspendOfCrossinlineSuspend.kt | 2 +- .../inlineSuspendOfNoinlineOrdinary.kt | 7 +- .../inlineSuspendOfNoinlineSuspend.kt | 2 +- .../generators/tests/GenerateJsTests.kt | 4 + .../InlineSuspendTestsGenerated.java | 496 ++++++++++++++++++ .../semantics/JsCodegenBoxTestGenerated.java | 95 ++-- .../abstractClassesForGeneratedTests.kt | 2 + 14 files changed, 585 insertions(+), 55 deletions(-) create mode 100644 js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/InlineSuspendTestsGenerated.java diff --git a/compiler/testData/codegen/boxInline/suspend/inlineSuspendContinuation.kt b/compiler/testData/codegen/boxInline/suspend/inlineSuspendContinuation.kt index c8f990edbd5..833c0af0d58 100644 --- a/compiler/testData/codegen/boxInline/suspend/inlineSuspendContinuation.kt +++ b/compiler/testData/codegen/boxInline/suspend/inlineSuspendContinuation.kt @@ -3,6 +3,7 @@ // WITH_RUNTIME // WITH_COROUTINES // NO_CHECK_LAMBDA_INLINING +// TARGET_BACKEND: JVM suspend inline fun test1(c: () -> Unit) { c() diff --git a/compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineOrdinary.kt b/compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineOrdinary.kt index 52ff3ae2bbf..56a148b7b70 100644 --- a/compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineOrdinary.kt +++ b/compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineOrdinary.kt @@ -2,13 +2,18 @@ // COMMON_COROUTINES_TEST // WITH_RUNTIME // WITH_COROUTINES - +// IGNORE_BACKEND: JS import COROUTINES_PACKAGE.* import helpers.* // Block is allowed to be called inside the body of owner inline function // Block is allowed to be called from nested classes/lambdas (as common crossinlines) +// Needed for JS compatibility +interface Runnable { + fun run(): Unit +} + suspend inline fun test1(crossinline c: () -> Unit) { c() } diff --git a/compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineOrdinary.kt b/compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineOrdinary.kt index f4949da52f7..936b0b2d079 100644 --- a/compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineOrdinary.kt +++ b/compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineOrdinary.kt @@ -2,13 +2,18 @@ // COMMON_COROUTINES_TEST // WITH_RUNTIME // WITH_COROUTINES - +// IGNORE_BACKEND: JS import COROUTINES_PACKAGE.* import helpers.* // Block is allowed to be called inside the body of owner inline function // Block is allowed to be called from nested classes/lambdas (as common crossinlines) +// Needed for JS compatibility +interface Runnable { + fun run(): Unit +} + suspend inline fun test1(noinline c: () -> Unit) { c() } diff --git a/compiler/testData/codegen/boxInline/suspend/multipleLocals.kt b/compiler/testData/codegen/boxInline/suspend/multipleLocals.kt index 9f1cd2e97a7..e700dda418e 100644 --- a/compiler/testData/codegen/boxInline/suspend/multipleLocals.kt +++ b/compiler/testData/codegen/boxInline/suspend/multipleLocals.kt @@ -3,12 +3,16 @@ // WITH_RUNTIME // WITH_COROUTINES // NO_CHECK_LAMBDA_INLINING - object Result { var a: String = "" var b: Int = 0 } +// Needed for JS compatibility +interface Runnable { + fun run(): Unit +} + suspend inline fun inlineMe(c: suspend () -> Unit) { var a = "" var b = 0 diff --git a/compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfCrossinlineSuspend.kt b/compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfCrossinlineSuspend.kt index 8296129a7ea..e94339a6c65 100644 --- a/compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfCrossinlineSuspend.kt +++ b/compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfCrossinlineSuspend.kt @@ -2,7 +2,7 @@ // COMMON_COROUTINES_TEST // WITH_RUNTIME // WITH_COROUTINES - +// SKIP_SOURCEMAP_REMAPPING import COROUTINES_PACKAGE.* import helpers.* diff --git a/compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfNoinlineSuspend.kt b/compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfNoinlineSuspend.kt index 26971d321da..9e65cc7e552 100644 --- a/compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfNoinlineSuspend.kt +++ b/compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfNoinlineSuspend.kt @@ -2,7 +2,7 @@ // COMMON_COROUTINES_TEST // WITH_RUNTIME // WITH_COROUTINES - +// SKIP_SOURCEMAP_REMAPPING import COROUTINES_PACKAGE.* import helpers.* diff --git a/compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineOrdinary.kt b/compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineOrdinary.kt index db45628aeeb..f72cdb13483 100644 --- a/compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineOrdinary.kt +++ b/compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineOrdinary.kt @@ -2,13 +2,18 @@ // COMMON_COROUTINES_TEST // WITH_RUNTIME // WITH_COROUTINES - +// IGNORE_BACKEND: JS import COROUTINES_PACKAGE.* import helpers.* // Block is allowed to be called inside the body of owner inline function // Block is allowed to be called from nested classes/lambdas (as common crossinlines) +// Needed for JS compatibility +interface Runnable { + fun run(): Unit +} + class Controller { var res = "FAIL 1" diff --git a/compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineSuspend.kt b/compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineSuspend.kt index b8a1f612892..126d7fd59c2 100644 --- a/compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineSuspend.kt +++ b/compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineSuspend.kt @@ -2,7 +2,7 @@ // COMMON_COROUTINES_TEST // WITH_RUNTIME // WITH_COROUTINES - +// SKIP_SOURCEMAP_REMAPPING import COROUTINES_PACKAGE.* import helpers.* diff --git a/compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineOrdinary.kt b/compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineOrdinary.kt index ad42a35a057..1180c7c4e09 100644 --- a/compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineOrdinary.kt +++ b/compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineOrdinary.kt @@ -2,13 +2,18 @@ // COMMON_COROUTINES_TEST // WITH_RUNTIME // WITH_COROUTINES - +// IGNORE_BACKEND: JS import COROUTINES_PACKAGE.* import helpers.* // Block is allowed to be called inside the body of owner inline function // Block is allowed to be called from nested classes/lambdas (as common crossinlines) +// Needed for JS compatibility +interface Runnable { + fun run(): Unit +} + class Controller { var res = "FAIL 1" diff --git a/compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineSuspend.kt b/compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineSuspend.kt index 14c5fc5db7d..1e13cf2866d 100644 --- a/compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineSuspend.kt +++ b/compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineSuspend.kt @@ -2,7 +2,7 @@ // COMMON_COROUTINES_TEST // WITH_RUNTIME // WITH_COROUTINES - +// SKIP_SOURCEMAP_REMAPPING import COROUTINES_PACKAGE.* import helpers.* diff --git a/js/js.tests/test/org/jetbrains/kotlin/generators/tests/GenerateJsTests.kt b/js/js.tests/test/org/jetbrains/kotlin/generators/tests/GenerateJsTests.kt index 0ee22674f28..e6cddef4e2b 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/generators/tests/GenerateJsTests.kt +++ b/js/js.tests/test/org/jetbrains/kotlin/generators/tests/GenerateJsTests.kt @@ -100,6 +100,10 @@ fun main(args: Array) { model("codegen/boxInline/defaultValues/", targetBackend = TargetBackend.JS_IR) } + testClass { + model("codegen/boxInline/suspend/", targetBackend = TargetBackend.JS) + } + testClass { model("codegen/box/arrays", targetBackend = TargetBackend.JS) } diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/InlineSuspendTestsGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/InlineSuspendTestsGenerated.java new file mode 100644 index 00000000000..9b987c61eba --- /dev/null +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/InlineSuspendTestsGenerated.java @@ -0,0 +1,496 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +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.TargetBackend; +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("compiler/testData/codegen/boxInline/suspend") +@TestDataPath("$PROJECT_ROOT") +@RunWith(JUnit3RunnerWithInners.class) +public class InlineSuspendTestsGenerated extends AbstractInlineSuspendTests { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInSuspend() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("capturedVariables.kt") + public void testCapturedVariables_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/capturedVariables.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("capturedVariables.kt") + public void testCapturedVariables_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/capturedVariables.kt", "kotlin.coroutines"); + } + + @TestMetadata("crossinlineSuspendLambdaInsideCrossinlineSuspendLambda.kt") + public void testCrossinlineSuspendLambdaInsideCrossinlineSuspendLambda_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/crossinlineSuspendLambdaInsideCrossinlineSuspendLambda.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("crossinlineSuspendLambdaInsideCrossinlineSuspendLambda.kt") + public void testCrossinlineSuspendLambdaInsideCrossinlineSuspendLambda_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/crossinlineSuspendLambdaInsideCrossinlineSuspendLambda.kt", "kotlin.coroutines"); + } + + @TestMetadata("inlineOrdinaryOfCrossinlineSuspend.kt") + public void testInlineOrdinaryOfCrossinlineSuspend_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfCrossinlineSuspend.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("inlineOrdinaryOfCrossinlineSuspend.kt") + public void testInlineOrdinaryOfCrossinlineSuspend_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfCrossinlineSuspend.kt", "kotlin.coroutines"); + } + + @TestMetadata("inlineOrdinaryOfNoinlineSuspend.kt") + public void testInlineOrdinaryOfNoinlineSuspend_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfNoinlineSuspend.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("inlineOrdinaryOfNoinlineSuspend.kt") + public void testInlineOrdinaryOfNoinlineSuspend_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfNoinlineSuspend.kt", "kotlin.coroutines"); + } + + @TestMetadata("inlineSuspendOfCrossinlineOrdinary.kt") + public void testInlineSuspendOfCrossinlineOrdinary_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineOrdinary.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("inlineSuspendOfCrossinlineOrdinary.kt") + public void testInlineSuspendOfCrossinlineOrdinary_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineOrdinary.kt", "kotlin.coroutines"); + } + + @TestMetadata("inlineSuspendOfCrossinlineSuspend.kt") + public void testInlineSuspendOfCrossinlineSuspend_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineSuspend.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("inlineSuspendOfCrossinlineSuspend.kt") + public void testInlineSuspendOfCrossinlineSuspend_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineSuspend.kt", "kotlin.coroutines"); + } + + @TestMetadata("inlineSuspendOfNoinlineOrdinary.kt") + public void testInlineSuspendOfNoinlineOrdinary_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineOrdinary.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("inlineSuspendOfNoinlineOrdinary.kt") + public void testInlineSuspendOfNoinlineOrdinary_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineOrdinary.kt", "kotlin.coroutines"); + } + + @TestMetadata("inlineSuspendOfNoinlineSuspend.kt") + public void testInlineSuspendOfNoinlineSuspend_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineSuspend.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("inlineSuspendOfNoinlineSuspend.kt") + public void testInlineSuspendOfNoinlineSuspend_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineSuspend.kt", "kotlin.coroutines"); + } + + @TestMetadata("inlineSuspendOfOrdinary.kt") + public void testInlineSuspendOfOrdinary_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfOrdinary.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("inlineSuspendOfOrdinary.kt") + public void testInlineSuspendOfOrdinary_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfOrdinary.kt", "kotlin.coroutines"); + } + + @TestMetadata("inlineSuspendOfSuspend.kt") + public void testInlineSuspendOfSuspend_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfSuspend.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("inlineSuspendOfSuspend.kt") + public void testInlineSuspendOfSuspend_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfSuspend.kt", "kotlin.coroutines"); + } + + @TestMetadata("multipleLocals.kt") + public void testMultipleLocals_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/multipleLocals.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("multipleLocals.kt") + public void testMultipleLocals_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/multipleLocals.kt", "kotlin.coroutines"); + } + + @TestMetadata("multipleSuspensionPoints.kt") + public void testMultipleSuspensionPoints_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/multipleSuspensionPoints.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("multipleSuspensionPoints.kt") + public void testMultipleSuspensionPoints_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/multipleSuspensionPoints.kt", "kotlin.coroutines"); + } + + @TestMetadata("returnValue.kt") + public void testReturnValue_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/returnValue.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("returnValue.kt") + public void testReturnValue_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/returnValue.kt", "kotlin.coroutines"); + } + + @TestMetadata("tryCatchStackTransform.kt") + public void testTryCatchStackTransform_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/tryCatchStackTransform.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("tryCatchStackTransform.kt") + public void testTryCatchStackTransform_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/tryCatchStackTransform.kt", "kotlin.coroutines"); + } + + @TestMetadata("compiler/testData/codegen/boxInline/suspend/callableReference") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class CallableReference extends AbstractInlineSuspendTests { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInCallableReference() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/callableReference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("ordinaryParameter.kt") + public void testOrdinaryParameter() throws Exception { + runTest("compiler/testData/codegen/boxInline/suspend/callableReference/ordinaryParameter.kt"); + } + + @TestMetadata("simple.kt") + public void testSimple_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("simple.kt") + public void testSimple_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt", "kotlin.coroutines"); + } + + @TestMetadata("suspendOfOrdinary.kt") + public void testSuspendOfOrdinary() throws Exception { + runTest("compiler/testData/codegen/boxInline/suspend/callableReference/suspendOfOrdinary.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/boxInline/suspend/defaultParameter") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class DefaultParameter extends AbstractInlineSuspendTests { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInDefaultParameter() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/defaultParameter"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("defaultValueCrossinline.kt") + public void testDefaultValueCrossinline_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueCrossinline.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("defaultValueCrossinline.kt") + public void testDefaultValueCrossinline_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueCrossinline.kt", "kotlin.coroutines"); + } + + @TestMetadata("defaultValueInline.kt") + public void testDefaultValueInline_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInline.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("defaultValueInline.kt") + public void testDefaultValueInline_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInline.kt", "kotlin.coroutines"); + } + } + + @TestMetadata("compiler/testData/codegen/boxInline/suspend/inlineUsedAsNoinline") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class InlineUsedAsNoinline extends AbstractInlineSuspendTests { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInInlineUsedAsNoinline() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/inlineUsedAsNoinline"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("inlineOnly.kt") + public void testInlineOnly() throws Exception { + runTest("compiler/testData/codegen/boxInline/suspend/inlineUsedAsNoinline/inlineOnly.kt"); + } + + @TestMetadata("simpleNamed.kt") + public void testSimpleNamed() throws Exception { + runTest("compiler/testData/codegen/boxInline/suspend/inlineUsedAsNoinline/simpleNamed.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/boxInline/suspend/receiver") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Receiver extends AbstractInlineSuspendTests { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInReceiver() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/receiver"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("inlineOrdinaryOfCrossinlineSuspend.kt") + public void testInlineOrdinaryOfCrossinlineSuspend_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfCrossinlineSuspend.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("inlineOrdinaryOfCrossinlineSuspend.kt") + public void testInlineOrdinaryOfCrossinlineSuspend_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfCrossinlineSuspend.kt", "kotlin.coroutines"); + } + + @TestMetadata("inlineOrdinaryOfNoinlineSuspend.kt") + public void testInlineOrdinaryOfNoinlineSuspend_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfNoinlineSuspend.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("inlineOrdinaryOfNoinlineSuspend.kt") + public void testInlineOrdinaryOfNoinlineSuspend_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfNoinlineSuspend.kt", "kotlin.coroutines"); + } + + @TestMetadata("inlineSuspendOfCrossinlineOrdinary.kt") + public void testInlineSuspendOfCrossinlineOrdinary_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineOrdinary.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("inlineSuspendOfCrossinlineOrdinary.kt") + public void testInlineSuspendOfCrossinlineOrdinary_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineOrdinary.kt", "kotlin.coroutines"); + } + + @TestMetadata("inlineSuspendOfCrossinlineSuspend.kt") + public void testInlineSuspendOfCrossinlineSuspend_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineSuspend.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("inlineSuspendOfCrossinlineSuspend.kt") + public void testInlineSuspendOfCrossinlineSuspend_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineSuspend.kt", "kotlin.coroutines"); + } + + @TestMetadata("inlineSuspendOfNoinlineOrdinary.kt") + public void testInlineSuspendOfNoinlineOrdinary_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineOrdinary.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("inlineSuspendOfNoinlineOrdinary.kt") + public void testInlineSuspendOfNoinlineOrdinary_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineOrdinary.kt", "kotlin.coroutines"); + } + + @TestMetadata("inlineSuspendOfNoinlineSuspend.kt") + public void testInlineSuspendOfNoinlineSuspend_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineSuspend.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("inlineSuspendOfNoinlineSuspend.kt") + public void testInlineSuspendOfNoinlineSuspend_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineSuspend.kt", "kotlin.coroutines"); + } + + @TestMetadata("inlineSuspendOfOrdinary.kt") + public void testInlineSuspendOfOrdinary_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfOrdinary.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("inlineSuspendOfOrdinary.kt") + public void testInlineSuspendOfOrdinary_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfOrdinary.kt", "kotlin.coroutines"); + } + + @TestMetadata("inlineSuspendOfSuspend.kt") + public void testInlineSuspendOfSuspend_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfSuspend.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("inlineSuspendOfSuspend.kt") + public void testInlineSuspendOfSuspend_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfSuspend.kt", "kotlin.coroutines"); + } + } + + @TestMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class StateMachine extends AbstractInlineSuspendTests { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInStateMachine() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/stateMachine"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("innerLambdaInsideLambda.kt") + public void testInnerLambdaInsideLambda_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaInsideLambda.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("innerLambdaInsideLambda.kt") + public void testInnerLambdaInsideLambda_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaInsideLambda.kt", "kotlin.coroutines"); + } + + @TestMetadata("innerLambdaWithoutCrossinline.kt") + public void testInnerLambdaWithoutCrossinline_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaWithoutCrossinline.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("innerLambdaWithoutCrossinline.kt") + public void testInnerLambdaWithoutCrossinline_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaWithoutCrossinline.kt", "kotlin.coroutines"); + } + + @TestMetadata("innerLambda.kt") + public void testInnerLambda_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambda.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("innerLambda.kt") + public void testInnerLambda_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambda.kt", "kotlin.coroutines"); + } + + @TestMetadata("innerMadnessCallSite.kt") + public void testInnerMadnessCallSite_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadnessCallSite.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("innerMadnessCallSite.kt") + public void testInnerMadnessCallSite_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadnessCallSite.kt", "kotlin.coroutines"); + } + + @TestMetadata("innerMadness.kt") + public void testInnerMadness_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadness.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("innerMadness.kt") + public void testInnerMadness_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadness.kt", "kotlin.coroutines"); + } + + @TestMetadata("innerObjectInsideInnerObject.kt") + public void testInnerObjectInsideInnerObject_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectInsideInnerObject.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("innerObjectInsideInnerObject.kt") + public void testInnerObjectInsideInnerObject_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectInsideInnerObject.kt", "kotlin.coroutines"); + } + + @TestMetadata("innerObjectSeveralFunctions.kt") + public void testInnerObjectSeveralFunctions_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectSeveralFunctions.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("innerObjectSeveralFunctions.kt") + public void testInnerObjectSeveralFunctions_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectSeveralFunctions.kt", "kotlin.coroutines"); + } + + @TestMetadata("innerObjectWithoutCapturingCrossinline.kt") + public void testInnerObjectWithoutCapturingCrossinline_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectWithoutCapturingCrossinline.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("innerObjectWithoutCapturingCrossinline.kt") + public void testInnerObjectWithoutCapturingCrossinline_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectWithoutCapturingCrossinline.kt", "kotlin.coroutines"); + } + + @TestMetadata("innerObject.kt") + public void testInnerObject_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObject.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("innerObject.kt") + public void testInnerObject_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObject.kt", "kotlin.coroutines"); + } + + @TestMetadata("normalInline.kt") + public void testNormalInline_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/normalInline.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("normalInline.kt") + public void testNormalInline_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/normalInline.kt", "kotlin.coroutines"); + } + + @TestMetadata("numberOfSuspentions.kt") + public void testNumberOfSuspentions_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/numberOfSuspentions.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("numberOfSuspentions.kt") + public void testNumberOfSuspentions_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/numberOfSuspentions.kt", "kotlin.coroutines"); + } + } +} diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index 8bf4a090497..722e87a08d2 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -6007,6 +6007,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlus.kt", "kotlin.coroutines.experimental"); } + @TestMetadata("suspendOperatorPlus.kt") + public void testSuspendOperatorPlus_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlus.kt", "kotlin.coroutines"); + } + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) @@ -6016,28 +6021,31 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { } private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { - KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS, - testDataFilePath); + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS, testDataFilePath); } public void testAllFilesPresentInCallableReference() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File( - "compiler/testData/codegen/box/coroutines/featureIntersection/callableReference"), - Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); } @TestMetadata("fromJava.kt") public void testFromJava_1_2() throws Exception { - runTestWithPackageReplacement( - "compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/fromJava.kt", - "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/fromJava.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("fromJava.kt") + public void testFromJava_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/fromJava.kt", "kotlin.coroutines"); } @TestMetadata("longArgs.kt") public void testLongArgs_1_2() throws Exception { - runTestWithPackageReplacement( - "compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/longArgs.kt", - "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/longArgs.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("longArgs.kt") + public void testLongArgs_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/longArgs.kt", "kotlin.coroutines"); } @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound") @@ -6049,22 +6057,21 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { } private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { - KotlinTestUtils - .runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS, - testDataFilePath); + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS, testDataFilePath); } public void testAllFilesPresentInBound() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File( - "compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound"), - Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); } @TestMetadata("emptyLHS.kt") public void testEmptyLHS_1_2() throws Exception { - runTestWithPackageReplacement( - "compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/emptyLHS.kt", - "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/emptyLHS.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("emptyLHS.kt") + public void testEmptyLHS_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/emptyLHS.kt", "kotlin.coroutines"); } } @@ -6077,29 +6084,31 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { } private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { - KotlinTestUtils - .runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS, - testDataFilePath); + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS, testDataFilePath); } public void testAllFilesPresentInFunction() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File( - "compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function"), - Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); } @TestMetadata("genericCallableReferenceArguments.kt") public void testGenericCallableReferenceArguments_1_2() throws Exception { - runTestWithPackageReplacement( - "compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferenceArguments.kt", - "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferenceArguments.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("genericCallableReferenceArguments.kt") + public void testGenericCallableReferenceArguments_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferenceArguments.kt", "kotlin.coroutines"); } @TestMetadata("genericCallableReferencesWithNullableTypes.kt") public void testGenericCallableReferencesWithNullableTypes_1_2() throws Exception { - runTestWithPackageReplacement( - "compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithNullableTypes.kt", - "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithNullableTypes.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("genericCallableReferencesWithNullableTypes.kt") + public void testGenericCallableReferencesWithNullableTypes_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithNullableTypes.kt", "kotlin.coroutines"); } @TestMetadata("getArityViaFunctionImpl.kt") @@ -6116,32 +6125,26 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { } private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { - KotlinTestUtils - .runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS, - testDataFilePath); + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS, testDataFilePath); } public void testAllFilesPresentInLocal() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File( - "compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local"), - Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); } @TestMetadata("equalsHashCode.kt") public void testEqualsHashCode_1_2() throws Exception { - runTestWithPackageReplacement( - "compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/equalsHashCode.kt", - "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/equalsHashCode.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("equalsHashCode.kt") + public void testEqualsHashCode_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/equalsHashCode.kt", "kotlin.coroutines"); } } } } - @TestMetadata("suspendOperatorPlus.kt") - public void testSuspendOperatorPlus_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlus.kt", "kotlin.coroutines"); - } - @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/abstractClassesForGeneratedTests.kt b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/abstractClassesForGeneratedTests.kt index 9e98a112108..98a6c80ef81 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/abstractClassesForGeneratedTests.kt +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/abstractClassesForGeneratedTests.kt @@ -29,6 +29,8 @@ abstract class AbstractEnumValuesInlineTests : BorrowedInlineTest("enum/") abstract class AbstractInlineDefaultValuesTests : BorrowedInlineTest("defaultValues/") +abstract class AbstractInlineSuspendTests : BorrowedInlineTest("suspend/") + abstract class AbstractBoxJsTest : BasicBoxTest( BasicBoxTest.TEST_DATA_DIR_PATH + "box/", "box/"