Skip to content

Commit

Permalink
We now pass 17-positional.t.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Oct 19, 2010
1 parent d22037d commit e6de8a1
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions t/nqp/17-positional.t
@@ -0,0 +1,23 @@
#! nqp

# check positional subscripting

plan(7);

my @l := (1,2,3,4,5);

say("ok 1 # list assignment didn't barf");
say('ok ',@l[1], ' # numeric subscript');
say('ok ', @l['2'], ' # string subscript');

my $idx := 3;

say('ok ', @l[$idx], ' # variable subscript');
say('ok ', @l[$idx + 1], ' # expression in subscript');

@l[0] := 'ok 6 # string array element';
say(@l[0]);

@l[10] := 'ok 7 # automatic expansion';
say(@l[10]);

0 comments on commit e6de8a1

Please sign in to comment.