From f21e4f264ab285817bfad1698dbb8b8b300c9ece Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Wed, 17 Feb 2021 20:14:04 -0500 Subject: Add file attachment example --- examples/qtest/attach-file.test | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 examples/qtest/attach-file.test (limited to 'examples/qtest/attach-file.test') diff --git a/examples/qtest/attach-file.test b/examples/qtest/attach-file.test new file mode 100644 index 00000000..9d8e7504 --- /dev/null +++ b/examples/qtest/attach-file.test @@ -0,0 +1,35 @@ +#!/usr/bin/env perl +require 5.008; +use warnings; +use strict; + +chdir("attach-file") or die "chdir testdir failed: $!\n"; + +require TestDriver; + +cleanup(); + +my $td = new TestDriver('attach-file'); + +$td->runtest("attach file", + {$td->COMMAND => + "pdf-attach-file --infile input.pdf" . + " --attachment ./potato.png" . + " --outfile a.pdf" . + " --mimetype image/png"}, + {$td->STRING => + "pdf-attach-file: attaching ./potato.png as potato.png\n", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("check output", + {$td->FILE => "a.pdf"}, + {$td->FILE => "output.pdf"}); + +cleanup(); + +$td->report(2); + +sub cleanup +{ + unlink "a.pdf"; +} -- cgit v1.2.3-70-g09d2