# fcodes S use strict; use warnings; use Test::More tests => 78; #use Pod::Simple::Debug (6); 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"; is( $x->_out("=pod\n\nI like S.\n"), => 'I like bric-a-brac.' ); is( $x->_out("=pod\n\nI like S.\n"), => 'I like bric-a-brac a gogo .' ); is( $x->_out("=pod\n\nI like S<< bric-a-brac a gogo >>.\n"), => 'I like bric-a-brac a gogo.' ); SKIP: { if (chr(65) ne 'A') { skip "Skip because not in ASCIIland", 4; } is( $x->_out( sub { $_[0]->nbsp_for_S(1) }, "=pod\n\nI like S.\n"), 'I like bric-a-brac a gogo.' ); is( $x->_out( sub { $_[0]->nbsp_for_S(1) }, qq{=pod\n\nI like S>.\n}), 'I like "bric-a-brac a gogo".' ); is( $x->_out( sub { $_[0]->nbsp_for_S(1) }, qq{=pod\n\nI like S>.\n}), 'I like Stuff like that.' ); is( $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.' ); } &is( $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", )); &is( map {my $z = $_; $z =~ s/content-implicit="yes" //g; $z =~ s/raw=".+?" //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}, )); &is( map {my $z = $_; $z =~ s/raw=".+?" //g; $z } $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}, )); &is( map {my $z = $_; $z =~ s/content-implicit="yes" //g; $z =~ s/raw=".+?" //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(< > 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 ); $x = 'Pod::Simple::Text'; # Test text output of links. is( $x->_out(qq{=pod\n\nL\n}), " Net::Ping\n\n" ); is( $x->_out(qq{=pod\n\nBe sure to read the L docs\n}), " Be sure to read the Net::Ping docs\n\n" ); is( $x->_out(qq{=pod\n\nL\n}), " http://www.perl.com\n\n" ); is( $x->_out(qq{=pod\n\nL\n}), " crontab(5)\n\n" ); is( $x->_out(qq{=pod\n\nL\n}), qq{ "Ping-pong" in Net::Ping\n\n} ); is( $x->_out(qq{=pod\n\nL\n}), qq{ "Object Methods"\n\n} ); is( $x->_out(qq{=pod\n\nL\n}), qq{ "Object Methods"\n\n} ); is( $x->_out(qq{=pod\n\nL<"Object Methods">\n}), qq{ "Object Methods"\n\n} ); is( $x->_out(qq{=pod\n\nLong>\n}), qq{ "Ping-pong" in Net::Ping\n\n} ); is( $x->_out(qq{=pod\n\nL\n}), " news:comp.lang.perl.misc\n\n" ); is( $x->_out(qq{=pod\n\nL\n}), " http://www.perl.org\n\n" ); is( $x->_out(qq{=pod\n\nSee L\n}), " See http://www.perl.org\n\n" ); is( $x->_out(qq{=pod\n\nL\n}), " http://www.perl.org/CPAN/authors/id/S/SB/SBURKE/\n\n" ); is( $x->_out(qq{=pod\n\nLlang.perl.misc>\n}), " news:comp.lang.perl.misc\n\n" ); is( $x->_out(qq{=pod\n\nLperl.org>\n}), " http://www.perl.org\n\n" ); is( $x->_out(qq{=pod\n\nL\n}), " things\n\n" ); is( $x->_out(qq{=pod\n\nL\n}), " things\n\n" ); is( $x->_out(qq{=pod\n\nL\n}), " Perl Error Messages\n\n" ); is( $x->_out(qq{=pod\n\nL\n}), " Perl Error Messages\n\n" ); is( $x->_out(qq{=pod\n\nL\n}), " Perl Error Messages\n\n" ); is( $x->_out(qq{=pod\n\nL\n}), " perl.org \n\n" ); is( $x->_out(qq{=pod\n\nSee L\n}), " See perl.org \n\n" ); # Test HTML output of links. use Pod::Simple::HTML; my $PERLDOC = "https://metacpan.org/pod"; my $MANURL = "http://man.he.net/man"; sub x { Pod::Simple::HTML->_out( sub { $_[0]->bare_output(1) }, "=pod\n\n$_[0]", ) } is( x(qq{L\n}), qq{\n

