Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix comment block parsing, add tests
- Loading branch information
Tadeusz Sośnierz
committed
Jul 7, 2011
1 parent
571755c
commit 40859e6
Showing
2 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
use Test; | ||
plan 9; | ||
my $r; | ||
|
||
=begin pod | ||
=for comment | ||
foo foo | ||
bla bla bla | ||
This isn't a comment | ||
=end pod | ||
|
||
$r = $POD[0]; | ||
isa_ok $r.content[0], Pod__Block__Comment; | ||
is $r.content[0].content.elems, 1; | ||
is $r.content[0].content, "foo foo\nbla bla bla\n"; | ||
|
||
# from S26 | ||
=comment | ||
This file is deliberately specified in Perl 6 Pod format | ||
|
||
$r = $POD[1]; | ||
isa_ok $r, Pod__Block__Comment; | ||
is $r.content.elems, 1; | ||
is $r.content[0], | ||
"This file is deliberately specified in Perl 6 Pod format\n"; | ||
|
||
# this happens to break hilighting in some editors, | ||
# so I put it at the end | ||
=begin comment | ||
foo foo | ||
=begin invalid pod | ||
=as many invalid pod as we want | ||
===yay! | ||
=end comment | ||
$r = $POD[2]; | ||
isa_ok $r, Pod__Block; | ||
is $r.content.elems, 1; | ||
is $r.content[0], "foo foo\n=begin invalid pod\n" | ||
~ "=as many invalid pod as we want\n===yay!\n"; |