This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Get t/uni/cache.t working under minitest
[perl5.git] / t / op / array_base.t
1 #!perl -w
2 use strict;
3
4 BEGIN {
5  require './test.pl';
6
7  plan (tests => my $tests = 11);
8
9  # Run these at BEGIN time, before arybase loads
10  use v5.15;
11  is(eval('$[ = 1; 123'), undef);
12  like($@, qr/\AAssigning non-zero to \$\[ is no longer possible/);
13
14  if (is_miniperl()) {
15    # skip the rest
16    SKIP: { skip ("no arybase.xs on miniperl", $tests-2) }
17    exit;
18  }
19 }
20
21 no warnings 'deprecated';
22
23 is(eval('$['), 0);
24 is(eval('$[ = 0; 123'), 123);
25 is(eval('$[ = 1; 123'), 123);
26 $[ = 1;
27 ok $INC{'arybase.pm'};
28
29 use v5.15;
30 is(eval('$[ = 1; 123'), undef);
31 like($@, qr/\AAssigning non-zero to \$\[ is no longer possible/);
32 is $[, 0, '$[ is 0 under 5.16';
33 $_ = "hello";
34 /l/g;
35 my $pos = \pos;
36 is $$pos, 3;
37 $$pos = 1;
38 is $$pos, 1;
39
40 1;