]> granicus.if.org Git - php/commitdiff
Add regression test for bug #25745
authorMoriyoshi Koizumi <moriyoshi@php.net>
Fri, 3 Oct 2003 16:59:44 +0000 (16:59 +0000)
committerMoriyoshi Koizumi <moriyoshi@php.net>
Fri, 3 Oct 2003 16:59:44 +0000 (16:59 +0000)
ext/ctype/tests/bug25745.phpt [new file with mode: 0644]

diff --git a/ext/ctype/tests/bug25745.phpt b/ext/ctype/tests/bug25745.phpt
new file mode 100644 (file)
index 0000000..1d0ae0d
--- /dev/null
@@ -0,0 +1,24 @@
+--TEST--
+Bug #25745 (ctype functions fail with non-ascii characters)
+--FILE--
+<?php
+$funcs = array(
+       "ctype_alnum", "ctype_alpha", "ctype_cntrl", "ctype_digit",
+       "ctype_graph", "ctype_lower", "ctype_print", "ctype_punct",
+       "ctype_space", "ctype_upper", "ctype_xdigit"
+);
+
+foreach ($funcs as $ctype_func) {
+       for ($i = 0; $i < 256; $i++) {
+               $a = $ctype_func($i);
+               $b = $ctype_func(chr($i));
+               if ($a != $b) {
+                       echo "broken... $ctype_func($i) = $a, $ctype_func(chr($i)) = $b\n";
+                       exit;
+               }
+       }
+}
+echo "ok\n";
+?>
+--EXPECT--
+ok