blob: d04390af2194c52118982904156d2e6f213b528f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
/*
* Copyright 2017-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/
package kotlinx.serialization
import kotlinx.serialization.test.noJsLegacy
import kotlin.test.*
class CachedSerializersTest {
@Serializable
object Object
@Serializable
sealed class SealedParent {
@Serializable
data class Child(val i: Int) : SealedParent()
}
@Serializable
abstract class Abstract
@Test
fun testObjectSerializersAreSame() = noJsLegacy {
assertSame(Object.serializer(), Object.serializer())
}
@Test
fun testSealedSerializersAreSame() = noJsLegacy {
assertSame(SealedParent.serializer(), SealedParent.serializer())
}
@Test
fun testAbstractSerializersAreSame() = noJsLegacy {
assertSame(Abstract.serializer(), Abstract.serializer())
}
}
|