aboutsummaryrefslogtreecommitdiffstats
path: root/qpdf/qtest/qpdf-json.test
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-05-20 02:56:10 +0200
committerJay Berkenbilt <ejb@ql.org>2022-05-20 15:16:25 +0200
commit907df2c823710319e53c0ba6583a1ede4ee5413d (patch)
tree04baea2cca930f387f0438a1eb030213384a1202 /qpdf/qtest/qpdf-json.test
parenta83b7b0611dfa0063e0c95a4b6722501feb99a17 (diff)
downloadqpdf-907df2c823710319e53c0ba6583a1ede4ee5413d.tar.zst
Round-trip tests with --json-stream-data=file
Diffstat (limited to 'qpdf/qtest/qpdf-json.test')
-rw-r--r--qpdf/qtest/qpdf-json.test27
1 files changed, 26 insertions, 1 deletions
diff --git a/qpdf/qtest/qpdf-json.test b/qpdf/qtest/qpdf-json.test
index 80c73d60..3ab581e7 100644
--- a/qpdf/qtest/qpdf-json.test
+++ b/qpdf/qtest/qpdf-json.test
@@ -142,7 +142,32 @@ $td->runtest("check manual JSON to JSON to JSON",
{$td->FILE => "a.json", $td->EXIT_STATUS => 0},
$td->NORMALIZE_NEWLINES);
-# QXXXQ file
+$n_tests += 6;
+$td->runtest("json-output with file",
+ {$td->COMMAND => "qpdf --json-output=2" .
+ " --json-stream-prefix=auto-1 --json-stream-data=file" .
+ " minimal.pdf a.json"},
+ {$td->STRING => "", $td->EXIT_STATUS => 0});
+$td->runtest("check file mode",
+ {$td->FILE => "a.json"},
+ {$td->FILE => "minimal-json-file.out"},
+ $td->NORMALIZE_NEWLINES);
+$td->runtest("JSON to JSON with file",
+ {$td->COMMAND => "qpdf --json-input --json-output=2" .
+ " --json-stream-prefix=auto-2 --json-stream-data=file" .
+ " a.json -"},
+ {$td->FILE => "minimal-json-file-2.out", $td->EXIT_STATUS => 0},
+ $td->NORMALIZE_NEWLINES);
+$td->runtest("JSON with file to qdf",
+ {$td->COMMAND => "qpdf --json-input --qdf --static-id" .
+ " a.json a.pdf"},
+ {$td->STRING => "", $td->EXIT_STATUS => 0});
+$td->runtest("PDF to qdf",
+ {$td->COMMAND => "qpdf --qdf --static-id minimal.pdf b.pdf"},
+ {$td->STRING => "", $td->EXIT_STATUS => 0});
+$td->runtest("check PDF",
+ {$td->FILE => "a.pdf"},
+ {$td->FILE => "b.pdf"});
cleanup();
$td->report($n_tests);