Skip to content

Commit

Permalink
Add additional data from contextual serializer to ensure it was used
Browse files Browse the repository at this point in the history
  • Loading branch information
OptimumCode committed Jun 30, 2024
1 parent 6d72bc7 commit e5c7ed5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/commonTest/kotlin/com/charleskorn/kaml/YamlReadingTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2079,7 +2079,7 @@ class YamlReadingTest : FlatFunSpec({
override val descriptor: SerialDescriptor
get() = String.serializer().descriptor

override fun deserialize(decoder: Decoder): Inner = Inner(decoder.decodeString())
override fun deserialize(decoder: Decoder): Inner = Inner("from context serializer: ${decoder.decodeString()}")
override fun serialize(encoder: Encoder, value: Inner) = throw UnsupportedOperationException()
}

Expand All @@ -2093,7 +2093,7 @@ class YamlReadingTest : FlatFunSpec({
val result = parser.decodeFromString(Container.serializer(), input)

test("deserializes it using the dynamically installed serializer") {
result shouldBe Container(Inner("this is the input"))
result shouldBe Container(Inner("from context serializer: this is the input"))
}
}

Expand Down

0 comments on commit e5c7ed5

Please sign in to comment.