more test for apply
This commit is contained in:
parent
76d89b43db
commit
5df923920c
@ -2506,6 +2506,27 @@ class ScriptTest {
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testApplyFromStatic() = runTest {
|
||||
eval(
|
||||
"""
|
||||
class Foo(value) {
|
||||
|
||||
fun test() {
|
||||
"test: "+value
|
||||
}
|
||||
static val instance = Foo("bar")
|
||||
}
|
||||
|
||||
Foo.instance.apply {
|
||||
assertEquals("bar", value)
|
||||
assertEquals("test: bar", test())
|
||||
}
|
||||
|
||||
""".trimIndent()
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testExtend() = runTest() {
|
||||
eval(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user