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 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
|
#!/usr/bin/perl -w # -*- perl -*-
#
# test the generation of HTML lists
use strict;
use lib qw( ./lib ../lib );
use Pod::POM;
use Pod::POM::View::HTML;
use Pod::POM::Test;
$Pod::POM::DEFAULT_VIEW = 'Pod::POM::View::HTML';
ntests(2);
my $text;
{ local $/ = undef;
$text = <DATA>;
}
my ($test, $expect) = split(/\s*-------+\s*/, $text);
my $parser = Pod::POM->new();
my $pom = $parser->parse_text($test);
assert( $pom );
my $result = "$pom";
for ($result, $expect) {
s/^\s*//;
s/\s*$//;
}
match($result, $expect);
#print $pom;
__DATA__
=head1 Test
=over 4
=item *
The first item
=item *
The second item
=back
=over 4
=item 1
The 1st item
=item 2
The 2nd item
=back
=over 4
=item 1.
The 1st item
=item 2.
The 2nd item
=back
=over 4
=item foo
The foo item
=item bar
The bar item
=item crash bang wallop!
The crazy item
=back
------------------------------------------------------------------------
<html><body bgcolor="#ffffff">
<h1>Test</h1>
<ul>
<li>
<p>The first item</p>
</li>
<li>
<p>The second item</p>
</li>
</ul>
<ol>
<li>
<p>The 1st item</p>
</li>
<li>
<p>The 2nd item</p>
</li>
</ol>
<ol>
<li>
<p>The 1st item</p>
</li>
<li>
<p>The 2nd item</p>
</li>
</ol>
<ul>
<li><a name="item_foo"></a><b>foo</b>
<p>The foo item</p>
</li>
<li><a name="item_bar"></a><b>bar</b>
<p>The bar item</p>
</li>
<li><a name="item_crash_bang_wallop_"></a><b>crash bang wallop!</b>
<p>The crazy item</p>
</li>
</ul>
</body></html>
|