Annotation of embedaddon/php/ext/ctype/tests/001.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: ctype on integers
3: --SKIPIF--
4: <?php require_once('skipif.inc'); ?>
5: --FILE--
6: <?php
7: setlocale(LC_ALL,"C");
8:
9: function ctype_test_001($function) {
10: $n=0;
11: for($a=0;$a<256;$a++) {
12: if($function($a)) $n++;
13: }
14: echo "$function $n\n";
15: }
16: ctype_test_001("ctype_lower");
17: ctype_test_001("ctype_upper");
18: ctype_test_001("ctype_alpha");
19: ctype_test_001("ctype_digit");
20: ctype_test_001("ctype_alnum");
21: ctype_test_001("ctype_cntrl");
22: ctype_test_001("ctype_graph");
23: ctype_test_001("ctype_print");
24: ctype_test_001("ctype_punct");
25: ctype_test_001("ctype_space");
26: ctype_test_001("ctype_xdigit");
27: ?>
28: --EXPECT--
29: ctype_lower 26
30: ctype_upper 26
31: ctype_alpha 52
32: ctype_digit 10
33: ctype_alnum 62
34: ctype_cntrl 33
35: ctype_graph 94
36: ctype_print 95
37: ctype_punct 32
38: ctype_space 6
39: ctype_xdigit 22
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>