From: Ilya Zakharevich Date: Fri, 26 Jun 1998 21:09:02 +0000 (-0400) Subject: pat.t tests X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=09f25ae45ab0f96a5d70b190df74b68dfb600067;p=p5sagit%2Fp5-mst-13.2.git pat.t tests Message-Id: <199806270109.VAA14907@monk.mps.ohio-state.edu> p4raw-id: //depot/perl@1246 --- diff --git a/t/op/pat.t b/t/op/pat.t index 4c4bd9e..fecdf0c 100755 --- a/t/op/pat.t +++ b/t/op/pat.t @@ -6,7 +6,7 @@ # $RCSfile: pat.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:12 $ -print "1..120\n"; +print "1..123\n"; chdir 't' if -d 't'; @INC = "../lib"; @@ -450,6 +450,22 @@ foreach $ans ('', 'a', '') { $test++; } +sub prefixify { + my($v,$a,$b,$res) = @_; + $v =~ s/\Q$a\E/$b/; + print "not " unless $res eq $v; + print "ok $test\n"; + $test++; +} +prefixify('/a/b/lib/arch', "/a/b/lib", 'X/lib', 'X/lib/arch'); +prefixify('/a/b/man/arch', "/a/b/man", 'X/man', 'X/man/arch'); + +$_ = 'var="foo"'; +/(\")/; +print "not " unless $1 and /$1/; +print "ok $test\n"; +$test++; + sub must_warn_pat { my $warn_pat = shift; return sub { print "not " unless $_[0] =~ /$warn_pat/ }