6 use Test::More tests => 6;
12 # test a corrupted file
14 open FH, '>t/test.db';
18 DBM::Deep->new( "t/test.db" );
19 } qr/DBM::Deep: Corrupted file, no master index record/, "Fail if there's no master index record";
24 tie %hash, 'DBM::Deep', 't/test.db';
29 tie @array, 'DBM::Deep', 't/test.db';
30 } qr/DBM::Deep: File type mismatch/, "Fail if we try and tie a hash file with an array";
33 DBM::Deep->new( file => 't/test.db', type => DBM::Deep->TYPE_ARRAY )
34 } qr/DBM::Deep: File type mismatch/, "Fail if we try and open a hash file with an array";
40 tie @array, 'DBM::Deep', 't/test.db';
45 tie %hash, 'DBM::Deep', 't/test.db';
46 } qr/DBM::Deep: File type mismatch/, "Fail if we try and tie an array file with a hash";
49 DBM::Deep->new( file => 't/test.db', type => DBM::Deep->TYPE_HASH )
50 } qr/DBM::Deep: File type mismatch/, "Fail if we try and open an array file with a hash";