diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/CodegenTestCase.java b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/CodegenTestCase.java index b5ef7b3aa46..f3f33960ab4 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/CodegenTestCase.java +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/CodegenTestCase.java @@ -785,24 +785,21 @@ public abstract class CodegenTestCase extends KtUsefulTestCase { protected void doTest(String filePath) throws Exception { File file = new File(filePath); - String expectedText = KotlinTestUtils.doLoadFile(file); Ref javaFilesDir = Ref.create(); - List testFiles = createTestFiles(file, expectedText, javaFilesDir, ""); + String expectedText = KotlinTestUtils.doLoadFile(file); + if (!coroutinesPackage.isEmpty()) { + expectedText = expectedText.replace("COROUTINES_PACKAGE", coroutinesPackage); + } + + List testFiles = createTestFiles(file, expectedText, javaFilesDir, coroutinesPackage); doMultiFileTest(file, testFiles, javaFilesDir.get()); } protected void doTestWithCoroutinesPackageReplacement(String filePath, String packageName) throws Exception { - File file = new File(filePath); - String expectedText = KotlinTestUtils.doLoadFile(file); - expectedText = expectedText.replace("COROUTINES_PACKAGE", packageName); this.coroutinesPackage = packageName; - Ref javaFilesDir = Ref.create(); - - List testFiles = createTestFiles(file, expectedText, javaFilesDir, coroutinesPackage); - - doMultiFileTest(file, testFiles, javaFilesDir.get()); + doTest(filePath); } @NotNull