Ilia, I had added some tests to test the new binary safe behavior of strstr(), strchr(), strrchr(). They are in ext/standard/tests/strings/002.phpt But the more the better :))
Andrey ----- Original Message ----- From: "Ilia Alshanetsky" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, October 08, 2002 12:07 AM Subject: [PHP-CVS] cvs: php4 /ext/standard/tests/strings strpos.phpt strstr.phpt substr_count.phpt > iliaa Mon Oct 7 17:07:42 2002 EDT > > Added files: > /php4/ext/standard/tests/strings strstr.phpt strpos.phpt > substr_count.phpt > Log: > Added tests for strstr(), strpos() and substr_count() functions. > > > > Index: php4/ext/standard/tests/strings/strstr.phpt > +++ php4/ext/standard/tests/strings/strstr.phpt > --TEST-- > strstr() function > --POST-- > --GET-- > --FILE-- > <?php > var_dump(strstr("test string", "test")); > var_dump(strstr("test string", "string")); > var_dump(strstr("test string", "strin")); > var_dump(strstr("test string", "t s")); > var_dump(strstr("test string", "g")); > var_dump(md5(strstr("te".chr(0)."st", chr(0)))); > var_dump(strstr("tEst", "test")); > var_dump(strstr("teSt", "test")); > var_dump(@strstr("", "")); > var_dump(@strstr("a", "")); > var_dump(@strstr("", "a")); > var_dump(md5(@strstr("\\\\a\\", "\\a"))); > ?> > --EXPECT-- > string(11) "test string" > string(6) "string" > string(6) "string" > string(8) "t string" > string(1) "g" > string(32) "7272696018bdeb2c9a3f8d01fc2a9273" > bool(false) > bool(false) > bool(false) > bool(false) > bool(false) > string(32) "6ec19f52f0766c463f3bb240f4396913" > > Index: php4/ext/standard/tests/strings/strpos.phpt > +++ php4/ext/standard/tests/strings/strpos.phpt > --TEST-- > strpos() function > --POST-- > --GET-- > --FILE-- > <?php > var_dump(strpos("test string", "test")); > var_dump(strpos("test string", "string")); > var_dump(strpos("test string", "strin")); > var_dump(strpos("test string", "t s")); > var_dump(strpos("test string", "g")); > var_dump(strpos("te".chr(0)."st", chr(0))); > var_dump(strpos("tEst", "test")); > var_dump(strpos("teSt", "test")); > var_dump(@strpos("", "")); > var_dump(@strpos("a", "")); > var_dump(@strpos("", "a")); > var_dump(@strpos("\\\\a", "\\a")); > ?> > --EXPECT-- > int(0) > int(5) > int(5) > int(3) > int(10) > int(2) > bool(false) > bool(false) > bool(false) > bool(false) > bool(false) > int(1) > > Index: php4/ext/standard/tests/strings/substr_count.phpt > +++ php4/ext/standard/tests/strings/substr_count.phpt > --TEST-- > substr_count() function > --POST-- > --GET-- > --FILE-- > <?php > var_dump(@substr_count("", "")); > var_dump(@substr_count("a", "")); > var_dump(@substr_count("", "a")); > var_dump(@substr_count("", "a")); > var_dump(@substr_count("", chr(0))); > > $a = str_repeat("abcacba", 100); > var_dump(@substr_count($a, "bca")); > > $a = str_repeat("abcacbabca", 100); > var_dump(@substr_count($a, "bca")); > ?> > --EXPECT-- > bool(false) > bool(false) > int(0) > int(0) > int(0) > int(100) > int(200) > > > > -- > PHP CVS Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php