Fix merging errors
This commit is contained in:
@@ -91,8 +91,10 @@ class GenericReplTest : TestCase() {
|
|||||||
listOf(File(KotlinIntegrationTestBase.getCompilerLib(), "kotlin-runtime.jar")),
|
listOf(File(KotlinIntegrationTestBase.getCompilerLib(), "kotlin-runtime.jar")),
|
||||||
"kotlin.script.templates.standard.ScriptTemplateWithArgs")
|
"kotlin.script.templates.standard.ScriptTemplateWithArgs")
|
||||||
|
|
||||||
val codeLine0 = ReplCodeLine(0, "val l1 = 1\r\nl1\r\n")
|
val state = repl.createState()
|
||||||
val res0 = repl.replCompiler?.check(codeLine0)
|
|
||||||
|
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
|
val res0c = res0 as? ReplCheckResult.Ok
|
||||||
TestCase.assertNotNull("Unexpected compile result: $res0", res0c)
|
TestCase.assertNotNull("Unexpected compile result: $res0", res0c)
|
||||||
|
|
||||||
|
|||||||
@@ -534,12 +534,11 @@ class CompilerDaemonTest : KotlinIntegrationTestBase() {
|
|||||||
|
|
||||||
fun testDaemonReplLocalEvalNoParams() {
|
fun testDaemonReplLocalEvalNoParams() {
|
||||||
withDaemon { daemon ->
|
withDaemon { daemon ->
|
||||||
withDisposable { disposable ->
|
val repl = KotlinRemoteReplCompilerClient(daemon!!, null, CompileService.TargetPlatform.JVM,
|
||||||
val repl = KotlinRemoteReplCompilerClient(daemon!!, null, CompileService.TargetPlatform.JVM,
|
emptyArray(),
|
||||||
emptyArray(),
|
TestMessageCollector(),
|
||||||
TestMessageCollector(),
|
classpathFromClassloader(),
|
||||||
classpathFromClassloader(),
|
ScriptWithNoParam::class.qualifiedName!!)
|
||||||
ScriptWithNoParam::class.qualifiedName!!)
|
|
||||||
|
|
||||||
val localEvaluator = GenericReplEvaluator(emptyList(), Thread.currentThread().contextClassLoader)
|
val localEvaluator = GenericReplEvaluator(emptyList(), Thread.currentThread().contextClassLoader)
|
||||||
|
|
||||||
@@ -550,11 +549,10 @@ class CompilerDaemonTest : KotlinIntegrationTestBase() {
|
|||||||
|
|
||||||
fun testDaemonReplLocalEvalStandardTemplate() {
|
fun testDaemonReplLocalEvalStandardTemplate() {
|
||||||
withDaemon { daemon ->
|
withDaemon { daemon ->
|
||||||
withDisposable { disposable ->
|
val repl = KotlinRemoteReplCompilerClient(daemon!!, null, CompileService.TargetPlatform.JVM, emptyArray(),
|
||||||
val repl = KotlinRemoteReplCompilerClient(daemon!!, null, CompileService.TargetPlatform.JVM, emptyArray(),
|
TestMessageCollector(),
|
||||||
TestMessageCollector(),
|
classpathFromClassloader(),
|
||||||
classpathFromClassloader(),
|
"kotlin.script.templates.standard.ScriptTemplateWithArgs")
|
||||||
"kotlin.script.templates.standard.ScriptTemplateWithArgs")
|
|
||||||
|
|
||||||
val localEvaluator = GenericReplEvaluator(emptyList(), Thread.currentThread().contextClassLoader,
|
val localEvaluator = GenericReplEvaluator(emptyList(), Thread.currentThread().contextClassLoader,
|
||||||
ScriptArgsWithTypes(arrayOf(emptyArray<String>()), arrayOf(Array<String>::class)))
|
ScriptArgsWithTypes(arrayOf(emptyArray<String>()), arrayOf(Array<String>::class)))
|
||||||
@@ -627,7 +625,7 @@ class CompilerDaemonTest : KotlinIntegrationTestBase() {
|
|||||||
if (logFile.isLogContainsSequence("Idle timeout exceeded 1s")) break
|
if (logFile.isLogContainsSequence("Idle timeout exceeded 1s")) break
|
||||||
Thread.sleep(200)
|
Thread.sleep(200)
|
||||||
}
|
}
|
||||||
repl.dispose()
|
replCompiler.dispose()
|
||||||
|
|
||||||
Thread.sleep(200)
|
Thread.sleep(200)
|
||||||
logFile.assertLogContainsSequence("Idle timeout exceeded 1s",
|
logFile.assertLogContainsSequence("Idle timeout exceeded 1s",
|
||||||
|
|||||||
+2
-2
@@ -117,9 +117,9 @@ obj
|
|||||||
val engine = ScriptEngineManager().getEngineByExtension("kts")!!
|
val engine = ScriptEngineManager().getEngineByExtension("kts")!!
|
||||||
val res1 = engine.eval("val x = 3")
|
val res1 = engine.eval("val x = 3")
|
||||||
Assert.assertNull(res1)
|
Assert.assertNull(res1)
|
||||||
val res2 = engine.eval("eval(\"\$x + 2\")")
|
val res2 = engine.eval("val y = eval(\"\$x + 2\")\ny")
|
||||||
Assert.assertEquals(5, res2)
|
Assert.assertEquals(5, res2)
|
||||||
val res3 = engine.eval("x + 4")
|
val res3 = engine.eval("y + 2")
|
||||||
Assert.assertEquals(7, res3)
|
Assert.assertEquals(7, res3)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user