rename testToJsonString and add new test for @Transient serialization
This commit is contained in:
parent
8b94432f66
commit
7b1ba71ef0
@ -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())
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user