This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix ext/arybase/t/*.t that assumed '.' in @INC
[perl5.git] / ext / arybase / t / scope.t
CommitLineData
36b2db7e 1use warnings; no warnings 'deprecated';
b82b06b8
FC
2use strict;
3
4use Test::More tests => 14;
5
6our @t = qw(a b c d e f);
7
8is $t[3], "d";
9$[ = 3;
10is $t[3], "a";
11{
12 is $t[3], "a";
13 $[ = -1;
14 is $t[3], "e";
15 $[ = +0;
16 is $t[3], "d";
17 $[ = +1;
18 is $t[3], "c";
19 $[ = 0;
20 is $t[3], "d";
21}
22is $t[3], "a";
23{
24 local $[ = -1;
25 is $t[3], "e";
26}
27is $t[3], "a";
28{
29 ($[) = -1;
30 is $t[3], "e";
31}
32is $t[3], "a";
78e59864 33BEGIN { push @INC, '.' }
b82b06b8
FC
34use t::scope_0;
35is scope0_test(), "d";
36
37
38is eval(q{
39 $[ = 3;
40 BEGIN { my $x = "foo\x{666}"; $x =~ /foo\p{Alnum}/; }
41 $t[3];
42}), "a";
43
441;