This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update Pod-Simple to CPAN version 3.18
[perl5.git] / cpan / Pod-Simple / t / items02.t
CommitLineData
433cf6b4
JV
1# Testing the =item directive\r
2BEGIN {\r
3 if($ENV{PERL_CORE}) {\r
4 chdir 't';\r
5 @INC = '../lib';\r
6 }\r
7}\r
8\r
9use strict;\r
10use Test;\r
11BEGIN { plan tests => 4 };\r
12\r
13my $d;\r
14#use Pod::Simple::Debug (\$d,0);\r
15\r
16ok 1;\r
17\r
18use Pod::Simple::DumpAsXML;\r
19use Pod::Simple::XMLOutStream;\r
20print "# Pod::Simple version $Pod::Simple::VERSION\n";\r
21sub e ($$) { Pod::Simple::DumpAsXML->_duo(@_) }\r
22\r
23my $x = 'Pod::Simple::XMLOutStream';\r
24\r
25print "##### Tests for =item directives via class $x\n";\r
26\r
27$Pod::Simple::XMLOutStream::ATTR_PAD = ' ';\r
28$Pod::Simple::XMLOutStream::SORT_ATTRS = 1; # for predictably testable output\r
29\r
30\r
31print "#\n# Tests for =item [number] that are icky...\n";\r
32ok( $x->_out("\n=over\n\n=item 5\n\nStuff\n\n=cut\n\nCrunk\nZorp\n\n=item 4\n\nQuux\n\n=back\n\n"),\r
33 '<Document><over-text indent="4"><item-text>5</item-text><Para>Stuff</Para><item-text>4</item-text><Para>Quux</Para></over-text></Document>'\r
34);\r
35\r
36ok( $x->_out("\n=over\n\n=item 5.\n\nStuff\n\n=cut\n\nCrunk\nZorp\n\n=item 4.\n\nQuux\n\n=back\n\n"),\r
37 '<Document><over-text indent="4"><item-text>5.</item-text><Para>Stuff</Para><item-text>4.</item-text><Para>Quux</Para></over-text></Document>'\r
38);\r
39\r
40\r
41print "# Wrapping up... one for the road...\n";\r
42ok 1;\r
43print "# --- Done with ", __FILE__, " --- \n";\r
44\r