To: | The Perl5 Porters Mailing List <perl5-porters [...] perl.org>, mjd [...] cpan.org |
Subject: | [PATCH] Small test tweak for Memoize/t/error.t |
From: | Andreas J Koenig <andreas.koenig [...] anima.de> |
Date: | Fri, 15 Aug 2003 11:55:22 +0200 |
While working on the TEST script today I encountered an error in the
Memoize/t/error.t test just because I was in the wrong operating
system. As there are already provisions to protect the test against
changes in the OS, I thought we could carry that protection one step
further. The following patch allows the test script to fail if, e.g.
the DB_File.so cannot be loaded.
--- /home/src/perl/repoperls/perl-p-5.8.0@20717/lib/Memoize/t/errors.t 2002-07-12 21:56:19.000000000 +0200
+++ perl-p-5.8.0@20717/lib/Memoize/t/errors.t 2003-08-15 11:41:52.000000000 +0200
@@ -33,7 +33,8 @@
memoize(sub {}, LIST_CACHE => [HASH => \%cache ]);
};
print $@ =~ /can only store scalars/
- || $@ =~ /Can't locate.*in \@INC/ ? "ok $n\n" : "not ok $n # $@\n";
+ || $@ =~ /Can't locate.*in \@INC/
+ || $@ =~ /Can't load '.*?' for module/ ? "ok $n\n" : "not ok $n # $@\n";
1 while unlink $dummyfile, "$dummyfile.dir", "$dummyfile.pag", "$dummyfile.db";
$n++;
}
--
andreas