]> git.vpit.fr Git - perl/modules/autovivification.git/blob - t/33-array-tied.t
This is 0.18
[perl/modules/autovivification.git] / t / 33-array-tied.t
1 #!perl -T
2
3 use strict;
4 use warnings;
5
6 use Test::More;
7
8 BEGIN {
9  eval 'use Tie::Array; scalar keys %Tie::StdArray::'
10                or plan skip_all => 'Tie::StdArray required to test tied arrays';
11  defined and diag "Using Tie::StdArray $_" for $Tie::Array::VERSION;
12  plan tests => 1;
13 }
14
15 {
16  tie my @a, 'Tie::StdArray';
17  tie my @b, 'Tie::StdArray';
18
19  $a[1] = 'hlagh';
20  $b[0] = \@a;
21
22  my $res = do {
23   no autovivification;
24   $b[0][1];
25  };
26  is $res, 'hlagh', 'nested tied arrays';
27 }