This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update Pod::Simple from 3.43 to 3.45
[perl5.git] / cpan / Pod-Simple / t / xhtml15.t
1 # t/xhtml15.t - test compatibility between Pod::Simple::XHTML and
2 # Pod::Simple::HtmlBatch
3
4 use strict;
5 use warnings;
6 use Test::More tests => 4;
7
8 use_ok('Pod::Simple::XHTML') or exit;
9
10 my ($parser, $results);
11
12 initialize();
13 my $style = 'http://amazingpants.com/style.css';
14 $parser->html_css($style);
15 $parser->parse_string_document( '=head1 Foo' );
16 like $results, qr/ href="$style" /, 'CSS is correct when link is passed in';
17
18 initialize();
19 my $link = qq{<link rel="stylesheet" href="$style" type="text/css">};
20 $parser->html_css($link);
21 $parser->parse_string_document( '=head1 Foo' );
22 like $results, qr/ href="$style" /, 'CSS is correct when <link> is passed in';
23
24 #note('These methods are called when XHTML is used by HtmlBatch');
25 can_ok $parser, qw/batch_mode_page_object_init html_header_after_title/;
26
27 sub initialize {
28     $parser = Pod::Simple::XHTML->new;
29     $parser->index(1);
30     $parser->output_string( \$results );
31     $results = '';
32 }