Enable stdlib/lynon tests and add try wrapper

This commit is contained in:
sergeych committed 2026-01-29 03:13:15 +03:00
1 parent f788f79d4b
commit c7e2455340
7 files changed
+63 -22

No files matched your search

@@ -27,7 +27,7 @@ import kotlin.test.assertEquals
import kotlin.test.assertIs
import kotlin.test.assertTrue
@Ignore("TODO(bytecode-only): uses fallback (try/catch)")
@Ignore("TODO(bytecode-only): exception rethrow mismatch")
class EmbeddingExceptionTest {
@Test
+8 -1
View File
@@ -20,9 +20,9 @@ import net.sergeych.lyng.eval
import kotlin.test.Ignore
import kotlin.test.Test
@Ignore("TODO(bytecode-only): uses fallback")
class StdlibTest {
@Test
@Ignore("TODO(bytecode-only): iterable filter mismatch")
fun testIterableFilter() = runTest {
eval("""
assertEquals([2,4,6,8], (1..8).filter{ println("call2"); it % 2 == 0 }.toList() )
@@ -33,6 +33,7 @@ class StdlibTest {
}
@Test
@Ignore("TODO(bytecode-only): range first/last mismatch")
fun testFirstLast() = runTest {
eval("""
assertEquals(1, (1..8).first )
@@ -41,6 +42,7 @@ class StdlibTest {
}
@Test
@Ignore("TODO(bytecode-only): range take mismatch")
fun testTake() = runTest {
eval("""
val r = 1..8
@@ -50,6 +52,7 @@ class StdlibTest {
}
@Test
@Ignore("TODO(bytecode-only): any/all mismatch")
fun testAnyAndAll() = runTest {
eval("""
assert( [1,2,3].any { it > 2 } )
@@ -87,6 +90,7 @@ class StdlibTest {
}
@Test
@Ignore("TODO(bytecode-only): range drop mismatch")
fun testDrop() = runTest {
eval("""
assertEquals([7,8], (1..8).drop(6).toList() )
@@ -95,6 +99,7 @@ class StdlibTest {
}
@Test
@Ignore("TODO(bytecode-only): flatten/filter mismatch")
fun testFlattenAndFilter() = runTest {
eval("""
assertEquals([1,2,3,4,5,6], [1,3,5].map { [it, it+1] }.flatten() )
@@ -110,6 +115,7 @@ class StdlibTest {
}
@Test
@Ignore("TODO(bytecode-only): count mismatch")
fun testCount() = runTest {
eval("""
assertEquals(5, (1..10).toList().count { it % 2 == 1 } )
@@ -117,6 +123,7 @@ class StdlibTest {
}
@Test
@Ignore("TODO(bytecode-only): with mismatch")
fun testWith() = runTest {
eval("""
class Person(val name, var age)