2022-05-14 20:16:20 +00:00
|
|
|
#!/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();
|
|
|
|
|
2022-05-19 21:27:41 +00:00
|
|
|
my $td = new TestDriver('swap-and-replace');
|
2022-05-14 20:16:20 +00:00
|
|
|
|
|
|
|
my $n_tests = 3;
|
|
|
|
|
|
|
|
$td->runtest("swap and replace",
|
|
|
|
{$td->COMMAND => "test_driver 14 test14-in.pdf"},
|
|
|
|
{$td->FILE => "test14.out",
|
|
|
|
$td->EXIT_STATUS => 0},
|
|
|
|
$td->NORMALIZE_NEWLINES);
|
|
|
|
$td->runtest("check output",
|
|
|
|
{$td->FILE => "a.pdf"},
|
|
|
|
{$td->FILE => "test14-out.pdf"});
|
|
|
|
|
|
|
|
# Most of the test suite uses static or deterministic ID. This test
|
|
|
|
# case exercises regular ID generation. Test 14 also exercises writing
|
|
|
|
# to memory without static ID.
|
|
|
|
$td->runtest("check non-static ID version",
|
|
|
|
{$td->COMMAND => "sh ./diff-ignore-ID-version a.pdf b.pdf"},
|
|
|
|
{$td->STRING => "okay\n", $td->EXIT_STATUS => 0},
|
|
|
|
$td->NORMALIZE_NEWLINES);
|
|
|
|
|
|
|
|
cleanup();
|
|
|
|
$td->report($n_tests);
|