1# Testing the =item directive
2use strict;
3use warnings;
4use Test::More tests => 2;
5
6BEGIN {
7  require FindBin;
8  unshift @INC, $FindBin::Bin . '/lib';
9}
10use helpers;
11
12my $d;
13#use Pod::Simple::Debug (\$d,0);
14
15use Pod::Simple::DumpAsXML;
16use Pod::Simple::XMLOutStream;
17print "# Pod::Simple version $Pod::Simple::VERSION\n";
18
19my $x = 'Pod::Simple::XMLOutStream';
20
21print "##### Tests for =item directives via class $x\n";
22
23$Pod::Simple::XMLOutStream::ATTR_PAD   = ' ';
24$Pod::Simple::XMLOutStream::SORT_ATTRS = 1; # for predictably testable output
25
26
27print "#\n# Tests for =item [number] that are icky...\n";
28is( $x->_out(sub { $_[0]->no_errata_section(1) },
29  "\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"),
30    '<Document><over-text indent="4"><item-text>5</item-text><Para>Stuff</Para><item-text>4</item-text><Para>Quux</Para></over-text></Document>'
31);
32
33is( $x->_out(sub { $_[0]->no_errata_section(1) },
34  "\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"),
35    '<Document><over-text indent="4"><item-text>5.</item-text><Para>Stuff</Para><item-text>4.</item-text><Para>Quux</Para></over-text></Document>'
36);
37