aboutsummaryrefslogtreecommitdiffstats
path: root/libtests
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-01-30 19:45:02 +0100
committerJay Berkenbilt <ejb@ql.org>2022-01-31 21:57:45 +0100
commit3b60224bae16f36e0b6caf13fe1e119b9fa1f6b1 (patch)
treeafdaac0f93751a9ec3d689ab08f18a34ca6f4679 /libtests
parentb74e7989c34e041e7a6461e00ae045045273ca51 (diff)
downloadqpdf-3b60224bae16f36e0b6caf13fe1e119b9fa1f6b1.tar.zst
JSONHandler: pass JSON object to array start function
Diffstat (limited to 'libtests')
-rw-r--r--libtests/json_handler.cc3
-rw-r--r--libtests/qtest/json_handler/json_handler.out8
2 files changed, 8 insertions, 3 deletions
diff --git a/libtests/json_handler.cc b/libtests/json_handler.cc
index dcc8e66e..568677a8 100644
--- a/libtests/json_handler.cc
+++ b/libtests/json_handler.cc
@@ -71,8 +71,7 @@ static std::shared_ptr<JSONHandler> make_all_handler()
auto h5s = std::make_shared<JSONHandler>();
h->addDictKeyHandler("five", h5s);
h5s->addArrayHandlers(
- make_print_message("array begin"),
- make_print_message("array end"),
+ print_json, make_print_message("array end"),
h5);
auto h6 = std::make_shared<JSONHandler>();
h6->addDictHandlers(
diff --git a/libtests/qtest/json_handler/json_handler.out b/libtests/qtest/json_handler/json_handler.out
index d9d99660..f076d4ee 100644
--- a/libtests/qtest/json_handler/json_handler.out
+++ b/libtests/qtest/json_handler/json_handler.out
@@ -25,7 +25,13 @@
"three": true,
"two": 3.14
}
-.five: json: array begin
+.five: json: [
+ "x",
+ false,
+ "y",
+ null,
+ true
+]
.five[0]: string: x
.five[1]: bool: false
.five[2]: string: y