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 local $TODO = "Sig doesn't match, but it's legal??";
38 tie @array, 'DBM::Deep', {
40 type => DBM::Deep->TYPE_ARRAY,
42 } qr/DBM::Deep: Cannot open a hash-based file with an array/, "\$SIG_TYPE doesn't match file's type";
45 DBM::Deep->new( file => 't/test.db', type => DBM::Deep->TYPE_ARRAY );
49 tie %hash, 'DBM::Deep', {
51 type => DBM::Deep->TYPE_HASH,
53 } qr/DBM::Deep: Cannot open a array-based file with a hash/, "\$SIG_TYPE doesn't match file's type";