File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
formats/cbor/commonTest/src/kotlinx/serialization/cbor Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -40,9 +40,10 @@ class CborDecoderTest {
40
40
HexConverter .parseHexBinary(" cafe" ),
41
41
HexConverter .parseHexBinary(" cafe" )
42
42
)
43
- // with maps, lists & strings of indefinite length
43
+ // with maps, lists & strings of indefinite length (note: this test vector did not correspond to proper encoding before, but decoded fine)
44
+ // this collapsing bytes wrapped in a bytes string into a byte string could be an indicator of a buggy (as in: too lenient) decoder.
44
45
val hex =
45
- " bf637374726d48656c6c6f2c20776f726c64216169182a686e756c6c61626c65f6646c6973749f61616162ff636d6170bf01f502f4ff65696e6e6572bf6161636c6f6cff6a696e6e6572734c6973749fbf6161636b656bffff6a62797465537472696e675f42cafeff696279746541727261799f383521ffff "
46
+ " bf637374726d48656c6c6f2c20776f726c64216169182a686e756c6c61626c65f6646c6973749f61616162ff636d6170bf01f502f4ff65696e6e6572bf6161636c6f6cff6a696e6e6572734c6973749fbf6161636b656bffff6a62797465537472696e6742cafe696279746541727261799f383521ffff "
46
47
assertEquals(
47
48
test, Cbor .decodeFromHexString(
48
49
TypesUmbrella .serializer(),
@@ -54,9 +55,7 @@ class CborDecoderTest {
54
55
assertEquals(Cbor .encodeToCbor(test), struct)
55
56
assertEquals(test, Cbor .decodeFromCbor(TypesUmbrella .serializer(), struct))
56
57
57
-
58
58
assertEquals(hex, Cbor .encodeToHexString(TypesUmbrella .serializer(), test))
59
-
60
59
assertEquals(hex, Cbor .encodeToHexString(CborElement .serializer(), struct))
61
60
62
61
You can’t perform that action at this time.
0 commit comments