diff --git a/compiler/testData/codegen/scriptCustom/fibwprunner.kts b/compiler/testData/codegen/scriptCustom/fibwprunner.kts index 575bc2e42e8..dcc7da17317 100644 --- a/compiler/testData/codegen/scriptCustom/fibwprunner.kts +++ b/compiler/testData/codegen/scriptCustom/fibwprunner.kts @@ -1,3 +1,3 @@ -val fibwp = test.Fibwp(5) +val fibwp = test.Fibwp_lang(5) val callResult = fibwp.fib(4) -val result = fibwp.num + fibwp.result - 5 \ No newline at end of file +val result = fibwp.num + fibwp.result - 5 diff --git a/compiler/tests-common/org/jetbrains/kotlin/codegen/CodegenTestCase.java b/compiler/tests-common/org/jetbrains/kotlin/codegen/CodegenTestCase.java index b3d9c996f5f..03c6885e831 100644 --- a/compiler/tests-common/org/jetbrains/kotlin/codegen/CodegenTestCase.java +++ b/compiler/tests-common/org/jetbrains/kotlin/codegen/CodegenTestCase.java @@ -252,6 +252,7 @@ public abstract class CodegenTestCase extends KtUsefulTestCase { try { File file = new File(fullPath); String content = FileUtil.loadFile(file, Charsets.UTF_8.name(), true); + assert myFiles == null : "Should not initialize myFiles twice"; myFiles = CodegenTestFiles.create(file.getName(), content, myEnvironment.getProject()); return content; } catch (IOException e) { diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/GenerateNotNullAssertionsTest.java b/compiler/tests/org/jetbrains/kotlin/codegen/GenerateNotNullAssertionsTest.java index 437569106cb..28cbba34e39 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/GenerateNotNullAssertionsTest.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/GenerateNotNullAssertionsTest.java @@ -55,6 +55,7 @@ public class GenerateNotNullAssertionsTest extends CodegenTestCase { configuration.put(JVMConfigurationKeys.DISABLE_PARAM_ASSERTIONS, disableParamAssertions); myEnvironment = KotlinCoreEnvironment.createForTests(getTestRootDisposable(), configuration, EnvironmentConfigFiles.JVM_CONFIG_FILES); + myFiles = null; } private void loadSource(@NotNull String fileName) { diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/OuterClassGenTest.java b/compiler/tests/org/jetbrains/kotlin/codegen/OuterClassGenTest.java index e28deb4d091..64f02e9ba48 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/OuterClassGenTest.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/OuterClassGenTest.java @@ -109,9 +109,10 @@ public class OuterClassGenTest extends CodegenTestCase { public void testLocalObjectInLambdaInlinedIntoObject() throws Exception { OuterClassInfo intoObjectInfo = new OuterClassInfo("foo/Bar", "objectInLambdaInlinedIntoObject", "()V"); - doCustomTest("foo/Bar\\$objectInLambdaInlinedIntoObject\\$\\$inlined\\$inlineFoo\\$1", intoObjectInfo, "inlineObject"); + } + public void testLocalObjectInLambdaInlinedIntoObject2() throws Exception { OuterClassInfo objectInLambda = new OuterClassInfo("foo/Bar$objectInLambdaInlinedIntoObject$$inlined$inlineFoo$1", "run", "()V"); doCustomTest("foo/Bar\\$objectInLambdaInlinedIntoObject\\$\\$inlined\\$inlineFoo\\$1\\$lambda\\$1", objectInLambda, "inlineObject"); @@ -134,9 +135,10 @@ public class OuterClassGenTest extends CodegenTestCase { public void testLambdaInLambdaInlinedIntoObject() throws Exception { OuterClassInfo intoObjectInfo = new OuterClassInfo("foo/Bar", "objectInLambdaInlinedIntoObject", "()V"); - doCustomTest("foo/Bar\\$objectInLambdaInlinedIntoObject\\$\\$inlined\\$inlineFoo\\$1", intoObjectInfo, "inlineLambda"); + } + public void testLambdaInLambdaInlinedIntoObject2() throws Exception { OuterClassInfo objectInLambda = new OuterClassInfo("foo/Bar$objectInLambdaInlinedIntoObject$$inlined$inlineFoo$1", "invoke", "()V"); doCustomTest("foo/Bar\\$objectInLambdaInlinedIntoObject\\$\\$inlined\\$inlineFoo\\$1\\$lambda\\$1", objectInLambda, "inlineLambda"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ScriptGenTest.kt b/compiler/tests/org/jetbrains/kotlin/codegen/ScriptGenTest.kt index a029f5bcf40..5a8adc307e7 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ScriptGenTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ScriptGenTest.kt @@ -24,9 +24,7 @@ import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment import org.jetbrains.kotlin.config.JVMConfigurationKeys import org.jetbrains.kotlin.config.addKotlinSourceRoots import org.jetbrains.kotlin.script.KotlinScriptDefinitionFromTemplate -import org.jetbrains.kotlin.script.ScriptTemplateDefinition import org.jetbrains.kotlin.scripts.ScriptWithIntParam -import org.jetbrains.kotlin.scripts.TestKotlinScriptDependenciesResolver import org.jetbrains.kotlin.test.ConfigurationKind import org.jetbrains.kotlin.test.KotlinTestUtils import org.jetbrains.kotlin.test.TestJdkKind @@ -107,8 +105,6 @@ class ScriptGenTest : CodegenTestCase() { myEnvironment = KotlinCoreEnvironment.createForTests(testRootDisposable, configuration, EnvironmentConfigFiles.JVM_CONFIG_FILES) - for (path in sourcePaths) { - loadFile(path) - } + loadFiles(*sourcePaths.toTypedArray()) } }