File: filter-runlengthdecode.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-- 771 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::RunLengthDecode;

my $in = '--- Look at this test string. ---';
my $out = "\xfe-\x01 L\xffo\x16k at this test string. \xfe-";
my $filter = bless {}, 'PDF::Builder::Basic::PDF::Filter::RunLengthDecode';

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

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


# Add the end-of-document marker
$out .= "\x80";

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

is($filter->infilt($out),
   $in,
   q{RunLengthDecode test string with EOD marker is decoded correctly});

1;