diff --git a/compiler/tests/org/jetbrains/kotlin/cli/jvm/repl/GenericReplTest.kt b/compiler/tests/org/jetbrains/kotlin/cli/jvm/repl/GenericReplTest.kt index c85c900db7d..d73a2bec5c4 100644 --- a/compiler/tests/org/jetbrains/kotlin/cli/jvm/repl/GenericReplTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/cli/jvm/repl/GenericReplTest.kt @@ -91,8 +91,10 @@ class GenericReplTest : TestCase() { listOf(File(KotlinIntegrationTestBase.getCompilerLib(), "kotlin-runtime.jar")), "kotlin.script.templates.standard.ScriptTemplateWithArgs") - val codeLine0 = ReplCodeLine(0, "val l1 = 1\r\nl1\r\n") - val res0 = repl.replCompiler?.check(codeLine0) + val state = repl.createState() + + val codeLine0 = ReplCodeLine(0, 0, "val l1 = 1\r\nl1\r\n") + val res0 = repl.replCompiler?.check(state, codeLine0) val res0c = res0 as? ReplCheckResult.Ok TestCase.assertNotNull("Unexpected compile result: $res0", res0c) diff --git a/compiler/tests/org/jetbrains/kotlin/daemon/CompilerDaemonTest.kt b/compiler/tests/org/jetbrains/kotlin/daemon/CompilerDaemonTest.kt index 34f2055e8ec..f6ddafdebec 100644 --- a/compiler/tests/org/jetbrains/kotlin/daemon/CompilerDaemonTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/daemon/CompilerDaemonTest.kt @@ -534,12 +534,11 @@ class CompilerDaemonTest : KotlinIntegrationTestBase() { fun testDaemonReplLocalEvalNoParams() { withDaemon { daemon -> - withDisposable { disposable -> - val repl = KotlinRemoteReplCompilerClient(daemon!!, null, CompileService.TargetPlatform.JVM, - emptyArray(), - TestMessageCollector(), - classpathFromClassloader(), - ScriptWithNoParam::class.qualifiedName!!) + val repl = KotlinRemoteReplCompilerClient(daemon!!, null, CompileService.TargetPlatform.JVM, + emptyArray(), + TestMessageCollector(), + classpathFromClassloader(), + ScriptWithNoParam::class.qualifiedName!!) val localEvaluator = GenericReplEvaluator(emptyList(), Thread.currentThread().contextClassLoader) @@ -550,11 +549,10 @@ class CompilerDaemonTest : KotlinIntegrationTestBase() { fun testDaemonReplLocalEvalStandardTemplate() { withDaemon { daemon -> - withDisposable { disposable -> - val repl = KotlinRemoteReplCompilerClient(daemon!!, null, CompileService.TargetPlatform.JVM, emptyArray(), - TestMessageCollector(), - classpathFromClassloader(), - "kotlin.script.templates.standard.ScriptTemplateWithArgs") + val repl = KotlinRemoteReplCompilerClient(daemon!!, null, CompileService.TargetPlatform.JVM, emptyArray(), + TestMessageCollector(), + classpathFromClassloader(), + "kotlin.script.templates.standard.ScriptTemplateWithArgs") val localEvaluator = GenericReplEvaluator(emptyList(), Thread.currentThread().contextClassLoader, ScriptArgsWithTypes(arrayOf(emptyArray()), arrayOf(Array::class))) @@ -627,7 +625,7 @@ class CompilerDaemonTest : KotlinIntegrationTestBase() { if (logFile.isLogContainsSequence("Idle timeout exceeded 1s")) break Thread.sleep(200) } - repl.dispose() + replCompiler.dispose() Thread.sleep(200) logFile.assertLogContainsSequence("Idle timeout exceeded 1s", diff --git a/libraries/examples/kotlin-jsr223-daemon-local-eval-example/src/test/kotlin/org/jetbrains/kotlin/script/jsr223/KotlinJsr223ScriptEngineIT.kt b/libraries/examples/kotlin-jsr223-daemon-local-eval-example/src/test/kotlin/org/jetbrains/kotlin/script/jsr223/KotlinJsr223ScriptEngineIT.kt index 655fcbd995a..266d2a46c32 100644 --- a/libraries/examples/kotlin-jsr223-daemon-local-eval-example/src/test/kotlin/org/jetbrains/kotlin/script/jsr223/KotlinJsr223ScriptEngineIT.kt +++ b/libraries/examples/kotlin-jsr223-daemon-local-eval-example/src/test/kotlin/org/jetbrains/kotlin/script/jsr223/KotlinJsr223ScriptEngineIT.kt @@ -117,9 +117,9 @@ obj val engine = ScriptEngineManager().getEngineByExtension("kts")!! val res1 = engine.eval("val x = 3") Assert.assertNull(res1) - val res2 = engine.eval("eval(\"\$x + 2\")") + val res2 = engine.eval("val y = eval(\"\$x + 2\")\ny") Assert.assertEquals(5, res2) - val res3 = engine.eval("x + 4") + val res3 = engine.eval("y + 2") Assert.assertEquals(7, res3) } }