Subject: | [PATCH] Test failure with perl 5.12 |
Date: | Sat, 08 May 2010 02:18:48 +0900 |
To: | bug-DBM-Deep [...] rt.cpan.org |
From: | Ansgar Burchardt <ansgar [...] 43-1.org> |
Hi,
the tests fail with perl 5.12 [1] due to a new warning:
t/01_basic.t .................... ok
Use of uninitialized value $_ in lc at /build/niko-libdbm-deep-perl_1.0022-1-i386-4RBZoH/libdbm-deep-perl-
1.0022/blib/lib/DBM/Deep/Storage/DBI.pm line 60.
# Tests were run but no plan was declared and done_testing() was not seen.
t/02_hash.t .....................
Dubious, test returned 255 (wstat 65280, 0xff00)
All 50 subtests passed
[...]
Note that we use TEST_SQLITE=1 to enable the additional tests.
I prepared a small patch to avoid this warning. DBM::Deep passes the
test suite with perl 5.10.1 and 5.12 on Debian with this patch.
Please consider applying it for the next release.
Regards,
Ansgar
[1] <http://bugs.debian.org/580189>
From: Ansgar Burchardt <ansgar@43-1.org>
Date: Sat, 08 May 2010 01:44:05 +0900
Bug-Debian: http://bugs.debian.org/580189
Subject: Fix build with perl 5.12
This fixes the following warnings:
Use of uninitialized value $_ in lc at .../lib/DBM/Deep/Storage/DBI.pm line 60.
--- libdbm-deep-perl.orig/lib/DBM/Deep/Storage/DBI.pm
+++ libdbm-deep-perl/lib/DBM/Deep/Storage/DBI.pm
@@ -57,7 +57,7 @@
) or die $DBI::error;
# Should we use the same method as done in new() if passed a $dbh?
- (undef, $self->{driver}) = map lc, DBI->parse_dsn( $self->{dbi}{dsn} );
+ (undef, $self->{driver}) = map defined($_) ? lc($_) : undef, DBI->parse_dsn( $self->{dbi}{dsn} );
return 1;
}