]> granicus.if.org Git - php/commitdiff
MFB / fix tests
authorArnaud Le Blanc <lbarnaud@php.net>
Sun, 14 Sep 2008 14:57:26 +0000 (14:57 +0000)
committerArnaud Le Blanc <lbarnaud@php.net>
Sun, 14 Sep 2008 14:57:26 +0000 (14:57 +0000)
ext/standard/tests/strings/stripos_variation1.phpt
ext/standard/tests/strings/stripos_variation11.phpt
ext/standard/tests/strings/stripos_variation12.phpt
ext/standard/tests/strings/stripos_variation2.phpt

index d96bcbed9497355ab3aedf51578bfc7277821032..7aeda4082c28f7500c68315e310eff40b33ff943 100644 (file)
@@ -7,10 +7,10 @@ Test stripos() function : usage variations - double quoted strings for 'haystack
  * Source code: ext/standard/string.c
 */
 
-/* Test stripos() function by passing double quoted strings to 'haystack' & 'needle' arguments */
+/* Test stripos() function by passing double quoted strings for 'haystack' & 'needle' arguments */
 
 echo "*** Testing stripos() function: with double quoted strings ***\n";
-$haystack = "Hello,\t\n\0\n  $&!#%\o,()*+-./:;<=>?@hello123456he \x234 \101";
+$haystack = "Hello,\t\n\0\n  $&!#%\o,()*+-./:;<=>?@hello123456he \x234 \101 ";
 $needle = array(
   //regular strings
   "l",
@@ -50,6 +50,7 @@ $needle = array(
   "()",
   "*+",
   "+",
+  "-",
   ".",
   ".;",
   ":;",
@@ -57,6 +58,8 @@ $needle = array(
   "<=>",
   ">",
   "=>",
+  "?",
+  "@",
   "@hEllo",
 
   "12345", //decimal numeric string
@@ -68,7 +71,7 @@ $needle = array(
   $haystack  //haystack as needle
 );
  
-/* loop through 'needle' array to get the position of the needle in haystack string */
+/* loop through to get the position of the needle in haystack string */
 $count = 1;
 for($index=0; $index<count($needle); $index++) {
   echo "-- Iteration $count --\n";
@@ -78,7 +81,7 @@ for($index=0; $index<count($needle); $index++) {
 }
 echo "*** Done ***";
 ?>
---EXPECT--
+--EXPECTF--
 *** Testing stripos() function: with double quoted strings ***
 -- Iteration 1 --
 int(2)
@@ -112,19 +115,19 @@ int(7)
 int(9)
 -- Iteration 11 --
 int(8)
-int(52)
+bool(false)
 -- Iteration 12 --
 int(8)
-int(52)
+bool(false)
 -- Iteration 13 --
 int(8)
-int(52)
+bool(false)
 -- Iteration 14 --
 int(8)
-int(52)
+bool(false)
 -- Iteration 15 --
 int(8)
-int(52)
+bool(false)
 -- Iteration 16 --
 bool(false)
 bool(false)
@@ -159,48 +162,57 @@ bool(false)
 int(23)
 bool(false)
 -- Iteration 27 --
-int(25)
+int(24)
 bool(false)
 -- Iteration 28 --
-bool(false)
+int(25)
 bool(false)
 -- Iteration 29 --
-int(27)
+bool(false)
 bool(false)
 -- Iteration 30 --
-int(28)
+int(27)
 bool(false)
 -- Iteration 31 --
-int(29)
+int(28)
 bool(false)
 -- Iteration 32 --
-int(31)
-int(31)
+int(29)
+bool(false)
 -- Iteration 33 --
-int(30)
+int(31)
 bool(false)
 -- Iteration 34 --
+int(30)
+bool(false)
+-- Iteration 35 --
+int(32)
+bool(false)
+-- Iteration 36 --
 int(33)
+bool(false)
+-- Iteration 37 --
 int(33)
--- Iteration 35 --
+bool(false)
+-- Iteration 38 --
 int(39)
 int(39)
--- Iteration 36 --
+-- Iteration 39 --
 int(15)
 int(48)
--- Iteration 37 --
+-- Iteration 40 --
 int(15)
 int(48)
--- Iteration 38 --
+-- Iteration 41 --
 int(51)
 int(51)
--- Iteration 39 --
+-- Iteration 42 --
 int(51)
 int(51)
--- Iteration 40 --
+-- Iteration 43 --
 bool(false)
 bool(false)
--- Iteration 41 --
+-- Iteration 44 --
 int(0)
 bool(false)
 *** Done ***
index 92aaeb37a94135c4b782bfe889a5a46780cda2f1..540cbd2ff97ad33ea8a9f6d3449a9af965a7a815 100644 (file)
@@ -92,7 +92,7 @@ echo "*** Done ***";
 *** Testing stripos() function with unexpected values for haystack and needle ***
 -- Iteration 1 --
 bool(false)
-int(1)
+bool(false)
 -- Iteration 2 --
 bool(false)
 bool(false)
@@ -125,17 +125,17 @@ Warning: Needle argument codepoint value out of range (0 - 0x10FFFF) in %s on li
 bool(false)
 -- Iteration 8 --
 bool(false)
-int(7)
+bool(false)
 -- Iteration 9 --
 bool(false)
-int(3)
+bool(false)
 -- Iteration 10 --
 
 Notice: Array to string conversion in %s on line %d
 bool(false)
 
 Notice: Array to string conversion in %s on line %d
-int(5)
+bool(false)
 -- Iteration 11 --
 
 Notice: Array to string conversion in %s on line %d
index c29e3533a58532253616c6bfa902b0d85beadc74..3de4e495fa3e37e5ac264a8c12e8888dd2b2c00b 100644 (file)
@@ -31,15 +31,15 @@ echo "*** Done ***";
 int(5)
 int(5)
 int(0)
-int(12)
+bool(false)
 int(11)
 int(11)
 int(0)
-int(3)
+bool(false)
 int(5)
 int(5)
 int(0)
-int(6)
+bool(false)
 int(5)
-int(6)
+bool(false)
 *** Done ***
index 85717161a5e63a259f87fc9c0a141ffa6058f4cf..0ba417de4d7a143d171951772e37090c86d46990 100644 (file)
@@ -119,16 +119,16 @@ int(10)
 int(10)
 -- Iteration 12 --
 bool(false)
-int(63)
+bool(false)
 -- Iteration 13 --
 bool(false)
-int(63)
+bool(false)
 -- Iteration 14 --
 bool(false)
-int(63)
+bool(false)
 -- Iteration 15 --
 bool(false)
-int(63)
+bool(false)
 -- Iteration 16 --
 bool(false)
 bool(false)