#!/usr/bin/perl -w # t/beginend.t - check additions to =begin and =end BEGIN { chdir 't' if -d 't'; } use strict; use lib '../lib'; use Test::More tests => 20; use_ok('Pod::PseudoPod::HTML') or exit; my ($parser, $results); initialize($parser, $results); $parser->parse_string_document(<<'EOPOD'); =begin sidebar This is the text of the sidebar. =end sidebar EOPOD is($results, <<'EOHTML', "a simple sidebar");
EOHTML initialize($parser, $results); $parser->parse_string_document(<<'EOPOD'); =begin sidebar Title Text This is the text of the sidebar. =end sidebar EOPOD is($results, <<'EOHTML', "a sidebar with a title");This is the text of the sidebar.
EOHTML initialize($parser, $results); $parser->parse_string_document(<<'EOPOD'); =begin sidebar Title Text This is the text of the ZTitle Text
This is the text of the sidebar.
EOHTML initialize($parser, $results); $parser->parse_string_document(<<'EOPOD'); =begin programlisting This is used for code blocks and should have no effect beyond ordinary indented text. =end programlisting EOPOD is($results, <<'EOHTML', "allow programlisting blocks");Title Text
This is the text of the sidebar.
This is used for code blocks
and should have no effect
beyond ordinary indented text.
EOHTML
initialize($parser, $results);
$parser->add_css_tags(1);
$parser->parse_string_document(<<'EOPOD');
=begin programlisting
This is used for code blocks
and should have no effect
beyond ordinary indented text.
=end programlisting
EOPOD
is($results, <<'EOHTML', "programlisting blocks with css tags turned on");
This is used for code blocks
and should have no effect
beyond ordinary indented text.
This is used for code blocks
and should have no effect
beyond ordinary indented text.
EOHTML
foreach my $target (qw(blockquote comment caution epigraph
example important note screen tip warning)) {
initialize($parser, $results);
$parser->parse_string_document(<<"EOPOD");
=begin $target
This is a $target.
=end $target
EOPOD
is($results, <<"EOHTML", "allow $target blocks");
This is a $target.
EOHTML } initialize($parser, $results); $parser->parse_string_document(<<'EOPOD'); =begin figure F
This is a sample figure
EOHTML ###################################### sub initialize { $_[0] = Pod::PseudoPod::HTML->new (); $_[0]->output_string( \$results ); # Send the resulting output to a string $_[1] = ''; return; }