From 7b1ba71ef0b9ce9427fb0b213bcc4a160e97a39a Mon Sep 17 00:00:00 2001 From: sergeych Date: Sun, 18 Jan 2026 20:34:58 +0300 Subject: [PATCH] rename `testToJsonString` and add new test for `@Transient` serialization --- lynglib/src/commonTest/kotlin/OOTest.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lynglib/src/commonTest/kotlin/OOTest.kt b/lynglib/src/commonTest/kotlin/OOTest.kt index a5c6834..26d3e79 100644 --- a/lynglib/src/commonTest/kotlin/OOTest.kt +++ b/lynglib/src/commonTest/kotlin/OOTest.kt @@ -887,7 +887,7 @@ class OOTest { """.trimIndent()) } @Test - fun testToJsonString() = runTest { + fun testToStringWithTransient() = runTest { eval(""" class C(amount,@Transient transient=0) { val l by lazy { transient + amount } @@ -903,4 +903,12 @@ class OOTest { println(C(1).lock().lock().amount) """.trimIndent()) } + + @Test + fun testToJsonString() = runTest { + eval(""" + class T(a,b,@Transient c=0) + assertEquals("{\"a\":\"foo\",\"b\":\"bar\"}",T("foo", "bar").toJsonString()) + """.trimIndent()) + } } \ No newline at end of file