diff --git a/t/01-delimited.t b/t/01-delimited.t index 6ed39a8..aead81e 100644 --- a/t/01-delimited.t +++ b/t/01-delimited.t @@ -81,12 +81,17 @@ isa_ok $r, Pod6::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'; + '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'; -is $r.content[2].content[0], "Dragon Tears!"; -is $r.content[3], "Which, as we all know..."; -is $r.content[4].content[0], "Turn into Jelly Beans!"; + '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'; $x = q[ =begin pod @@ -99,5 +104,7 @@ between these two paragraphs ]; $r = Pod6::parse($x); isa_ok $r, Pod6::Block; -is $r.content[0], 'someone accidentally left a space'; -is $r.content[1], 'between these two paragraphs'; +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'; diff --git a/t/02-paragraph.t b/t/02-paragraph.t index dcc04e5..7a40d4a 100644 --- a/t/02-paragraph.t +++ b/t/02-paragraph.t @@ -1,6 +1,6 @@ use Test; use Pod6; -plan 15; +plan 22; my $x = q[ =for foo @@ -40,11 +40,14 @@ Outside blocks ]; $r = Pod6::parse($x); isa_ok $r.content[0], Pod6::Block; -is $r.content[0].content[0], "Inside got"; +is $r.content[0].content[0], "Inside got", + 'paragraph block content ok, 1/2'; isa_ok $r.content[1], Pod6::Block; -is $r.content[1].content[0], "Inside bidden"; +is $r.content[1].content[0], "Inside bidden", + 'paragraph block content ok, 1/2'; isa_ok $r.content[2], Str; -is $r.content[2], "Outside blocks"; +is $r.content[2], "Outside blocks", + 'content outside blocks is all right'; # mixed blocks $x = q[ @@ -68,3 +71,42 @@ is $r.content[0].content[0], "one, delimited block", "mixed blocks, 1"; is $r.content[1].content[0], "two, paragraph block", "mixed blocks, 2"; is $r.content[2].content[0], "three, still a parablock", "mixed blocks, 3"; is $r.content[3].content[0], "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 +$x = q[ +=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 + Dragon Tears! + + Which, as we all know... + + =for bar + Turn into Jelly Beans! +=end foo +]; + +$r = Pod6::parse($x); +isa_ok $r, Pod6::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';