-
Notifications
You must be signed in to change notification settings - Fork 626
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KeyValueSerializer: Fix missing call to endStructure() (#2272)
The sequential decoding path was missing it. Use decodeStructure() to avoid this error. Co-authored-by: Pavel Vasin <git@vasin.nl>
- Loading branch information
1 parent
8007574
commit ef67bce
Showing
3 changed files
with
39 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
core/commonTest/src/kotlinx/serialization/internal/TuplesTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Copyright 2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
package kotlinx.serialization.internal | ||
|
||
import kotlin.test.* | ||
import kotlinx.serialization.builtins.* | ||
|
||
class TuplesTest { | ||
@Test | ||
fun testSequentialDecodingKeyValue() { | ||
val decoder = DummySequentialDecoder() | ||
val serializer = MapEntrySerializer(Unit.serializer(), Unit.serializer()) | ||
serializer.deserialize(decoder) | ||
assertEquals(decoder.beginStructureCalled, decoder.endStructureCalled) | ||
} | ||
} |