6 use Test::More tests => 6;
12 # make sure you can clear the error state
15 # test a corrupted file
17 open FH, '>t/test.db';
21 DBM::Deep->new( "t/test.db" );
22 } qr/DBM::Deep: Corrupted file, no master index record/, "Fail if there's no master index record";
27 tie %hash, 'DBM::Deep', 't/test.db';
32 tie @array, 'DBM::Deep', 't/test.db';
33 } qr/DBM::Deep: File type mismatch/, "Fail if we try and tie a hash file with an array";
36 DBM::Deep->new( file => 't/test.db', type => DBM::Deep->TYPE_ARRAY )
37 } qr/DBM::Deep: File type mismatch/, "Fail if we try and open a hash file with an array";
43 tie @array, 'DBM::Deep', 't/test.db';
48 tie %hash, 'DBM::Deep', 't/test.db';
49 } qr/DBM::Deep: File type mismatch/, "Fail if we try and tie an array file with a hash";
52 DBM::Deep->new( file => 't/test.db', type => DBM::Deep->TYPE_HASH )
53 } qr/DBM::Deep: File type mismatch/, "Fail if we try and open an array file with a hash";