Fix for bug id 19990615.008, pos() unset during s///ge.
[p5sagit/p5-mst-13.2.git] / t / op / pos.t
CommitLineData
02c45c47 1#!./perl
2
084916e3 3print "1..4\n";
02c45c47 4
5$x='banana';
6$x=~/.a/g;
7if (pos($x)==2) {print "ok 1\n"} else {print "not ok 1\n";}
8
9$x=~/.z/gc;
10if (pos($x)==2) {print "ok 2\n"} else {print "not ok 2\n";}
11
12sub f { my $p=$_[0]; return $p }
13
14$x=~/.a/g;
15if (f(pos($x))==4) {print "ok 3\n"} else {print "not ok 3\n";}
16
084916e3 17# Is pos() set inside //g? (bug id 19990615.008)
18$x = "test string?"; $x =~ s/\w/pos($x)/eg;
19print "not " unless $x eq "0123 5678910?";
20print "ok 4\n";
21
22
23