summaryrefslogtreecommitdiff
path: root/t/op/magic.t
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2013-08-29 10:47:31 +0200
committerNicholas Clark <nick@ccl4.org>2013-08-29 10:51:18 +0200
commit66230c862b0c3d1a8bbb014cc747d938d0e90149 (patch)
tree6ff8d3370898ab929ea2e565cbaae959467672a7 /t/op/magic.t
parentb8f07b9f533b110a924514a9e3dd9017a224fd36 (diff)
downloadperl-66230c862b0c3d1a8bbb014cc747d938d0e90149.tar.gz
${^MPEN} had been treated as a synonym of ${^MATCH} due to a missing break;
A missing break; in Perl_gv_fetchpvn_flags() meant that the variable ${^MPEN} had been behaving as a synonym of ${^MATCH}. Adding the break makes ${^MPEN} behave like all other unused multi-character control character variable.
Diffstat (limited to 't/op/magic.t')
-rw-r--r--t/op/magic.t9
1 files changed, 8 insertions, 1 deletions
diff --git a/t/op/magic.t b/t/op/magic.t
index 7a929d0f9a..2ad591a8ad 100644
--- a/t/op/magic.t
+++ b/t/op/magic.t
@@ -5,7 +5,7 @@ BEGIN {
chdir 't' if -d 't';
@INC = '../lib';
require './test.pl';
- plan (tests => 180);
+ plan (tests => 184);
}
# Test that defined() returns true for magic variables created on the fly,
@@ -646,6 +646,13 @@ eval '
1' or die $@;
is $stuff[0], $stuff[1], '$^H modifies ${^OPEN} consistently';
+# Tests for some non-magic names:
+is ${^MPE}, undef, '${^MPE} starts undefined';
+is ++${^MPE}, 1, '${^MPE} can be incremented';
+
+# This one used to fail due to a missing break;
+is ${^MPEN}, undef, '${^MPEN} starts undefined';
+is ++${^MPEN}, 1, '${^MPEN} can be incremented';
# ^^^^^^^^^ New tests go here ^^^^^^^^^