11 BEGIN { plan tests => 14 };
13 #use Pod::Simple::Debug (6);
17 use Pod::Simple::XMLOutStream;
18 print "# Pod::Simple version $Pod::Simple::VERSION\n";
19 my $x = 'Pod::Simple::XMLOutStream';
20 sub e ($$) { $x->_duo(@_) }
22 $Pod::Simple::XMLOutStream::ATTR_PAD = ' ';
23 $Pod::Simple::XMLOutStream::SORT_ATTRS = 1; # for predictably testable output
26 print "# S as such...\n";
28 ok( $x->_out("=pod\n\nI like S<bric-a-brac>.\n"),
29 => '<Document><Para>I like <S>bric-a-brac</S>.</Para></Document>' );
30 ok( $x->_out("=pod\n\nI like S<bric-a-brac a gogo >.\n"),
31 => '<Document><Para>I like <S>bric-a-brac a gogo </S>.</Para></Document>' );
32 ok( $x->_out("=pod\n\nI like S<< bric-a-brac a gogo >>.\n"),
33 => '<Document><Para>I like <S>bric-a-brac a gogo</S>.</Para></Document>' );
35 my $unless_ascii = (chr(65) eq 'A') ? '' :
36 "Skip because not in ASCIIland";
39 $x->_out( sub { $_[0]->nbsp_for_S(1) },
40 "=pod\n\nI like S<bric-a-brac a gogo>.\n"),
41 '<Document><Para>I like bric-a-brac a gogo.</Para></Document>'
44 $x->_out( sub { $_[0]->nbsp_for_S(1) },
45 qq{=pod\n\nI like S<L</"bric-a-brac a gogo">>.\n}),
46 '<Document><Para>I like <L content-implicit="yes" section="bric-a-brac a gogo" type="pod">"bric-a-brac a gogo"</L>.</Para></Document>'
49 $x->_out( sub { $_[0]->nbsp_for_S(1) },
50 qq{=pod\n\nI like S<L<Stuff like that|/"bric-a-brac a gogo">>.\n}),
51 '<Document><Para>I like <L section="bric-a-brac a gogo" type="pod">Stuff like that</L>.</Para></Document>'
54 $x->_out( sub { $_[0]->nbsp_for_S(1) },
55 qq{=pod\n\nI like S<L<Stuff I<like that>|/"bric-a-brac a gogo">>.\n}),
56 '<Document><Para>I like <L section="bric-a-brac a gogo" type="pod">Stuff <I>like that</I></L>.</Para></Document>'
59 &ok( $x->_duo( sub { $_[0]->nbsp_for_S(1) },
60 "=pod\n\nI like S<bric-a-brac a gogo>.\n",
61 "=pod\n\nI like bric-a-bracE<160>aE<160>gogo.\n",
64 map {my $z = $_; $z =~ s/content-implicit="yes" //g; $z }
65 $x->_duo( sub { $_[0]->nbsp_for_S(1) },
66 qq{=pod\n\nI like S<L</"bric-a-brac a gogo">>.\n},
67 qq{=pod\n\nI like L<"bric-a-bracE<160>aE<160>gogo"|/"bric-a-brac a gogo">.\n},
69 &ok( $x->_duo( sub { $_[0]->nbsp_for_S(1) },
70 qq{=pod\n\nI like S<L<Stuff like that|"bric-a-brac a gogo">>.\n},
71 qq{=pod\n\nI like L<StuffE<160>likeE<160>that|"bric-a-brac a gogo">.\n},
74 map {my $z = $_; $z =~ s/content-implicit="yes" //g; $z }
75 $x->_duo( sub { $_[0]->nbsp_for_S(1) },
76 qq{=pod\n\nI like S<L<Stuff I<like that>|"bric-a-brac a gogo">>.\n},
77 qq{=pod\n\nI like L<StuffE<160>I<likeE<160>that>|"bric-a-brac a gogo">.\n},
80 use Pod::Simple::Text;
81 $x = Pod::Simple::Text->new;
82 $x->preserve_whitespace(1);
86 =head1 The Tk::mega manpage showed me how C<< SE<lt> E<gt> foo >> is being rendered
88 Both pod2text and pod2man S< > lose the rest of the line
90 =head1 Do they always S< > lose the rest of the line?
96 The Tk::mega manpage showed me how S< > foo is being rendered
98 Both pod2text and pod2man lose the rest of the line
100 Do they always lose the rest of the line?
105 print "# Wrapping up... one for the road...\n";
107 print "# --- Done with ", __FILE__, " --- \n";