diff options
Diffstat (limited to 'formats/cbor/commonTest/src/kotlinx/serialization/cbor/CborReaderTest.kt')
-rw-r--r-- | formats/cbor/commonTest/src/kotlinx/serialization/cbor/CborReaderTest.kt | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/formats/cbor/commonTest/src/kotlinx/serialization/cbor/CborReaderTest.kt b/formats/cbor/commonTest/src/kotlinx/serialization/cbor/CborReaderTest.kt index edbe5e62..f615d5ed 100644 --- a/formats/cbor/commonTest/src/kotlinx/serialization/cbor/CborReaderTest.kt +++ b/formats/cbor/commonTest/src/kotlinx/serialization/cbor/CborReaderTest.kt @@ -634,6 +634,34 @@ class CborReaderTest { } @Test + fun testReadValueClassWithByteString() { + assertContentEquals( + expected = byteArrayOf(0x11, 0x22, 0x33), + actual = Cbor.decodeFromHexString<ValueClassWithByteString>("43112233").x + ) + } + + @Test + fun testReadValueClassCustomByteString() { + assertEquals( + expected = ValueClassWithCustomByteString(CustomByteString(0x11, 0x22, 0x33)), + actual = Cbor.decodeFromHexString("43112233") + ) + } + + @Test + fun testReadValueClassWithUnlabeledByteString() { + assertContentEquals( + expected = byteArrayOf( + 0x11, + 0x22, + 0x33 + ), + actual = Cbor.decodeFromHexString<ValueClassWithUnlabeledByteString>("43112233").x.x + ) + } + + @Test fun testIgnoresTagsOnStrings() { /* * 84 # array(4) |