Commits

Toby Inkster committed 55ccc18 Draft

100% code coverage for test suite (according to Devel::Cover)

Comments (0)

Files changed (2)

lib/Exporter/Everything.pm

 	my $import = "$caller\::import";
 	my $exporter;
 	*$import = subname $import, sub {
-		$exporter ||= Exporter::Everything::build_exporter($caller);
+		$exporter = build_exporter($caller) unless $exporter;
 		goto $exporter;
 	}
 }
 	my $subs   = Package::Stash::->new($caller)->get_all_symbols('CODE');
 	
 	my %R;
-	for (keys %$subs)
+	for (sort keys %$subs)
 	{
 		if (/^_build_(.+)$/) {
-			$R{$1} ||= $subs->{$_};
+			$R{$1} = $subs->{$_};
 		}
 		elsif (lc $_ eq 'import') {
 			# no
 
 sub build_exporter
 {
-	my %subs  = exportable_subs( @_ ? $_[0] : caller );
+	my $for_package = @_ ? $_[0] : caller;	
+	my %subs = exportable_subs($for_package);
 	
 	return Sub::Exporter::build_exporter({
 		exports    => [ %subs ],
 BEGIN {
 	package Local::Exporter;
 	use Exporter::Everything;
+	sub _a { 42 }; sub _build__a { return \&_a };
 	sub _build_foo {
 		my ($class, $name, $arg) = @_;
 		return sub { $arg->{'foobar'} || 'FOOBAR' };