X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fop%2Fchop.t;h=77263ad3ad191693035f2a7117f5eee1be9ffde2;hb=0f5d15d614a56a8b655f35e4e8c6a0dba34da106;hp=3516c2d18ccf246af6e989425311e68dcb7b6ee4;hpb=a0d0e21ea6ea90a22318550944fe6cb09ae10cda;p=p5sagit%2Fp5-mst-13.2.git diff --git a/t/op/chop.t b/t/op/chop.t index 3516c2d..77263ad 100755 --- a/t/op/chop.t +++ b/t/op/chop.t @@ -2,7 +2,7 @@ # $RCSfile: chop.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:40 $ -print "1..22\n"; +print "1..28\n"; # optimized @@ -70,3 +70,18 @@ $_ = "f"; $/ = ""; print chomp() == 0 ? "ok 21\n" : "not ok 21\n"; print $_ eq "f" ? "ok 22\n" : "not ok 22\n"; + +$_ = "xx"; +$/ = "xx"; +print chomp() == 2 ? "ok 23\n" : "not ok 23\n"; +print $_ eq "" ? "ok 24\n" : "not ok 24\n"; + +$_ = "axx"; +$/ = "xx"; +print chomp() == 2 ? "ok 25\n" : "not ok 25\n"; +print $_ eq "a" ? "ok 26\n" : "not ok 26\n"; + +$_ = "axx"; +$/ = "yy"; +print chomp() == 0 ? "ok 27\n" : "not ok 27\n"; +print $_ eq "axx" ? "ok 28\n" : "not ok 28\n";