2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-09-21 01:29:06 +00:00
qpdf/qpdf/qtest/linearize-pass1.test
Jay Berkenbilt 4ee393d1fa Remove compression from linearization tests where possible
By combining --linearize with --compress-streams=n, we ensure that no
new compressed data will appear in linearized output, which makes the
output independent of zlib's output. There are other tests to ensure
that linearization works correctly with compression. This commit
involves changing some test outputs and test code as well just
updating test suites.
2023-12-20 15:46:20 -05:00

33 lines
812 B
Perl

#!/usr/bin/env perl
require 5.008;
use warnings;
use strict;
unshift(@INC, '.');
require qpdf_test_helpers;
chdir("qpdf") or die "chdir testdir failed: $!\n";
require TestDriver;
cleanup();
my $td = new TestDriver('linearize-pass1');
my $n_tests = 3;
$td->runtest("linearize pass 1 file",
{$td->COMMAND => "qpdf --linearize --static-id" .
" --compress-streams=n" .
" --linearize-pass1=b.pdf minimal.pdf a.pdf"},
{$td->STRING => "", $td->EXIT_STATUS => 0});
$td->runtest("check output",
{$td->FILE => "a.pdf"},
{$td->FILE => "minimal-linearized.pdf"});
$td->runtest("check pass1 file",
{$td->FILE => "b.pdf"},
{$td->FILE => "minimal-linearize-pass1.pdf"});
cleanup();
$td->report($n_tests);