"Fossies" - the Fresh Open Source Software Archive

Member "php-7.2.27/ext/ctype/tests/001.phpt" (22 Jan 2020, 779 Bytes) of package /linux/www/php-7.2.27.tar.xz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    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