summaryrefslogtreecommitdiff
path: root/t/op/pat.t
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.berkeley.edu>1998-06-09 23:51:47 -0400
committerGurusamy Sarathy <gsar@cpan.org>1998-06-11 06:45:52 +0000
commitce862d02de7e5d8ac2078735cf4bd004193e837d (patch)
treed4854f3cbeed1218899e244256dcaa2fd801b7b5 /t/op/pat.t
parentd17537aab689bff5dd6b2e2650edc82102b86270 (diff)
downloadperl-ce862d02de7e5d8ac2078735cf4bd004193e837d.tar.gz
Bugs with (?{}), $^R and many-to-many subst
Message-Id: <199806100751.DAA05441@monk.mps.ohio-state.edu> p4raw-id: //depot/perl@1117
Diffstat (limited to 't/op/pat.t')
-rwxr-xr-xt/op/pat.t20
1 files changed, 19 insertions, 1 deletions
diff --git a/t/op/pat.t b/t/op/pat.t
index e6b90158f9..5516ce595c 100755
--- a/t/op/pat.t
+++ b/t/op/pat.t
@@ -2,7 +2,7 @@
# $RCSfile: pat.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:12 $
-print "1..104\n";
+print "1..107\n";
$x = "abc\ndef\n";
@@ -355,6 +355,24 @@ print "not " unless f(pos($x)) == 4;
print "ok $test\n";
$test++;
+$x = $^R = 67;
+'foot' =~ /foo(?{$x = 12; 75})[t]/;
+print "not " unless $^R eq '75';
+print "ok $test\n";
+$test++;
+
+$x = $^R = 67;
+'foot' =~ /foo(?{$x = 12; 75})[xy]/;
+print "not " unless $^R eq '67' and $x eq '12';
+print "ok $test\n";
+$test++;
+
+$x = $^R = 67;
+'foot' =~ /foo(?{ $^R + 12 })((?{ $x = 12; $^R + 17 })[xy])?/;
+print "not " unless $^R eq '79' and $x eq '12';
+print "ok $test\n";
+$test++;
+
sub must_warn_pat {
my $warn_pat = shift;
return sub { print "not " unless $_[0] =~ /$warn_pat/ }