6 BEGIN { plan tests => 10 }
11 # testing the various modes of opening a file
16 my $db = tie %hash, 'DBM::Deep', 't/test.db';
19 print "ERROR: " . $db->error();
29 my $db = tie %hash, 'DBM::Deep', {
34 print "ERROR: " . $db->error();
44 my $db = tie @array, 'DBM::Deep', 't/test.db';
47 print "ERROR: " . $db->error();
54 local $TODO = "TIE_ARRAY doesn't set the type correctly";
55 is( $db->{type}, DBM::Deep->TYPE_ARRAY, "TIE_ARRAY sets the correct type" );
62 my $db = tie @array, 'DBM::Deep', {
67 print "ERROR: " . $db->error();
74 local $TODO = "TIE_ARRAY doesn't set the type correctly";
75 is( $db->{type}, DBM::Deep->TYPE_ARRAY, "TIE_ARRAY sets the correct type" );
79 # These are testing the naive use of ref() within TIEHASH and TIEARRAY.
80 # They should be doing (Scalar::Util::reftype($_[0]) eq 'HASH') and then
81 # erroring out if it's not.
83 todo_skip "Naive use of ref()", 1;
86 my $db = tie %hash, 'DBM::Deep', [
91 print "ERROR: " . $db->error();
99 todo_skip "Naive use of ref()", 1;
102 my $db = tie @array, 'DBM::Deep', [
107 print "ERROR: " . $db->error();
114 # These are testing the naive use of the {@_} construct within TIEHASH and
115 # TIEARRAY. Instead, they should be checking (@_ % 2 == 0) and erroring out
118 todo_skip( "Naive use of {\@_}", 1 );
121 my $db = tie %hash, 'DBM::Deep',
122 undef, file => 't/test.db'
126 print "ERROR: " . $db->error();
134 todo_skip( "Naive use of {\@_}", 1 );
137 my $db = tie @array, 'DBM::Deep',
138 undef, file => 't/test.db'
142 print "ERROR: " . $db->error();