diff options
author | Nick Ing-Simmons <nik@tiuk.ti.com> | 1998-07-19 12:38:30 +0000 |
---|---|---|
committer | Nick Ing-Simmons <nik@tiuk.ti.com> | 1998-07-19 12:38:30 +0000 |
commit | dceca5ce5559314ce26684c74b3a02f61015492c (patch) | |
tree | 676ab2ce1d7c4e738906552a4d6c4f71645f7d16 /t | |
parent | 15b6a22a03c78fa80bf8e9675c0fde098d83cee8 (diff) | |
parent | 2909fa0e2236c057a14e92ab228e041ad03cd60c (diff) | |
download | perl-dceca5ce5559314ce26684c74b3a02f61015492c.tar.gz |
Merge Mainline
p4raw-id: //depot/ansiperl@1566
Diffstat (limited to 't')
-rwxr-xr-x | t/comp/multiline.t | 8 | ||||
-rwxr-xr-x | t/op/pat.t | 27 | ||||
-rwxr-xr-x | t/op/subst.t | 6 |
3 files changed, 35 insertions, 6 deletions
diff --git a/t/comp/multiline.t b/t/comp/multiline.t index fc1eedc8d2..ed418b84fc 100755 --- a/t/comp/multiline.t +++ b/t/comp/multiline.t @@ -9,11 +9,15 @@ open(try,'>Comp.try') || (die "Can't open temp file."); $x = 'now is the time for all good men to come to. + + +! + '; $y = 'now is the time' . "\n" . 'for all good men' . "\n" . -'to come to.' . "\n"; +'to come to.' . "\n\n\n!\n\n"; if ($x eq $y) {print "ok 1\n";} else {print "not ok 1\n";} @@ -30,7 +34,7 @@ while (<try>) { if ($z eq $y) {print "ok 2\n";} else {print "not ok 2\n";} -if ($count == 3) {print "ok 3\n";} else {print "not ok 3\n";} +if ($count == 7) {print "ok 3\n";} else {print "not ok 3\n";} $_ = ($^O eq 'MSWin32') ? `type Comp.try` : `cat Comp.try`; diff --git a/t/op/pat.t b/t/op/pat.t index cbd5f89ead..ef014f2562 100755 --- a/t/op/pat.t +++ b/t/op/pat.t @@ -4,9 +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. -# $RCSfile: pat.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:12 $ - -print "1..135\n"; +print "1..139\n"; BEGIN { chdir 't' if -d 't'; @@ -560,3 +558,26 @@ my $for_future = make_must_warn('reserved for future extensions'); &$for_future('q(a:[b]:) =~ /[x[:foo:]]/'); &$for_future('q(a=[b]=) =~ /[x[=foo=]]/'); &$for_future('q(a.[b].) =~ /[x[.foo.]]/'); + +# test if failure of patterns returns empty list +$_ = 'aaa'; +@_ = /bbb/; +print "not " if @_; +print "ok $test\n"; +$test++; + +@_ = /bbb/g; +print "not " if @_; +print "ok $test\n"; +$test++; + +@_ = /(bbb)/; +print "not " if @_; +print "ok $test\n"; +$test++; + +@_ = /(bbb)/g; +print "not " if @_; +print "ok $test\n"; +$test++; + diff --git a/t/op/subst.t b/t/op/subst.t index 57a956dda6..2d42eeb386 100755 --- a/t/op/subst.t +++ b/t/op/subst.t @@ -6,7 +6,7 @@ BEGIN { @INC = '../lib' if -d '../lib'; } -print "1..70\n"; +print "1..71\n"; $x = 'foo'; $_ = "x"; @@ -302,3 +302,7 @@ s{ \d+ \b [,.;]? (?{ 'digits' }) }{$^R}xg; print ($_ eq $foo ? "ok 70\n" : "not ok 70\n#'$_'\n#'$foo'\n"); +$_ = 'x' x 20; +s/\d*|x/<$&>/g; +$foo = '<>' . ('<x><>' x 20) ; +print ($_ eq $foo ? "ok 71\n" : "not ok 71\n#'$_'\n#'$foo'\n"); |