more test for apply

This commit is contained in:
Sergey Chernov 2025-11-12 13:01:35 +01:00
parent 76d89b43db
commit 5df923920c

View File

@ -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(