File: 30htmlps.t

package info (click to toggle)
libmail-box-perl 2.055-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,348 kB
  • ctags: 1,393
  • sloc: perl: 20,386; makefile: 43
file content (44 lines) | stat: -rw-r--r-- 863 bytes parent folder | download | duplicates (3)
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
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/perl -T
#
# Test conversions from HTML/XHTML to postscript with HTML::FormatPS
#

use strict;
use warnings;

use lib qw(. .. tests);
use Tools;

use Test::More;

use Mail::Message::Body::Lines;

BEGIN {
   
   eval 'require HTML::FormatPS';

   if($@)
   {   plan skip_all => "requires HTML::FormatPS.\n";
       exit 0;
   }

   require Mail::Message::Convert::HtmlFormatPS;
   plan tests => 5;
}

my $html  = Mail::Message::Convert::HtmlFormatPS->new;

my $body = Mail::Message::Body::Lines->new
  ( type => 'text/html'
  , data => $raw_html_data
  );

my $f = $html->format($body);
ok(defined $f);
ok(ref $f);
isa_ok($f, 'Mail::Message::Body');
is($f->type, 'application/postscript');
is($f->transferEncoding, 'none');

# The result of the conversion is not checked, because the output
# is rather large and may vary over versions of HTML::FormatPS