fixed many bugs with variable visibility in mixed scopes

This commit is contained in:
sergeych committed 2025-08-17 12:24:39 +03:00
1 parent eca746b189
commit 464a6dcb99
14 files changed
+285 -162

No files matched your search

+13 -2
View File
@@ -23,8 +23,9 @@ class StdlibTest {
@Test
fun testIterableFilter() = runTest {
eval("""
assertEquals([1,3,5,7], (1..8).filter{ it % 2 == 1 }.toList() )
assertEquals([2,4,6,8], (1..8).filter{ it % 2 == 0 }.toList() )
assertEquals([2,4,6,8], (1..8).filter{ println("call2"); it % 2 == 0 }.toList() )
println("-------------------")
assertEquals([1,3,5,7], (1..8).filter{ println("call1"); it % 2 == 1 }.toList() )
""".trimIndent())
}
@@ -46,6 +47,16 @@ class StdlibTest {
""".trimIndent())
}
@Test
fun testAnyAndAll() = runTest {
eval("""
assert( [1,2,3].any { it > 2 } )
assert( ![1,2,3].any { it > 4 } )
assert( [1,2,3].all { it <= 3 } )
""".trimIndent())
}
@Test
fun testRingBuffer() = runTest {
eval("""