File: filter-ascii85decode.t

package info (click to toggle)
libpdf-api2-perl 2.047-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 20,228 kB
  • sloc: perl: 42,227; makefile: 11
file content (30 lines) | stat: -rw-r--r-- 893 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use Test::More tests => 4;

use warnings;
use strict;

use PDF::API2::Basic::PDF::Filter::ASCII85Decode;

my $filter = PDF::API2::Basic::PDF::Filter::ASCII85Decode->new();

my $in = 'BT /F1 24 Tf 100 700 Td (Hello World)Tj ET';
my $out = q{6<#'\7PQ#@1a#b0+>GQ(+?(u.+B2ko-qIocCi:FtDfTZ).9(%)78s~>};

is($filter->outfilt($in, 1),
   $out,
   q{ASCII85Decode test string is encoded correctly});

is($filter->infilt($out, 1),
   $in,
   q{ASCII85Decode test string is decoded correctly});

$in = 'BT /F1 24 Tf 100 700 Td (Hello Worlds!)Tj ET';
$out = q{6<#'\7PQ#@1a#b0+>GQ(+?(u.+B2ko-qIocCi:FtDfTZ)F!2u3C*5rE~>};

is($in,
   $filter->infilt($filter->outfilt($in, 1), 1),
   q{ASCII85Decode test string encodes and decodes without changing the string (multiple of four bytes)});

is($filter->outfilt($in, 1),
   $out,
   q{ASCII85Decode test string is encoded correctly (multiple of four bytes)});