summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.berkeley.edu>1998-11-25 18:33:45 -0500
committerGurusamy Sarathy <gsar@cpan.org>1998-11-28 18:35:35 +0000
commit22e551b9ed23de1d5af9977d67389142f4d41cc5 (patch)
tree076d061e252db2b367185a92e907bc710c9bee7d /t
parentf2ac83ee9b0351aafadde538d84d97d64ef7e570 (diff)
downloadperl-22e551b9ed23de1d5af9977d67389142f4d41cc5.tar.gz
Fix \G in REx without //g
Message-Id: <199811260433.XAA29281@monk.mps.ohio-state.edu> p4raw-id: //depot/perl@2365
Diffstat (limited to 't')
-rwxr-xr-xt/op/pat.t29
1 files changed, 28 insertions, 1 deletions
diff --git a/t/op/pat.t b/t/op/pat.t
index cea2267f08..12b939708a 100755
--- a/t/op/pat.t
+++ b/t/op/pat.t
@@ -4,7 +4,7 @@
# the format supported by op/regexp.t. If you want to add a test
# that does fit that format, add it to op/re_tests, not here.
-print "1..162\n";
+print "1..168\n";
BEGIN {
chdir 't' if -d 't';
@@ -692,6 +692,33 @@ print "not "
print "ok $test\n";
$test++;
+$str = 'abcde';
+pos $str = 2;
+
+print "not " if $str =~ /^\G/;
+print "ok $test\n";
+$test++;
+
+print "not " if $str =~ /^.\G/;
+print "ok $test\n";
+$test++;
+
+print "not " unless $str =~ /^..\G/;
+print "ok $test\n";
+$test++;
+
+print "not " if $str =~ /^...\G/;
+print "ok $test\n";
+$test++;
+
+print "not " unless $str =~ /.\G./ and $& eq 'bc';
+print "ok $test\n";
+$test++;
+
+print "not " unless $str =~ /\G../ and $& eq 'cd';
+print "ok $test\n";
+$test++;
+
# see if matching against temporaries (created via pp_helem()) is safe
{ foo => "ok $test\n".$^X }->{foo} =~ /^(.*)\n/g;
print "$1\n";