fix #78 add fmt CLI subcommand and improve legacy script execution paths
This commit is contained in:
1 parent
20f4e54a02
commit
b630d69186
6 files changed
+248
-58
No files matched your search
@@ -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)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user