This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re-deprecate $[
[perl5.git] / ext / arybase / t / av2arylen.t
1 use warnings; no warnings 'deprecated';
2 use strict;
3
4 use Test::More tests => 8;
5
6 our @t = qw(a b c d e f);
7 our $r = \@t;
8
9 $[ = 3;
10
11 is_deeply [ scalar $#t ], [ 8 ];
12 is_deeply [ $#t ], [ 8 ];
13 is_deeply [ scalar $#$r ], [ 8 ];
14 is_deeply [ $#$r ], [ 8 ];
15
16 my $arylen=\$#t;
17 push @t, 'g';
18 is 0+$$arylen, 9;
19 $[ = 4;
20 is 0+$$arylen, 10;
21 --$$arylen;
22 $[ = 3;
23 is 0+$$arylen, 8;
24 is 0+$#t, 8;
25
26 1;