summaryrefslogtreecommitdiff
path: root/t/lib/db-recno.t
diff options
context:
space:
mode:
authorPaul Marquess <paul.marquess@btinternet.com>2000-12-11 23:07:17 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-12-12 19:48:26 +0000
commit3245f0580c13b3ab105e59fb6c74519f9d8c8ef0 (patch)
treede2b1ccd02b733ca5a43ba53eb4e4737bff4ee42 /t/lib/db-recno.t
parent3601bd2ab5316cf7ceba3f53d5e81474fb7d9b12 (diff)
downloadperl-3245f0580c13b3ab105e59fb6c74519f9d8c8ef0.tar.gz
DB_File-1.74
Message-ID: <000001c063c7$1b9d28a0$a20a140a@bfs.phone.com> p4raw-id: //depot/perl@8094
Diffstat (limited to 't/lib/db-recno.t')
-rwxr-xr-xt/lib/db-recno.t34
1 files changed, 31 insertions, 3 deletions
diff --git a/t/lib/db-recno.t b/t/lib/db-recno.t
index f932a8938c..8b5a88cc6d 100755
--- a/t/lib/db-recno.t
+++ b/t/lib/db-recno.t
@@ -12,6 +12,7 @@ BEGIN {
use DB_File;
use Fcntl;
use strict ;
+use warnings;
use vars qw($dbh $Dfile $bad_ones $FA) ;
# full tied array support started in Perl 5.004_57
@@ -99,7 +100,7 @@ sub bad_one
EOM
}
-print "1..127\n";
+print "1..128\n";
my $Dfile = "recno.tmp";
unlink $Dfile ;
@@ -340,6 +341,7 @@ unlink $Dfile;
package Another ;
+ use warnings ;
use strict ;
open(FILE, ">SubDB.pm") or die "Cannot open SubDB.pm: $!\n" ;
@@ -347,6 +349,7 @@ unlink $Dfile;
package SubDB ;
+ use warnings ;
use strict ;
use vars qw( @ISA @EXPORT) ;
@@ -487,6 +490,7 @@ EOM
{
# DBM Filter tests
+ use warnings ;
use strict ;
my (@h, $db) ;
my ($fetch_key, $store_key, $fetch_value, $store_value) = ("") x 4 ;
@@ -593,6 +597,7 @@ EOM
{
# DBM Filter with a closure
+ use warnings ;
use strict ;
my (@h, $db) ;
@@ -655,6 +660,7 @@ EOM
{
# DBM Filter recursion detection
+ use warnings ;
use strict ;
my (@h, $db) ;
unlink $Dfile;
@@ -679,6 +685,7 @@ EOM
{
my $redirect = new Redirect $file ;
+ use warnings FATAL => qw(all);
use strict ;
use DB_File ;
@@ -734,6 +741,7 @@ EOM
{
my $redirect = new Redirect $save_output ;
+ use warnings FATAL => qw(all);
use strict ;
use vars qw(@h $H $file $i) ;
use DB_File ;
@@ -850,11 +858,31 @@ EOM
my $a = "";
local $SIG{__WARN__} = sub {$a = $_[0]} ;
- tie @h, 'DB_File', $Dfile, O_RDWR|O_CREAT, 0664, $DB_RECNO
+ tie @h, 'DB_File', $Dfile, O_RDWR|O_CREAT, 0664, $DB_RECNO
or die "Can't open file: $!\n" ;
$h[0] = undef;
ok(127, $a eq "") ;
- untie @h;
+ untie @h ;
+ unlink $Dfile;
+}
+
+{
+ # test that %hash = () doesn't produce the warning
+ # Argument "" isn't numeric in entersub
+ use warnings ;
+ use strict ;
+ use DB_File ;
+ my $a = "";
+ local $SIG{__WARN__} = sub {$a = $_[0]} ;
+
+ unlink $Dfile;
+ my @h ;
+
+ tie @h, 'DB_File', $Dfile, O_RDWR|O_CREAT, 0664, $DB_RECNO
+ or die "Can't open file: $!\n" ;
+ @h = (); ;
+ ok(128, $a eq "") ;
+ untie @h ;
unlink $Dfile;
}