2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-11-16 17:45:09 +00:00
qpdf/qpdf/qtest/swap-and-replace.test

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

38 lines
1012 B
Plaintext
Raw Normal View History

#!/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');
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);