Fixed problem with second-level values being overwritten when accessed.
[dbsrgits/DBM-Deep.git] / t / 02_hash.t
index 039e134..c8a0cab 100644 (file)
@@ -4,6 +4,7 @@ use warnings FATAL => 'all';
 use Test::More;
 use Test::Exception;
 use t::common qw( new_dbm );
+use Scalar::Util qw( reftype );
 
 use_ok( 'DBM::Deep' );
 
@@ -50,7 +51,6 @@ while ( my $dbm_maker = $dbm_factory->() ) {
     #
     # Q: How do we make sure that the iterator is unique? Is it supposed to be?
 
-=pod
     ##
     # count keys
     ##
@@ -140,6 +140,7 @@ while ( my $dbm_maker = $dbm_factory->() ) {
     # Test autovivification
     $db->{unknown}{bar} = 1;
     ok( $db->{unknown}, 'Autovivified hash exists' );
+    is( reftype($db->{unknown}), 'HASH', "... and it's a HASH" );
     cmp_ok( $db->{unknown}{bar}, '==', 1, 'And the value stored is there' );
 
     # Test failures
@@ -174,7 +175,6 @@ while ( my $dbm_maker = $dbm_factory->() ) {
     throws_ok {
         $db->exists(undef);
     } qr/Cannot use an undefined hash key/, "EXISTS fails on an undefined key";
-=cut
 }
 
 done_testing;