3 use Test::More tests => 10;
5 use t::common qw( new_fh );
9 my ($fh, $filename) = new_fh();
13 my $db = DBM::Deep->new( $filename );
16 $db->{scalarref} = \$x;
17 } qr/Storage of references of type 'SCALAR' is not supported/,
18 'Storage of scalar refs not supported';
21 $db->{scalarref} = \\$x;
22 } qr/Storage of references of type 'REF' is not supported/,
23 'Storage of ref refs not supported';
26 $db->{scalarref} = sub { 1 };
27 } qr/Storage of references of type 'CODE' is not supported/,
28 'Storage of code refs not supported';
31 $db->{scalarref} = $db->_get_self->_fh;
32 } qr/Storage of references of type 'GLOB' is not supported/,
33 'Storage of glob refs not supported';
37 todo_skip "Refs to DBM::Deep objects aren't implemented yet", 2;
39 $db->{selfref} = \$db->{scalar};
40 } "Refs to DBM::Deep objects are ok";
42 is( ${$db->{selfref}}, $x, "A ref to a DBM::Deep object is ok" );
47 my $db = DBM::Deep->new( $filename );
49 is( $db->{scalar}, $x, "Scalar retrieved ok" );
51 todo_skip "Refs to DBM::Deep objects aren't implemented yet", 2;
52 is( ${$db->{scalarref}}, 30, "Scalarref retrieved ok" );
53 is( ${$db->{selfref}}, 26, "Scalarref to stored scalar retrieved ok" );