diff options
Diffstat (limited to 'atarist/test/gdbm')
-rw-r--r-- | atarist/test/gdbm | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/atarist/test/gdbm b/atarist/test/gdbm new file mode 100644 index 0000000000..207eea39a1 --- /dev/null +++ b/atarist/test/gdbm @@ -0,0 +1,28 @@ +die "cant create dbmtest" unless dbmopen(%keys, "dbmtest", 0666); + +print "Writing...\n"; + +foreach (0..100) { + $keys{"$_"} = $_; +} + +print "Done\n"; + +dbmclose (%keys); + +die "cant read dbmtest" unless dbmopen(%rkeys, "dbmtest", undef); + +$i = 0; +print "Reading...\n"; +while (($key, $val) = each %rkeys) +{ + if ($keys{$key} != $val) + { + print 'Incorrect val ', $key, ' = ', $val, ' expecting ', $keys{$key}, "\n"; + $i = $i + 1; + } +} +print "Done\n"; +dbmclose (%keys); +print $i, " Error(s)\n"; +unlink "dbmtest"; |