Net::Ping

\n} ); is( x(qq{Be sure to read the L docs\n}), qq{\n

Be sure to read the Net::Ping docs

\n} ); is( x(qq{L\n}), qq{\n

http://www.perl.com

\n} ); is( x(qq{L\n}), qq{\n

crontab(5)

\n} ); is( x(qq{L\n}), qq{\n

"Ping-pong" in Net::Ping

\n} ); is( x(qq{L\n}), qq{\n

"Object Methods"

\n} ); is( x(qq{L\n}), qq{\n

"Object Methods"

\n} ); is( x(qq{L<"Object Methods">\n}), qq{\n

"Object Methods"

\n} ); is( x(qq{Long>\n}), qq{\n

"Ping-pong" in Net::Ping

\n} ); is( x(qq{L\n}), qq{\n

news:comp.lang.perl.misc

\n} ); is( x(qq{L\n}), qq{\n

http://www.perl.org

\n} ); is( x(qq{See L\n}), qq{\n

See http://www.perl.org

\n} ); is( x(qq{L\n}), qq{\n

http://www.perl.org/CPAN/authors/id/S/SB/SBURKE/

\n} ); is( x(qq{Llang.perl.misc>\n}), qq{\n

news:comp.lang.perl.misc

\n} ); is( x(qq{Lperl.org>\n}), qq{\n

http://www.perl.org

\n} ); is( x(qq{L\n}), qq{\n

things

\n} ); is( x(qq{L\n}), qq{\n

things

\n} ); is( x(qq{L\n}), qq{\n

Perl Error Messages

\n} ); is( x(qq{L\n}), qq{\n

Perl Error Messages

\n} ); is( x(qq{L\n}), qq{\n

Perl Error Messages

\n} ); is( x(qq{L\n}), qq{\n

perl.org

\n} ); is( x(qq{See L\n}), qq{\n

See perl.org

\n} ); # Test link output in XHTML. use Pod::Simple::XHTML; sub o ($) { my $p = Pod::Simple::XHTML->new; $p->html_header(""); $p->html_footer(""); my $results = ''; $p->output_string( \$results ); # Send the resulting output to a string $p->parse_string_document("=pod\n\n$_[0]"); return $results; } is( o(qq{L}), qq{

Net::Ping

\n\n} ); is( o(qq{Be sure to read the L docs}), qq{

Be sure to read the Net::Ping docs

\n\n} ); is( o(qq{L}), qq{

http://www.perl.com

\n\n} ); is( o(qq{L}), qq{

crontab(5)

\n\n} ); is( o(qq{L}), qq{

"Ping-pong" in Net::Ping

\n\n} ); is( o(qq{L}), qq{

"Object Methods"

\n\n} ); is( o(qq{L}), qq{

"Object Methods"

\n\n} ); is( o(qq{L<"Object Methods">}), qq{

"Object Methods"

\n\n} ); is( o(qq{Long>}), qq{

"Ping-pong" in Net::Ping

\n\n} ); is( o(qq{L}), qq{

news:comp.lang.perl.misc

\n\n} ); is( o(qq{L}), qq{

http://www.perl.org

\n\n} ); is( o(qq{See L}), qq{

See http://www.perl.org

\n\n} ); is( o(qq{L}), qq{

http://www.perl.org/CPAN/authors/id/S/SB/SBURKE/

\n\n} ); is( o(qq{Llang.perl.misc>}), qq{

news:comp.lang.perl.misc

\n\n} ); is( o(qq{Lperl.org>}), qq{

http://www.perl.org

\n\n} ); is( o(qq{L}), qq{

things

\n\n} ); is( o(qq{L}), qq{

things

\n\n} ); is( o(qq{L}), qq{

Perl Error Messages

\n\n} ); is( o(qq{L}), qq{

Perl Error Messages

\n\n} ); is( o(qq{L}), qq{

Perl Error Messages

\n\n} ); is( o(qq{L}), qq{

perl.org

\n\n} ); is( o(qq{See L}), qq{

See perl.org

\n\n} );