Skip to content

Commit

Permalink
Clarify the misconception in the test for `defaultDeserializerForNumb…
Browse files Browse the repository at this point in the history
…er` and make it work

See Kotlin#2598.
  • Loading branch information
ShreckYe committed Mar 12, 2024
1 parent 4973f07 commit 23c385c
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class SerialPolymorphicNumberTest {
object Case : Abstract()

@Serializable
data class Default(val type: Int?) : Abstract()
object Default : Abstract()
}

val protoBuf = ProtoBuf {
Expand All @@ -106,7 +106,6 @@ class SerialPolymorphicNumberTest {
@Test
fun testPolymorphicModule() {
testConversion<Abstract>(protoBuf, Abstract.Case, "08011200")
// TODO Not working. However, even the original default serializer for serial names is not working for Protobuf as tested.
// assertEquals(Abstract.Default(0), protoBuf.decodeFromHexString<Abstract>("08001200"))
assertEquals(Abstract.Default, protoBuf.decodeFromHexString<Abstract>("08001200"))
}
}

0 comments on commit 23c385c

Please sign in to comment.