fix #78 add fmt CLI subcommand and improve legacy script execution paths

This commit is contained in:
sergeych committed 2025-12-05 21:02:18 +01:00
1 parent 20f4e54a02
commit b630d69186
6 files changed
+248 -58

No files matched your search

+16 -1
View File
@@ -3992,7 +3992,22 @@ class ScriptTest {
val x = eval("""
import lyng.serialization
{ value: 12, inner: { "foo": 1, "bar": "two" }}
""".trimIndent()).decodeSerializable<TestJson3>()println(x)
""".trimIndent()).decodeSerializable<TestJson3>()
assertEquals(TestJson3(12, JsonObject(mapOf("foo" to JsonPrimitive(1), "bar" to Json.encodeToJsonElement("two")))), x)
}
@Serializable
data class TestEnum(
val value: Int,
val inner: JsonObject
)
@Test
fun deserializeEnumJsonTest() = runTest {
val x = eval("""
import lyng.serialization
enum
{ value: 12, inner: { "foo": 1, "bar": "two" }}
""".trimIndent()).decodeSerializable<TestJson3>()
assertEquals(TestJson3(12, JsonObject(mapOf("foo" to JsonPrimitive(1), "bar" to Json.encodeToJsonElement("two")))), x)
}
}