Upgrade to Pod-Simple-3.05.
[p5sagit/p5-mst-13.2.git] / lib / Pod / Simple / t / html01.t
CommitLineData
351625bd 1# t/html-para.t
2
3BEGIN {
4 if($ENV{PERL_CORE}) {
5 chdir 't';
6 @INC = '../lib';
7 }
8}
9
10use strict;
11use Test;
12BEGIN { plan tests => 8 };
13
14#use Pod::Simple::Debug (10);
15
16use Pod::Simple::HTML;
17
18sub x ($) { Pod::Simple::HTML->_out(
19 sub{ $_[0]->bare_output(1) },
20 "=pod\n\n$_[0]",
21) }
22
23ok( x(
24q{
25=pod
26
27This is a paragraph
28
29=cut
30}),
31 qq{\n<p>This is a paragraph</p>\n},
32 "paragraph building"
33);
34
35
36ok( x(qq{=pod\n\nThis is a paragraph}),
37 qq{\n<p>This is a paragraph</p>\n},
38 "paragraph building"
39);
40
41
42ok( x(qq{This is a paragraph}),
43 qq{\n<p>This is a paragraph</p>\n},
44 "paragraph building"
45);
46
47
48
49ok(x(
50'=head1 This is a heading')
51 => q{/\s*<h1><a[^<>]+>This\s+is\s+a\s+heading</a></h1>\s*$/},
52 "heading building"
53);
54
55ok(x(
56'=head2 This is a heading too')
57 => q{/\s*<h2><a[^<>]+>This\s+is\s+a\s+heading\s+too</a></h2>\s*$/},
58 "heading building"
59);
60
61ok(x(
62'=head3 Also, this is a heading')
63 => q{/\s*<h3><a[^<>]+>Also,\s+this\s+is\s+a\s+heading</a></h3>\s*$/},
64 "heading building"
65);
66
67
68ok(x(
69'=head4 This, too, is a heading')
70 => q{/\s*<h4><a[^<>]+>This,\s+too,\s+is\s+a\s+heading</a></h4>\s*$/},
71 "heading building"
72);
73
74
75print "# And one for the road...\n";
76ok 1;
77