diff options
author | Nicholas Clark <nick@ccl4.org> | 2010-12-16 13:25:05 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2010-12-16 14:51:53 +0000 |
commit | 28e5c022d7f209060c6e4d0179285b742e0bad64 (patch) | |
tree | a6184cd7fa6289b7079f0ba662c45afcff28daab /ext/GDBM_File | |
parent | 89cebecca5600bb94e404ffac30bb2fa04e516c3 (diff) | |
download | perl-28e5c022d7f209060c6e4d0179285b742e0bad64.tar.gz |
Converge ext/[GNOS]DBM_File/t/[gnos]dbm.t further.
Including Cross propagating some fixes:
grep in void context warning (f84167b37281b9fd c57cf257e9e58200), but improve
it by avoiding void context entirely, by actually testing the results :-)
"cleaner close on tests, take 2", d1e4d418969ad3c5
Diffstat (limited to 'ext/GDBM_File')
-rw-r--r-- | ext/GDBM_File/t/gdbm.t | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/ext/GDBM_File/t/gdbm.t b/ext/GDBM_File/t/gdbm.t index 9f6807c183..680b67fd75 100644 --- a/ext/GDBM_File/t/gdbm.t +++ b/ext/GDBM_File/t/gdbm.t @@ -13,7 +13,7 @@ BEGIN { use strict; use warnings; -use Test::More tests => 81; +use Test::More tests => 83; use GDBM_File; unlink <Op_dbmx.*>; @@ -26,11 +26,9 @@ my $Dfile = "Op_dbmx.pag"; if (! -e $Dfile) { ($Dfile) = <Op_dbmx*>; } - SKIP: { - skip " different file permission semantics on $^O", 1 + skip "different file permission semantics on $^O", 1 if $^O eq 'amigaos' || $^O eq 'os2' || $^O eq 'MSWin32' || $^O eq 'NetWare' || $^O eq 'dos' || $^O eq 'cygwin'; - my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime, $blksize,$blocks) = stat($Dfile); is($mode & 0777, 0640); @@ -137,6 +135,7 @@ unlink <Op_dbmx*>, $Dfile; package SubDB ; use strict ; + use warnings ; use vars qw(@ISA @EXPORT) ; require Exporter ; @@ -168,7 +167,7 @@ unlink <Op_dbmx*>, $Dfile; 1 ; EOM - close FILE ; + close FILE or die "Could not close: $!"; BEGIN { push @INC, '.'; } unlink <dbhash_tmp*> ; @@ -455,7 +454,6 @@ unlink <Op_dbmx*>, $Dfile; my $db = tie %h, 'GDBM_File', 'Op1_dbmx', GDBM_WRCREAT, 0640; isa_ok($db, 'GDBM_File'); - $db->filter_fetch_key (sub { }) ; $db->filter_store_key (sub { }) ; $db->filter_fetch_value (sub { }) ; @@ -466,7 +464,7 @@ unlink <Op_dbmx*>, $Dfile; $h{"fred"} = "joe" ; is($h{"fred"}, "joe"); - eval { my @r= grep { $h{$_} } (1, 2, 3) }; + is_deeply([eval { map { $h{$_} } (1, 2, 3) }], [undef, undef, undef]); is($@, ''); @@ -482,7 +480,7 @@ unlink <Op_dbmx*>, $Dfile; is($db->FIRSTKEY(), "fred"); - eval { my @r= grep { $h{$_} } (1, 2, 3) }; + is_deeply([eval { map { $h{$_} } (1, 2, 3) }], [undef, undef, undef]); is($@, ''); undef $db ; |