Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Import more pod tests. We now fully pass 01-delimited.t
  • Loading branch information
Tadeusz Sośnierz committed Jul 7, 2011
1 parent 13ce60f commit 587360f
Showing 1 changed file with 77 additions and 1 deletion.
78 changes: 77 additions & 1 deletion t/pod/01-delimited.t
@@ -1,4 +1,5 @@
use Test;
plan 28;
my $r;

=begin foo
Expand Down Expand Up @@ -49,4 +50,79 @@ $r = $POD[4];
is $r.name, 'something', 'parent name ok';
isa_ok $r.content[0], Pod__Block, "nested blocks work";
is $r.content[0].content[0], "toot tooot!", "and their content";
is $r.content[0].name, 'somethingelse', 'child name ok';done;
is $r.content[0].name, 'somethingelse', 'child name ok';

# Albi
=begin foo
and so, all of the villages chased
Albi, The Racist Dragon, into the
very cold and very scary cave

and it was so cold and so scary in
there, that Albi began to cry

=begin bar
Dragon Tears!
=end bar

Which, as we all know...

=begin bar
Turn into Jelly Beans!
=end bar
=end foo
$r = $POD[5];
isa_ok $r, Pod__Block;
is $r.content.elems, 5, '5 sub-nodes in foo';
is $r.content[0],
'and so, all of the villages chased Albi, The Racist Dragon, ' ~
'into the very cold and very scary cave',
'...in the marmelade forest';
is $r.content[1],
'and it was so cold and so scary in there, that Albi began to cry',
'...between the make-believe trees';
is $r.content[2].content[0], "Dragon Tears!",
'...in a cottage cheese cottage';
is $r.content[3], "Which, as we all know...",
'...lives Albi! Albi!';
is $r.content[4].content[0], "Turn into Jelly Beans!",
'...Albi, the Racist Dragon';

=begin pod
someone accidentally left a space
between these two paragraphs
=end pod

$r = $POD[6];
isa_ok $r, Pod__Block;
is $r.content[0], 'someone accidentally left a space',
'accidental space, 1/2';
is $r.content[1], 'between these two paragraphs',
'accidental space, 2/2';

# various things which caused the spectest to fail at some point
=begin kwid

= DESCRIPTION
bla bla

foo
=end kwid
$r = $POD[7];
is $r.content[0], '= DESCRIPTION bla bla';
is $r.content[1], 'foo';

=begin more-discussion-needed
XXX: chop(@array) should return an array of chopped strings?
XXX: chop(%has) should return a hash of chopped strings?
=end more-discussion-needed

$r = $POD[8];
isa_ok $r, Pod__Block;

0 comments on commit 587360f

Please sign in to comment.