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