johannes Wed Jul 11 15:46:20 2007 UTC
Modified files:
/php-src/ext/standard/tests/strings count_chars.phpt
Log:
Fix test for unicode mode
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/count_chars.phpt?r1=1.2&r2=1.3&diff_format=u
Index: php-src/ext/standard/tests/strings/count_chars.phpt
diff -u php-src/ext/standard/tests/strings/count_chars.phpt:1.2
php-src/ext/standard/tests/strings/count_chars.phpt:1.3
--- php-src/ext/standard/tests/strings/count_chars.phpt:1.2 Wed May 19
08:45:23 2004
+++ php-src/ext/standard/tests/strings/count_chars.phpt Wed Jul 11 15:46:20 2007
@@ -4,15 +4,80 @@
<?php
$s = "het leven is net erwtensoep - je kunt er geen touw aan vastknopen";
for($i=0; $i<3; $i++) {
- echo implode(count_chars($s, $i))."\n";
+ $c = count_chars($s, $i);
+ if ($i == 1) {
+ print_r($c);
+ } else {
+ echo implode($c),"\n";
+ }
}
+
echo $a = count_chars($s, 3), "\n";
-echo (int) strlen(count_chars($s, 4)) == 256-strlen($a),"\n";
+var_dump((int) strlen(count_chars($s, 4)) == 256-strlen($a));
?>
--EXPECT--
000000000000000000000000000000001200000000000010000000000000000000000000000000000000000000000000003000120111121083202362220000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-121312111121832236222
+Array
+(
+ [32] => 12
+ [45] => 1
+ [97] => 3
+ [101] => 12
+ [103] => 1
+ [104] => 1
+ [105] => 1
+ [106] => 1
+ [107] => 2
+ [108] => 1
+ [110] => 8
+ [111] => 3
+ [112] => 2
+ [114] => 2
+ [115] => 3
+ [116] => 6
+ [117] => 2
+ [118] => 2
+ [119] => 2
+)
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-aeghijklnoprstuvw
-1
+bool(true)
+--UEXPECTF--
+Warning: count_chars(): Only mode=1 is supported with Unicode strings in %s on
line %d
+
+Warning: implode(): Argument to implode must be an array in %s on line %d
+
+Array
+(
+ [h] => 1
+ [e] => 12
+ [t] => 6
+ [ ] => 12
+ [l] => 1
+ [v] => 2
+ [n] => 8
+ [i] => 1
+ [s] => 3
+ [r] => 2
+ [w] => 2
+ [o] => 3
+ [p] => 2
+ [-] => 1
+ [j] => 1
+ [k] => 2
+ [u] => 2
+ [g] => 1
+ [a] => 3
+)
+
+Warning: count_chars(): Only mode=1 is supported with Unicode strings in %s on
line %d
+
+Warning: implode(): Argument to implode must be an array in %s on line %d
+
+
+Warning: count_chars(): Only mode=1 is supported with Unicode strings in %s on
line %d
+
+
+Warning: count_chars(): Only mode=1 is supported with Unicode strings in %s on
line %d
+bool(false)
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php