summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Le Blanc <lbarnaud@php.net>2008-09-14 14:57:26 +0000
committerArnaud Le Blanc <lbarnaud@php.net>2008-09-14 14:57:26 +0000
commitc2f830ca21bcc94fd191eb9c6d2eeca3bb60c058 (patch)
treeee83808715a344c9981fe683759733d19090d85b
parent8225d21a2d0bcf65d70fd4a4572e0d0199b19884 (diff)
downloadphp-git-c2f830ca21bcc94fd191eb9c6d2eeca3bb60c058.tar.gz
MFB / fix tests
-rw-r--r--ext/standard/tests/strings/stripos_variation1.phpt60
-rw-r--r--ext/standard/tests/strings/stripos_variation11.phpt8
-rw-r--r--ext/standard/tests/strings/stripos_variation12.phpt8
-rw-r--r--ext/standard/tests/strings/stripos_variation2.phpt8
4 files changed, 48 insertions, 36 deletions
diff --git a/ext/standard/tests/strings/stripos_variation1.phpt b/ext/standard/tests/strings/stripos_variation1.phpt
index d96bcbed94..7aeda4082c 100644
--- a/ext/standard/tests/strings/stripos_variation1.phpt
+++ b/ext/standard/tests/strings/stripos_variation1.phpt
@@ -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 ***
diff --git a/ext/standard/tests/strings/stripos_variation11.phpt b/ext/standard/tests/strings/stripos_variation11.phpt
index 92aaeb37a9..540cbd2ff9 100644
--- a/ext/standard/tests/strings/stripos_variation11.phpt
+++ b/ext/standard/tests/strings/stripos_variation11.phpt
@@ -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
diff --git a/ext/standard/tests/strings/stripos_variation12.phpt b/ext/standard/tests/strings/stripos_variation12.phpt
index c29e3533a5..3de4e495fa 100644
--- a/ext/standard/tests/strings/stripos_variation12.phpt
+++ b/ext/standard/tests/strings/stripos_variation12.phpt
@@ -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 ***
diff --git a/ext/standard/tests/strings/stripos_variation2.phpt b/ext/standard/tests/strings/stripos_variation2.phpt
index 85717161a5..0ba417de4d 100644
--- a/ext/standard/tests/strings/stripos_variation2.phpt
+++ b/ext/standard/tests/strings/stripos_variation2.phpt
@@ -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)