4 # based on t/op/dbm.t modified for gdbm and atariST stat() semantics
10 print (dbmopen(h,'Op.dbm',0640) ? "ok 1\n" : "not ok 1\n");
11 ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
12 $blksize,$blocks) = stat('Op.dbm');
13 print (($mode & 0770) == 0640 ? "ok 2\n" : "not ok 2\n");
14 while (($key,$value) = each(h)) {
17 print (!$i ? "ok 3\n" : "not ok 3\n");
19 $h{'goner1'} = 'snork';
23 $h{'jkl','mno'} = "JKL\034MNO";
24 $h{'a',2,3,4,5} = join("\034",'A',2,3,4,5);
35 $h{'goner2'} = 'snork';
39 print (dbmopen(h,'Op.dbm',0640) ? "ok 4\n" : "not ok 4\n");
59 $h{'goner3'} = 'snork';
67 if ($#keys == 29 && $#values == 29) {print "ok 5\n";} else {print "not ok 5\n";}
69 while (($key,$value) = each(h)) {
70 if ($key eq $keys[$i] && $value eq $values[$i] && $key gt $value) {
72 $i++ if $key eq $value;
76 if ($i == 30) {print "ok 6\n";} else {print "not ok 6\n";}
78 @keys = ('blurfl', keys(h), 'dyick');
79 if ($#keys == 31) {print "ok 7\n";} else {print "not ok 7\n";}
84 # check cache overflow and numeric keys and contents
86 for ($i = 1; $i < 200; $i++) { $h{$i + 0} = $i + 0; }
87 for ($i = 1; $i < 200; $i++) { $ok = 0 unless $h{$i} == $i; }
88 print ($ok ? "ok 8\n" : "not ok 8\n");
90 ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
91 $blksize,$blocks) = stat('Op.dbm');
92 print ($size > 0 ? "ok 9\n" : "not ok 9\n");
94 @h{0..200} = 200..400;
96 print join(':',200..400) eq join(':',@foo) ? "ok 10\n" : "not ok 10\n";
98 print ($h{'foo'} eq '' ? "ok 11\n" : "not ok 11\n");
99 print ($h{''} eq 'bar' ? "ok 12\n" : "not ok 12\n");