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