10 use_ok( 'DBM::Deep' );
12 # How should one test for creation failure with the tie mechanism?
18 tie %hash, 'DBM::Deep', "t/test.db";
20 $hash{key1} = 'value';
21 is( $hash{key1}, 'value', 'Set and retrieved key1' );
26 tie %hash, 'DBM::Deep', "t/test.db";
28 is( $hash{key1}, 'value', 'Set and retrieved key1' );
30 is( keys %hash, 1, "There's one key so far" );
31 ok( exists $hash{key1}, "... and it's key1" );
35 tie my @array, 'DBM::Deep', {
37 type => DBM::Deep->TYPE_ARRAY,
39 } qr/DBM::Deep: File type mismatch/, "\$SIG_TYPE doesn't match file's type";
42 DBM::Deep->new( file => 't/test2.db', type => DBM::Deep->TYPE_ARRAY );
45 tie my %hash, 'DBM::Deep', {
47 type => DBM::Deep->TYPE_HASH,
49 } qr/DBM::Deep: File type mismatch/, "\$SIG_TYPE doesn't match file's type";