BEGIN { if($ENV{PERL_CORE}) { chdir 't'; @INC = '../lib'; } } use strict; use Test; BEGIN { plan tests => 14 }; #use Pod::Simple::Debug (6); ok 1; use Pod::Simple::XMLOutStream; print "# Pod::Simple version $Pod::Simple::VERSION\n"; my $x = 'Pod::Simple::XMLOutStream'; sub e ($$) { $x->_duo(@_) } $Pod::Simple::XMLOutStream::ATTR_PAD = ' '; $Pod::Simple::XMLOutStream::SORT_ATTRS = 1; # for predictably testable output print "# S as such...\n"; ok( $x->_out("=pod\n\nI like S.\n"), => 'I like bric-a-brac.' ); ok( $x->_out("=pod\n\nI like S.\n"), => 'I like bric-a-brac a gogo .' ); ok( $x->_out("=pod\n\nI like S<< bric-a-brac a gogo >>.\n"), => 'I like bric-a-brac a gogo.' ); my $unless_ascii = (chr(65) eq 'A') ? '' : "Skip because not in ASCIIland"; skip( $unless_ascii, $x->_out( sub { $_[0]->nbsp_for_S(1) }, "=pod\n\nI like S.\n"), 'I like bric-a-brac a gogo.' ); skip( $unless_ascii, $x->_out( sub { $_[0]->nbsp_for_S(1) }, qq{=pod\n\nI like S>.\n}), 'I like "bric-a-brac a gogo".' ); skip( $unless_ascii, $x->_out( sub { $_[0]->nbsp_for_S(1) }, qq{=pod\n\nI like S>.\n}), 'I like Stuff like that.' ); skip( $unless_ascii, $x->_out( sub { $_[0]->nbsp_for_S(1) }, qq{=pod\n\nI like S|/"bric-a-brac a gogo">>.\n}), 'I like Stuff like that.' ); &ok( $x->_duo( sub { $_[0]->nbsp_for_S(1) }, "=pod\n\nI like S.\n", "=pod\n\nI like bric-a-bracE<160>aE<160>gogo.\n", )); &ok( map {my $z = $_; $z =~ s/content-implicit="yes" //g; $z } $x->_duo( sub { $_[0]->nbsp_for_S(1) }, qq{=pod\n\nI like S>.\n}, qq{=pod\n\nI like L<"bric-a-bracE<160>aE<160>gogo"|/"bric-a-brac a gogo">.\n}, )); &ok( $x->_duo( sub { $_[0]->nbsp_for_S(1) }, qq{=pod\n\nI like S>.\n}, qq{=pod\n\nI like LlikeE<160>that|"bric-a-brac a gogo">.\n}, )); &ok( map {my $z = $_; $z =~ s/content-implicit="yes" //g; $z } $x->_duo( sub { $_[0]->nbsp_for_S(1) }, qq{=pod\n\nI like S|"bric-a-brac a gogo">>.\n}, qq{=pod\n\nI like LIthat>|"bric-a-brac a gogo">.\n}, )); use Pod::Simple::Text; $x = Pod::Simple::Text->new; $x->preserve_whitespace(1); # RT#25679 ok( $x->_out(< E foo >> is being rendered Both pod2text and pod2man S< > lose the rest of the line =head1 Do they always S< > lose the rest of the line? =cut END ), < foo is being rendered Both pod2text and pod2man lose the rest of the line Do they always lose the rest of the line? END ); print "# Wrapping up... one for the road...\n"; ok 1; print "# --- Done with ", __FILE__, " --- \n";