aboutsummaryrefslogtreecommitdiffstats
path: root/libtests
diff options
context:
space:
mode:
Diffstat (limited to 'libtests')
-rw-r--r--libtests/json.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/libtests/json.cc b/libtests/json.cc
index 3844222f..b386e6eb 100644
--- a/libtests/json.cc
+++ b/libtests/json.cc
@@ -1,6 +1,7 @@
#include <qpdf/assert_test.h>
#include <qpdf/JSON.hh>
+#include <qpdf/Pipeline.hh>
#include <qpdf/QPDFObjectHandle.hh>
#include <iostream>
@@ -113,6 +114,19 @@ test_main()
{"c", "[\n true\n]"},
};
assert(dvalue == xdvalue);
+ auto blob_data = [](Pipeline* p) {
+ *p << "\x01\x02\x03\x04\x05\xff\xfe\xfd\xfc\xfb";
+ };
+ JSON jblob = JSON::makeDictionary();
+ jblob.addDictionaryMember("normal", JSON::parse(R"("string")"));
+ jblob.addDictionaryMember("blob", JSON::makeBlob(blob_data));
+ // cSpell:ignore AQIDBAX
+ check(
+ jblob,
+ "{\n"
+ " \"blob\": \"AQIDBAX//v38+w==\",\n"
+ " \"normal\": \"string\"\n"
+ "}");
}
static void