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