4
BEGIN { plan tests => 19 };
6
#use Pod::Simple::Debug (6);
10
use Pod::Simple::DumpAsXML;
11
use Pod::Simple::XMLOutStream;
12
print "# Pod::Simple version $Pod::Simple::VERSION\n";
13
sub e ($$) { Pod::Simple::DumpAsXML->_duo(@_) }
16
print "# Simple tests for head1 - head4...\n";
17
ok( Pod::Simple::XMLOutStream->_out("\n=head1 Chacha\n\n"),
18
'<Document><head1>Chacha</head1></Document>'
20
ok( Pod::Simple::XMLOutStream->_out("\n=head2 Chacha\n\n"),
21
'<Document><head2>Chacha</head2></Document>'
23
ok( Pod::Simple::XMLOutStream->_out("\n=head3 Chacha\n\n"),
24
'<Document><head3>Chacha</head3></Document>'
26
ok( Pod::Simple::XMLOutStream->_out("\n=head4 Chacha\n\n"),
27
'<Document><head4>Chacha</head4></Document>'
30
print "# Testing whitespace equivalence...\n";
32
&ok(e "\n=head1 Chacha\n\n", "\n=head1 Chacha\n\n");
33
&ok(e "\n=head1 Chacha\n\n", "\n=head1\tChacha\n\n");
34
&ok(e "\n=head1 Chacha\n\n", "\n=head1\tChacha \n\n");
38
ok( Pod::Simple::XMLOutStream->_out("=head1 Chachacha"),
39
'<Document><head1>Chachacha</head1></Document>'
43
print "# Testing whitespace variance ...\n";
44
ok( Pod::Simple::XMLOutStream->_out("=head1 Cha cha cha \n"),
45
'<Document><head1>Cha cha cha</head1></Document>'
47
ok( Pod::Simple::XMLOutStream->_out("=head1 Cha cha\tcha \n"),
48
'<Document><head1>Cha cha cha</head1></Document>'
54
print "# Testing head2, head3, head4 more...\n";
56
ok( Pod::Simple::XMLOutStream->_out("=head2 Cha cha\tcha \n"),
57
'<Document><head2>Cha cha cha</head2></Document>'
59
ok( Pod::Simple::XMLOutStream->_out("=head3 Cha cha\tcha \n"),
60
'<Document><head3>Cha cha cha</head3></Document>'
62
ok( Pod::Simple::XMLOutStream->_out("=head4 Cha cha\tcha \n"),
63
'<Document><head4>Cha cha cha</head4></Document>'
66
print "# Testing entity expansion...\n";
68
ok( Pod::Simple::XMLOutStream->_out("=head4 fooE<64>bar!\n"),
69
Pod::Simple::XMLOutStream->_out("\n=head4 foo\@bar!\n\n"),
72
# TODO: a mode so that DumpAsXML can ask for all contiguous string
73
# sequences to be fused?
74
# &ok( e "=head4 fooE<64>bar!\n", "\n=head4 foo\@bar!\n\n");
76
print "# Testing formatting sequences...\n";
78
# True only if the sequences resolve, as they should...
79
&ok( e "=head4 C<foobar!>\n", "\n=head4 C<< foobar! >>\n\n");
80
&ok( e "=head4 C<foobar!>\n", "\n\n=head4 C<<< foobar! >>>\n");
81
&ok( e "=head4 C<foobar!>\n", "\n=head4 C<< foobar!\n\t>>\n\n");
83
print "# Wrapping up... one for the road...\n";
85
print "# --- Done with ", __FILE__, " --- \n";