maps serialization

This commit is contained in:
sergeych committed 2025-08-03 15:06:46 +03:00
1 parent 2339130241
commit 790cce0d24
5 files changed
+76 -27

No files matched your search

+23
View File
@@ -508,6 +508,7 @@ class LynonTests {
testEncode(["the", "the", "wall", "the", "wall", "wall"])
testEncode([1,2,3, "the", "wall", "wall"])
testEncode([false, false, false, true,true])
testEncode([])
""".trimIndent()
)
}
@@ -534,6 +535,28 @@ class LynonTests {
testEncode( [1 => "one", 1 => "one", "foo" => "MapEntry"] )
""".trimIndent())
}
@Test
fun testHomogenousMap() = runTest {
val s = testScope()
s.eval("""
testEncode( Map("one" => 1, "two" => 2) )
testEncode( Map() )
""".trimIndent())
}
@Test
fun testHeterogeneousMap() = runTest {
val s = testScope()
s.eval("""
// testEncode(["one", 2])
// testEncode([1, "2"])
// testEncode( Map("one" => 1, 2 => 2) )
testEncode( Map("one" => 1, 2 => "2") )
""".trimIndent())
}
}