]> git.vpit.fr Git - perl/modules/autovivification.git/blobdiff - t/23-hash-tied.t
Make sure a_defined() calls get magic before testing for definedness
[perl/modules/autovivification.git] / t / 23-hash-tied.t
diff --git a/t/23-hash-tied.t b/t/23-hash-tied.t
new file mode 100644 (file)
index 0000000..7fd0fc3
--- /dev/null
@@ -0,0 +1,27 @@
+#!perl -T
+
+use strict;
+use warnings;
+
+use Test::More;
+
+BEGIN {
+ eval 'use Tie::Hash; scalar keys %Tie::StdHash::'
+                or plan skip_all => 'Tie::StdHash required to test tied hashes';
+ defined and diag "Using Tie::StdHash $_" for $Tie::Hash::VERSION;
+ plan tests => 1;
+}
+
+{
+ tie my %x, 'Tie::StdHash';
+ tie my %y, 'Tie::StdHash';
+
+ $x{key} = 'hlagh';
+ $y{x}   = \%x;
+
+ my $res = do {
+  no autovivification;
+  $y{x}{key};
+ };
+ is $res, 'hlagh', 'nested tied hashes';
+}