diff options
author | Ilya Zakharevich <ilya@math.berkeley.edu> | 1998-06-09 23:51:47 -0400 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-06-11 06:45:52 +0000 |
commit | ce862d02de7e5d8ac2078735cf4bd004193e837d (patch) | |
tree | d4854f3cbeed1218899e244256dcaa2fd801b7b5 /t/op/subst.t | |
parent | d17537aab689bff5dd6b2e2650edc82102b86270 (diff) | |
download | perl-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/subst.t')
-rwxr-xr-x | t/op/subst.t | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/t/op/subst.t b/t/op/subst.t index 248aa71b9d..92a848fe80 100755 --- a/t/op/subst.t +++ b/t/op/subst.t @@ -2,7 +2,7 @@ # $RCSfile: s.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:22 $ -print "1..69\n"; +print "1..70\n"; $x = 'foo'; $_ = "x"; @@ -270,3 +270,31 @@ print $_ eq "bbcbb" ? "ok 68\n" : "not ok 68 # `$_' ne `bbcbb'\n"; # XXX TODO: Most tests above don't test return values of the ops. They should. $_ = "ab"; print (s/a/b/ == 1 ? "ok 69\n" : "not ok 69\n"); + +$_ = <<'EOL'; + $url = new URI::URL "http://www/"; die if $url eq "xXx"; +EOL +$^R = 'junk'; + +$foo = ' $@%#lowercase $@%# lowercase UPPERCASE$@%#UPPERCASE' . + ' $@%#lowercase$@%#lowercase$@%# lowercase lowercase $@%#lowercase' . + ' lowercase $@%#MiXeD$@%# '; + +s{ \d+ \b [,.;]? (?{ 'digits' }) + | + [a-z]+ \b [,.;]? (?{ 'lowercase' }) + | + [A-Z]+ \b [,.;]? (?{ 'UPPERCASE' }) + | + [A-Z] [a-z]+ \b [,.;]? (?{ 'Capitalized' }) + | + [A-Za-z]+ \b [,.;]? (?{ 'MiXeD' }) + | + [A-Za-z0-9]+ \b [,.;]? (?{ 'alphanumeric' }) + | + \s+ (?{ ' ' }) + | + [^A-Za-z0-9\s]+ (?{ '$@%#' }) +}{$^R}xg; +print ($_ eq $foo ? "ok 70\n" : "not ok 70\n#'$_'\n#'$foo'\n"); + |