Skip to content

Commit

Permalink
add xml test on :artifacts option
Browse files Browse the repository at this point in the history
  • Loading branch information
dwarring committed Nov 19, 2023
1 parent c44aa4a commit e0a4251
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion t/07artifacts.t
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use Test;
plan 2;
plan 3;

use PDF::Class;
use PDF::Tags;
Expand Down Expand Up @@ -45,6 +45,18 @@ my $xml = q{<Document>
</Document>
};

my $xml2 = q{<Document>
<P>
Test para with hidden artifact
______________________________
and nested spanning text
</P>
<Artifact>
Page 1
</Artifact>
</Document>
};

skip "PDF::Content v0.5.17+ needed for accurate pre-save XML"
unless PDF::Content.^ver >= v0.5.17;
is $tags[0].xml, $xml, 'XML, pre-saved';
Expand All @@ -57,4 +69,9 @@ $tags = PDF::Tags::Reader.read: :$pdf, :quiet;

is $tags[0].xml, $xml, 'XML, round-tripped';

$pdf .= open: "t/07artifacts.pdf";
$tags = PDF::Tags::Reader.read: :$pdf, :quiet, :artifacts;

is $tags[0].xml(:artifacts), $xml2, 'XML, round-tripped, with artifacts';

done-testing;

0 comments on commit e0a4251

Please sign in to comment.