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
|
@Test
|
||||||
fun testExtend() = runTest() {
|
fun testExtend() = runTest() {
|
||||||
eval(
|
eval(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user