Skip to content

Commit

Permalink
unhandled lowercase pod block typenames should throw an exception
Browse files Browse the repository at this point in the history
  • Loading branch information
tbrowder committed Aug 27, 2018
1 parent 929336e commit 6581cb5
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions S26-documentation/02-paragraph.t
Expand Up @@ -51,66 +51,66 @@ is $r.contents[2].contents, "Outside blocks",

# mixed blocks
=begin pod
=begin one
one, delimited block
=end one
=for two
two, paragraph block
=for three
three, still a parablock
=begin four
four, another delimited one
=end four
=begin One
One, delimited block
=end One
=for Two
Two, paragraph block
=for THree
Three, still a parablock
=begin Four
Four, another delimited one
=end Four
=end pod

$r = $=pod[4];
is $r.contents[0].contents[0].contents,
"one, delimited block", "mixed blocks, 1";
"One, delimited block", "mixed blocks, 1";
is $r.contents[1].contents[0].contents,
"two, paragraph block", "mixed blocks, 2";
"Two, paragraph block", "mixed blocks, 2";
is $r.contents[2].contents[0].contents,
"three, still a parablock", "mixed blocks, 3";
"Three, still a parablock", "mixed blocks, 3";
is $r.contents[3].contents[0].contents,
"four, another delimited one", "mixed blocks, 4";
"Four, another delimited one", "mixed blocks, 4";

# tests without Albi would still be tests, but definitely very, very sad
# also, Albi without paragraph blocks wouldn't be the happiest dragon
# either
=begin foo
=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
=for bar
=for Bar
Dragon Tears!
Which, as we all know...
=for bar
=for Bar
Turn into Jelly Beans!
=end foo
=end Foo

$r = $=pod[5];
isa-ok $r, Pod::Block;
is $r.contents.elems, 5, '5 sub-nodes in foo';
is $r.name, 'foo';
is $r.name, 'Foo';
is $r.contents[0].contents,
'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.contents[1].contents,
'and it was so cold and so scary in there, that Albi began to cry',
'...between the make-believe trees';
is $r.contents[2].name, 'bar';
is $r.contents[2].name, 'Bar';
is $r.contents[2].contents[0].contents, "Dragon Tears!",
'...in a cottage cheese cottage';
is $r.contents[3].contents, "Which, as we all know...",
'...lives Albi! Albi!';
is $r.contents[4].name, 'bar';
is $r.contents[4].name, 'Bar';
is $r.contents[4].contents[0].contents, "Turn into Jelly Beans!",
'...Albi, the Racist Dragon';

Expand Down

0 comments on commit 6581cb5

Please sign in to comment.