Refactored to _descend to fix the recursion bug
[dbsrgits/DBM-Deep.git] / t / 25_tie_return_value.t
1 use strict;
2 use warnings FATAL => 'all';
3
4 use Test::More;
5 use t::common qw( new_fh );
6
7 use_ok( 'DBM::Deep' );
8
9 use Scalar::Util qw( reftype );
10
11 {
12     my ($fh, $filename) = new_fh();
13
14     my %hash;
15     my $obj = tie %hash, 'DBM::Deep', $filename;
16     isa_ok( $obj, 'DBM::Deep' );
17     is( reftype( $obj ), 'HASH', "... and its underlying representation is an HASH" );
18 }
19
20 {
21     my ($fh, $filename) = new_fh();
22
23     my @array;
24     my $obj = tie @array, 'DBM::Deep', $filename;
25     isa_ok( $obj, 'DBM::Deep' );
26     is( reftype( $obj ), 'HASH', "... and its underlying representation is an HASH" );
27 }
28
29 done_testing;