File: filter-ascii85decode.t

package info (click to toggle)
libpdf-builder-perl 3.027-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 23,992 kB
  • sloc: perl: 107,532; makefile: 10
file content (33 lines) | stat: -rw-r--r-- 919 bytes parent folder | download | duplicates (4)
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
31
32
33
#!/usr/bin/perl
use warnings;
use strict;

use Test::More tests => 4;

use PDF::Builder::Basic::PDF::Filter::ASCII85Decode;

my $filter = PDF::Builder::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)});

1;