Add test on repl with implicit receiver

This commit is contained in:
Ilya Chernikov
2019-07-16 12:51:34 +02:00
parent a13d452cd8
commit b68ab0d968
@@ -55,6 +55,25 @@ class ReplTest : TestCase() {
)
}
@Test
fun testImplicitReceiver() {
val receiver = TestReceiver()
chechEvaluateInRepl(
simpleScriptompilationConfiguration.with {
implicitReceivers(TestReceiver::class)
},
simpleScriptEvaluationConfiguration.with {
implicitReceivers(receiver)
},
sequenceOf(
"val x = 4",
"x + prop1",
"res1 * 3"
),
sequenceOf(null, 7, 21)
)
}
@Test
fun testEvalWithError() {
chechEvaluateInRepl(
@@ -141,4 +160,6 @@ val simpleScriptompilationConfiguration = createJvmCompilationConfigurationFromT
}
}
val simpleScriptEvaluationConfiguration = ScriptEvaluationConfiguration()
val simpleScriptEvaluationConfiguration = ScriptEvaluationConfiguration()
class TestReceiver(val prop1: Int = 3)