summaryrefslogtreecommitdiff
path: root/t/op/pat.t
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avar@cpan.org>2007-04-09 22:02:42 +0000
committerSteve Peters <steve@fisharerojo.org>2007-04-10 02:53:34 +0000
commit3914f56082a0817d46ec5706e82e48b4e4e19f9d (patch)
tree7e73f292973bb3287dfd73bb1460de961f2fb427 /t/op/pat.t
parent9bc340e7075cf676a06e1e977596de553dbf79fb (diff)
downloadperl-3914f56082a0817d46ec5706e82e48b4e4e19f9d.tar.gz
Re: [PATCH] length() on magic capture variables
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com> Message-ID: <51dd1af80704091502m19130c28y29e6e656516fabfd@mail.gmail.com> p4raw-id: //depot/perl@30881
Diffstat (limited to 't/op/pat.t')
-rwxr-xr-xt/op/pat.t14
1 files changed, 13 insertions, 1 deletions
diff --git a/t/op/pat.t b/t/op/pat.t
index 6d3cafd62d..5512b2b17d 100755
--- a/t/op/pat.t
+++ b/t/op/pat.t
@@ -4411,11 +4411,23 @@ ok($@=~/\QSequence \k... not terminated in regex;\E/);
iseq( (join ",", sort map "@$_", values %-), ",a" );
}
+# length() on captures, these end up in Perl_magic_len
+{
+ my $_ = "aoeu \xe6var ook";
+ /^ \w+ \s (?<eek>\S+)/x;
+
+ iseq( length($`), 4, 'length $`' );
+ iseq( length($'), 4, q[length $'] );
+ iseq( length($&), 9, 'length $&' );
+ iseq( length($1), 4, 'length $1' );
+ iseq( length($+{eek}), 4, 'length $+{eek} == length $1' );
+}
+
# Put new tests above the dotted line about a page above this comment
iseq(0+$::test,$::TestCount,"Got the right number of tests!");
# Don't forget to update this!
BEGIN {
- $::TestCount = 1658;
+ $::TestCount = 1663;
print "1..$::TestCount\n";
}