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';
33 tie @array, 'DBM::Deep', 't/test.db';
34 } qr/DBM::Deep: File type mismatch/, "Fail if we try and tie a hash file with an array";
37 DBM::Deep->new( file => 't/test.db', type => DBM::Deep->TYPE_ARRAY )
38 } qr/DBM::Deep: File type mismatch/, "Fail if we try and open a hash file with an array";
44 tie @array, 'DBM::Deep', 't/test.db';
50 tie %hash, 'DBM::Deep', 't/test.db';
51 } qr/DBM::Deep: File type mismatch/, "Fail if we try and tie an array file with a hash";
54 DBM::Deep->new( file => 't/test.db', type => DBM::Deep->TYPE_HASH )
55 } qr/DBM::Deep: File type mismatch/, "Fail if we try and open an array file with a hash";