From: Antony Dovgal Date: Tue, 19 Sep 2006 11:49:21 +0000 (+0000) Subject: fix tests X-Git-Tag: RELEASE_1_0_0RC1~1625 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ad1d0e6d657a5e430c1a40517debabe984111bbe;p=php fix tests --- diff --git a/ext/iconv/tests/iconv_substr.phpt b/ext/iconv/tests/iconv_substr.phpt index 1a6bd30534..f4e7ff47bf 100644 --- a/ext/iconv/tests/iconv_substr.phpt +++ b/ext/iconv/tests/iconv_substr.phpt @@ -59,3 +59,21 @@ string(0) "" string(0) "" string(0) "" string(10) "¤Á¤Ï ISO-2" +--UEXPECT-- +666768696a6b6c +666768696a6b6c +a6a4a8a4aaa4ab +a4aba4ada4afa4b1a4b3a4b5a4b7 +bool(false) +string(0) "" +unicode(14) "This is a test" +string(14) "This is a test" +unicode(3) "est" +string(3) "est" +unicode(5) "This " +string(5) "This " +unicode(0) "" +string(0) "" +unicode(0) "" +string(0) "" +string(10) "¤Á¤Ï ISO-2" diff --git a/ext/pcre/tests/bug20528.phpt b/ext/pcre/tests/bug20528.phpt index 8182fd9bfe..87f0672fc1 100644 --- a/ext/pcre/tests/bug20528.phpt +++ b/ext/pcre/tests/bug20528.phpt @@ -22,3 +22,20 @@ array(7) { [6]=> string(2) "#)" } +--UEXPECT-- +array(7) { + [0]=> + unicode(2) "(#" + [1]=> + unicode(2) "11" + [2]=> + unicode(1) "/" + [3]=> + unicode(2) "19" + [4]=> + unicode(1) "/" + [5]=> + unicode(4) "2002" + [6]=> + unicode(2) "#)" +} diff --git a/ext/pcre/tests/pcre_count.phpt b/ext/pcre/tests/pcre_count.phpt index 1239d48ffb..68162c4a66 100644 --- a/ext/pcre/tests/pcre_count.phpt +++ b/ext/pcre/tests/pcre_count.phpt @@ -38,3 +38,12 @@ string(25) "... ... ... ... v1c0d1/|/" int(4) string(25) "... ... ... ... v1c0d1/|/" NULL +--UEXPECT-- +unicode(56) "xxxx xxxx 1-a-3-4 1-2-a-4 1-2-3-a a-a-a-a xxxx xxxx-xxxx" +int(5) +unicode(41) "Hxxxx xxxx xxxx xxxx xxxx 42 xxxx 13 xxxx" +int(7) +unicode(25) "... ... ... ... v1c0d1/|/" +int(4) +unicode(25) "... ... ... ... v1c0d1/|/" +NULL diff --git a/ext/pcre/tests/preg_replace.phpt b/ext/pcre/tests/preg_replace.phpt index e26db8c2fd..eac46c0f4b 100644 --- a/ext/pcre/tests/preg_replace.phpt +++ b/ext/pcre/tests/preg_replace.phpt @@ -24,12 +24,12 @@ string(0) "" Warning: preg_replace_callback(): Modifier /e cannot be used with replacement callback in %spreg_replace.php on line 10 NULL --UEXPECTF-- -string(1) "x" -string(4) "abcd" -string(8) "zaab2k3l" +unicode(1) "x" +unicode(4) "abcd" +unicode(8) "zaab2k3l" -Warning: preg_replace_callback(): Requires argument 2, '', to be a valid callback in %spreg_replace.php on line 8 +Warning: preg_replace_callback(): Requires argument 2, '', to be a valid callback in %s on line %d unicode(0) "" -Warning: preg_replace_callback(): Modifier /e cannot be used with replacement callback in %spreg_replace.php on line 10 +Warning: preg_replace_callback(): Modifier /e cannot be used with replacement callback in %s on line %d NULL diff --git a/ext/pcre/tests/preg_replace2.phpt b/ext/pcre/tests/preg_replace2.phpt index 80a94d8768..2c076e7ebc 100644 --- a/ext/pcre/tests/preg_replace2.phpt +++ b/ext/pcre/tests/preg_replace2.phpt @@ -40,3 +40,28 @@ array(2) { string(1) "$" } ==done== +--UEXPECTF-- +Warning: preg_replace(): Parameter mismatch, pattern is a string while replacement in an array. in %s on line %d +bool(false) +unicode(1) "c" +array(3) { + [0]=> + unicode(1) "x" + [1]=> + unicode(2) "aA" + [2]=> + unicode(2) "vb" +} +array(2) { + [0]=> + unicode(1) "$" + [1]=> + unicode(1) "$" +} +array(2) { + [0]=> + unicode(3) "x$y" + [1]=> + unicode(1) "$" +} +==done== diff --git a/ext/pcre/tests/preg_replace_callback2.phpt b/ext/pcre/tests/preg_replace_callback2.phpt index d5c528daa4..e5e0e79ddd 100644 --- a/ext/pcre/tests/preg_replace_callback2.phpt +++ b/ext/pcre/tests/preg_replace_callback2.phpt @@ -39,19 +39,19 @@ array(1) { } string(3) "aBC" --UEXPECTF-- -Warning: preg_replace_callback(): Unable to call custom replacement function in %spreg_replace_callback2.php on line %d +Warning: preg_replace_callback(): Unable to call custom replacement function in %s on line %d array(3) { [0]=> - string(12) "'a' 'b3' bcd" + unicode(12) "'a' 'b3' bcd" [u"v"]=> - string(6) "aksfjk" + unicode(6) "aksfjk" [12]=> - string(9) "'aa' 'bb'" + unicode(9) "'aa' 'bb'" } -Notice: Array to string conversion in %spreg_replace_callback2.php on line 17 +Notice: Array to string conversion in %s on line %d array(1) { [0]=> - string(7) "'A'rray" + unicode(7) "'A'rray" } -string(3) "aBC" +unicode(3) "aBC" diff --git a/ext/pcre/tests/preg_replace_callback3.phpt b/ext/pcre/tests/preg_replace_callback3.phpt index 15d125116e..9e1a0c595e 100644 --- a/ext/pcre/tests/preg_replace_callback3.phpt +++ b/ext/pcre/tests/preg_replace_callback3.phpt @@ -18,13 +18,13 @@ var_dump(preg_replace_callback($a,$a,$a,$a,$a)); echo "Done\n"; ?> --EXPECTF-- -Warning: Wrong parameter count for preg_replace_callback() in %s on line %d +Warning: preg_replace_callback() expects at least 3 parameters, 0 given in %s on line %d NULL -Warning: Wrong parameter count for preg_replace_callback() in %s on line %d +Warning: preg_replace_callback() expects at least 3 parameters, 1 given in %s on line %d NULL -Warning: Wrong parameter count for preg_replace_callback() in %s on line %d +Warning: preg_replace_callback() expects at least 3 parameters, 2 given in %s on line %d NULL Warning: preg_replace_callback(): Requires argument 2, '2', to be a valid callback in %s on line %d @@ -36,21 +36,20 @@ int(3) Warning: preg_replace_callback(): Requires argument 2, '2', to be a valid callback in %s on line %d int(3) -Warning: preg_replace_callback(): Requires argument 2, '', to be a valid callback in %s on line 1%d -string(0) "" +Warning: preg_replace_callback() expects parameter 4 to be long, string given in %s on line %d +NULL -Warning: preg_replace_callback(): Requires argument 2, 'Array', to be a valid callback in %s on line %d -array(0) { -} +Warning: preg_replace_callback() expects parameter 4 to be long, array given in %s on line %d +NULL Done --UEXPECTF-- -Warning: Wrong parameter count for preg_replace_callback() in %s on line %d +Warning: preg_replace_callback() expects at least 3 parameters, 0 given in %s on line %d NULL -Warning: Wrong parameter count for preg_replace_callback() in %s on line %d +Warning: preg_replace_callback() expects at least 3 parameters, 1 given in %s on line %d NULL -Warning: Wrong parameter count for preg_replace_callback() in %s on line %d +Warning: preg_replace_callback() expects at least 3 parameters, 2 given in %s on line %d NULL Warning: preg_replace_callback(): Requires argument 2, '2', to be a valid callback in %s on line %d @@ -62,10 +61,9 @@ int(3) Warning: preg_replace_callback(): Requires argument 2, '2', to be a valid callback in %s on line %d int(3) -Warning: preg_replace_callback(): Requires argument 2, '', to be a valid callback in %s on line %d -unicode(0) "" +Warning: preg_replace_callback() expects parameter 4 to be long, Unicode string given in %s on line %d +NULL -Warning: preg_replace_callback(): Requires argument 2, 'Array', to be a valid callback in %s on line %d -array(0) { -} +Warning: preg_replace_callback() expects parameter 4 to be long, array given in %s on line %d +NULL Done diff --git a/ext/pcre/tests/split.phpt b/ext/pcre/tests/split.phpt index 8ec8e655cf..a2a024fc40 100644 --- a/ext/pcre/tests/split.phpt +++ b/ext/pcre/tests/split.phpt @@ -84,3 +84,71 @@ array(4) { [3]=> string(1) "u" } +--UEXPECTF-- +Warning: preg_split() expects at least 2 parameters, 0 given in %s on line %d +bool(false) + +Warning: preg_split(): Compilation failed: nothing to repeat at offset 0 in %s on line %d +bool(false) +array(3) { + [0]=> + unicode(1) "x" + [1]=> + unicode(2) "yy" + [2]=> + unicode(3) "zzz" +} +array(3) { + [0]=> + unicode(1) "x" + [1]=> + unicode(2) "yy" + [2]=> + unicode(3) "zzz" +} +array(3) { + [0]=> + unicode(1) "x" + [1]=> + unicode(2) "yy" + [2]=> + unicode(3) "zzz" +} +array(1) { + [0]=> + unicode(8) "x yy,zzz" +} +array(2) { + [0]=> + unicode(1) "x" + [1]=> + unicode(6) "yy,zzz" +} +array(8) { + [0]=> + unicode(0) "" + [1]=> + unicode(1) "a" + [2]=> + unicode(1) "b" + [3]=> + unicode(0) "" + [4]=> + unicode(1) "c" + [5]=> + unicode(0) "" + [6]=> + unicode(1) "u" + [7]=> + unicode(0) "" +} +array(4) { + [0]=> + unicode(1) "a" + [1]=> + unicode(1) "b" + [2]=> + unicode(1) "c" + [3]=> + unicode(1) "u" +} diff --git a/ext/pcre/tests/split2.phpt b/ext/pcre/tests/split2.phpt index 391acb951e..d57e20cd69 100644 --- a/ext/pcre/tests/split2.phpt +++ b/ext/pcre/tests/split2.phpt @@ -313,3 +313,298 @@ array(1) { string(6) "ab2c3u" } bool(true) +--UEXPECTF-- +array(15) { + [0]=> + unicode(0) "" + [1]=> + unicode(0) "" + [2]=> + unicode(1) "a" + [3]=> + unicode(0) "" + [4]=> + unicode(1) "b" + [5]=> + unicode(1) "2" + [6]=> + unicode(0) "" + [7]=> + unicode(0) "" + [8]=> + unicode(1) "c" + [9]=> + unicode(1) "3" + [10]=> + unicode(0) "" + [11]=> + unicode(0) "" + [12]=> + unicode(1) "u" + [13]=> + unicode(0) "" + [14]=> + unicode(0) "" +} +array(8) { + [0]=> + array(2) { + [0]=> + unicode(0) "" + [1]=> + int(0) + } + [1]=> + array(2) { + [0]=> + unicode(1) "a" + [1]=> + int(0) + } + [2]=> + array(2) { + [0]=> + unicode(1) "b" + [1]=> + int(1) + } + [3]=> + array(2) { + [0]=> + unicode(0) "" + [1]=> + int(3) + } + [4]=> + array(2) { + [0]=> + unicode(1) "c" + [1]=> + int(3) + } + [5]=> + array(2) { + [0]=> + unicode(0) "" + [1]=> + int(5) + } + [6]=> + array(2) { + [0]=> + unicode(1) "u" + [1]=> + int(5) + } + [7]=> + array(2) { + [0]=> + unicode(0) "" + [1]=> + int(6) + } +} +array(6) { + [0]=> + unicode(1) "a" + [1]=> + unicode(1) "b" + [2]=> + unicode(1) "2" + [3]=> + unicode(1) "c" + [4]=> + unicode(1) "3" + [5]=> + unicode(1) "u" +} +array(4) { + [0]=> + array(2) { + [0]=> + unicode(1) "a" + [1]=> + int(0) + } + [1]=> + array(2) { + [0]=> + unicode(1) "b" + [1]=> + int(1) + } + [2]=> + array(2) { + [0]=> + unicode(1) "c" + [1]=> + int(3) + } + [3]=> + array(2) { + [0]=> + unicode(1) "u" + [1]=> + int(5) + } +} +array(15) { + [0]=> + array(2) { + [0]=> + unicode(0) "" + [1]=> + int(0) + } + [1]=> + array(2) { + [0]=> + unicode(0) "" + [1]=> + int(0) + } + [2]=> + array(2) { + [0]=> + unicode(1) "a" + [1]=> + int(0) + } + [3]=> + array(2) { + [0]=> + unicode(0) "" + [1]=> + int(1) + } + [4]=> + array(2) { + [0]=> + unicode(1) "b" + [1]=> + int(1) + } + [5]=> + array(2) { + [0]=> + unicode(1) "2" + [1]=> + int(2) + } + [6]=> + array(2) { + [0]=> + unicode(0) "" + [1]=> + int(3) + } + [7]=> + array(2) { + [0]=> + unicode(0) "" + [1]=> + int(3) + } + [8]=> + array(2) { + [0]=> + unicode(1) "c" + [1]=> + int(3) + } + [9]=> + array(2) { + [0]=> + unicode(1) "3" + [1]=> + int(4) + } + [10]=> + array(2) { + [0]=> + unicode(0) "" + [1]=> + int(5) + } + [11]=> + array(2) { + [0]=> + unicode(0) "" + [1]=> + int(5) + } + [12]=> + array(2) { + [0]=> + unicode(1) "u" + [1]=> + int(5) + } + [13]=> + array(2) { + [0]=> + unicode(0) "" + [1]=> + int(6) + } + [14]=> + array(2) { + [0]=> + unicode(0) "" + [1]=> + int(6) + } +} +array(6) { + [0]=> + array(2) { + [0]=> + unicode(1) "a" + [1]=> + int(0) + } + [1]=> + array(2) { + [0]=> + unicode(1) "b" + [1]=> + int(1) + } + [2]=> + array(2) { + [0]=> + unicode(1) "2" + [1]=> + int(2) + } + [3]=> + array(2) { + [0]=> + unicode(1) "c" + [1]=> + int(3) + } + [4]=> + array(2) { + [0]=> + unicode(1) "3" + [1]=> + int(4) + } + [5]=> + array(2) { + [0]=> + unicode(1) "u" + [1]=> + int(5) + } +} + +Warning: preg_last_error() expects exactly 0 parameters, 1 given in %s on line %d +NULL +bool(true) +array(1) { + [0]=> + unicode(6) "ab2c3u" +} +bool(true)