From: Leon Timmermans Date: Mon, 27 Aug 2012 11:11:04 +0000 (+0200) Subject: Handle ':all' correctly X-Git-Tag: v0.001006~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=707baf12f7564c0b85c1d185fb4697246cb4d56d;p=p5sagit%2FSub-Exporter-Progressive.git Handle ':all' correctly Not sure this ever worked correctly in the first place --- diff --git a/Changes b/Changes index 7a590da..c9a9a9c 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,5 @@ + - Handle ':all' correctly + 0.001005 - 2012-08-25 - Add support for tags - Warn if defaults are not in exports diff --git a/lib/Sub/Exporter/Progressive.pm b/lib/Sub/Exporter/Progressive.pm index c8b61e6..06fc082 100644 --- a/lib/Sub/Exporter/Progressive.pm +++ b/lib/Sub/Exporter/Progressive.pm @@ -77,7 +77,8 @@ sub sub_export_options { last OPTIONS } } - @{$_} = map { $_ eq '-all' ? @exports : $_ } @{$_} for \@defaults, values %tags; + @{$_} = map { / \A [:-] all \z /x ? @exports : $_ } @{$_} for \@defaults, values %tags; + $tags{all} ||= [ @exports ]; my @errors = grep { my $default = $_; !grep { $default eq $_ } @exports } @defaults; die join(', ', @errors) . " is not exported by the $inner_target module\n" if @errors; } diff --git a/t/all.t b/t/all.t index 2421633..fda725b 100644 --- a/t/all.t +++ b/t/all.t @@ -11,4 +11,12 @@ ok(main->can('junk1'), 'sub exported'); ok(main->can('junk2'), 'sub exported'); ok(! $INC{'Sub/Exporter.pm'}, 'Sub::Exporter not loaded'); +package Other; +use Test::More; +use A::JunkAll ':all'; + +ok(main->can('junk1'), 'sub exported'); +ok(main->can('junk2'), 'sub exported'); +ok(! $INC{'Sub/Exporter.pm'}, 'Sub::Exporter not loaded'); + done_testing;