summaryrefslogtreecommitdiff
path: root/dist/Exporter
diff options
context:
space:
mode:
authorDagfinn Ilmari Mannsåker <ilmari@ilmari.org>2019-06-26 17:56:06 +0100
committerDagfinn Ilmari Mannsåker <ilmari@ilmari.org>2019-06-26 18:01:08 +0100
commitcae2b4cb147cde9e8200c3c1eb888e83824ee275 (patch)
treef4dbc0dcaf8a271fb63bae4e400334629d2ec3db /dist/Exporter
parent0bf4efd7a7452f08b16f083f741efdc2784a764f (diff)
downloadperl-cae2b4cb147cde9e8200c3c1eb888e83824ee275.tar.gz
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).
Diffstat (limited to 'dist/Exporter')
-rw-r--r--dist/Exporter/lib/Exporter.pm2
-rw-r--r--dist/Exporter/lib/Exporter/Heavy.pm4
-rw-r--r--dist/Exporter/t/Exporter.t12
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));