1#!/usr/bin/perl -w # -*- perl -*- 2# 3# test the generation of HTML lists 4 5use strict; 6use lib qw( ./lib ../lib ); 7use Pod::POM; 8use Pod::POM::View::HTML; 9use Pod::POM::Test; 10 11$Pod::POM::DEFAULT_VIEW = 'Pod::POM::View::HTML'; 12 13ntests(2); 14 15my $text; 16{ local $/ = undef; 17 $text = <DATA>; 18} 19my ($test, $expect) = split(/\s*-------+\s*/, $text); 20 21 22my $parser = Pod::POM->new(); 23my $pom = $parser->parse_text($test); 24 25assert( $pom ); 26 27my $result = "$pom"; 28 29for ($result, $expect) { 30 s/^\s*//; 31 s/\s*$//; 32} 33 34match($result, $expect); 35#print $pom; 36 37__DATA__ 38=head1 Test 39 40=over 4 41 42=item * 43 44The first item 45 46=item * 47 48The second item 49 50=back 51 52=over 4 53 54=item 1 55 56The 1st item 57 58=item 2 59 60The 2nd item 61 62=back 63 64=over 4 65 66=item 1. 67 68The 1st item 69 70=item 2. 71 72The 2nd item 73 74=back 75 76=over 4 77 78=item foo 79 80The foo item 81 82=item bar 83 84The bar item 85 86=item crash bang wallop! 87 88The crazy item 89 90=back 91 92------------------------------------------------------------------------ 93 94<html> 95<body bgcolor="#ffffff"> 96<h1>Test</h1> 97 98<ul> 99<li> 100<p>The first item</p> 101</li> 102<li> 103<p>The second item</p> 104</li> 105</ul> 106<ol> 107<li> 108<p>The 1st item</p> 109</li> 110<li> 111<p>The 2nd item</p> 112</li> 113</ol> 114<ol> 115<li> 116<p>The 1st item</p> 117</li> 118<li> 119<p>The 2nd item</p> 120</li> 121</ol> 122<ul> 123<li><a name="item_foo"></a><b>foo</b> 124<p>The foo item</p> 125</li> 126<li><a name="item_bar"></a><b>bar</b> 127<p>The bar item</p> 128</li> 129<li><a name="item_crash_bang_wallop_"></a><b>crash bang wallop!</b> 130<p>The crazy item</p> 131</li> 132</ul> 133</body> 134</html> 135 136