From: Jarkko Hietaniemi Date: Thu, 16 Aug 2001 00:20:40 +0000 (+0000) Subject: Add Unicode tests for index/rindex. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4f5934513d9d00d273f4c179b77b3845e83bf927;p=p5sagit%2Fp5-mst-13.2.git Add Unicode tests for index/rindex. p4raw-id: //depot/perl@11686 --- diff --git a/t/op/index.t b/t/op/index.t index 0b08f08..748855a 100755 --- a/t/op/index.t +++ b/t/op/index.t @@ -2,8 +2,7 @@ # $RCSfile: index.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:59 $ -print "1..20\n"; - +print "1..24\n"; $foo = 'Now is the time for all good men to come to the aid of their country.'; @@ -40,3 +39,11 @@ print rindex("ababa","a",2) == 2 ? "ok 17\n" : "not ok 17\n"; print rindex("ababa","a",3) == 2 ? "ok 18\n" : "not ok 18\n"; print rindex("ababa","a",4) == 4 ? "ok 19\n" : "not ok 19\n"; print rindex("ababa","a",5) == 4 ? "ok 20\n" : "not ok 20\n"; + +$a = "foo \x{1234}bar"; + +print index($a, "\x{1234}") == 4 ? "ok 21\n" : "not ok 21\n"; +print index($a, "bar", ) == 5 ? "ok 22\n" : "not ok 22\n"; + +print rindex($a, "\x{1234}") == 4 ? "ok 23\n" : "not ok 23\n"; +print rindex($a, "foo", ) == 0 ? "ok 24\n" : "not ok 24\n";