10 BEGIN { plan tests => 62 };
13 #use Pod::Simple::Debug (\$d, 0);
18 use Pod::Simple::DumpAsXML;
19 use Pod::Simple::XMLOutStream;
20 print "# Pod::Simple version $Pod::Simple::VERSION\n";
21 sub e ($$) { Pod::Simple::DumpAsXML->_duo(@_) }
23 my $x = 'Pod::Simple::XMLOutStream';
24 $Pod::Simple::XMLOutStream::ATTR_PAD = ' ';
25 $Pod::Simple::XMLOutStream::SORT_ATTRS = 1; # for predictably testable output
28 sub moj {$_[0]->accept_target('mojojojo')}
29 sub mojtext {$_[0]->accept_target_as_text('mojojojo')}
30 sub any {$_[0]->accept_target_as_text('*')}
32 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33 print "# Testing non-matching complaint...\n";
37 ok( ($out = $x->_out( "=pod\n\nI like pie.\n\n=begin mojojojo\n\nStuff\n\n=end blorp\n\nYup.\n"))
39 ) or print "# Didn't contain POD ERRORS:\n# $out\n";
41 ok( ($out = $x->_out( \&moj, "=pod\n\nI like pie.\n\n=begin :mojojojo\n\nStuff\n\n=end :blorp\n\nYup.\n"))
43 ) or print "# Didn't contain POD ERRORS:\n# $out\n";
44 ok( ($out = $x->_out( \&moj, "=pod\n\nI like pie.\n\n=begin :mojojojo\n\n=begin :zaz\n\nStuff\n\n=end :blorp\n\nYup.\n"))
46 ) or print "# Didn't contain POD ERRORS:\n# $out\n";
50 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
53 print "# Testing some trivial cases of non-acceptance...\n";
55 ok( $x->_out( "=pod\n\nI like pie.\n\n=begin mojojojo\n\nStuff\n\n=end mojojojo\n\nYup.\n"),
56 '<Document><Para>I like pie.</Para><Para>Yup.</Para></Document>'
58 ok( $x->_out( "=pod\n\nI like pie.\n\n=begin mojojojo\n\n\nStuff\n\n=end mojojojo\n\nYup.\n"),
59 '<Document><Para>I like pie.</Para><Para>Yup.</Para></Document>'
61 ok( $x->_out( "=pod\n\nI like pie.\n\n=begin :mojojojo\n\n\nStuff\n\n=end :mojojojo\n\nYup.\n"),
62 '<Document><Para>I like pie.</Para><Para>Yup.</Para></Document>'
65 ok( $x->_out( "=pod\n\nI like pie.\n\n=begin mojojojo\n\n Stuff\n\n=end mojojojo\n\nYup.\n"),
66 '<Document><Para>I like pie.</Para><Para>Yup.</Para></Document>'
68 ok( $x->_out( "=pod\n\nI like pie.\n\n=begin mojojojo\n\n\n Stuff\n\n=end mojojojo\n\nYup.\n"),
69 '<Document><Para>I like pie.</Para><Para>Yup.</Para></Document>'
71 ok( $x->_out( "=pod\n\nI like pie.\n\n=begin :mojojojo\n\n\n Stuff\n\n=end :mojojojo\n\nYup.\n"),
72 '<Document><Para>I like pie.</Para><Para>Yup.</Para></Document>'
75 ok( $x->_out( "=pod\n\nI like pie.\n\n=begin mojojojo\n\nI<Stuff>\n\n=end mojojojo\n\nYup.\n"),
76 '<Document><Para>I like pie.</Para><Para>Yup.</Para></Document>'
78 ok( $x->_out( "=pod\n\nI like pie.\n\n=begin mojojojo\n\n\nI<Stuff>\n\n=end mojojojo\n\nYup.\n"),
79 '<Document><Para>I like pie.</Para><Para>Yup.</Para></Document>'
81 ok( $x->_out( "=pod\n\nI like pie.\n\n=begin :mojojojo\n\n\nI<Stuff>\n\n=end :mojojojo\n\nYup.\n"),
82 '<Document><Para>I like pie.</Para><Para>Yup.</Para></Document>'
87 ok( $x->_out( "=pod\n\nI like pie.\n\n=begin psketti,mojojojo,crunk\n\nStuff\n\n=end psketti,mojojojo,crunk\n\nYup.\n"),
88 '<Document><Para>I like pie.</Para><Para>Yup.</Para></Document>'
90 ok( $x->_out( "=pod\n\nI like pie.\n\n=begin psketti,mojojojo,crunk\n\n\nStuff\n\n=end psketti,mojojojo,crunk\n\nYup.\n"),
91 '<Document><Para>I like pie.</Para><Para>Yup.</Para></Document>'
93 ok( $x->_out( "=pod\n\nI like pie.\n\n=begin :psketti,mojojojo,crunk\n\n\nStuff\n\n=end :psketti,mojojojo,crunk\n\nYup.\n"),
94 '<Document><Para>I like pie.</Para><Para>Yup.</Para></Document>'
97 ok( $x->_out( "=pod\n\nI like pie.\n\n=begin psketti,mojojojo,crunk\n\n Stuff\n\n=end psketti,mojojojo,crunk\n\nYup.\n"),
98 '<Document><Para>I like pie.</Para><Para>Yup.</Para></Document>'
100 ok( $x->_out( "=pod\n\nI like pie.\n\n=begin psketti,mojojojo,crunk\n\n\n Stuff\n\n=end psketti,mojojojo,crunk\n\nYup.\n"),
101 '<Document><Para>I like pie.</Para><Para>Yup.</Para></Document>'
103 ok( $x->_out( "=pod\n\nI like pie.\n\n=begin :psketti,mojojojo,crunk\n\n\n Stuff\n\n=end :psketti,mojojojo,crunk\n\nYup.\n"),
104 '<Document><Para>I like pie.</Para><Para>Yup.</Para></Document>'
107 ok( $x->_out( "=pod\n\nI like pie.\n\n=begin psketti,mojojojo,crunk\n\nI<Stuff>\n\n=end psketti,mojojojo,crunk\n\nYup.\n"),
108 '<Document><Para>I like pie.</Para><Para>Yup.</Para></Document>'
110 ok( $x->_out( "=pod\n\nI like pie.\n\n=begin psketti,mojojojo,crunk\n\n\nI<Stuff>\n\n=end psketti,mojojojo,crunk\n\nYup.\n"),
111 '<Document><Para>I like pie.</Para><Para>Yup.</Para></Document>'
113 ok( $x->_out( "=pod\n\nI like pie.\n\n=begin :psketti,mojojojo,crunk\n\n\nI<Stuff>\n\n=end :psketti,mojojojo,crunk\n\nYup.\n"),
114 '<Document><Para>I like pie.</Para><Para>Yup.</Para></Document>'
117 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
119 print "# Testing matching because of negated non-acceptance...\n";
121 ok( $x->_out( "=pod\n\nI like pie.\n\n=begin !crunk\n\nstuff\n\n=end !crunk\n\nYup.\n"),
122 '<Document><Para>I like pie.</Para><for target="!crunk" target_matching="!"><Data xml:space="preserve">stuff</Data></for><Para>Yup.</Para></Document>'
124 ok( $x->_out( \&moj, "=pod\n\nI like pie.\n\n=begin !crunk\n\nstuff\n\n=end !crunk\n\nYup.\n"),
125 '<Document><Para>I like pie.</Para><for target="!crunk" target_matching="!"><Data xml:space="preserve">stuff</Data></for><Para>Yup.</Para></Document>'
127 ok( $x->_out( "=pod\n\nI like pie.\n\n=begin !mojojojo\n\nstuff\n\n=end !mojojojo\n\nYup.\n"),
128 '<Document><Para>I like pie.</Para><for target="!mojojojo" target_matching="!"><Data xml:space="preserve">stuff</Data></for><Para>Yup.</Para></Document>'
130 ok( $x->_out( "=pod\n\nI like pie.\n\n=begin !mojojojo\n\nI<stuff>\n\n=end !mojojojo\n\nYup.\n"),
131 '<Document><Para>I like pie.</Para><for target="!mojojojo" target_matching="!"><Data xml:space="preserve">I<stuff></Data></for><Para>Yup.</Para></Document>'
133 ok( $x->_out( "=pod\n\nI like pie.\n\n=begin !:mojojojo\n\nI<stuff>\n\n=end !:mojojojo\n\nYup.\n"),
134 '<Document><Para>I like pie.</Para><for target="!:mojojojo" target_matching="!"><Para><I>stuff</I></Para></for><Para>Yup.</Para></Document>'
136 ok( $x->_out( "=pod\n\nI like pie.\n\n=begin :!mojojojo \n\nI<stuff>\n\n=end :!mojojojo \t \n\nYup.\n"),
137 '<Document><Para>I like pie.</Para><for target=":!mojojojo" target_matching="!"><Para><I>stuff</I></Para></for><Para>Yup.</Para></Document>'
140 ok( $x->_out( "=pod\n\nI like pie.\n\n=begin !crunk,zaz\n\nstuff\n\n=end !crunk,zaz\n\nYup.\n"),
141 '<Document><Para>I like pie.</Para><for target="!crunk,zaz" target_matching="!"><Data xml:space="preserve">stuff</Data></for><Para>Yup.</Para></Document>'
143 ok( $x->_out( \&moj, "=pod\n\nI like pie.\n\n=begin !crunk\n\nstuff\n\n=end !crunk\n\nYup.\n"),
144 '<Document><Para>I like pie.</Para><for target="!crunk" target_matching="!"><Data xml:space="preserve">stuff</Data></for><Para>Yup.</Para></Document>'
146 ok( $x->_out( \&mojtext, "=pod\n\nI like pie.\n\n=begin !crunk\n\nstuff\n\n=end !crunk\n\nYup.\n"),
147 '<Document><Para>I like pie.</Para><for target="!crunk" target_matching="!"><Data xml:space="preserve">stuff</Data></for><Para>Yup.</Para></Document>'
149 ok( $x->_out( \&any, "=pod\n\nI like pie.\n\n=begin !crunk\n\nstuff\n\n=end !crunk\n\nYup.\n"),
150 '<Document><Para>I like pie.</Para><for target="!crunk" target_matching="!"><Data xml:space="preserve">stuff</Data></for><Para>Yup.</Para></Document>'
153 ok( $x->_out( "=pod\n\nI like pie.\n\n=begin !mojojojo\n\nstuff\n\n=end !mojojojo\n\nYup.\n"),
154 '<Document><Para>I like pie.</Para><for target="!mojojojo" target_matching="!"><Data xml:space="preserve">stuff</Data></for><Para>Yup.</Para></Document>'
156 ok( $x->_out( "=pod\n\nI like pie.\n\n=begin !mojojojo\n\nI<stuff>\n\n\n=end !mojojojo\n\nYup.\n"),
157 '<Document><Para>I like pie.</Para><for target="!mojojojo" target_matching="!"><Data xml:space="preserve">I<stuff></Data></for><Para>Yup.</Para></Document>'
160 ok( $x->_out( "=pod\n\nI like pie.\n\n=begin !psketti,mojojojo,crunk\n\n\nI<stuff>\n\n=end !psketti,mojojojo,crunk\n\nYup.\n"),
161 '<Document><Para>I like pie.</Para><for target="!psketti,mojojojo,crunk" target_matching="!"><Data xml:space="preserve">I<stuff></Data></for><Para>Yup.</Para></Document>'
163 ok( $x->_out( "=pod\n\nI like pie.\n\n=begin !:psketti,mojojojo,crunk\n\nI<stuff>\n\n=end !:psketti,mojojojo,crunk\n\nYup.\n"),
164 '<Document><Para>I like pie.</Para><for target="!:psketti,mojojojo,crunk" target_matching="!"><Para><I>stuff</I></Para></for><Para>Yup.</Para></Document>'
167 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
169 print "# Testing accept_target + simple ...\n";
170 ok( $x->_out( \&moj, "=pod\n\nI like pie.\n\n=begin mojojojo\n\nI<stuff>\n\n=end mojojojo \n\nYup.\n"),
171 '<Document><Para>I like pie.</Para><for target="mojojojo" target_matching="mojojojo"><Data xml:space="preserve">I<stuff></Data></for><Para>Yup.</Para></Document>'
173 ok( $x->_out( \&moj, "=pod\n\nI like pie.\n\n=begin psketti,mojojojo,crunk\n\nI<stuff>\n\n=end psketti,mojojojo,crunk \n\nYup.\n"),
174 '<Document><Para>I like pie.</Para><for target="psketti,mojojojo,crunk" target_matching="mojojojo"><Data xml:space="preserve">I<stuff></Data></for><Para>Yup.</Para></Document>'
177 print "# Testing accept_target_as_text + simple ...\n";
178 ok( $x->_out( \&mojtext, "=pod\n\nI like pie.\n\n=begin mojojojo\n\nI<stuff>\n\n=end mojojojo \n\nYup.\n"),
179 '<Document><Para>I like pie.</Para><for target="mojojojo" target_matching="mojojojo"><Para><I>stuff</I></Para></for><Para>Yup.</Para></Document>'
181 ok( $x->_out( \&mojtext, "=pod\n\nI like pie.\n\n=begin psketti,mojojojo,crunk\n\nI<stuff>\n\n=end psketti,mojojojo,crunk \n\nYup.\n"),
182 '<Document><Para>I like pie.</Para><for target="psketti,mojojojo,crunk" target_matching="mojojojo"><Para><I>stuff</I></Para></for><Para>Yup.</Para></Document>'
185 print "# Testing accept_target + two simples ...\n";
187 ok( $x->_out( \&moj, "=pod\n\nI like pie.\n\n=begin mojojojo\n\nI<stuff>\n\nHm, B<things>!\n\n=end mojojojo\n\n\nYup.\n"),
188 '<Document><Para>I like pie.</Para><for target="mojojojo" target_matching="mojojojo"><Data xml:space="preserve">I<stuff></Data><Data xml:space="preserve">Hm, B<things>!</Data></for><Para>Yup.</Para></Document>'
191 ok( $x->_out( \&moj, "=pod\n\nI like pie.\n\n=begin psketti,mojojojo,crunk\n\nI<stuff>\n\nHm, B<things>!\n\n=end psketti,mojojojo,crunk\n\nYup.\n"),
192 '<Document><Para>I like pie.</Para><for target="psketti,mojojojo,crunk" target_matching="mojojojo"><Data xml:space="preserve">I<stuff></Data><Data xml:space="preserve">Hm, B<things>!</Data></for><Para>Yup.</Para></Document>'
195 ok( $x->_out( \&moj, "=pod\n\nI like pie.\n\n=begin :mojojojo\n\nI<stuff>\n\nHm, B<things>!\n\n=end :mojojojo\n\nYup.\n"),
196 '<Document><Para>I like pie.</Para><for target=":mojojojo" target_matching="mojojojo"><Para><I>stuff</I></Para><Para>Hm, <B>things</B>!</Para></for><Para>Yup.</Para></Document>'
198 ok( $x->_out( \&moj, "=pod\n\nI like pie.\n\n=begin :psketti,mojojojo,crunk\n\nI<stuff>\n\nHm, B<things>!\n\n=end :psketti,mojojojo,crunk\n\nYup.\n"),
199 '<Document><Para>I like pie.</Para><for target=":psketti,mojojojo,crunk" target_matching="mojojojo"><Para><I>stuff</I></Para><Para>Hm, <B>things</B>!</Para></for><Para>Yup.</Para></Document>'
202 print "# Testing accept_target_as_text + two simples ...\n";
204 ok( $x->_out( \&mojtext, "=pod\n\nI like pie.\n\n=begin psketti,mojojojo,crunk\n\nI<stuff>\n\nHm, B<things>!\n\n=end psketti,mojojojo,crunk\n\nYup.\n"),
205 '<Document><Para>I like pie.</Para><for target="psketti,mojojojo,crunk" target_matching="mojojojo"><Para><I>stuff</I></Para><Para>Hm, <B>things</B>!</Para></for><Para>Yup.</Para></Document>'
207 ok( $x->_out( \&mojtext, "=pod\n\nI like pie.\n\n=begin :psketti,mojojojo,crunk\n\nI<stuff>\n\nHm, B<things>!\n\n=end :psketti,mojojojo,crunk\n\nYup.\n"),
208 '<Document><Para>I like pie.</Para><for target=":psketti,mojojojo,crunk" target_matching="mojojojo"><Para><I>stuff</I></Para><Para>Hm, <B>things</B>!</Para></for><Para>Yup.</Para></Document>'
213 print "# Testing accept_target + two simples, latter with leading whitespace ...\n";
216 ok( $x->_out( \&moj, "=pod\n\nI like pie.\n\n=begin mojojojo\n\nI<stuff>\n\n Hm, B<things>!\nTrala.\n\n=end mojojojo\n\n\nYup.\n"),
217 qq{<Document><Para>I like pie.</Para><for target="mojojojo" target_matching="mojojojo"><Data xml:space="preserve">I<stuff></Data><Data xml:space="preserve"> Hm, B<things>!\nTrala.\n</Data></for><Para>Yup.</Para></Document>}
219 ok( $x->_out( \&moj, "=pod\n\nI like pie.\n\n=begin psketti,mojojojo,crunk\n\nI<stuff>\n\n Hm, B<things>!\nTrala.\n\n=end psketti,mojojojo,crunk\n\nYup.\n"),
220 qq{<Document><Para>I like pie.</Para><for target="psketti,mojojojo,crunk" target_matching="mojojojo"><Data xml:space="preserve">I<stuff></Data><Data xml:space="preserve"> Hm, B<things>!\nTrala.\n</Data></for><Para>Yup.</Para></Document>}
223 ok( $x->_out( \&moj, "=pod\n\nI like pie.\n\n=begin mojojojo\n\nI<stuff>\n\n Hm, B<things>!\nTrala.\n\n\n=end mojojojo\n\n\nYup.\n"),
224 qq{<Document><Para>I like pie.</Para><for target="mojojojo" target_matching="mojojojo"><Data xml:space="preserve">I<stuff></Data><Data xml:space="preserve"> Hm, B<things>!\nTrala.\n\n</Data></for><Para>Yup.</Para></Document>}
226 ok( $x->_out( \&moj, "=pod\n\nI like pie.\n\n=begin psketti,mojojojo,crunk\n\nI<stuff>\n\n Hm, B<things>!\nTrala.\n\n\n=end psketti,mojojojo,crunk\n\nYup.\n"),
227 qq{<Document><Para>I like pie.</Para><for target="psketti,mojojojo,crunk" target_matching="mojojojo"><Data xml:space="preserve">I<stuff></Data><Data xml:space="preserve"> Hm, B<things>!\nTrala.\n\n</Data></for><Para>Yup.</Para></Document>}
231 print "# Testing :-target and accept_target + two simples, latter with leading whitespace ...\n";
233 ok( $x->_out( \&moj, "=pod\n\nI like pie.\n\n=begin :mojojojo\n\nI<stuff>\nTrala!\n\n Hm, B<things>!\nTrala.\n\n=end :mojojojo\n\nYup.\n"),
234 qq{<Document><Para>I like pie.</Para><for target=":mojojojo" target_matching="mojojojo"><Para><I>stuff</I> Trala!</Para><Verbatim xml:space="preserve"> Hm, B<things>!\nTrala.</Verbatim></for><Para>Yup.</Para></Document>}
236 ok( $x->_out( \&moj, "=pod\n\nI like pie.\n\n=begin :psketti,mojojojo,crunk\n\nI<stuff>\nTrala!\n\n Hm, B<things>!\nTrala.\n\n=end :psketti,mojojojo,crunk\n\nYup.\n"),
237 qq{<Document><Para>I like pie.</Para><for target=":psketti,mojojojo,crunk" target_matching="mojojojo"><Para><I>stuff</I> Trala!</Para><Verbatim xml:space="preserve"> Hm, B<things>!\nTrala.</Verbatim></for><Para>Yup.</Para></Document>}
240 print "# now with accept_target_as_text\n";
241 ok( $x->_out( \&mojtext, "=pod\n\nI like pie.\n\n=begin mojojojo\n\nI<stuff>\nTrala!\n\n Hm, B<things>!\nTrala.\n\n=end mojojojo\n\nYup.\n"),
242 qq{<Document><Para>I like pie.</Para><for target="mojojojo" target_matching="mojojojo"><Para><I>stuff</I> Trala!</Para><Verbatim xml:space="preserve"> Hm, B<things>!\nTrala.</Verbatim></for><Para>Yup.</Para></Document>}
244 ok( $x->_out( \&mojtext, join "\n\n" =>
245 "=pod\n\nI like pie.\n\n=begin psketti,mojojojo,crunk",
247 " Hm, B<things>!\nTrala.",
248 "=end psketti,mojojojo,crunk",
251 qq{<Document><Para>I like pie.</Para>}.
252 qq{<for target="psketti,mojojojo,crunk" target_matching="mojojojo">}.
253 qq{<Para><I>stuff</I> Trala!</Para>}.
254 qq{<Verbatim xml:space="preserve"> Hm, B<things>!\nTrala.</Verbatim>}.
255 qq{</for><Para>Yup.</Para></Document>}
258 print "# Now with five paragraphs (p,v,v,p,p) and accept_target_as_text\n";
260 ok( $x->_out( \&mojtext, join "\n\n" =>
261 "=pod\n\nI like pie.\n\n=begin psketti,mojojojo,crunk",
263 " Hm, B<things>!\nTrala.",
264 " Oh, F<< dodads >>!\nHurf.",
265 "Boing C<spr-\t\n\t\t\toink>\n Blorg!",
266 "Woohah S<thwack\nwoohah>squim!",
267 "=end psketti,mojojojo,crunk",
270 qq{<Document><Para>I like pie.</Para>}.
271 qq{<for target="psketti,mojojojo,crunk" target_matching="mojojojo">}.
272 qq{<Para><I>stuff</I> Trala!</Para>}.
273 qq{<Verbatim xml:space="preserve"> Hm, B<things>!\nTrala.\n\n}.
274 qq{ Oh, F<< dodads >>!\nHurf.</Verbatim>}.
275 qq{<Para>Boing <C>spr- oink</C> Blorg!</Para>}.
276 qq{<Para>Woohah <S>thwack woohah</S>squim!</Para>}.
277 qq{</for><Para>Yup.</Para></Document>}
282 print "#\n# Now nested begin...end regions...\n";
284 sub mojprok { shift->accept_targets(qw{mojojojo prok}) }
286 ok( $x->_out( \&mojprok, join "\n\n" =>
287 "=pod\n\nI like pie.",
288 "=begin :psketti,mojojojo,crunk",
290 " Hm, B<things>!\nTrala.",
291 " Oh, F<< dodads >>!\nHurf.",
292 "Boing C<spr-\t\n\t\t\toink>\n Blorg!",
294 "Woohah S<thwack\nwoohah>squim!",
297 "=end :psketti,mojojojo,crunk",
300 qq{<Document><Para>I like pie.</Para>}.
301 qq{<for target=":psketti,mojojojo,crunk" target_matching="mojojojo">}.
302 qq{<Para><I>stuff</I> Trala!</Para>}.
303 qq{<Verbatim xml:space="preserve"> Hm, B<things>!\nTrala.\n\n}.
304 qq{ Oh, F<< dodads >>!\nHurf.</Verbatim>}.
305 qq{<Para>Boing <C>spr- oink</C> Blorg!</Para>}.
306 qq{<for target=":prok" target_matching="prok">}.
307 qq{<Para>Woohah <S>thwack woohah</S>squim!</Para>}.
309 qq{<Para>Zubaaz.</Para>}.
311 qq{<Para>Yup.</Para></Document>}
315 print "# a little more complex this time...\n";
317 ok( $x->_out( \&mojprok, join "\n\n" =>
318 "=pod\n\nI like pie.",
319 "=begin :psketti,mojojojo,crunk",
321 " Hm, B<things>!\nTrala.",
322 " Oh, F<< dodads >>!\nHurf.",
323 "Boing C<spr-\t\n\t\t\toink>\n Blorg!",
325 " Blorp, B<things>!\nTrala.",
326 " Khh, F<< dodads >>!\nHurf.",
327 "Woohah S<thwack\nwoohah>squim!",
330 "=end :psketti,mojojojo,crunk",
333 qq{<Document><Para>I like pie.</Para>}.
334 qq{<for target=":psketti,mojojojo,crunk" target_matching="mojojojo">}.
335 qq{<Para><I>stuff</I> Trala!</Para>}.
336 qq{<Verbatim xml:space="preserve"> Hm, B<things>!\nTrala.\n\n}.
337 qq{ Oh, F<< dodads >>!\nHurf.</Verbatim>}.
338 qq{<Para>Boing <C>spr- oink</C> Blorg!</Para>}.
339 qq{<for target=":prok" target_matching="prok">}.
340 qq{<Verbatim xml:space="preserve"> Blorp, B<things>!\nTrala.\n\n}.
341 qq{ Khh, F<< dodads >>!\nHurf.</Verbatim>}.
342 qq{<Para>Woohah <S>thwack woohah</S>squim!</Para>}.
344 qq{<Para>Zubaaz.</Para>}.
346 qq{<Para>Yup.</Para></Document>}
351 print "# Now with nesting where inner region is non-resolving...\n";
353 ok( $x->_out( \&mojprok, join "\n\n" =>
354 "=pod\n\nI like pie.",
355 "=begin :psketti,mojojojo,crunk",
357 " Hm, B<things>!\nTrala.",
358 " Oh, F<< dodads >>!\nHurf.",
359 "Boing C<spr-\t\n\t\t\toink>\n Blorg!",
361 " Blorp, B<things>!\nTrala.",
362 " Khh, F<< dodads >>!\nHurf.",
363 "Woohah S<thwack\nwoohah>squim!",
366 "=end :psketti,mojojojo,crunk",
369 qq{<Document><Para>I like pie.</Para>}.
370 qq{<for target=":psketti,mojojojo,crunk" target_matching="mojojojo">}.
371 qq{<Para><I>stuff</I> Trala!</Para>}.
372 qq{<Verbatim xml:space="preserve"> Hm, B<things>!\nTrala.\n\n}.
373 qq{ Oh, F<< dodads >>!\nHurf.</Verbatim>}.
374 qq{<Para>Boing <C>spr- oink</C> Blorg!</Para>}.
375 qq{<for target="prok" target_matching="prok">}.
376 qq{<Data xml:space="preserve"> Blorp, B<things>!\nTrala.\n\n}.
377 qq{ Khh, F<< dodads >>!\nHurf.\n</Data>}.
378 qq{<Data xml:space="preserve">Woohah S<thwack\nwoohah>squim!</Data>}.
380 qq{<Para>Zubaaz.</Para>}.
382 qq{<Para>Yup.</Para></Document>}
387 print "# Now a begin...end with a non-resolving for inside\n";
389 ok( $x->_out( \&mojprok, join "\n\n" =>
390 "=pod\n\nI like pie.",
391 "=begin :psketti,mojojojo,crunk",
393 " Hm, B<things>!\nTrala.",
394 " Oh, F<< dodads >>!\nHurf.",
395 "Boing C<spr-\t\n\t\t\toink>\n Blorg!",
397 . " Blorp, B<things>!\nTrala.\n Khh, F<< dodads >>!\nHurf.",
399 "=end :psketti,mojojojo,crunk",
402 qq{<Document><Para>I like pie.</Para>}.
403 qq{<for target=":psketti,mojojojo,crunk" target_matching="mojojojo">}.
404 qq{<Para><I>stuff</I> Trala!</Para>}.
405 qq{<Verbatim xml:space="preserve"> Hm, B<things>!\nTrala.\n\n}.
406 qq{ Oh, F<< dodads >>!\nHurf.</Verbatim>}.
407 qq{<Para>Boing <C>spr- oink</C> Blorg!</Para>}.
408 qq{<for target="prok" target_matching="prok">}.
409 qq{<Data xml:space="preserve">Blorp, B<things>!\nTrala.\n}.
410 qq{ Khh, F<< dodads >>!\nHurf.</Data>}.
412 qq{<Para>Zubaaz.</Para>}.
414 qq{<Para>Yup.</Para></Document>}
420 print "# Now a begin...end with a resolving for inside\n";
422 ok( $x->_out( \&mojprok, join "\n\n" =>
423 "=pod\n\nI like pie.",
424 "=begin :psketti,mojojojo,crunk",
426 " Hm, B<things>!\nTrala.",
427 " Oh, F<< dodads >>!\nHurf.",
428 "Boing C<spr-\t\n\t\t\toink>\n Blorg!",
430 . " Blorp, B<things>!\nTrala.\n Khh, F<< dodads >>!\nHurf.",
432 "=end :psketti,mojojojo,crunk",
435 qq{<Document><Para>I like pie.</Para>}.
436 qq{<for target=":psketti,mojojojo,crunk" target_matching="mojojojo">}.
437 qq{<Para><I>stuff</I> Trala!</Para>}.
438 qq{<Verbatim xml:space="preserve"> Hm, B<things>!\nTrala.\n\n}.
439 qq{ Oh, F<< dodads >>!\nHurf.</Verbatim>}.
440 qq{<Para>Boing <C>spr- oink</C> Blorg!</Para>}.
441 qq{<for target=":prok" target_matching="prok">}.
442 qq{<Para>Blorp, <B>things</B>! Trala. Khh, }.
443 qq{<F>dodads</F>! Hurf.</Para>}.
445 qq{<Para>Zubaaz.</Para>}.
447 qq{<Para>Yup.</Para></Document>}
450 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
452 print "# Testing matching of begin block titles\n";
453 ok( $x->_out( \&moj, "=pod\n\nI like pie.\n\n=begin mojojojo Title\n\nstuff\n\n=end mojojojo \n\nYup.\n"),
454 '<Document><Para>I like pie.</Para><for target="mojojojo" target_matching="mojojojo" title="Title"><Data xml:space="preserve">stuff</Data></for><Para>Yup.</Para></Document>'
457 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
459 print "# Wrapping up... one for the road...\n";
461 print "# --- Done with ", __FILE__, " --- \n";