Skip to content

Commit

Permalink
add tests for RT #74478
Browse files Browse the repository at this point in the history
  • Loading branch information
timo committed Dec 18, 2012
1 parent cdca426 commit c50e4ea
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion S02-magicals/args.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 4;
plan 6;

isa_ok @*ARGS, Array, '@*ARGS is an Array';
is_deeply @*ARGS, [], 'by default @*ARGS is empty array';
Expand All @@ -19,4 +19,18 @@ is_run 'print @*ARGS.join(q[, ])', :args[1, 2, "foo"],
status => 0,
}, 'providing command line arguments sets @*ARGS';

is_run 'for @*ARGS[ 1 ..^ +@*ARGS ] { .say };', :args[1, 'two', 'three'],
{
out => "two\nthree\n",
err => '',
status => 0,
}, 'postcircumfix:<[ ]> works for @*ARGS';

is_run 'my @a = @*ARGS; for @a[ 1 ..^ +@*ARGS ] { .say };', :args[1, 'two', 'three'],
{
out => "two\nthree\n",
err => '',
status => 0,
}, 'can copy @*ARGS to array.';

done;

0 comments on commit c50e4ea

Please sign in to comment.