summaryrefslogtreecommitdiff
path: root/t/comp
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-05-26 06:00:01 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-06-07 08:18:53 -0700
commit6954f42f948dcf1dba2014aa06dd5c33b7561992 (patch)
treeae3709c7181f41b050a51cd1f510ab5b9556ac6e /t/comp
parentbf3d870f8b8accd379ab520c1ff1daa10317d27d (diff)
downloadperl-6954f42f948dcf1dba2014aa06dd5c33b7561992.tar.gz
Make prototype call FETCH before checking CORE:: prefix
$ perl5.16.0 -e '"CORE::length" =~ /(.*)/; warn prototype $1;' Warning: something's wrong at -e line 1. $ perl5.16.0 -e 'warn prototype "CORE::length"' _ at -e line 1. Since sv_2cv calls get-magic, the easiest solution is to copy the argument if it is magical.
Diffstat (limited to 't/comp')
-rw-r--r--t/comp/proto.t10
1 files changed, 8 insertions, 2 deletions
diff --git a/t/comp/proto.t b/t/comp/proto.t
index 8e9821f1b5..d5e4d5bb22 100644
--- a/t/comp/proto.t
+++ b/t/comp/proto.t
@@ -18,7 +18,7 @@ BEGIN {
# strict
use strict;
-print "1..179\n";
+print "1..180\n";
my $i = 1;
@@ -409,7 +409,7 @@ print "ok ", $i++, "\n";
print "# CORE::open => ($p)\nnot " if ($p = prototype('CORE::open')) ne '*;$@';
print "ok ", $i++, "\n";
-print "# CORE:Foo => ($p), \$@ => '$@'\nnot "
+print "# CORE::Foo => ($p), \$@ => '$@'\nnot "
if defined ($p = eval { prototype('CORE::Foo') or 1 }) or $@ !~ /^Can't find an opnumber/;
print "ok ", $i++, "\n";
@@ -423,6 +423,12 @@ print "# CORE::\\x{100}: => ($p), \$@ => '$@'\nnot "
if $@ !~ /^Can't find an opnumber for "\x{100}"/;
print "ok ", $i++, "\n";
+"CORE::Foo" =~ /(.*)/;
+print "# \$1 containing CORE::Foo => ($p), \$@ => '$@'\nnot "
+ if defined ($p = eval { prototype($1) or 1 })
+ or $@ !~ /^Can't find an opnumber/;
+print "ok ", $i++, " - \$1 containing CORE::Foo\n";
+
# correctly note too-short parameter lists that don't end with '$',
# a possible regression.