Improve variable resolution and expand test coverage; improved wahtsnew

This commit is contained in:
sergeych committed 2026-02-17 08:06:06 +03:00
1 parent afa4b20070
commit b6851b7098
4 files changed
+134 -22

No files matched your search

+25 -11
View File
@@ -132,15 +132,29 @@ class StdlibTest {
""".trimIndent())
}
// @Test
// fun testFunFromSample() = runTest {
// range should be iterable if it is intrange
// eval("""
// val data = 1..5 // or [1, 2, 3, 4, 5]
// fun test() {
// data.filter { it % 2 == 0 }.map { it * it }
// }
// test()
// """.trimIndent())
// }
@Test
fun testFilter1() = runTest {
// range should be iterable if it is intrange
eval("""
val data = 1..5 // or [1, 2, 3, 4, 5]
assert( data is Iterable<Int> )
fun test() {
data.filter { it % 2 == 0 }.map { it * it }
}
test()
""".trimIndent())
}
@Test
fun testFilter2() = runTest {
eval("""
val data = [1, 2, 3, 4, 5]
assert( data is Iterable<Int> )
fun test() {
data.filter { it % 2 == 0 }.map { it * it }
}
test()
"""
)
}
}