diff --git a/test/src/unit-cbor.cpp b/test/src/unit-cbor.cpp index d3b81d814..19cdf1879 100644 --- a/test/src/unit-cbor.cpp +++ b/test/src/unit-cbor.cpp @@ -2486,7 +2486,14 @@ TEST_CASE("examples from RFC 7049 Appendix A") auto expected = utils::read_binary_file(TEST_DATA_DIRECTORY "/binary_data/cbor_binary.out"); CHECK(j == json::binary(expected)); + // 0xd8 CHECK(json::to_cbor(json::binary(std::vector {}, 0x42)) == std::vector {0xd8, 0x42, 0x40}); + // 0xd9 + CHECK(json::to_cbor(json::binary(std::vector {}, 1000)) == std::vector {0xd9, 0x03, 0xe8, 0x40}); + // 0xda + CHECK(json::to_cbor(json::binary(std::vector {}, 394216)) == std::vector {0xda, 0x00, 0x06, 0x03, 0xe8, 0x40}); + // 0xdb + CHECK(json::to_cbor(json::binary(std::vector {}, 8589934590)) == std::vector {0xdb, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xfe, 0x40}); } SECTION("arrays")