Scripting: refactor history handling in legacy REPL using new infra

#KT-47187 fixed
This commit is contained in:
Ilya Chernikov
2022-05-18 12:11:06 +02:00
committed by teamcity
parent 92bf260057
commit 597677dae3
6 changed files with 59 additions and 5 deletions
@@ -369,6 +369,19 @@ class ReplTest : TestCase() {
)
}
@Test
fun testCompileWithoutEval() {
val replCompiler = KJvmReplCompilerBase<ReplCodeAnalyzerBase>()
val replEvaluator = BasicJvmReplEvaluator()
val compCfg = simpleScriptCompilationConfiguration
runBlocking {
replCompiler.compile("false".toScriptSource(), compCfg)
replCompiler.compile("true".toScriptSource(), compCfg).onSuccess {
replEvaluator.eval(it, simpleScriptEvaluationConfiguration)
}
}
}
companion object {
private fun positionsEqual(a: SourceCode.Position?, b: SourceCode.Position?): Boolean {
if (a == null || b == null) {