In perl.git, the branch blead has been updated <https://perl5.git.perl.org/perl.git/commitdiff/cae2b4cb147cde9e8200c3c1eb888e83824ee275?hp=0bf4efd7a7452f08b16f083f741efdc2784a764f>
- Log ----------------------------------------------------------------- commit cae2b4cb147cde9e8200c3c1eb888e83824ee275 Author: Dagfinn Ilmari Mannsåker <[email protected]> Date: Wed Jun 26 17:56:06 2019 +0100 Fix leading spaces in Exporter error message The second and subsequent lines when trying to import non-existent items had a leading space (or whatever $" happened to be). ----------------------------------------------------------------------- Summary of changes: dist/Exporter/lib/Exporter.pm | 2 +- dist/Exporter/lib/Exporter/Heavy.pm | 4 ++-- dist/Exporter/t/Exporter.t | 12 ++++++++++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/dist/Exporter/lib/Exporter.pm b/dist/Exporter/lib/Exporter.pm index 0e8775db25..19d7645ac5 100644 --- a/dist/Exporter/lib/Exporter.pm +++ b/dist/Exporter/lib/Exporter.pm @@ -9,7 +9,7 @@ require 5.006; our $Debug = 0; our $ExportLevel = 0; our $Verbose ||= 0; -our $VERSION = '5.73'; +our $VERSION = '5.74'; our (%Cache); sub as_heavy { diff --git a/dist/Exporter/lib/Exporter/Heavy.pm b/dist/Exporter/lib/Exporter/Heavy.pm index 21b67c18c4..004815ea47 100644 --- a/dist/Exporter/lib/Exporter/Heavy.pm +++ b/dist/Exporter/lib/Exporter/Heavy.pm @@ -148,7 +148,7 @@ sub heavy_export { if (!$export_cache->{$sym}) { # accumulate the non-exports push @carp, - qq["$sym" is not exported by the $pkg module\n]; + qq["$sym" is not exported by the $pkg module]; $oops++; } } @@ -156,7 +156,7 @@ sub heavy_export { } if ($oops) { require Carp; - Carp::croak("@{carp}Can't continue after import errors"); + Carp::croak(join("\n", @carp, "Can't continue after import errors")); } } else { diff --git a/dist/Exporter/t/Exporter.t b/dist/Exporter/t/Exporter.t index d6ac63f2e3..0119975141 100644 --- a/dist/Exporter/t/Exporter.t +++ b/dist/Exporter/t/Exporter.t @@ -18,7 +18,7 @@ sub ok ($;$) { BEGIN { $test = 1; - print "1..31\n"; + print "1..33\n"; require Exporter; ok( 1, 'Exporter compiled' ); } @@ -117,7 +117,6 @@ Testing->import(@imports); @imports), 'import by symbols' ); - package Yar; my @tags = qw(:This :tray); Testing->import(@tags); @@ -128,6 +127,15 @@ Testing->import(@tags); @{$Testing::EXPORT_TAGS{@tags}}), 'import by tags' ); +package Err; +my @missing = qw(first second); +eval { Testing->import(@missing) }; +my $err = $@; + +for my $func (@missing) { + ::ok( $@ =~ /^"$func" is not exported by the Testing module$/m, + "$func is not exported error message" ); +} package Arrr; Testing->import(qw(!lifejacket)); -- Perl5 Master Repository
