Skip to content

Commit

Permalink
test for RT #57790, scalars indexed with [1] should return a Failure
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Sep 18, 2010
1 parent 8c3cfd3 commit 5ca3dae
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions S02-builtin_data_types/array.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 102;
plan 103;

#L<S02/Mutable types/Array>

Expand Down Expand Up @@ -329,14 +329,15 @@ my @array2 = ("test", 1, Mu);
is [][].elems, 0, '[][] returns empty list/array';
}

# RT #58372
# RT #58372 and RT #57790
# by current group understanding of #perl6, postcircumifx:<[ ]> is actually
# defined in Any, so that .[0] is the identity operation for non-Positional
# types
{
is 1[0], 1, '.[0] is identiity operation for scalars (Int)';
is 'abc'[0], 'abc', '.[0] is identiity operation for scalars (Str)';
nok 'abc'[1].defined, '.[1] on a scalar is not defined';
isa_ok 1[1], Failure, 'indexing a scalar with other than 0 returns a Failure';
dies_ok { Mu.[0] }, 'but Mu has no .[]';
}

Expand Down

0 comments on commit 5ca3dae

Please sign in to comment.