Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
all ranges now autotruncate on subscripting
  • Loading branch information
TimToady committed Sep 2, 2014
1 parent 2befb5e commit 79039df
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions S12-class/attributes.t
Expand Up @@ -141,18 +141,19 @@ eval_dies_ok q[
}

#RT #75010
# Note, all ranges now autotruncate if they run off the end, not just infinite ones
{

my @y=1,2,3;
is_deeply( [@y], [ 1, 2, 3 ], 'Plain array' );
is_deeply( [@y[1 .. +@y]], [ 2, 3, Any ], 'Array from 2-nd element to end+1' );
is_deeply( [@y[1 .. +@y]], [ 2, 3 ], 'Array from 2-nd element to end+1' );
is_deeply( [@y[1 ..^ +@y]], [ 2, 3 ], 'Array from 2-nd element to end' );

class AB {
has @.x;
method aa {
my @y=1,2,3;
is_deeply( [@y[1 .. +@y]], [ 2, 3, Any ], 'Plain array in the method' );
is_deeply( [@y[1 .. +@y]], [ 2, 3 ], 'Plain array in the method' );
is_deeply( [@.x], [ 1, 2, 3 ], 'Array from 2-nd element to end+1 in the method' );
is_deeply( [@.x[1 ..^ +@.x]], [ 2, 3 ], 'Array from 2-nd element to end in the method' );
}
Expand Down

0 comments on commit 79039df

Please sign in to comment.