Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add tests for advent 2013 day 04 (incomplete)
  • Loading branch information
moritz committed Jan 31, 2014
1 parent 1ff6d63 commit 90ed0c3
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions integration/advent2013-04.t
@@ -0,0 +1,49 @@
use v6;
use Test;

plan 7;

is q:to"FIN", "Hello again.\n", 'basic heredoc with :to';
Hello again.
FIN

my $str = q[q:to"noend";
HELLO WORLD noend
];

eval_dies_ok $str, 'Runaway multiline is an error';

is q:to[finished], " Hello there\n everybody\n", "indention of heredocs
(1)";
Hello there
everybody
finished
my $first = q:to/END/;
HELLO
WORLD
END

my $second = q:to/END/;
HELLO
WORLD
END

is $first, $second, "Indention stripped to end delimiter indention";

my $dlrs = 21;
my $cnts = 18;

is q:to/EOF/.chop, '$dlrs dollars and {$cnts} cents.', 'no interpolation by
default';
$dlrs dollars and {$cnts} cents.
EOF

#?rakudo todo ':c in heredocs'
is q:to:c/EOF/.chop, '$dlrs dollars and 18 cents.', ':c enables closure compilation';
$dlrs dollars and {$cnts} cents.
EOF

is qq:to/EOF/.chop, '21 dollars and 18 cents.', 'heredocs with qq interpolate';
$dlrs dollars and {$cnts} cents.
EOF

0 comments on commit 90ed0c3

Please sign in to comment.