BEGIN { if($ENV{PERL_CORE}) { chdir 't'; @INC = '../lib'; } } use strict; use Test; BEGIN { plan tests => 21 }; #use Pod::Simple::Debug (5); ok 1; use Pod::Simple::DumpAsXML; use Pod::Simple::XMLOutStream; print "# Pod::Simple version $Pod::Simple::VERSION\n"; sub e ($$) { Pod::Simple::DumpAsXML->_duo(@_) } print "# With weird leading whitespace...\n"; # With weird whitespace ok( Pod::Simple::XMLOutStream->_out("=pod\n\nI\n"), 'foo' ); ok( Pod::Simple::XMLOutStream->_out("=pod\n\nB< foo>\n"), ' foo' ); ok( Pod::Simple::XMLOutStream->_out("=pod\n\nB<\tfoo>\n"), ' foo' ); ok( Pod::Simple::XMLOutStream->_out("=pod\n\nB<\nfoo>\n"), ' foo' ); ok( Pod::Simple::XMLOutStream->_out("=pod\n\nB\n"), 'foo' ); ok( Pod::Simple::XMLOutStream->_out("=pod\n\nB\n"), 'foo ' ); ok( Pod::Simple::XMLOutStream->_out("=pod\n\nB\n"), 'foo ' ); print "#\n# Tests for wedges outside of formatting codes...\n"; &ok( Pod::Simple::XMLOutStream->_out("=pod\n\nX < 3 and N > 19\n"), Pod::Simple::XMLOutStream->_out("=pod\n\nX E 3 and N E 19\n") ); print "# A complex test with internal whitespace...\n"; ok( Pod::Simple::XMLOutStream->_out("=pod\n\nIB< bar>CF< quux\t?>\n"), 'foo barbaz quux ?' ); print "# Without any nesting...\n"; ok( Pod::Simple::XMLOutStream->_out("=pod\n\nFCIBX\n"), 'abcde' ); print "# Without any nesting, but with Z's...\n"; ok( Pod::Simple::XMLOutStream->_out("=pod\n\nZ<>FCIBX\n"), 'abcde' ); print "# With lots of nesting, and Z's...\n"; ok( Pod::Simple::XMLOutStream->_out("=pod\n\nZ<>Ffoo> I> B>baz>\n"), 'foo bar thingbaz' ); print "#\n# *** Now testing different numbers of wedges ***\n"; print "# Without any nesting...\n"; ok( Pod::Simple::XMLOutStream->_out("=pod\n\nF<< a >>C<<< b >>>I<<<< c >>>>B<< d >>X<< e >>\n"), 'abcde' ); print "# Without any nesting, but with Z's, and odder whitespace...\n"; ok( Pod::Simple::XMLOutStream->_out("=pod\n\nF<< aZ<> >>C<<< Z<>b >>>I<<<< c >>>>B<< d \t >>X<<\ne >>\n"), 'aZ<>Z<>bcde' ); print "# With nesting and Z's, and odder whitespace...\n"; ok( Pod::Simple::XMLOutStream->_out("=pod\n\nF<< aZ<> >>C<<< Z<>bZ<>B<< d \t >>X<<\ne >> >>>I<<<< c >>>>\n"), "aZ<>Z<>bZ<>B<< d >>X<< e >>c" ); print "# Regression https://rt.cpan.org/Ticket/Display.html?id=12239\n"; ok( Pod::Simple::XMLOutStream->_out("=pod\n\nC<<< foo->bar >>>\n"), 'foo->bar' ); ok( Pod::Simple::XMLOutStream->_out("=pod\n\nC<<< C >>>\n"), 'C<foo>' ); ok( Pod::Simple::XMLOutStream->_out("=pod\n\nC<<< C<> >>>\n"), 'C<<foo>>' ); print "# Misc...\n"; ok( Pod::Simple::XMLOutStream->_out( "=pod\n\nI like I with B and Stuff and N < 3 and X<< things >> hoohah\n" ."And I a happy time>.\n" ."And B>>.>\n" ) => "I like PIE with cream and Stuff and N < 3 and things hoohah " ."And pie is also a happy time. " ."And I like pie." ); print "# Wrapping up... one for the road...\n"; ok 1; print "# --- Done with ", __FILE__, " --- \n";