X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2Fsdbm.t;h=591fe14c60bee65cd7bbf6d822e8a7c4f3463ca6;hb=bf99883da2fbc1b4d546abddb96990a37466b881;hp=c8ae09285bc6476b92a8b09186c02b1d7aebc778;hpb=8490252049bf42d3d2f75d89178a8682bf22ba74;p=p5sagit%2Fp5-mst-13.2.git diff --git a/t/lib/sdbm.t b/t/lib/sdbm.t index c8ae092..591fe14 100755 --- a/t/lib/sdbm.t +++ b/t/lib/sdbm.t @@ -6,7 +6,7 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; require Config; import Config; - if ($Config{'extensions'} !~ /\bSDBM_File\b/) { + if (($Config{'extensions'} !~ /\bSDBM_File\b/) && ($^O ne 'VMS')){ print "1..0\n"; exit 0; } @@ -17,18 +17,18 @@ use Fcntl; print "1..18\n"; -unlink ; +unlink ; umask(0); -print (tie(%h,SDBM_File,'Op.dbmx', O_RDWR|O_CREAT, 0640) +print (tie(%h,SDBM_File,'Op_dbmx', O_RDWR|O_CREAT, 0640) ? "ok 1\n" : "not ok 1\n"); -$Dfile = "Op.dbmx.pag"; +$Dfile = "Op_dbmx.pag"; if (! -e $Dfile) { - ($Dfile) = ; + ($Dfile) = ; } -if ($^O eq 'amigaos' || $^O eq 'os2' || $^O eq 'MSWin32') { - print "ok 2\n"; +if ($^O eq 'amigaos' || $^O eq 'os2' || $^O eq 'MSWin32' || $^O eq 'dos') { + print "ok 2 # Skipped: different file permission semantics\n"; } else { ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime, @@ -60,7 +60,7 @@ $h{'goner2'} = 'snork'; delete $h{'goner2'}; untie(%h); -print (tie(%h,SDBM_File,'Op.dbmx', O_RDWR, 0640) ? "ok 4\n" : "not ok 4\n"); +print (tie(%h,SDBM_File,'Op_dbmx', O_RDWR, 0640) ? "ok 4\n" : "not ok 4\n"); $h{'j'} = 'J'; $h{'k'} = 'K'; @@ -90,7 +90,7 @@ delete $h{'goner3'}; if ($#keys == 29 && $#values == 29) {print "ok 5\n";} else {print "not ok 5\n";} -while (($key,$value) = each(h)) { +while (($key,$value) = each(%h)) { if ($key eq $keys[$i] && $value eq $values[$i] && $key eq lc($value)) { $key =~ y/a-z/A-Z/; $i++ if $key eq $value; @@ -99,7 +99,7 @@ while (($key,$value) = each(h)) { if ($i == 30) {print "ok 6\n";} else {print "not ok 6\n";} -@keys = ('blurfl', keys(h), 'dyick'); +@keys = ('blurfl', keys(%h), 'dyick'); if ($#keys == 31) {print "ok 7\n";} else {print "not ok 7\n";} $h{'foo'} = ''; @@ -123,7 +123,12 @@ print ($h{'foo'} eq '' ? "ok 11\n" : "not ok 11\n"); print ($h{''} eq 'bar' ? "ok 12\n" : "not ok 12\n"); untie %h; -unlink 'Op.dbmx.dir', $Dfile; +if ($^O eq 'VMS') { + unlink 'Op_dbmx.sdbm_dir', $Dfile; +} else { + unlink 'Op_dbmx.dir', $Dfile; +} + sub ok { @@ -187,7 +192,7 @@ EOM my %h ; my $X ; eval ' - $X = tie(%h, "SubDB","dbhash.tmp", O_RDWR|O_CREAT, 0640 ); + $X = tie(%h, "SubDB","dbhash_tmp", O_RDWR|O_CREAT, 0640 ); ' ; main::ok(14, $@ eq "") ; @@ -200,6 +205,8 @@ EOM main::ok(17, $@ eq "") ; main::ok(18, $ret eq "[[5]]") ; - unlink "SubDB.pm", ; + undef $X; + untie(%h); + unlink "SubDB.pm", ; }