diff options
Diffstat (limited to 'cpan/Pod-Simple/t')
-rw-r--r-- | cpan/Pod-Simple/t/corpus.t | 4 | ||||
-rw-r--r-- | cpan/Pod-Simple/t/corpus2/README | 3 | ||||
-rw-r--r-- | cpan/Pod-Simple/t/fcodes.t | 16 | ||||
-rw-r--r-- | cpan/Pod-Simple/t/fcodes_l.t | 42 | ||||
-rw-r--r-- | cpan/Pod-Simple/t/fcodes_s.t | 2 | ||||
-rw-r--r-- | cpan/Pod-Simple/t/html01.t | 21 | ||||
-rw-r--r-- | cpan/Pod-Simple/t/htmlbat.t | 35 | ||||
-rw-r--r-- | cpan/Pod-Simple/t/pulltitl.t | 26 | ||||
-rw-r--r-- | cpan/Pod-Simple/t/reinit.t | 2 | ||||
-rw-r--r-- | cpan/Pod-Simple/t/search20.t | 8 | ||||
-rw-r--r-- | cpan/Pod-Simple/t/search22.t | 8 | ||||
-rw-r--r-- | cpan/Pod-Simple/t/search50.t | 30 | ||||
-rw-r--r-- | cpan/Pod-Simple/t/strpvbtm.t | 111 | ||||
-rw-r--r-- | cpan/Pod-Simple/t/xhtml01.t | 136 | ||||
-rw-r--r-- | cpan/Pod-Simple/t/xhtml10.t | 408 |
15 files changed, 775 insertions, 77 deletions
diff --git a/cpan/Pod-Simple/t/corpus.t b/cpan/Pod-Simple/t/corpus.t index da54f99948..3427b915e1 100644 --- a/cpan/Pod-Simple/t/corpus.t +++ b/cpan/Pod-Simple/t/corpus.t @@ -129,9 +129,7 @@ foreach my $f (@testfiles) { next if $f =~ /nonesuch/; - # foo.xml.out is not a portable filename. foo.xml_out may be a bit more portable - - my $outfilename = ($HACK > 1) ? $wouldxml{$f} : "$wouldxml{$f}_out"; + my $outfilename = ($HACK > 1) ? $wouldxml{$f} : "$wouldxml{$f}\_out"; if($HACK) { open OUT, ">$outfilename" or die "Can't write-open $outfilename: $!\n"; binmode(OUT); diff --git a/cpan/Pod-Simple/t/corpus2/README b/cpan/Pod-Simple/t/corpus2/README new file mode 100644 index 0000000000..de30cb2490 --- /dev/null +++ b/cpan/Pod-Simple/t/corpus2/README @@ -0,0 +1,3 @@ +This is a corpus of data that hasn't been implemented yet. It's +included for future reference, and will be moved to the main corpus +directory as it is implemented. diff --git a/cpan/Pod-Simple/t/fcodes.t b/cpan/Pod-Simple/t/fcodes.t index 02e2a27ee1..7dbf14bcfb 100644 --- a/cpan/Pod-Simple/t/fcodes.t +++ b/cpan/Pod-Simple/t/fcodes.t @@ -7,7 +7,7 @@ BEGIN { use strict; use Test; -BEGIN { plan tests => 18 }; +BEGIN { plan tests => 21 }; #use Pod::Simple::Debug (5); @@ -81,14 +81,24 @@ ok( Pod::Simple::XMLOutStream->_out("=pod\n\nF<< a >>C<<< b >>>I<<<< c >>>>B<< d print "# Without any nesting, but with Z's, and odder whitespace...\n"; ok( Pod::Simple::XMLOutStream->_out("=pod\n\nF<< aZ<> >>C<<< Z<>b >>>I<<<< c >>>>B<< d \t >>X<<\ne >>\n"), - '<Document><Para><F>a</F><C>b</C><I>c</I><B>d</B><X>e</X></Para></Document>' + '<Document><Para><F>aZ<></F><C>Z<>b</C><I>c</I><B>d</B><X>e</X></Para></Document>' ); print "# With nesting and Z's, and odder whitespace...\n"; ok( Pod::Simple::XMLOutStream->_out("=pod\n\nF<< aZ<> >>C<<< Z<>bZ<>B<< d \t >>X<<\ne >> >>>I<<<< c >>>>\n"), - '<Document><Para><F>a</F><C>b<B>d</B><X>e</X></C><I>c</I></Para></Document>' + "<Document><Para><F>aZ<></F><C>Z<>bZ<>B<< d >>X<< e >></C><I>c</I></Para></Document>" ); +print "# Regression https://rt.cpan.org/Ticket/Display.html?id=12239\n"; +ok( Pod::Simple::XMLOutStream->_out("=pod\n\nC<<< foo->bar >>>\n"), + '<Document><Para><C>foo->bar</C></Para></Document>' +); +ok( Pod::Simple::XMLOutStream->_out("=pod\n\nC<<< C<foo> >>>\n"), + '<Document><Para><C>C<foo></C></Para></Document>' +); +ok( Pod::Simple::XMLOutStream->_out("=pod\n\nC<<< C<<foo>> >>>\n"), + '<Document><Para><C>C<<foo>></C></Para></Document>' +); print "# Misc...\n"; ok( Pod::Simple::XMLOutStream->_out( diff --git a/cpan/Pod-Simple/t/fcodes_l.t b/cpan/Pod-Simple/t/fcodes_l.t index 17be5dbb48..3a32fbcd22 100644 --- a/cpan/Pod-Simple/t/fcodes_l.t +++ b/cpan/Pod-Simple/t/fcodes_l.t @@ -337,32 +337,32 @@ print "#\n# Now some very complex L<text|stuff> tests with variant syntax...\n"; ok( $x->_out(qq{=pod\n\nL<< Perl B<<< Error E<77>essages >>>|perldiag >>\n}), - '<Document><Para><L to="perldiag" type="pod">Perl <B>Error Messages</B></L></Para></Document>' + '<Document><Para><L content-implicit="yes" section="Perl B<<< Error E<77>essages" type="pod">"Perl B<<< Error E<77>essages"</L>>|perldiag >></Para></Document>', ); ok( $x->_out(qq{=pod\n\nL<< Perl\nB<<< Error\nE<77>essages >>>|perldiag >>\n}), - '<Document><Para><L to="perldiag" type="pod">Perl <B>Error Messages</B></L></Para></Document>' + '<Document><Para><L content-implicit="yes" section="Perl B<<< Error E<77>essages" type="pod">"Perl B<<< Error E<77>essages"</L>>|perldiag >></Para></Document>' ); ok( $x->_out(qq{=pod\n\nL<< Perl\nB<<< Error\t E<77>essages >>>|perldiag >>\n}), - '<Document><Para><L to="perldiag" type="pod">Perl <B>Error Messages</B></L></Para></Document>' + '<Document><Para><L content-implicit="yes" section="Perl B<<< Error E<77>essages" type="pod">"Perl B<<< Error E<77>essages"</L>>|perldiag >></Para></Document>' ); ok( $x->_out(qq{=pod\n\nL<< SWITCH B<<< E<115>tatements >>>|perlsyn/"Basic I<<<< BLOCKs >>>> and Switch StatementE<115>" >>\n}), - '<Document><Para><L section="Basic BLOCKs and Switch Statements" to="perlsyn" type="pod">SWITCH <B>statements</B></L></Para></Document>' + '<Document><Para><L content-implicit="yes" section="SWITCH B<<< E<115>tatements" type="pod">"SWITCH B<<< E<115>tatements"</L>>|perlsyn/"Basic <I>BLOCKs</I> and Switch Statements" >></Para></Document>' ); ok( $x->_out(qq{=pod\n\nL<< SWITCH B<<< E<115>tatements >>>|perlsyn/Basic I<<<< BLOCKs >>>> and Switch StatementE<115> >>\n}), - '<Document><Para><L section="Basic BLOCKs and Switch Statements" to="perlsyn" type="pod">SWITCH <B>statements</B></L></Para></Document>' + '<Document><Para><L content-implicit="yes" section="SWITCH B<<< E<115>tatements" type="pod">"SWITCH B<<< E<115>tatements"</L>>|perlsyn/Basic <I>BLOCKs</I> and Switch Statements >></Para></Document>' ); ok( $x->_out(qq{=pod\n\nL<<< the F<< various >> attributes|/"Member Data" >>>\n}), - '<Document><Para><L section="Member Data" type="pod">the <F>various</F> attributes</L></Para></Document>' + '<Document><Para><L section="Member Data" type="pod">the F<< various >> attributes</L></Para></Document>' ); ok( $x->_out(qq{=pod\n\nL<<< the F<< various >> attributes|/Member Data >>>\n}), - '<Document><Para><L section="Member Data" type="pod">the <F>various</F> attributes</L></Para></Document>' + '<Document><Para><L section="Member Data" type="pod">the F<< various >> attributes</L></Para></Document>' ); ok( $x->_out(qq{=pod\n\nL<<< the F<< various >> attributes|"Member Data" >>>\n}), - '<Document><Para><L section="Member Data" type="pod">the <F>various</F> attributes</L></Para></Document>' + '<Document><Para><L section="Member Data" type="pod">the F<< various >> attributes</L></Para></Document>' ); ########################################################################### @@ -371,51 +371,51 @@ print "#\n# Now some very complex L<text|stuff> tests with variant syntax and te ok( $x->_out(qq{=pod\n\nI like L<< Perl B<<< Error E<77>essages >>>|perldiag >>.\n}), - '<Document><Para>I like <L to="perldiag" type="pod">Perl <B>Error Messages</B></L>.</Para></Document>' + '<Document><Para>I like <L content-implicit="yes" section="Perl B<<< Error E<77>essages" type="pod">"Perl B<<< Error E<77>essages"</L>>|perldiag >>.</Para></Document>' ); ok( $x->_out(qq{=pod\n\nI like L<< Perl\nB<<< Error\nE<77>essages >>>|perldiag >>.\n}), - '<Document><Para>I like <L to="perldiag" type="pod">Perl <B>Error Messages</B></L>.</Para></Document>' + '<Document><Para>I like <L content-implicit="yes" section="Perl B<<< Error E<77>essages" type="pod">"Perl B<<< Error E<77>essages"</L>>|perldiag >>.</Para></Document>' ); ok( $x->_out(qq{=pod\n\nI like L<< Perl\nB<<< Error\t E<77>essages >>>|perldiag >>.\n}), - '<Document><Para>I like <L to="perldiag" type="pod">Perl <B>Error Messages</B></L>.</Para></Document>' + '<Document><Para>I like <L content-implicit="yes" section="Perl B<<< Error E<77>essages" type="pod">"Perl B<<< Error E<77>essages"</L>>|perldiag >>.</Para></Document>' ); ok( $x->_out(qq{=pod\n\nI like L<< SWITCH B<<< E<115>tatements >>>|perlsyn/"Basic I<<<< BLOCKs >>>> and Switch StatementE<115>" >>.\n}), - '<Document><Para>I like <L section="Basic BLOCKs and Switch Statements" to="perlsyn" type="pod">SWITCH <B>statements</B></L>.</Para></Document>' + '<Document><Para>I like <L content-implicit="yes" section="SWITCH B<<< E<115>tatements" type="pod">"SWITCH B<<< E<115>tatements"</L>>|perlsyn/"Basic <I>BLOCKs</I> and Switch Statements" >>.</Para></Document>' ); ok( $x->_out(qq{=pod\n\nI like L<< SWITCH B<<< E<115>tatements >>>|perlsyn/Basic I<<<< BLOCKs >>>> and Switch StatementE<115> >>.\n}), - '<Document><Para>I like <L section="Basic BLOCKs and Switch Statements" to="perlsyn" type="pod">SWITCH <B>statements</B></L>.</Para></Document>' + '<Document><Para>I like <L content-implicit="yes" section="SWITCH B<<< E<115>tatements" type="pod">"SWITCH B<<< E<115>tatements"</L>>|perlsyn/Basic <I>BLOCKs</I> and Switch Statements >>.</Para></Document>' ); ok( $x->_out(qq{=pod\n\nI like L<<< the F<< various >> attributes|/"Member Data" >>>.\n}), - '<Document><Para>I like <L section="Member Data" type="pod">the <F>various</F> attributes</L>.</Para></Document>' + '<Document><Para>I like <L section="Member Data" type="pod">the F<< various >> attributes</L>.</Para></Document>' ); ok( $x->_out(qq{=pod\n\nI like L<<< the F<< various >> attributes|/Member Data >>>.\n}), - '<Document><Para>I like <L section="Member Data" type="pod">the <F>various</F> attributes</L>.</Para></Document>' + '<Document><Para>I like <L section="Member Data" type="pod">the F<< various >> attributes</L>.</Para></Document>' ); ok( $x->_out(qq{=pod\n\nI like L<<< the F<< various >> attributes|"Member Data" >>>.\n}), - '<Document><Para>I like <L section="Member Data" type="pod">the <F>various</F> attributes</L>.</Para></Document>' + '<Document><Para>I like <L section="Member Data" type="pod">the F<< various >> attributes</L>.</Para></Document>' ); ok( $x->_out(qq{=pod\n\nI like L<<< B<text>s|http://text.com >>>.\n}), -'<Document><Para>I like <L to="http://text.com" type="url"><B>text</B>s</L>.</Para></Document>' +'<Document><Para>I like <L to="http://text.com" type="url">B<text>s</L>.</Para></Document>' ); ok( $x->_out(qq{=pod\n\nI like L<<< text|https://text.com/1/2 >>>.\n}), '<Document><Para>I like <L to="https://text.com/1/2" type="url">text</L>.</Para></Document>' ); ok( $x->_out(qq{=pod\n\nI like L<<< I<text>|http://text.com >>>.\n}), -'<Document><Para>I like <L to="http://text.com" type="url"><I>text</I></L>.</Para></Document>' +'<Document><Para>I like <L to="http://text.com" type="url">I<text></L>.</Para></Document>' ); ok( $x->_out(qq{=pod\n\nI like L<<< C<text>|http://text.com >>>.\n}), -'<Document><Para>I like <L to="http://text.com" type="url"><C>text</C></L>.</Para></Document>' +'<Document><Para>I like <L to="http://text.com" type="url">C<text></L>.</Para></Document>' ); ok( $x->_out(qq{=pod\n\nI like L<<< I<tI<eI<xI<t>>>>|mailto:earlE<64>text.com >>>.\n}), -'<Document><Para>I like <L to="mailto:earl@text.com" type="url"><I>t<I>e<I>x<I>t</I></I></I></I></L>.</Para></Document>' +'<Document><Para>I like <L to="mailto:earlE<64>text.com" type="url">I<tI<eI<xI<t>>>></L>.</Para></Document>' ); ok( $x->_out(qq{=pod\n\nI like L<<< textZ<>|http://text.com >>>.\n}), -'<Document><Para>I like <L to="http://text.com" type="url">text</L>.</Para></Document>' +'<Document><Para>I like <L to="http://text.com" type="url">textZ<></L>.</Para></Document>' ); diff --git a/cpan/Pod-Simple/t/fcodes_s.t b/cpan/Pod-Simple/t/fcodes_s.t index 657902115d..0c66d2c466 100644 --- a/cpan/Pod-Simple/t/fcodes_s.t +++ b/cpan/Pod-Simple/t/fcodes_s.t @@ -83,7 +83,7 @@ $x->preserve_whitespace(1); # RT#25679 ok( $x->_out(<<END -=head1 The Tk::mega manpage showed me how C<< SE<lt> E<gt> foo >> is being rendered +=head1 The Tk::mega manpage showed me how C<< S< > foo >> is being rendered Both pod2text and pod2man S< > lose the rest of the line diff --git a/cpan/Pod-Simple/t/html01.t b/cpan/Pod-Simple/t/html01.t index 2c0b04ef94..18e84a8019 100644 --- a/cpan/Pod-Simple/t/html01.t +++ b/cpan/Pod-Simple/t/html01.t @@ -9,7 +9,7 @@ BEGIN { use strict; use Test; -BEGIN { plan tests => 8 }; +BEGIN { plan tests => 9 }; #use Pod::Simple::Debug (10); @@ -71,6 +71,25 @@ ok(x( "heading building" ); +print x("=over 4\n\n=item one\n\n=item two\n\nHello\n\n=back\n"); +ok( + x("=over 4\n\n=item one\n\n=item two\n\nHello\n\n=back\n"), + q{ +<dl> +<dt><a name="one" +>one</a></dt> + +<dd> +<dt><a name="two" +>two</a></dt> + +<dd> +<p>Hello</p> +</dd> +</dl> +} +); + print "# And one for the road...\n"; ok 1; diff --git a/cpan/Pod-Simple/t/htmlbat.t b/cpan/Pod-Simple/t/htmlbat.t index 497f0e57d5..559754b6e6 100644 --- a/cpan/Pod-Simple/t/htmlbat.t +++ b/cpan/Pod-Simple/t/htmlbat.t @@ -8,18 +8,19 @@ BEGIN { # Time-stamp: "2004-05-24 02:07:47 ADT" use strict; +my $DEBUG = 0; #sub Pod::Simple::HTMLBatch::DEBUG () {5}; use Test; -BEGIN { plan tests => 8 } +BEGIN { plan tests => 9 } require Pod::Simple::HTMLBatch;; use File::Spec; use Cwd; my $cwd = cwd(); -print "# CWD: $cwd\n"; +print "# CWD: $cwd\n" if $DEBUG; my $t_dir; my $corpus_dir; @@ -38,7 +39,7 @@ foreach my $t_maybe ( next unless -e $corpus_dir; last; } -print "# OK, found the test corpus as $corpus_dir\n"; +print "# OK, found the test corpus as $corpus_dir\n" if $DEBUG; ok 1; my $outdir; @@ -54,16 +55,16 @@ END { } ok 1; -print "# Output dir: $outdir\n"; +print "# Output dir: $outdir\n" if $DEBUG; mkdir $outdir, 0777 or die "Can't mkdir $outdir: $!"; -print "# Converting $corpus_dir => $outdir\n"; +print "# Converting $corpus_dir => $outdir\n" if $DEBUG; my $conv = Pod::Simple::HTMLBatch->new; $conv->verbose(0); $conv->batch_convert( [$corpus_dir], $outdir ); ok 1; -print "# OK, back from converting.\n"; +print "# OK, back from converting.\n" if $DEBUG; my @files; use File::Find; @@ -79,19 +80,31 @@ find( sub { push @files, $File::Find::name; return }, $outdir ); } } -print "#Produced in $outdir ...\n"; -foreach my $f (sort @files) { - print "# $f\n"; +if ($DEBUG) { + print "#Produced in $outdir ...\n"; + foreach my $f (sort @files) { + print "# $f\n"; + } + print "# (", scalar(@files), " items total)\n"; } -print "# (", scalar(@files), " items total)\n"; # Some minimal sanity checks: ok scalar(grep m/\.css/i, @files) > 5; ok scalar(grep m/\.html?/i, @files) > 5; ok scalar grep m{squaa\W+Glunk.html?}i, @files; +if (my @long = grep { /^[^.]{9,}/ } map { s{^[^/]/}{} } @files) { + ok 0; + print "# File names too long:\n", + map { "# $_\n" } @long; +} else { + ok 1; +} + + + # use Pod::Simple; # *pretty = \&Pod::Simple::BlackBox::pretty; -print "# Bye from ", __FILE__, "\n"; +print "# Bye from ", __FILE__, "\n" if $DEBUG; ok 1; diff --git a/cpan/Pod-Simple/t/pulltitl.t b/cpan/Pod-Simple/t/pulltitl.t index abaf83f7b7..c50c9327b0 100644 --- a/cpan/Pod-Simple/t/pulltitl.t +++ b/cpan/Pod-Simple/t/pulltitl.t @@ -7,7 +7,7 @@ BEGIN { use strict; use Test; -BEGIN { plan tests => 104 }; +BEGIN { plan tests => 114 }; #use Pod::Simple::Debug (5); @@ -29,6 +29,7 @@ my $p = Pod::Simple::PullParser->new; $p->set_source( \qq{\n=head1 NAME\n\nBzorch\n\n=pod\n\nLala\n\n\=cut\n} ); ok $p->get_title(), 'Bzorch'; + my $t; ok( $t = $p->get_token); @@ -48,6 +49,29 @@ ok( $t && $t->type eq 'text' && $t->text, 'NAME' ); ########################################################################### { +print "# Testing a set with nocase, at line ", __LINE__, "\n"; +my $p = Pod::Simple::PullParser->new; +$p->set_source( \qq{\n=head1 Name\n\nShazbot\n\n=pod\n\nLala\n\n\=cut\n} ); + +ok $p->get_title(nocase => 1), 'Shazbot'; + +ok( my $t = $p->get_token); +ok( $t && $t->type, 'start'); +ok( $t && $t->type eq 'start' && $t->tagname, 'Document' ); + +ok( $t = $p->get_token); +ok( $t && $t->type, 'start'); +ok( $t && $t->type eq 'start' && $t->tagname, 'head1' ); + +ok( $t = $p->get_token); +ok( $t && $t->type, 'text'); +ok( $t && $t->type eq 'text' && $t->text, 'Name' ); + +} + +########################################################################### + +{ print "# Testing another set, at line ", __LINE__, "\n"; my $p = Pod::Simple::PullParser->new; diff --git a/cpan/Pod-Simple/t/reinit.t b/cpan/Pod-Simple/t/reinit.t index c10c65eb17..8576e9963e 100644 --- a/cpan/Pod-Simple/t/reinit.t +++ b/cpan/Pod-Simple/t/reinit.t @@ -42,7 +42,7 @@ foreach my $file ( next; } - my $precooked = source_path($file); + my $precooked = $file; my $outstring; my $compstring; $precooked =~ s<\.pod><o.txt>s; diff --git a/cpan/Pod-Simple/t/search20.t b/cpan/Pod-Simple/t/search20.t index 3022b3653b..52c6c36a16 100644 --- a/cpan/Pod-Simple/t/search20.t +++ b/cpan/Pod-Simple/t/search20.t @@ -69,16 +69,12 @@ print $p; { my $names = join "|", sort values %$where2name; -skip $^O eq 'VMS' ? '-- case may or may not be preserved' : 0, - $names, - "Blorm|Suzzle|Zonk::Pronk|hinkhonk::Glunk|hinkhonk::Vliff|perlflif|perlthng|perlzuk|squaa|squaa::Glunk|squaa::Vliff|squaa::Wowo|zikzik"; +ok $names, "Blorm|Suzzle|Zonk::Pronk|hinkhonk::Glunk|hinkhonk::Vliff|perlflif|perlthng|perlzuk|squaa|squaa::Glunk|squaa::Vliff|squaa::Wowo|zikzik"; } { my $names = join "|", sort keys %$name2where; -skip $^O eq 'VMS' ? '-- case may or may not be preserved' : 0, - $names, - "Blorm|Suzzle|Zonk::Pronk|hinkhonk::Glunk|hinkhonk::Vliff|perlflif|perlthng|perlzuk|squaa|squaa::Glunk|squaa::Vliff|squaa::Wowo|zikzik"; +ok $names, "Blorm|Suzzle|Zonk::Pronk|hinkhonk::Glunk|hinkhonk::Vliff|perlflif|perlthng|perlzuk|squaa|squaa::Glunk|squaa::Vliff|squaa::Wowo|zikzik"; } ok( ($name2where->{'squaa'} || 'huh???'), '/squaa\.pm$/'); diff --git a/cpan/Pod-Simple/t/search22.t b/cpan/Pod-Simple/t/search22.t index 6e6d662a1b..05157b748c 100644 --- a/cpan/Pod-Simple/t/search22.t +++ b/cpan/Pod-Simple/t/search22.t @@ -71,17 +71,13 @@ print $p; { print "# won't show any shadows, since we're just looking at the name2where keys\n"; my $names = join "|", sort keys %$name2where; -skip $^O eq 'VMS' ? '-- case may or may not be preserved' : 0, - $names, - "Blorm|Suzzle|Zonk::Pronk|hinkhonk::Glunk|hinkhonk::Vliff|perlflif|perlthng|perlzuk|squaa|squaa::Glunk|squaa::Vliff|squaa::Wowo|zikzik"; +ok $names, "Blorm|Suzzle|Zonk::Pronk|hinkhonk::Glunk|hinkhonk::Vliff|perlflif|perlthng|perlzuk|squaa|squaa::Glunk|squaa::Vliff|squaa::Wowo|zikzik"; } { print "# but here we'll see shadowing:\n"; my $names = join "|", sort values %$where2name; -skip $^O eq 'VMS' ? '-- case may or may not be preserved' : 0, - $names, - "Blorm|Suzzle|Zonk::Pronk|hinkhonk::Glunk|hinkhonk::Glunk|hinkhonk::Vliff|hinkhonk::Vliff|perlflif|perlthng|perlthng|perlzuk|squaa|squaa::Glunk|squaa::Vliff|squaa::Vliff|squaa::Vliff|squaa::Wowo|zikzik"; +ok $names, "Blorm|Suzzle|Zonk::Pronk|hinkhonk::Glunk|hinkhonk::Glunk|hinkhonk::Vliff|hinkhonk::Vliff|perlflif|perlthng|perlthng|perlzuk|squaa|squaa::Glunk|squaa::Vliff|squaa::Vliff|squaa::Vliff|squaa::Wowo|zikzik"; my %count; for(values %$where2name) { ++$count{$_} }; diff --git a/cpan/Pod-Simple/t/search50.t b/cpan/Pod-Simple/t/search50.t index d207276857..55fb8a5e01 100644 --- a/cpan/Pod-Simple/t/search50.t +++ b/cpan/Pod-Simple/t/search50.t @@ -11,7 +11,7 @@ use strict; use Pod::Simple::Search; use Test; -BEGIN { plan tests => 7 } +BEGIN { plan tests => 8 } print "# Test the scanning of the whole of \@INC ...\n"; @@ -45,9 +45,12 @@ $p =~ s/^/# /mg; print $p; print "# OK, making sure strict and strict.pm were in there...\n"; -ok( ($name2where->{'strict'} || 'huh???'), '/strict\.(pod|pm)$/'); +print "# (On Debian-based distributions Pod is stripped from\n", + "# strict.pm, so skip these tests.)\n"; +my $nopod = not exists ($name2where->{'strict'}); +skip($nopod, ($name2where->{'strict'} || 'huh???'), '/strict\.(pod|pm)$/'); -ok grep( m/strict\.(pod|pm)/, keys %$where2name ); +skip($nopod, grep( m/strict\.(pod|pm)/, keys %$where2name )); my $strictpath = $name2where->{'strict'}; if( $strictpath ) { @@ -56,8 +59,27 @@ if( $strictpath ) { for(@x) { s{[/\\]}{/}g; } print "# => \"$x[0]\" to \"$x[1]\"\n"; ok $x[0], $x[1], " find('strict') should match survey's name2where{strict}"; +} elsif ($nopod) { + skip "skipping find() for strict.pm"; # skipping find() for 'thatpath/strict.pm } else { - ok 0; # no 'thatpath/strict.pm' means can't test find() + ok 0; # an entry without a defined path means can't test find() +} + +print "# Test again on a module we know is present, in case the +strict.pm tests were skipped...\n"; + +# Grab the first item in $name2where, since it doesn't matter which we +# use. +my $testmod = (keys %$name2where)[0]; +my $testpath = $name2where->{$testmod}; +if( $testmod ) { + my @x = ($x->find($testmod)||'(nil)', $testpath); + print "# Comparing \"$x[0]\" to \"$x[1]\"\n"; + for(@x) { s{[/\\]}{/}g; } + print "# => \"$x[0]\" to \"$x[1]\"\n"; + ok $x[0], $x[1], " find('$testmod') should match survey's name2where{$testmod}"; +} else { + ok 0; # no 'thatpath/<name>.pm' means can't test find() } ok 1; diff --git a/cpan/Pod-Simple/t/strpvbtm.t b/cpan/Pod-Simple/t/strpvbtm.t new file mode 100644 index 0000000000..9cb83f3559 --- /dev/null +++ b/cpan/Pod-Simple/t/strpvbtm.t @@ -0,0 +1,111 @@ +#!/usr/bin/perl -w + +# t/strip_verbatim_indent.t.t - check verabtim indent stripping feature + +BEGIN { + chdir 't' if -d 't'; +} + +use strict; +use lib '../lib'; +use Test::More tests => 79; +#use Test::More 'no_plan'; + +use_ok('Pod::Simple::XHTML') or exit; +use_ok('Pod::Simple::XMLOutStream') or exit; + +isa_ok my $parser = Pod::Simple::XHTML->new, 'Pod::Simple::XHTML'; + +ok $parser->strip_verbatim_indent(' '), 'Should be able to set striper to " "'; +ok $parser->strip_verbatim_indent(' '), 'Should be able to set striper to " "'; +ok $parser->strip_verbatim_indent("t"), 'Should be able to set striper to "\\t"'; +ok $parser->strip_verbatim_indent(sub { ' ' }), 'Should be able to set striper to coderef'; + +for my $spec ( + [ + "\n=pod\n\n foo bar baz\n", + undef, + qq{<Document><Verbatim\nxml:space="preserve"> foo bar baz</Verbatim></Document>}, + "<pre><code> foo bar baz</code></pre>\n\n", + 'undefined indent' + ], + [ + "\n=pod\n\n foo bar baz\n", + ' ', + qq{<Document><Verbatim\nxml:space="preserve">foo bar baz</Verbatim></Document>}, + "<pre><code>foo bar baz</code></pre>\n\n", + 'single space indent' + ], + [ + "\n=pod\n\n foo bar baz\n", + ' ', + qq{<Document><Verbatim\nxml:space="preserve"> foo bar baz</Verbatim></Document>}, + "<pre><code> foo bar baz</code></pre>\n\n", + 'too large indent' + ], + [ + "\n=pod\n\n foo bar baz\n", + ' ', + qq{<Document><Verbatim\nxml:space="preserve">foo bar baz</Verbatim></Document>}, + "<pre><code>foo bar baz</code></pre>\n\n", + 'double space indent' + ], + [ + "\n=pod\n\n foo bar baz\n", + sub { ' ' }, + qq{<Document><Verbatim\nxml:space="preserve">foo bar baz</Verbatim></Document>}, + "<pre><code>foo bar baz</code></pre>\n\n", + 'code ref stripper' + ], + [ + "\n=pod\n\n foo bar\n\n baz blez\n", + ' ', + qq{<Document><Verbatim\nxml:space="preserve">foo bar\n\nbaz blez</Verbatim></Document>}, + "<pre><code>foo bar\n\nbaz blez</code></pre>\n\n", + 'single space indent and empty line' + ], + [ + "\n=pod\n\n foo bar\n\n baz blez\n", + sub { ' ' }, + qq{<Document><Verbatim\nxml:space="preserve">foo bar\n\nbaz blez</Verbatim></Document>}, + "<pre><code>foo bar\n\nbaz blez</code></pre>\n\n", + 'code ref indent and empty line' + ], + [ + "\n=pod\n\n foo bar\n\n baz blez\n", + sub { (my $s = shift->[0]) =~ s/\S.*//; $s }, + qq{<Document><Verbatim\nxml:space="preserve">foo bar\n\nbaz blez</Verbatim></Document>}, + "<pre><code>foo bar\n\nbaz blez</code></pre>\n\n", + 'heuristic code ref indent' + ], + [ + "\n=pod\n\n foo bar\n baz blez\n", + sub { s/^\s+// for @{ $_[0] } }, + qq{<Document><Verbatim\nxml:space="preserve">foo bar\nbaz blez</Verbatim></Document>}, + "<pre><code>foo bar\nbaz blez</code></pre>\n\n", + 'militant code ref' + ], +) { + my ($pod, $indent, $xml, $xhtml, $desc) = @$spec; + # Test XML output. + ok my $p = Pod::Simple::XMLOutStream->new, "Construct XML parser to test $desc"; + $p->hide_line_numbers(1); + my $output = ''; + $p->output_string( \$output ); + is $indent, $p->strip_verbatim_indent($indent), + 'Set stripper for XML to ' . (defined $indent ? qq{"$indent"} : 'undef'); + ok $p->parse_string_document( $pod ), "Parse POD to XML for $desc"; + is $output, $xml, "Should have expected XML output for $desc"; + + + # Test XHTML output. + ok $p = Pod::Simple::XHTML->new, "Construct XHMTL parser to test $desc"; + $p->html_header(''); + $p->html_footer(''); + $output = ''; + $p->output_string( \$output ); + is $indent, $p->strip_verbatim_indent($indent), + 'Set stripper for XHTML to ' . (defined $indent ? qq{"$indent"} : 'undef'); + ok $p->parse_string_document( $pod ), "Parse POD to XHTML for $desc"; + is $output, $xhtml, "Should have expected XHTML output for $desc"; +} diff --git a/cpan/Pod-Simple/t/xhtml01.t b/cpan/Pod-Simple/t/xhtml01.t index d75605a1ea..d2723904cd 100644 --- a/cpan/Pod-Simple/t/xhtml01.t +++ b/cpan/Pod-Simple/t/xhtml01.t @@ -8,7 +8,7 @@ BEGIN { use strict; use lib '../lib'; -use Test::More tests => 26; +use Test::More tests => 33; use_ok('Pod::Simple::XHTML') or exit; @@ -21,19 +21,19 @@ my $PERLDOC = "http://search.cpan.org/perldoc?"; initialize($parser, $results); $parser->parse_string_document( "=head1 Poit!" ); -is($results, "<h1>Poit!</h1>\n\n", "head1 level output"); +is($results, qq{<h1 id="Poit-">Poit!</h1>\n\n}, "head1 level output"); initialize($parser, $results); $parser->parse_string_document( "=head2 I think so Brain." ); -is($results, "<h2>I think so Brain.</h2>\n\n", "head2 level output"); +is($results, qq{<h2 id="I-think-so-Brain.">I think so Brain.</h2>\n\n}, "head2 level output"); initialize($parser, $results); $parser->parse_string_document( "=head3 I say, Brain..." ); -is($results, "<h3>I say, Brain...</h3>\n\n", "head3 level output"); +is($results, qq{<h3 id="I-say-Brain...">I say, Brain...</h3>\n\n}, "head3 level output"); initialize($parser, $results); -$parser->parse_string_document( "=head4 Zort!" ); -is($results, "<h4>Zort!</h4>\n\n", "head4 level output"); +$parser->parse_string_document( "=head4 Zort & Zog!" ); +is($results, qq{<h4 id="Zort-Zog-">Zort & Zog!</h4>\n\n}, "head4 level output"); initialize($parser, $results); @@ -63,7 +63,7 @@ EOPOD is($results, <<'EOHTML', "multiple paragraphs"); <p>B: Now, Pinky, if by any chance you are captured during this mission, remember you are Gunther Heindriksen from Appenzell. You moved to Grindelwald to drive the cog train to Murren. Can you repeat that?</p> -<p>P: Mmmm, no, Brain, don't think I can.</p> +<p>P: Mmmm, no, Brain, don't think I can.</p> EOHTML @@ -86,10 +86,12 @@ EOPOD is($results, <<'EOHTML', "simple bulleted list"); <ul> -<li>P: Gee, Brain, what do you want to do tonight?</li> +<li><p>P: Gee, Brain, what do you want to do tonight?</p> -<li>B: The same thing we do every night, Pinky. Try to take over the world!</li> +</li> +<li><p>B: The same thing we do every night, Pinky. Try to take over the world!</p> +</li> </ul> EOHTML @@ -114,10 +116,12 @@ EOPOD is($results, <<'EOHTML', "numbered list"); <ol> -<li>1. P: Gee, Brain, what do you want to do tonight?</li> +<li><p>P: Gee, Brain, what do you want to do tonight?</p> -<li>2. B: The same thing we do every night, Pinky. Try to take over the world!</li> +</li> +<li><p>B: The same thing we do every night, Pinky. Try to take over the world!</p> +</li> </ol> EOHTML @@ -140,16 +144,78 @@ The same thing we do every night, Pinky. Try to take over the world! EOPOD is($results, <<'EOHTML', "list with text headings"); +<dl> + +<dt>Pinky</dt> +<dd> + +<p>Gee, Brain, what do you want to do tonight?</p> + +</dd> +<dt>Brain</dt> +<dd> + +<p>The same thing we do every night, Pinky. Try to take over the world!</p> + +</dd> +</dl> + +EOHTML + +initialize($parser, $results); +$parser->parse_string_document(<<'EOPOD'); +=over + +=item * Pinky + +Gee, Brain, what do you want to do tonight? + +=item * Brain + +The same thing we do every night, Pinky. Try to take over the world! + +=back + +EOPOD + +is($results, <<'EOHTML', "list with bullet and text headings"); <ul> -<li>Pinky +<li><p>Pinky</p> <p>Gee, Brain, what do you want to do tonight?</p> -<li>Brain +</li> +<li><p>Brain</p> <p>The same thing we do every night, Pinky. Try to take over the world!</p> +</li> +</ul> + +EOHTML + +initialize($parser, $results); +$parser->parse_string_document(<<'EOPOD'); +=over + +=item * Brain <brain@binkyandthebrain.com> + +=item * Pinky <pinky@binkyandthebrain.com> + +=back + +EOPOD + +is($results, <<'EOHTML', "bulleted author list"); +<ul> + +<li><p>Brain <brain@binkyandthebrain.com></p> + +</li> +<li><p>Pinky <pinky@binkyandthebrain.com></p> + +</li> </ul> EOHTML @@ -245,7 +311,7 @@ $parser->parse_string_document(<<'EOPOD'); A plain paragraph with a L<perlport/Newlines>. EOPOD is($results, <<"EOHTML", "Link entity in a paragraph"); -<p>A plain paragraph with a <a href="${PERLDOC}perlport/Newlines">"Newlines" in perlport</a>.</p> +<p>A plain paragraph with a <a href="${PERLDOC}perlport/Newlines">"Newlines" in perlport</a>.</p> EOHTML @@ -304,20 +370,44 @@ is($results, <<"EOHTML", "File name in a paragraph"); EOHTML - +# It's not important that 's (apostrophes) be encoded for XHTML output. initialize($parser, $results); $parser->parse_string_document(<<'EOPOD'); =pod - # this header is very important & don't you forget it + # this header is very important & dont you forget it my $text = "File is: " . <FILE>; EOPOD is($results, <<"EOHTML", "Verbatim text with encodable entities"); -<pre><code> # this header is very important & don't you forget it +<pre><code> # this header is very important & dont you forget it my \$text = "File is: " . <FILE>;</code></pre> EOHTML +initialize($parser, $results); +$parser->parse_string_document(<<'EOPOD'); +=pod + +A text paragraph using E<sol> and E<verbar> special POD entities. + +EOPOD +is($results, <<"EOHTML", "Text with decodable entities"); +<p>A text paragraph using / and | special POD entities.</p> + +EOHTML + +initialize($parser, $results); +$parser->parse_string_document(<<'EOPOD'); +=pod + +A text paragraph using numeric POD entities: E<60>, E<62>. + +EOPOD +is($results, <<"EOHTML", "Text with numeric entities"); +<p>A text paragraph using numeric POD entities: <, >.</p> + +EOHTML + SKIP: for my $use_html_entities (0, 1) { if ($use_html_entities and not $Pod::Simple::XHTML::HAS_HTML_ENTITIES) { skip("HTML::Entities not installed", 1); @@ -327,18 +417,26 @@ SKIP: for my $use_html_entities (0, 1) { $parser->parse_string_document(<<'EOPOD'); =pod - # this header is very important & don't you forget it + # this header is very important & dont you forget it B<my $file = <FILEE<gt> || 'Blank!';> my $text = "File is: " . <FILE>; EOPOD is($results, <<"EOHTML", "Verbatim text with markup and embedded formatting"); -<pre><code> # this header is very important & don't you forget it +<pre><code> # this header is very important & dont you forget it <b>my \$file = <FILE> || 'Blank!';</b> my \$text = "File is: " . <FILE>;</code></pre> EOHTML } + +ok $parser = Pod::Simple::XHTML->new, 'Construct a new parser'; +$results = ''; +$parser->output_string( \$results ); # Send the resulting output to a string +ok $parser->parse_string_document( "=head1 Poit!" ), 'Parse with headers'; +like $results, qr{<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />}, + 'Should have proper http-equiv meta tag'; + ###################################### sub initialize { diff --git a/cpan/Pod-Simple/t/xhtml10.t b/cpan/Pod-Simple/t/xhtml10.t new file mode 100644 index 0000000000..c3ec2022a9 --- /dev/null +++ b/cpan/Pod-Simple/t/xhtml10.t @@ -0,0 +1,408 @@ +#!/usr/bin/perl -w + +# t/xhtml01.t - check basic output from Pod::Simple::XHTML + +BEGIN { + chdir 't' if -d 't'; +} + +use strict; +use lib '../lib'; +use Test::More tests => 44; +#use Test::More 'no_plan'; + +use_ok('Pod::Simple::XHTML') or exit; + +isa_ok my $parser = Pod::Simple::XHTML->new, 'Pod::Simple::XHTML'; +my $header = $parser->html_header; +my $footer = $parser->html_footer; + +for my $spec ( + [ 'foo' => 'foo', 'foo' ], + [ '12foo' => 'foo1', 'foo' ], + [ 'fo$bar' => 'fo-bar', 'fo-bar' ], + [ 'f12' => 'f12', 'f12' ], + [ '13' => 'pod13', 'pod13' ], + [ '**.:' => 'pod-.:', 'pod-.:' ], +) { + is $parser->idify( $spec->[0] ), $spec->[1], + qq{ID for "$spec->[0]" should be "$spec->[1]"}; + is $parser->idify( $spec->[0], 1 ), $spec->[2], + qq{Non-unique ID for "$spec->[0]" should be "$spec->[2]"}; +} + +my $results; + +initialize($parser, $results); +$parser->html_header($header); +$parser->html_footer($footer); +ok $parser->parse_string_document( '=head1 Foo' ), 'Parse one header'; +is $results, <<'EOF', 'Should have the index'; + +<html> +<head> +<title></title> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> +</head> +<body> + + +<ul id="index"> + <li><a href="#Foo">Foo</a></li> +</ul> + +<h1 id="Foo">Foo</h1> + +</body> +</html> + +EOF + +initialize($parser, $results); +ok $parser->parse_string_document( '=head1 Foo Bar' ), 'Parse multiword header'; +is $results, <<'EOF', 'Should have the index'; +<ul id="index"> + <li><a href="#Foo-Bar">Foo Bar</a></li> +</ul> + +<h1 id="Foo-Bar">Foo Bar</h1> + +EOF + +initialize($parser, $results); +ok $parser->parse_string_document( "=head1 Foo B<Bar>\n\n=head1 Foo B<Baz>" ), + 'Parse two multiword headers'; +is $results, <<'EOF', 'Should have the index'; +<ul id="index"> + <li><a href="#Foo-Bar">Foo <b>Bar</b></a></li> + <li><a href="#Foo-Baz">Foo <b>Baz</b></a></li> +</ul> + +<h1 id="Foo-Bar">Foo <b>Bar</b></h1> + +<h1 id="Foo-Baz">Foo <b>Baz</b></h1> + +EOF + +initialize($parser, $results); +ok $parser->parse_string_document( "=head1 Foo\n\n=head1 Bar" ), 'Parse two headers'; +is $results, <<'EOF', 'Should have both and the index'; +<ul id="index"> + <li><a href="#Foo">Foo</a></li> + <li><a href="#Bar">Bar</a></li> +</ul> + +<h1 id="Foo">Foo</h1> + +<h1 id="Bar">Bar</h1> + +EOF +initialize($parser, $results); +ok $parser->parse_string_document( "=head1 Foo\n\n=head1 Bar\n\n=head1 Baz" ), + 'Parse three headers'; +is $results, <<'EOF', 'Should have all three and the index'; +<ul id="index"> + <li><a href="#Foo">Foo</a></li> + <li><a href="#Bar">Bar</a></li> + <li><a href="#Baz">Baz</a></li> +</ul> + +<h1 id="Foo">Foo</h1> + +<h1 id="Bar">Bar</h1> + +<h1 id="Baz">Baz</h1> + +EOF + +initialize($parser, $results); +ok $parser->parse_string_document( "=head1 Foo\n\n=head2 Bar" ), 'Parse two levels'; +is $results, <<'EOF', 'Should have the dual-level index'; +<ul id="index"> + <li><a href="#Foo">Foo</a> + <ul> + <li><a href="#Bar">Bar</a></li> + </ul> + </li> +</ul> + +<h1 id="Foo">Foo</h1> + +<h2 id="Bar">Bar</h2> + +EOF + +initialize($parser, $results); +ok $parser->parse_string_document( "=head1 Foo\n\n=head2 Bar\n\n=head3 Baz" ), + 'Parse three levels'; +is $results, <<'EOF', 'Should have the three-level index'; +<ul id="index"> + <li><a href="#Foo">Foo</a> + <ul> + <li><a href="#Bar">Bar</a> + <ul> + <li><a href="#Baz">Baz</a></li> + </ul> + </li> + </ul> + </li> +</ul> + +<h1 id="Foo">Foo</h1> + +<h2 id="Bar">Bar</h2> + +<h3 id="Baz">Baz</h3> + +EOF + +initialize($parser, $results); +ok $parser->parse_string_document( "=head1 Foo\n\n=head2 Bar\n\n=head3 Baz\n\n=head4 Howdy" ), + 'Parse four levels'; +is $results, <<'EOF', 'Should have the four-level index'; +<ul id="index"> + <li><a href="#Foo">Foo</a> + <ul> + <li><a href="#Bar">Bar</a> + <ul> + <li><a href="#Baz">Baz</a> + <ul> + <li><a href="#Howdy">Howdy</a></li> + </ul> + </li> + </ul> + </li> + </ul> + </li> +</ul> + +<h1 id="Foo">Foo</h1> + +<h2 id="Bar">Bar</h2> + +<h3 id="Baz">Baz</h3> + +<h4 id="Howdy">Howdy</h4> + +EOF + +initialize($parser, $results); +ok $parser->parse_string_document( "=head1 Foo\n\n=head2 Bar\n\n=head2 Baz" ), + 'Parse 1/2'; +is $results, <<'EOF', 'Should have the 1/s index'; +<ul id="index"> + <li><a href="#Foo">Foo</a> + <ul> + <li><a href="#Bar">Bar</a></li> + <li><a href="#Baz">Baz</a></li> + </ul> + </li> +</ul> + +<h1 id="Foo">Foo</h1> + +<h2 id="Bar">Bar</h2> + +<h2 id="Baz">Baz</h2> + +EOF + +initialize($parser, $results); +ok $parser->parse_string_document( "=head1 Foo\n\n=head3 Bar" ), 'Parse jump from one to three'; +is $results, <<'EOF', 'Should have the 1-3 index'; +<ul id="index"> + <li><a href="#Foo">Foo</a> + <ul> + <li> + <ul> + <li><a href="#Bar">Bar</a></li> + </ul> + </li> + </ul> + </li> +</ul> + +<h1 id="Foo">Foo</h1> + +<h3 id="Bar">Bar</h3> + +EOF + +initialize($parser, $results); +ok $parser->parse_string_document( "=head1 Foo\n\n=head4 Bar" ), 'Parse jump from one to four'; +is $results, <<'EOF', 'Should have the 1-4 index'; +<ul id="index"> + <li><a href="#Foo">Foo</a> + <ul> + <li> + <ul> + <li> + <ul> + <li><a href="#Bar">Bar</a></li> + </ul> + </li> + </ul> + </li> + </ul> + </li> +</ul> + +<h1 id="Foo">Foo</h1> + +<h4 id="Bar">Bar</h4> + +EOF + +initialize($parser, $results); +ok $parser->parse_string_document( "=head2 Foo\n\n=head1 Bar" ), + 'Parse two down to 1'; +is $results, <<'EOF', 'Should have the 2-1 index'; +<ul id="index"> + <li> + <ul> + <li><a href="#Foo">Foo</a></li> + </ul> + </li> + <li><a href="#Bar">Bar</a></li> +</ul> + +<h2 id="Foo">Foo</h2> + +<h1 id="Bar">Bar</h1> + +EOF + +initialize($parser, $results); +ok $parser->parse_string_document( "=head2 Foo\n\n=head1 Bar\n\n=head4 Four\n\n=head4 Four2" ), + 'Parse two down to 1'; +is $results, <<'EOF', 'Should have the 2-1 index'; +<ul id="index"> + <li> + <ul> + <li><a href="#Foo">Foo</a></li> + </ul> + </li> + <li><a href="#Bar">Bar</a> + <ul> + <li> + <ul> + <li> + <ul> + <li><a href="#Four">Four</a></li> + <li><a href="#Four2">Four2</a></li> + </ul> + </li> + </ul> + </li> + </ul> + </li> +</ul> + +<h2 id="Foo">Foo</h2> + +<h1 id="Bar">Bar</h1> + +<h4 id="Four">Four</h4> + +<h4 id="Four2">Four2</h4> + +EOF + +initialize($parser, $results); +ok $parser->parse_string_document( "=head4 Foo" ), + 'Parse just a four'; +is $results, <<'EOF', 'Should have the 2-1 index'; +<ul id="index"> + <li> + <ul> + <li> + <ul> + <li> + <ul> + <li><a href="#Foo">Foo</a></li> + </ul> + </li> + </ul> + </li> + </ul> + </li> +</ul> + +<h4 id="Foo">Foo</h4> + +EOF + +initialize($parser, $results); +ok $parser->parse_string_document( <<'EOF' ), 'Parse a mixture'; +=head2 Foo + +=head3 Bar + +=head1 Baz + +=head4 Drink + +=head3 Sip + +=head4 Ouch + +=head1 Drip +EOF + +is $results, <<'EOF', 'And it should work!'; +<ul id="index"> + <li> + <ul> + <li><a href="#Foo">Foo</a> + <ul> + <li><a href="#Bar">Bar</a></li> + </ul> + </li> + </ul> + </li> + <li><a href="#Baz">Baz</a> + <ul> + <li> + <ul> + <li> + <ul> + <li><a href="#Drink">Drink</a></li> + </ul> + </li> + <li><a href="#Sip">Sip</a> + <ul> + <li><a href="#Ouch">Ouch</a></li> + </ul> + </li> + </ul> + </li> + </ul> + </li> + <li><a href="#Drip">Drip</a></li> +</ul> + +<h2 id="Foo">Foo</h2> + +<h3 id="Bar">Bar</h3> + +<h1 id="Baz">Baz</h1> + +<h4 id="Drink">Drink</h4> + +<h3 id="Sip">Sip</h3> + +<h4 id="Ouch">Ouch</h4> + +<h1 id="Drip">Drip</h1> + +EOF + +sub initialize { + $_[0] = Pod::Simple::XHTML->new; + $_[0]->html_header(''); + $_[0]->html_footer(''); + $_[0]->index(1); + $_[0]->output_string( \$results ); # Send the resulting output to a string + $_[1] = ''; + return; +} |