4 use warnings FATAL => 'all';
6 use Scalar::Util qw( reftype );
7 use Test::More tests => 10;
9 use t::common qw( new_fh );
11 use_ok( 'DBM::Deep' );
13 # This is bug #29957, reported by HANENKAMP
15 todo_skip "This crashes the code", 4;
16 my ($fh, $filename) = new_fh();
17 my $db = DBM::Deep->new(
24 for my $value ( 1 .. 3 ) {
32 # This is bug #33863, reported by PJS
34 my ($fh, $filename) = new_fh();
35 my $db = DBM::Deep->new(
41 my $foo = shift @{ $db->{foo} };
42 cmp_ok( @{ $db->{foo} }, '==', 0, "Shifting a scalar leaves no values" );
43 cmp_ok( $foo, '==', 42, "... And the value is correct." );
45 # $db->{bar} = [ [] ];
46 # my $bar = shift @{ $db->{bar} };
47 # cmp_ok( @{ $db->{bar} }, '==', 0, "Shifting an arrayref leaves no values" );
48 # use Data::Dumper; warn Dumper $bar;
50 $db->{baz} = { foo => [ 1 .. 3 ] };
51 $db->{baz2} = [ $db->{baz} ];
52 my $baz2 = shift @{ $db->{baz2} };
53 cmp_ok( @{ $db->{baz2} }, '==', 0, "Shifting an arrayref leaves no values" );
54 ok( exists $db->{baz}{foo} );
55 ok( exists $baz2->{foo} );