Annotation of embedaddon/php/ext/pcre/tests/locales.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Localized match
                      3: --SKIPIF--
                      4: <?php 
                      5: 
                      6: if (!function_exists('setlocale')) die('skip: setlocale() not available');
                      7: if (!@setlocale(LC_ALL, 'pt_PT', 'pt', 'pt_PT.ISO8859-1', 'portuguese')) die('skip pt locale not available');
                      8: 
                      9: ?>
                     10: --FILE--
                     11: <?php
                     12: 
                     13: // this tests if the cache is working correctly, as the char tables
                     14: // must be rebuilt after the locale change
                     15: 
                     16: setlocale(LC_ALL, 'C', 'POSIX');
                     17: var_dump(preg_match('/^\w{6}$/', 'aאבחיט'));
                     18: 
                     19: setlocale(LC_ALL, 'pt_PT', 'pt', 'pt_PT.ISO8859-1', 'portuguese');
                     20: var_dump(preg_match('/^\w{6}$/', 'aאבחיט'));
                     21: 
                     22: setlocale(LC_ALL, 'C', 'POSIX');
                     23: var_dump(preg_match('/^\w{6}$/', 'aאבחיט'));
                     24: 
                     25: ?>
                     26: --EXPECT--
                     27: int(0)
                     28: int(1)
                     29: int(0)

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>