5 use Test::More tests => 7;
7 use File::Temp qw( tempfile tempdir );
8 use Fcntl qw( :flock );
10 use_ok( 'DBM::Deep' );
12 my $dir = tempdir( CLEANUP => 1 );
13 my ($fh, $filename) = tempfile( 'tmpXXXX', UNLINK => 1, DIR => $dir );
15 my $db = DBM::Deep->new( $filename );
19 package My::Tie::Hash;
30 tie %hash, 'My::Tie::Hash';
31 isa_ok( tied(%hash), 'My::Tie::Hash' );
35 } qr/Cannot store something that is tied/, "Cannot store tied hashes";
40 package My::Tie::Array;
53 tie @array, 'My::Tie::Array';
54 isa_ok( tied(@array), 'My::Tie::Array' );
58 } qr/Cannot store something that is tied/, "Cannot store tied arrays";
62 package My::Tie::Scalar;
73 tie $scalar, 'My::Tie::Scalar';
74 isa_ok( tied($scalar), 'My::Tie::Scalar' );
77 $db->{foo} = \$scalar;
78 } qr/Storage of variables of type 'SCALAR' is not supported/, "Cannot store scalar references, let alone tied scalars";