2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-06-06 04:10:52 +00:00

Add tests for progress and verbose changes

This commit is contained in:
Jay Berkenbilt 2018-06-22 16:13:42 -04:00
parent d34ab8a936
commit c852af2a57
3 changed files with 41 additions and 2 deletions

View File

@ -1235,8 +1235,10 @@ my $pages_options = "--pages page-labels-and-outlines.pdf 1,3,5-7,z" .
$td->runtest("merge three files",
{$td->COMMAND => "qpdf page-labels-and-outlines.pdf a.pdf" .
" $pages_options --static-id"},
{$td->STRING => "", $td->EXIT_STATUS => 0});
" $pages_options --static-id --verbose --progress",
$td->FILTER => "perl filter-progress.pl"},
{$td->FILE => "verbose-merge.out", $td->EXIT_STATUS => 0},
$td->NORMALIZE_NEWLINES);
# Manually verified about this file: make sure that outline entries
# that pointed to pages that were preserved still work in the copy,
# and verify that all pages are as expected. page-labels-and-outlines

View File

@ -0,0 +1,23 @@
use strict;
use warnings;
my $seen = 0;
while (<>)
{
if (m/write progress: (?:10)?0\%/)
{
print;
}
elsif (m/write progress: /)
{
if (! $seen)
{
$seen = 1;
print "....other write progress....\n";
}
}
else
{
print;
}
}

View File

@ -0,0 +1,14 @@
qpdf: processing 20-pages.pdf
qpdf: processing ./20-pages.pdf
qpdf: processing minimal.pdf
qpdf: removing unreferenced pages from primary input
qpdf: adding pages from page-labels-and-outlines.pdf
qpdf: adding pages from 20-pages.pdf
qpdf: adding pages from page-labels-and-outlines.pdf
qpdf: adding pages from 20-pages.pdf
qpdf: adding pages from ./20-pages.pdf
qpdf: adding pages from minimal.pdf
qpdf: a.pdf: write progress: 0%
....other write progress....
qpdf: a.pdf: write progress: 100%
qpdf: wrote file a.pdf