Permalink
Browse files

add tests for RT #74478

  • Loading branch information...
1 parent cdca426 commit c50e4ea2e92d95219c169512a1c6c0b2f2030aaa @timo timo committed Dec 18, 2012
Showing with 15 additions and 1 deletion.
  1. +15 −1 S02-magicals/args.t
View
@@ -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';
@@ -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.