File: 33-array-tied.t

package info (click to toggle)
libautovivification-perl 0.18-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 440 kB
  • sloc: perl: 3,573; ansic: 1,507; makefile: 8
file content (27 lines) | stat: -rw-r--r-- 479 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!perl -T

use strict;
use warnings;

use Test::More;

BEGIN {
 eval 'use Tie::Array; scalar keys %Tie::StdArray::'
               or plan skip_all => 'Tie::StdArray required to test tied arrays';
 defined and diag "Using Tie::StdArray $_" for $Tie::Array::VERSION;
 plan tests => 1;
}

{
 tie my @a, 'Tie::StdArray';
 tie my @b, 'Tie::StdArray';

 $a[1] = 'hlagh';
 $b[0] = \@a;

 my $res = do {
  no autovivification;
  $b[0][1];
 };
 is $res, 'hlagh', 'nested tied arrays';
}