4
BEGIN { plan tests => 30 };
6
#use Pod::Simple::Debug (6);
10
require Pod::Simple::BlackBox;
13
require Pod::Simple; ok 1;
15
Pod::Simple->VERSION(.90); ok 1;
17
#print "# Pod::Simple version $Pod::Simple::VERSION\n";
19
require Pod::Simple::DumpAsXML; ok 1;
21
require Pod::Simple::XMLOutStream; ok 1;
23
sub e ($$) { Pod::Simple::DumpAsXML->_duo(@_) }
25
print "# Simple identity tests...\n";
30
&ok( e "puppies\n\n\n\n", "", );
33
print "# Contentful identity tests...\n";
35
&ok( e "=pod\n\nFoo\n", "=pod\n\nFoo\n" );
36
&ok( e "=pod\n\n\n\nFoo\n\n\n", "=pod\n\n\n\nFoo\n\n\n" );
37
&ok( e "=pod\n\n\n\nFoo\n\n\n", "=pod\n\nFoo\n" );
39
# Now with some more newlines
40
&ok( e "\n\n=pod\n\nFoo\n", "\n\n=pod\n\nFoo\n" );
41
&ok( e "=pod\n\n\n\nFoo\n\n\n", "=pod\n\n\n\nFoo\n\n\n" );
42
&ok( e "=pod\n\n\n\nFoo\n\n\n", "\n\n=pod\n\nFoo\n" );
45
&ok( e "=head1 Foo\n", "=head1 Foo\n" );
46
&ok( e "=head1 Foo\n\n=cut\n", "=head1 Foo\n\n=cut\n" );
47
&ok( e "=head1 Foo\n\n=cut\n", "=head1 Foo\n" );
49
# Now just add some newlines...
50
&ok( e "\n\n\n\n=head1 Foo\n", "\n\n\n\n=head1 Foo\n" );
51
&ok( e "=head1 Foo\n\n=cut\n", "=head1 Foo\n\n=cut\n" );
52
&ok( e "=head1 Foo\n\n=cut\n", "\n\n\n\n=head1 Foo\n" );
55
print "# Simple XMLification tests...\n";
57
ok( Pod::Simple::XMLOutStream->_out("\n\n\nprint \$^T;\n\n\n"),
58
qq{<Document\ncontentless="1"></Document>}
59
# make sure the contentless flag is set
61
ok( Pod::Simple::XMLOutStream->_out("\n\n"),
62
qq{<Document\ncontentless="1"></Document>}
63
# make sure the contentless flag is set
65
ok( Pod::Simple::XMLOutStream->_out("\n"),
66
qq{<Document\ncontentless="1"></Document>}
67
# make sure the contentless flag is set
69
ok( Pod::Simple::XMLOutStream->_out(""),
70
qq{<Document\ncontentless="1"></Document>}
71
# make sure the contentless flag is set
74
ok( Pod::Simple::XMLOutStream->_out('', '<Document></Document>' ) );
76
ok( Pod::Simple::XMLOutStream->_out("=pod\n\nFoo\n"),
77
'<Document><Para>Foo</Para></Document>'
80
ok( Pod::Simple::XMLOutStream->_out("=head1 Chacha\n\nFoo\n"),
81
'<Document><head1>Chacha</head1><Para>Foo</Para></Document>'
85
print "# Wrapping up... one for the road...\n";
87
print "# --- Done with ", __FILE__, " --- \n";