Skip to content

Commit db49548

Browse files
committed
Make a test robust to source having \r.
1 parent 7994e6b commit db49548

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

integration/advent2013-day04.t

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ use Test;
33

44
plan 7;
55

6-
is q:to"FIN", "Hello again.\n", 'basic heredoc with :to';
6+
sub un-r($str) { $str.subst("\r", "", :g) }
7+
8+
is un-r(q:to"FIN"), "Hello again.\n", 'basic heredoc with :to';
79
Hello again.
810
FIN
911

@@ -13,7 +15,7 @@ HELLO WORLD noend
1315

1416
throws_like { $str.EVAL }, X::AdHoc, 'Runaway multiline is an error, no exception object yet';
1517

16-
is q:to[finished], " Hello there\n everybody\n", "indention of heredocs
18+
is un-r(q:to[finished]), " Hello there\n everybody\n", "indention of heredocs
1719
(1)";
1820
Hello there
1921
everybody
@@ -34,7 +36,7 @@ is $first, $second, "Indention stripped to end delimiter indention";
3436
my $dlrs = 21;
3537
my $cnts = 18;
3638

37-
is q:to/EOF/.chop, '$dlrs dollars and {$cnts} cents.', 'no interpolation by
39+
is un-r(q:to/EOF/).chop, '$dlrs dollars and {$cnts} cents.', 'no interpolation by
3840
default';
3941
$dlrs dollars and {$cnts} cents.
4042
EOF
@@ -44,6 +46,6 @@ is q:to:c/EOF/.chop, '$dlrs dollars and 18 cents.', ':c enables closure compilat
4446
$dlrs dollars and {$cnts} cents.
4547
EOF
4648

47-
is qq:to/EOF/.chop, '21 dollars and 18 cents.', 'heredocs with qq interpolate';
49+
is un-r(qq:to/EOF/).chop, '21 dollars and 18 cents.', 'heredocs with qq interpolate';
4850
$dlrs dollars and {$cnts} cents.
4951
EOF

0 commit comments

Comments
 (0)