Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make a couple of tests cope better with \r's.
  • Loading branch information
jnthn committed Sep 25, 2013
1 parent f3ec9a8 commit cb4fc4e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions S26-documentation/04-code.t
Expand Up @@ -12,8 +12,8 @@ This ordinary paragraph introduces a code block:
$r = $=pod[0];
is $r.content[0].content, 'This ordinary paragraph introduces a code block:';
isa_ok $r.content[1], Pod::Block::Code;
is $r.content[1].content.Str, q[$this = 1 * code('block');
$which.is_specified(:by<indenting>);];
is $r.content[1].content.Str.subst("\r", "", :g), q[$this = 1 * code('block');
$which.is_specified(:by<indenting>);].subst("\r", "", :g);

# more fancy code blocks
=begin pod
Expand Down
10 changes: 7 additions & 3 deletions S26-documentation/05-comment.t
Expand Up @@ -2,6 +2,10 @@ use Test;
plan 9;
my $r;

sub norm_crlf($str) {
$str.subst("\r", "", :g)
}

=begin pod
=for comment
foo foo
Expand All @@ -13,7 +17,7 @@ This isn't a comment
$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";
is norm_crlf($r.content[0].content), "foo foo\nbla bla bla\n";

# from S26
=comment
Expand All @@ -22,7 +26,7 @@ This file is deliberately specified in Perl 6 Pod format
$r = $=pod[1];
isa_ok $r, Pod::Block::Comment;
is $r.content.elems, 1, 'one-line comment: number of elements';;
is $r.content[0],
is norm_crlf($r.content[0]),
"This file is deliberately specified in Perl 6 Pod format\n",
'one-line comment: contents';

Expand All @@ -38,5 +42,5 @@ foo foo
$r = $=pod[2];
isa_ok $r, Pod::Block;
is $r.content.elems, 1;
is $r.content[0], "foo foo\n=begin invalid pod\n"
is norm_crlf($r.content[0]), "foo foo\n=begin invalid pod\n"
~ "=as many invalid pod as we want\n===yay!\n";

0 comments on commit cb4fc4e

Please sign in to comment.