summaryrefslogtreecommitdiffstats
path: root/qpdf/qtest/qpdf.test
diff options
context:
space:
mode:
Diffstat (limited to 'qpdf/qtest/qpdf.test')
-rw-r--r--qpdf/qtest/qpdf.test12
1 files changed, 11 insertions, 1 deletions
diff --git a/qpdf/qtest/qpdf.test b/qpdf/qtest/qpdf.test
index da98020a..7bfe21cd 100644
--- a/qpdf/qtest/qpdf.test
+++ b/qpdf/qtest/qpdf.test
@@ -1825,14 +1825,24 @@ $td->runtest("out of range in deleted object",
show_ntests();
# ----------
$td->notify("--- Overwrite self ---");
-$n_tests += 1;
+$n_tests += 3;
copy("minimal.pdf", "a.pdf");
+copy("minimal.pdf", "split-out.pdf");
# Also tests @- for reading args from stdin
$td->runtest("don't overwrite self",
{$td->COMMAND => "(echo a.pdf; echo a.pdf) | qpdf \@-"},
{$td->REGEXP => "input file and output file are the same.*",
$td->EXIT_STATUS => 2});
+$td->runtest("output is not really output for split",
+ {$td->COMMAND => "qpdf --split-pages split-out.pdf split-out.pdf"},
+ {$td->STRING => "", $td->EXIT_STATUS => 0});
+$td->runtest("don't overwrite self (split)",
+ {$td->COMMAND =>
+ "qpdf --split-pages split-out-1.pdf split-out.pdf"},
+ {$td->REGEXP =>
+ ".*split pages would overwrite.* split-out-1.pdf",
+ $td->EXIT_STATUS => 2});
show_ntests();
# ----------