[libmoo-perl] 05/43: quote package and sub names in Sub::Quote errors
gregor herrmann
gregoa at debian.org
Mon Dec 26 17:56:13 UTC 2016
This is an automated email from the git hooks/post-receive script.
gregoa pushed a commit to branch master
in repository libmoo-perl.
commit 43273ffe30aa743a98bcb03fb830378bdca03af4
Author: Graham Knop <haarg at haarg.org>
Date: Fri Sep 9 16:46:52 2016 -0400
quote package and sub names in Sub::Quote errors
---
lib/Sub/Quote.pm | 4 ++--
t/sub-quote.t | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/Sub/Quote.pm b/lib/Sub/Quote.pm
index a78ae54..4a293fe 100644
--- a/lib/Sub/Quote.pm
+++ b/lib/Sub/Quote.pm
@@ -94,9 +94,9 @@ sub quote_sub {
my $subname = $name;
my $package = $subname =~ s/(.*)::// ? $1 : caller;
$name = join '::', $package, $subname;
- croak "package name $package too long!"
+ croak qq{package name "$package" too long!}
if length $package > 252;
- croak "sub name $subname too long!"
+ croak qq{sub name "$subname" too long!}
if length $subname > 252;
}
my @caller = caller(0);
diff --git a/t/sub-quote.t b/t/sub-quote.t
index 9ef5a48..9a07fc6 100644
--- a/t/sub-quote.t
+++ b/t/sub-quote.t
@@ -86,12 +86,12 @@ is exception {
like exception {
quote_sub "${long}${long}::${long}", q{ return 1; };
-}, qr/^package name $long$long too long/,
+}, qr/^package name "$long$long" too long/,
'over long package names error';
like exception {
quote_sub "${long}::${long}${long}", q{ return 1; };
-}, qr/^sub name $long$long too long/,
+}, qr/^sub name "$long$long" too long/,
'over long sub names error';
my $broken_quoted = quote_sub q{
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmoo-perl.git
More information about the Pkg-perl-cvs-commits
mailing list