projects
/
perl
/
modules
/
Test-Leaner.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
| inline |
side by side
(parent:
a615878
)
Handle all-negated imports properly
author
Vincent Pit <vince@profvince.com>
Fri, 8 Apr 2011 18:22:52 +0000 (20:22 +0200)
committer
Vincent Pit <vince@profvince.com>
Fri, 8 Apr 2011 18:23:00 +0000 (20:23 +0200)
In particular, make sure stubs are imported with old versions of
Test::More.
lib/Test/Leaner.pm
patch
|
blob
|
history
diff --git
a/lib/Test/Leaner.pm
b/lib/Test/Leaner.pm
index f43be92145f520bd3ea16c3251c2c161d0d352e7..344d10dbafd74144535d839dcd3e3c39632a1018 100644
(file)
--- a/
lib/Test/Leaner.pm
+++ b/
lib/Test/Leaner.pm
@@
-185,7
+185,13
@@
if ($ENV{PERL_TEST_LEANER_USES_TEST_MORE}) {
my $class = shift;
my @imports = &_handle_import_args;
- @imports = @EXPORT unless @imports;
+ if (@imports == grep /^!/, @imports) {
+ # All imports are negated, or @imports is empty
+ my %negated;
+ /^!(.*)/ and ++$negated{$1} for @imports;
+ push @imports, grep !$negated{$_}, @EXPORT;
+ }
+
my @test_more_imports;
for (@imports) {
if ($stubbed{$_}) {