Subject: | [PATCH] Allow any *DBM_File to work for IO::All testing |
The test suite for IO::All is hard-coded to use SDBM_File, and hence
fails if SDBM_File is not built. That attached patch lets testing
proceed by using any *DBM_File (or DB_File) that is found.
Subject: | io_all_dbm.patch |
--- t/dbm.t.orig 2007-04-04 10:20:18.000000000 -0400
+++ t/dbm.t 2007-04-04 10:25:36.000000000 -0400
@@ -1,11 +1,26 @@
use lib 't', 'lib';
use strict;
use warnings;
-use Test::More tests => 2;
+
+my $db_file;
+BEGIN {
+ use Config;
+ foreach (qw/SDBM_File GDBM_File ODBM_File NDBM_File DB_File/) {
+ if ($Config{extensions} =~ /\b$_\b/) {
+ $db_file = $_;
+ last;
+ }
+ }
+}
+
+use Test::More defined($db_file)
+ ? (tests => 2)
+ : (skip_all => 'No DMB modules available');
+
use IO::All;
use IO_All_Test;
-my $db = io('t/output/mydbm')->dbm('SDBM_File');
+my $db = io('t/output/mydbm')->dbm($db_file);
$db->{fortytwo} = 42;
$db->{foo} = 'bar';