10 BEGIN { plan tests => 30 };
12 #use Pod::Simple::Debug (6);
16 require Pod::Simple::BlackBox;
19 require Pod::Simple; ok 1;
21 Pod::Simple->VERSION(.90); ok 1;
23 #print "# Pod::Simple version $Pod::Simple::VERSION\n";
25 require Pod::Simple::DumpAsXML; ok 1;
27 require Pod::Simple::XMLOutStream; ok 1;
29 sub e ($$) { Pod::Simple::DumpAsXML->_duo(@_) }
31 print "# Simple identity tests...\n";
36 &ok( e "puppies\n\n\n\n", "", );
39 print "# Contentful identity tests...\n";
41 &ok( e "=pod\n\nFoo\n", "=pod\n\nFoo\n" );
42 &ok( e "=pod\n\n\n\nFoo\n\n\n", "=pod\n\n\n\nFoo\n\n\n" );
43 &ok( e "=pod\n\n\n\nFoo\n\n\n", "=pod\n\nFoo\n" );
45 # Now with some more newlines
46 &ok( e "\n\n=pod\n\nFoo\n", "\n\n=pod\n\nFoo\n" );
47 &ok( e "=pod\n\n\n\nFoo\n\n\n", "=pod\n\n\n\nFoo\n\n\n" );
48 &ok( e "=pod\n\n\n\nFoo\n\n\n", "\n\n=pod\n\nFoo\n" );
51 &ok( e "=head1 Foo\n", "=head1 Foo\n" );
52 &ok( e "=head1 Foo\n\n=cut\n", "=head1 Foo\n\n=cut\n" );
53 &ok( e "=head1 Foo\n\n=cut\n", "=head1 Foo\n" );
55 # Now just add some newlines...
56 &ok( e "\n\n\n\n=head1 Foo\n", "\n\n\n\n=head1 Foo\n" );
57 &ok( e "=head1 Foo\n\n=cut\n", "=head1 Foo\n\n=cut\n" );
58 &ok( e "=head1 Foo\n\n=cut\n", "\n\n\n\n=head1 Foo\n" );
61 print "# Simple XMLification tests...\n";
63 ok( Pod::Simple::XMLOutStream->_out("\n\n\nprint \$^T;\n\n\n"),
64 qq{<Document\ncontentless="1"></Document>}
65 # make sure the contentless flag is set
67 ok( Pod::Simple::XMLOutStream->_out("\n\n"),
68 qq{<Document\ncontentless="1"></Document>}
69 # make sure the contentless flag is set
71 ok( Pod::Simple::XMLOutStream->_out("\n"),
72 qq{<Document\ncontentless="1"></Document>}
73 # make sure the contentless flag is set
75 ok( Pod::Simple::XMLOutStream->_out(""),
76 qq{<Document\ncontentless="1"></Document>}
77 # make sure the contentless flag is set
80 ok( Pod::Simple::XMLOutStream->_out('', '<Document></Document>' ) );
82 ok( Pod::Simple::XMLOutStream->_out("=pod\n\nFoo\n"),
83 '<Document><Para>Foo</Para></Document>'
86 ok( Pod::Simple::XMLOutStream->_out("=head1 Chacha\n\nFoo\n"),
87 '<Document><head1>Chacha</head1><Para>Foo</Para></Document>'
91 print "# Wrapping up... one for the road...\n";
93 print "# --- Done with ", __FILE__, " --- \n";