]> granicus.if.org Git - php/commitdiff
fix unit tests for intl in accordance with new ICU releases
authorStanislav Malyshev <stas@php.net>
Tue, 4 Jan 2011 03:24:38 +0000 (03:24 +0000)
committerStanislav Malyshev <stas@php.net>
Tue, 4 Jan 2011 03:24:38 +0000 (03:24 +0000)
13 files changed:
ext/intl/grapheme/grapheme_string.c
ext/intl/tests/collator_get_locale.phpt
ext/intl/tests/collator_get_sort_key.phpt
ext/intl/tests/dateformat_set_timezone_id.phpt
ext/intl/tests/formatter_format.phpt
ext/intl/tests/formatter_format_currency.phpt
ext/intl/tests/grapheme.phpt
ext/intl/tests/locale_get_display_name.phpt
ext/intl/tests/locale_get_display_region.phpt
ext/intl/tests/locale_get_display_script.phpt
ext/intl/tests/locale_get_display_variant.phpt
ext/intl/tests/locale_get_region.phpt
ext/intl/tests/locale_parse_locale.phpt

index 6ad8769619df3d076f198bfd707edc595949a3b1..1784d028a8beae06627e0ab5fdeebb281f4820d1 100755 (executable)
@@ -70,8 +70,8 @@ PHP_FUNCTION(grapheme_strlen)
        }
 
        ret_len = grapheme_ascii_check(string, string_len);
-       
-       if ( ret_len >= 0 ) 
+
+       if ( ret_len >= 0 )
                RETURN_LONG(ret_len);
 
        /* convert the string to UTF-16. */
@@ -87,7 +87,7 @@ PHP_FUNCTION(grapheme_strlen)
                efree( ustring );
                RETURN_NULL();
        }
-       
+
        ret_len = grapheme_split_string(ustring, ustring_len, NULL, 0 TSRMLS_CC );
 
        efree( ustring );
@@ -110,37 +110,37 @@ PHP_FUNCTION(grapheme_strpos)
        long loffset = 0;
        int32_t offset = 0;
        int ret_pos, uchar_pos;
-       
+
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) {
-       
+
                intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
                         "grapheme_strpos: unable to parse input param", 0 TSRMLS_CC );
-                        
+
                RETURN_FALSE;
        }
 
        if ( OUTSIDE_STRING(loffset, haystack_len) ) {
-       
+
                intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Offset not contained in string", 1 TSRMLS_CC );
-               
+
                RETURN_FALSE;
        }
 
-       /* we checked that it will fit: */      
+       /* we checked that it will fit: */
        offset = (int32_t) loffset;
 
        /* the offset is 'grapheme count offset' so it still might be invalid - we'll check it later */
 
        if (needle_len == 0) {
-       
+
                intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Empty delimiter", 1 TSRMLS_CC );
-               
+
                RETURN_FALSE;
        }
 
 
        /* quick check to see if the string might be there
-        * I realize that 'offset' is 'grapheme count offset' but will work in spite of that 
+        * I realize that 'offset' is 'grapheme count offset' but will work in spite of that
        */
        found = (unsigned char *)php_memnstr((char *)haystack + offset, (char *)needle, needle_len, (char *)haystack + haystack_len);
 
@@ -178,31 +178,31 @@ PHP_FUNCTION(grapheme_stripos)
        int32_t offset = 0;
        int ret_pos, uchar_pos;
        int is_ascii;
-       
+
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) {
-       
+
                intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
                         "grapheme_stripos: unable to parse input param", 0 TSRMLS_CC );
-                        
+
                RETURN_FALSE;
        }
 
        if ( OUTSIDE_STRING(loffset, haystack_len) ) {
-       
+
                intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_stripos: Offset not contained in string", 1 TSRMLS_CC );
-               
+
                RETURN_FALSE;
        }
-       
+
        /* we checked that it will fit: */
        offset = (int32_t) loffset;
 
        /* the offset is 'grapheme count offset' so it still might be invalid - we'll check it later */
 
        if (needle_len == 0) {
-       
+
                intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_stripos: Empty delimiter", 1 TSRMLS_CC );
-               
+
                RETURN_FALSE;
        }
 
@@ -252,40 +252,40 @@ PHP_FUNCTION(grapheme_strrpos)
        int32_t offset = 0;
        int32_t ret_pos;
        int is_ascii;
-       
+
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) {
-       
+
                intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
                         "grapheme_strrpos: unable to parse input param", 0 TSRMLS_CC );
-                        
+
                RETURN_FALSE;
        }
 
        if ( OUTSIDE_STRING(loffset, haystack_len) ) {
-       
+
                intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Offset not contained in string", 1 TSRMLS_CC );
-               
+
                RETURN_FALSE;
        }
-       
+
        /* we checked that it will fit: */
        offset = (int32_t) loffset;
 
        /* the offset is 'grapheme count offset' so it still might be invalid - we'll check it later */
 
        if (needle_len == 0) {
-       
+
                intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Empty delimiter", 1 TSRMLS_CC );
-               
+
                RETURN_FALSE;
        }
 
        is_ascii = grapheme_ascii_check(haystack, haystack_len) >= 0;
 
        if ( is_ascii ) {
-       
+
                ret_pos = grapheme_strrpos_ascii(haystack, haystack_len, needle, needle_len, offset);
-               
+
 
                if ( ret_pos >= 0 ) {
                        RETURN_LONG(ret_pos);
@@ -307,7 +307,7 @@ PHP_FUNCTION(grapheme_strrpos)
        } else {
                RETURN_FALSE;
        }
-       
+
 
 }
 /* }}} */
@@ -322,31 +322,31 @@ PHP_FUNCTION(grapheme_strripos)
        int32_t offset = 0;
        int32_t ret_pos;
        int is_ascii;
-       
+
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) {
-       
+
                intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
                         "grapheme_strrpos: unable to parse input param", 0 TSRMLS_CC );
-                        
+
                RETURN_FALSE;
        }
 
        if ( OUTSIDE_STRING(loffset, haystack_len) ) {
-       
+
                intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Offset not contained in string", 1 TSRMLS_CC );
-               
+
                RETURN_FALSE;
        }
 
        /* we checked that it will fit: */
        offset = (int32_t) loffset;
-       
+
        /* the offset is 'grapheme count offset' so it still might be invalid - we'll check it later */
 
        if (needle_len == 0) {
-       
+
                intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Empty delimiter", 1 TSRMLS_CC );
-               
+
                RETURN_FALSE;
        }
 
@@ -361,7 +361,7 @@ PHP_FUNCTION(grapheme_strripos)
                php_strtolower((char *)haystack_dup, haystack_len);
 
                ret_pos = grapheme_strrpos_ascii(haystack_dup, haystack_len, needle_dup, needle_len, offset);
-               
+
                efree(haystack_dup);
                efree(needle_dup);
 
@@ -385,7 +385,7 @@ PHP_FUNCTION(grapheme_strripos)
        } else {
                RETURN_FALSE;
        }
-       
+
 
 }
 /* }}} */
@@ -407,17 +407,17 @@ PHP_FUNCTION(grapheme_substr)
        int32_t (*iter_func)(UBreakIterator *);
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|l", (char **)&str, &str_len, &lstart, &length) == FAILURE) {
-       
+
                intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
                         "grapheme_substr: unable to parse input param", 0 TSRMLS_CC );
-                        
+
                RETURN_FALSE;
        }
 
        if ( OUTSIDE_STRING(lstart, str_len) ) {
-       
+
                intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: start not contained in string", 1 TSRMLS_CC );
-               
+
                RETURN_FALSE;
        }
 
@@ -456,7 +456,7 @@ PHP_FUNCTION(grapheme_substr)
        if( U_FAILURE(status) ) {
                RETURN_FALSE;
        }
-       
+
        ubrk_setText(bi, ustr, ustr_len,        &status);
 
        if ( start < 0 ) {
@@ -482,9 +482,9 @@ PHP_FUNCTION(grapheme_substr)
        }
 
        if ( 0 != start || sub_str_start_pos >= ustr_len ) {
-       
+
                intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: start not contained in string", 1 TSRMLS_CC );
-       
+
                efree(ustr);
                ubrk_close(bi);
                RETURN_FALSE;
@@ -541,11 +541,11 @@ PHP_FUNCTION(grapheme_substr)
 
                length += iter_val;
        }
-       
+
        if ( UBRK_DONE == sub_str_end_pos && length < 0) {
-       
+
                intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: length not contained in string", 1 TSRMLS_CC );
-       
+
                efree(ustr);
                ubrk_close(bi);
                RETURN_FALSE;
@@ -586,17 +586,17 @@ static void strstr_common_handler(INTERNAL_FUNCTION_PARAMETERS, int f_ignore_cas
        zend_bool part = 0;
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|b", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &part) == FAILURE) {
-       
+
                intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
                         "grapheme_strstr: unable to parse input param", 0 TSRMLS_CC );
-                        
+
                RETURN_FALSE;
        }
 
        if (needle_len == 0) {
-       
+
                intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Empty delimiter", 1 TSRMLS_CC );
-               
+
                RETURN_FALSE;
        }
 
@@ -604,7 +604,7 @@ static void strstr_common_handler(INTERNAL_FUNCTION_PARAMETERS, int f_ignore_cas
        if ( !f_ignore_case ) {
 
                /* ASCII optimization: quick check to see if the string might be there
-                * I realize that 'offset' is 'grapheme count offset' but will work in spite of that 
+                * I realize that 'offset' is 'grapheme count offset' but will work in spite of that
                */
                found = (unsigned char *)php_memnstr((char *)haystack, (char *)needle, needle_len, (char *)haystack + haystack_len);
 
@@ -640,7 +640,7 @@ static void strstr_common_handler(INTERNAL_FUNCTION_PARAMETERS, int f_ignore_cas
 
        if (part) {
                RETURN_STRINGL(((char *)haystack), ret_pos, 1);
-       } 
+       }
        else {
                RETURN_STRINGL(((char *)haystack) + ret_pos, haystack_len - ret_pos, 1);
        }
@@ -752,7 +752,7 @@ grapheme_extract_count_iter(UBreakIterator *bi, int32_t size, unsigned char *pst
                size--;
        }
 
-       /* pos is one past the last UChar - and represent the number of code units to 
+       /* pos is one past the last UChar - and represent the number of code units to
                advance in the utf-8 buffer
        */
 
@@ -790,23 +790,23 @@ PHP_FUNCTION(grapheme_extract)
        zval *next = NULL; /* return offset of next part of the string */
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|llz", (char **)&str, &str_len, &size, &extract_type, &lstart, &next) == FAILURE) {
-       
+
                intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
                         "grapheme_extract: unable to parse input param", 0 TSRMLS_CC );
-                        
+
                RETURN_FALSE;
        }
 
        if ( NULL != next ) {
                if ( !PZVAL_IS_REF(next) ) {
-                       intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, 
+                       intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
                                 "grapheme_extract: 'next' was not passed by reference", 0 TSRMLS_CC );
-                        
+
                        RETURN_FALSE;
                }
                else {
                        /* initialize next */
-            ZVAL_LONG(next, start);
+            ZVAL_LONG(next, lstart);
                }
        }
 
@@ -814,7 +814,7 @@ PHP_FUNCTION(grapheme_extract)
 
                intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
                         "grapheme_extract: unknown extract type param", 0 TSRMLS_CC );
-                        
+
                RETURN_FALSE;
        }
 
@@ -845,7 +845,7 @@ PHP_FUNCTION(grapheme_extract)
                        if ( pstr >= str_end ) {
                                intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
                                                                "grapheme_extract: invalid input string", 0 TSRMLS_CC );
-                        
+
                                RETURN_FALSE;
                        }
                }
@@ -856,9 +856,9 @@ PHP_FUNCTION(grapheme_extract)
        /* if the string is all ASCII up to size+1 - or str_len whichever is first - then we are done.
                (size + 1 because the size-th character might be the beginning of a grapheme cluster)
         */
-       
+
        if ( -1 != grapheme_ascii_check(pstr, size + 1 < str_len ? size + 1 : str_len ) ) {
-        long nsize = ( size < str_len ? size : str_len ); 
+        long nsize = ( size < str_len ? size : str_len );
                if ( NULL != next ) {
                        ZVAL_LONG(next, start+nsize);
                }
index 2fab35eb47e39c6c28c4744da55bef331976b88e..3f5dbaa0ebb9a60283ca6b6a042f1c811f112fd8 100755 (executable)
@@ -19,7 +19,6 @@ function ut_main()
         -9999999999999,
         9999999999999,
         1.2,
-        9999999999999999999999999999999999999999999999
     );
 
     $coll = ut_coll_create( 'en_US' );
@@ -49,4 +48,3 @@ Locale of type -100 is false
 Locale of type -9999999999999 is false
 Locale of type 9999999999999 is false
 Locale of type 1.2 is 'en_US'
-Locale of type 1.0E+46 is false
index 0186c26f663d5f676a9a7fbd3d7ec056cea19d37..0fedde0fff2d75684ec9c41520579e998e168448 100755 (executable)
@@ -2,6 +2,8 @@
 collator_get_sort_key()
 --SKIPIF--
 <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+--XFAIL--
+Sort keys are not fixed, comparing them to fixed strings doesn't work.
 --FILE--
 <?php
 
@@ -30,7 +32,7 @@ function ut_main()
 
     // Regular strings keys
     $test_params = array(
-               'abc', 'abd', 'aaa', 
+               'abc', 'abd', 'aaa',
                'аа', 'а', 'z',
                '', null , '3',
         'y'  , 'i'  , 'k'
@@ -40,7 +42,7 @@ function ut_main()
 
     // Sort a non-ASCII array using ru_RU locale.
     $test_params = array(
-               'абг', 'абв', 'жжж', 'эюя' 
+               'абг', 'абв', 'жжж', 'эюя'
     );
 
     $res_str .= sort_arrays( 'ru_RU', $test_params );
@@ -67,9 +69,9 @@ source: %D0%B0
 key: _+%01%05%01%05%00
 source: z
 key: %5B%01%05%01%05%00
-source: 
+source:
 key: %01%01%00
-source: 
+source:
 key: %01%01%00
 source: 3
 key: %26%80%01%05%01%05%00
index 76b4d474c7fddb51b78786380ba78245aacf926e..900d424fec53d890ff3960acd660d47b0fddc7de 100755 (executable)
@@ -19,7 +19,7 @@ function ut_main()
                'CN'
        );
        $timestamp_entry = 0;
-       
+
        $res_str = '';
 
        $fmt = ut_datefmt_create( "en_US",  IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'America/San_Francisco' , IntlDateFormatter::GREGORIAN  );
@@ -56,18 +56,18 @@ After creation of the dateformatter :  timezone_id= America/San_Francisco
 -----------
 Trying to set timezone_id= America/New_York
 After call to set_timezone_id :  timezone_id= America/New_York
-Formatting timestamp=0 resulted in  Wednesday, December 31, 1969 7:00:00 PM ET
-Formatting timestamp=3600 resulted in  Wednesday, December 31, 1969 8:00:00 PM ET
+Formatting timestamp=0 resulted in  Wednesday, December 31, 1969 7:00:00 PM Eastern Standard Time
+Formatting timestamp=3600 resulted in  Wednesday, December 31, 1969 8:00:00 PM Eastern Standard Time
 -----------
 Trying to set timezone_id= America/Los_Angeles
 After call to set_timezone_id :  timezone_id= America/Los_Angeles
-Formatting timestamp=0 resulted in  Wednesday, December 31, 1969 4:00:00 PM PT
-Formatting timestamp=3600 resulted in  Wednesday, December 31, 1969 5:00:00 PM PT
+Formatting timestamp=0 resulted in  Wednesday, December 31, 1969 4:00:00 PM Pacific Standard Time
+Formatting timestamp=3600 resulted in  Wednesday, December 31, 1969 5:00:00 PM Pacific Standard Time
 -----------
 Trying to set timezone_id= America/Chicago
 After call to set_timezone_id :  timezone_id= America/Chicago
-Formatting timestamp=0 resulted in  Wednesday, December 31, 1969 6:00:00 PM CT
-Formatting timestamp=3600 resulted in  Wednesday, December 31, 1969 7:00:00 PM CT
+Formatting timestamp=0 resulted in  Wednesday, December 31, 1969 6:00:00 PM Central Standard Time
+Formatting timestamp=3600 resulted in  Wednesday, December 31, 1969 7:00:00 PM Central Standard Time
 -----------
 Trying to set timezone_id= CN
 After call to set_timezone_id :  timezone_id= CN
index 413c71d7a8c422872bc330d358977d98cbdfd72c..f47b123c82e57e7588a28bea7a04ac4e95c33298 100755 (executable)
@@ -9,7 +9,7 @@ numfmt_format()
  * Format a number using misc locales/patterns.
  */
 
-/* 
+/*
  * TODO: doesn't pass on ICU 3.6 because 'ru' and 'de' locales changed
  * currency and percent formatting.
  */
@@ -50,7 +50,7 @@ function ut_main()
         foreach( $styles as $style => $pattern )
         {
             $fmt = ut_nfmt_create( $locale, $style, $pattern );
-                       
+
                        if(!$fmt) {
                                $str_res .= "Bad formatter!\n";
                                continue;
@@ -74,8 +74,8 @@ Locale is: en_US
 '\$1,234,567.89'
 '123,456,789%'
 '1.23456789123457E6'
-'one million, two hundred and thirty-four thousand, five hundred and sixty-seven point eight nine one two three four five seven'
-'1,234,567th'
+'one million,? two hundred (and )?thirty-four thousand,? five hundred (and )?sixty-seven point eight nine one two three four five seven'
+'1,234,567(th|ᵗʰ)'
 '342:56:07'
 '#####.###'
 Bad formatter!
@@ -83,11 +83,11 @@ Bad formatter!
 Locale is: ru_UA
 '1234567,89123457'
 '1 234 567,891'
-'1 234 567,89 грн.'
-'123 456 789 ?%'
+'1 234 567,89 ?(грн\.|₴)'
+'123 456 789 ?%'
 '1,23456789123457E6'
-'миллион Ð´Ð²Ð° Ñ\81Ñ\82о Ñ\82Ñ\80идÑ\86аÑ\82Ñ\8c Ñ\87еÑ\82Ñ\8bÑ\80е Ñ\82Ñ\8bÑ\81Ñ\8fÑ\87а Ð¿Ñ\8fÑ\82Ñ\8c Ñ\81Ñ\82о Ñ\88еÑ\81Ñ\82Ñ\8cдеÑ\81Ñ\8fÑ\82 Ð²Ð¾семь'
-'1 234 567'
+'один Ð¼Ð¸Ð»Ð»Ð¸Ð¾Ð½ Ð´Ð²Ð°Ñ\81Ñ\82и Ñ\82Ñ\80идÑ\86аÑ\82Ñ\8c Ñ\87еÑ\82Ñ\8bÑ\80е Ñ\82Ñ\8bÑ\81Ñ\8fÑ\87 Ð¿Ñ\8fÑ\82Ñ\8cÑ\81оÑ\82 Ñ\88еÑ\81Ñ\82Ñ\8cдеÑ\81Ñ\8fÑ\82 Ñ\81емÑ\8c Ð·Ð°Ð¿Ñ\8fÑ\82аÑ\8f Ð²Ð¾Ñ\81емÑ\8c Ð´ÐµÐ²Ñ\8fÑ\82Ñ\8c Ð¾Ð´Ð¸Ð½ Ð´Ð²Ð° Ñ\82Ñ\80и Ñ\87еÑ\82Ñ\8bÑ\80е Ð¿Ñ\8fÑ\82Ñ\8c семь'
+'1 234 567.?'
 '1 234 567'
 '#####.###'
 Bad formatter!
@@ -95,11 +95,11 @@ Bad formatter!
 Locale is: de
 '1234567,89123457'
 '1.234.567,891'
-'(¤ )?1.234.567,89( ¤)?'
-'123.456.789 ?%'
+'(¤ )?1.234.567,89( ¤)?'
+'123\.456\.789 %'
 '1,23456789123457E6'
-'eine Million zweihundertvierunddreißigtausendfünfhundertsiebenundsechzig komma acht neun eins zwei drei vier fünf sieben'
-'1.234.567'
+'eine Million zwei­hundert­vier­und­dreißig­tausend­fünf­hundert­sieben­und­sechzig Komma acht neun eins zwei drei vier fünf sieben'
+'1.234.567.?'
 '1.234.567'
 '#####.###'
 Bad formatter!
@@ -107,11 +107,11 @@ Bad formatter!
 Locale is: fr
 '1234567,89123457'
 '1 234 567,891'
-'1 234 567,89 ¤'
+'1 234 567,89 ¤'
 '123 456 789 ?%'
 '1,23456789123457E6'
-'un million deux cents trente-quatre mille cinq cents soixante-sept virgule huit neuf un deux trois quatre cinq sept'
-'1 234 567'
+'un million deux-cent-trente-quatre-mille-cinq-cent-soixante-sept virgule huit neuf un deux trois quatre cinq sept'
+'1 234 567ᵉ?'
 '1 234 567'
 '#####.###'
 Bad formatter!
@@ -122,8 +122,8 @@ Locale is: en_UK
 '¤1,234,567.89'
 '123,456,789%'
 '1.23456789123457E6'
-'one million, two hundred and thirty-four thousand, five hundred and sixty-seven point eight nine one two three four five seven'
-'1,234,567th'
+'one million,? two hundred (and )?thirty-four thousand,? five hundred (and )?sixty-seven point eight nine one two three four five seven'
+'1,234,567(th|ᵗʰ)'
 '342:56:07'
 '#####.###'
 Bad formatter!
\ No newline at end of file
index 715f12256c7aba124872418a17644a4adbf3bc5e..c53f831b753db0c8110f99104c57dd7f327abbe9 100755 (executable)
@@ -8,7 +8,7 @@ numfmt_format_currency()
 /*
  * Format a number using misc currencies/locales.
  */
-/* 
+/*
  * TODO: doesn't pass on ICU 3.6 because 'ru' and 'uk' locales changed
  * currency formatting.
  */
@@ -41,9 +41,9 @@ include_once( 'ut_common.inc' );
 ut_run();
 
 ?>
---EXPECTREGEX--
+--EXPECT--
 en_UK: '£1,234,567.89'
-en_US: '\$1,234,567.89'
-ru: '1 234 567,89 ?р.'
-uk: '(грн. )?1 234 567,89( грн.)?'
-en: 'UAH1,234,567.89'
\ No newline at end of file
+en_US: '$1,234,567.89'
+ru: '1 234 567,89 р.'
+uk: '1 234 567,89 ₴'
+en: '1,234,567.89'
\ No newline at end of file
index d65c90900d00e455ab1835d50158f6f99da92077..def9110d0dd1cd867d87f5a99581ea5e20c97f97 100755 (executable)
@@ -772,8 +772,8 @@ function check_result($result, $expected) {
 
 function grapheme_strlen($string) {}
 
-"hindi" in devanagari strlen 5
-"ab" + "hindi" + "cde" strlen 10
+"hindi" in devanagari strlen 3
+"ab" + "hindi" + "cde" strlen 8
 "" strlen 0
 char_a_ring_nfd strlen 1
 char_a_ring_nfd + "bc" strlen 3
index 1e84bc2b96fa558407e67b588b46c6238525065e..cf8949865771620add65d1941bbf031037f12389 100755 (executable)
@@ -130,9 +130,9 @@ disp_locale=fr :  display_name=i-enochian
 disp_locale=de :  display_name=i-enochian
 -----------------
 locale='zh-hakka'
-disp_locale=en :  display_name=Chinese #HAKKA#
-disp_locale=fr :  display_name=chinois #HAKKA#
-disp_locale=de :  display_name=Chinesisch #HAKKA#
+disp_locale=en :  display_name=Chinese( #HAKKA#)?
+disp_locale=fr :  display_name=chinois( #HAKKA#)?
+disp_locale=de :  display_name=Chinesisch( #HAKKA#)?
 -----------------
 locale='zh-wuu'
 disp_locale=en :  display_name=Chinese #WUU#
@@ -201,12 +201,12 @@ disp_locale=de :  display_name=i-enochian
 -----------------
 locale='zh-Hant'
 disp_locale=en :  display_name=Chinese #Traditional Han#
-disp_locale=fr :  display_name=chinois #idéogrammes han #variante traditionnelle##
+disp_locale=fr :  display_name=chinois #idéogrammes han (#variante traditionnelle#|traditionnels)#
 disp_locale=de :  display_name=Chinesisch #Traditionelle Chinesische Schrift#
 -----------------
 locale='zh-Hans'
 disp_locale=en :  display_name=Chinese #Simplified Han#
-disp_locale=fr :  display_name=chinois #idéogrammes han #variante simplifiée##
+disp_locale=fr :  display_name=chinois #idéogrammes han (#variante simplifiée#|simplifiés)#
 disp_locale=de :  display_name=Chinesisch #Vereinfachte Chinesische Schrift#
 -----------------
 locale='sr-Cyrl'
@@ -221,7 +221,7 @@ disp_locale=de :  display_name=Serbisch #Lateinisch#
 -----------------
 locale='zh-Hans-CN'
 disp_locale=en :  display_name=Chinese #Simplified Han, China#
-disp_locale=fr :  display_name=chinois #idéogrammes han #variante simplifiée#, Chine#
+disp_locale=fr :  display_name=chinois #idéogrammes han (#variante simplifiée#|simplifiés), Chine#
 disp_locale=de :  display_name=Chinesisch #Vereinfachte Chinesische Schrift, China#
 -----------------
 locale='sr-Latn-CS'
@@ -230,19 +230,19 @@ disp_locale=fr :  display_name=serbe #latin, Serbie-et-Monténégro#
 disp_locale=de :  display_name=Serbisch #Lateinisch, Serbien und Montenegro#
 -----------------
 locale='sl-rozaj'
-disp_locale=en :  display_name=Slovenian #ROZAJ#
-disp_locale=fr :  display_name=slovène #ROZAJ#
-disp_locale=de :  display_name=Slowenisch #(ROZAJ|Resianisch)#
+disp_locale=en :  display_name=Slovenian( #ROZAJ#)?
+disp_locale=fr :  display_name=slovène( #ROZAJ#)?
+disp_locale=de :  display_name=Slowenisch( #(ROZAJ|Resianisch)#)?
 -----------------
 locale='sl-nedis'
-disp_locale=en :  display_name=Slovenian #NEDIS#
-disp_locale=fr :  display_name=slovène #NEDIS#
-disp_locale=de :  display_name=Slowenisch #NEDIS#
+disp_locale=en :  display_name=Slovenian( #NEDIS#)?
+disp_locale=fr :  display_name=slovène( #NEDIS#)?
+disp_locale=de :  display_name=Slowenisch( #NEDIS#)?
 -----------------
 locale='de-CH-1901'
 disp_locale=en :  display_name=German #Switzerland, Traditional German orthography#
 disp_locale=fr :  display_name=allemand #Suisse, orthographe allemande traditionnelle#
-disp_locale=de :  display_name=Deutsch #Schweiz, (1901|alte deutsche Rechtschreibung)#
+disp_locale=de :  display_name=Deutsch #Schweiz, (1901|[aA]lte deutsche Rechtschreibung)#
 -----------------
 locale='sl-IT-nedis'
 disp_locale=en :  display_name=Slovenian #Italy, Natisone dialect#
@@ -275,9 +275,9 @@ disp_locale=fr :  display_name=allemand #Suisse, X_PHONEBK#
 disp_locale=de :  display_name=Deutsch #Schweiz, X_PHONEBK#
 -----------------
 locale='az-Arab-x-AZE-derbend'
-disp_locale=en :  display_name=Azerbaijani #Arabic, X, AZE_DERBEND#
-disp_locale=fr :  display_name=azéri #arabe, X, AZE_DERBEND#
-disp_locale=de :  display_name=Aserbaidschanisch #Arabisch, X, AZE_DERBEND#
+disp_locale=en :  display_name=Azerbaijani #Arabic(, X, AZE_DERBEND)?#
+disp_locale=fr :  display_name=azéri #arabe(, X, AZE_DERBEND)?#
+disp_locale=de :  display_name=Aserbaidschanisch #Arabisch(, X, AZE_DERBEND)?#
 -----------------
 locale='zh-min'
 disp_locale=en :  display_name=Chinese #MIN#
@@ -320,9 +320,9 @@ disp_locale=fr :  display_name=chinois #Chine, A_MYEXT_X_PRIVATE#
 disp_locale=de :  display_name=Chinesisch #China, A_MYEXT_X_PRIVATE#
 -----------------
 locale='en-a-myExt-b-another'
-disp_locale=en :  display_name=English #A, MYEXT_B_ANOTHER#
-disp_locale=fr :  display_name=anglais #A, MYEXT_B_ANOTHER#
-disp_locale=de :  display_name=Englisch #A, MYEXT_B_ANOTHER#
+disp_locale=en :  display_name=English( #A, MYEXT_B_ANOTHER#)?
+disp_locale=fr :  display_name=anglais( #A, MYEXT_B_ANOTHER#)?
+disp_locale=de :  display_name=Englisch( #A, MYEXT_B_ANOTHER#)?
 -----------------
 locale='de-419-DE'
 disp_locale=en :  display_name=German #Latin America and the Caribbean, DE#
@@ -335,7 +335,7 @@ disp_locale=fr :  display_name=a #Allemagne#
 disp_locale=de :  display_name=a #Deutschland#
 -----------------
 locale='ar-a-aaa-b-bbb-a-ccc'
-disp_locale=en :  display_name=Arabic #A, AAA_B_BBB_A_CCC#
-disp_locale=fr :  display_name=arabe #A, AAA_B_BBB_A_CCC#
-disp_locale=de :  display_name=Arabisch #A, AAA_B_BBB_A_CCC#
+disp_locale=en :  display_name=Arabic( #A, AAA_B_BBB_A_CCC#)?
+disp_locale=fr :  display_name=arabe( #A, AAA_B_BBB_A_CCC#)?
+disp_locale=de :  display_name=Arabisch( #A, AAA_B_BBB_A_CCC#)?
 -----------------
index 47ebeb7af6e554ae3efdf035e5a0389646279300..354fc06231bf569e56b84041e245edcd2840fcd4 100755 (executable)
@@ -163,14 +163,14 @@ disp_locale=fr :  display_region=Serbie-et-Monténégro
 disp_locale=de :  display_region=Serbien und Montenegro
 -----------------
 locale='sl-rozaj'
-disp_locale=en :  display_region=ROZAJ
-disp_locale=fr :  display_region=ROZAJ
-disp_locale=de :  display_region=ROZAJ
+disp_locale=en :  display_region=
+disp_locale=fr :  display_region=
+disp_locale=de :  display_region=
 -----------------
 locale='sl-nedis'
-disp_locale=en :  display_region=NEDIS
-disp_locale=fr :  display_region=NEDIS
-disp_locale=de :  display_region=NEDIS
+disp_locale=en :  display_region=
+disp_locale=fr :  display_region=
+disp_locale=de :  display_region=
 -----------------
 locale='de-CH-1901'
 disp_locale=en :  display_region=Switzerland
@@ -208,9 +208,9 @@ disp_locale=fr :  display_region=Suisse
 disp_locale=de :  display_region=Schweiz
 -----------------
 locale='az-Arab-x-AZE-derbend'
-disp_locale=en :  display_region=X
-disp_locale=fr :  display_region=X
-disp_locale=de :  display_region=X
+disp_locale=en :  display_region=X?
+disp_locale=fr :  display_region=X?
+disp_locale=de :  display_region=X?
 -----------------
 locale='zh-min'
 disp_locale=en :  display_region=
@@ -253,9 +253,9 @@ disp_locale=fr :  display_region=Chine
 disp_locale=de :  display_region=China
 -----------------
 locale='en-a-myExt-b-another'
-disp_locale=en :  display_region=A
-disp_locale=fr :  display_region=A
-disp_locale=de :  display_region=A
+disp_locale=en :  display_region=A?
+disp_locale=fr :  display_region=A?
+disp_locale=de :  display_region=A?
 -----------------
 locale='de-419-DE'
 disp_locale=en :  display_region=Latin America and the Caribbean
@@ -268,7 +268,7 @@ disp_locale=fr :  display_region=Allemagne
 disp_locale=de :  display_region=Deutschland
 -----------------
 locale='ar-a-aaa-b-bbb-a-ccc'
-disp_locale=en :  display_region=A
-disp_locale=fr :  display_region=A
-disp_locale=de :  display_region=A
+disp_locale=en :  display_region=A?
+disp_locale=fr :  display_region=A?
+disp_locale=de :  display_region=A?
 -----------------
index 1b74e90c9616319274bd79f37b51fb4a769e04bb..916441b5fac04d38bb2af561ac3a77addab6d912 100755 (executable)
@@ -91,7 +91,7 @@ include_once( 'ut_common.inc' );
 ut_run();
 
 ?>
---EXPECT--
+--EXPECTREGEX--
 locale='uk-ua_CALIFORNIA@currency=;currency=GRN'
 disp_locale=en :  display_script=
 disp_locale=fr :  display_script=
@@ -134,12 +134,12 @@ disp_locale=de :  display_script=
 -----------------
 locale='zh-Hant'
 disp_locale=en :  display_script=Traditional Han
-disp_locale=fr :  display_script=idéogrammes han (variante traditionnelle)
+disp_locale=fr :  display_script=idéogrammes han (\(variante traditionnelle\)|traditionnels)
 disp_locale=de :  display_script=Traditionelle Chinesische Schrift
 -----------------
 locale='zh-Hans'
 disp_locale=en :  display_script=Simplified Han
-disp_locale=fr :  display_script=idéogrammes han (variante simplifiée)
+disp_locale=fr :  display_script=idéogrammes han (\(variante simplifiée\)|simplifiés)
 disp_locale=de :  display_script=Vereinfachte Chinesische Schrift
 -----------------
 locale='sr-Cyrl'
@@ -154,7 +154,7 @@ disp_locale=de :  display_script=Lateinisch
 -----------------
 locale='zh-Hans-CN'
 disp_locale=en :  display_script=Simplified Han
-disp_locale=fr :  display_script=idéogrammes han (variante simplifiée)
+disp_locale=fr :  display_script=idéogrammes han (\(variante simplifiée\)|simplifiés)
 disp_locale=de :  display_script=Vereinfachte Chinesische Schrift
 -----------------
 locale='sr-Latn-CS'
index 7a58ba34d35839fd2c9bcc4f935ae00a9fcdd860..25bfef15d03af6ecfc59fa61f5f248d63455840d 100755 (executable)
@@ -175,7 +175,7 @@ disp_locale=de :  display_variant=
 locale='de-CH-1901'
 disp_locale=en :  display_variant=Traditional German orthography
 disp_locale=fr :  display_variant=orthographe allemande traditionnelle
-disp_locale=de :  display_variant=(1901|alte deutsche Rechtschreibung)
+disp_locale=de :  display_variant=(1901|[Aa]lte deutsche Rechtschreibung)
 -----------------
 locale='sl-IT-nedis'
 disp_locale=en :  display_variant=Natisone dialect
@@ -208,9 +208,9 @@ disp_locale=fr :  display_variant=X_PHONEBK
 disp_locale=de :  display_variant=X_PHONEBK
 -----------------
 locale='az-Arab-x-AZE-derbend'
-disp_locale=en :  display_variant=AZE_DERBEND
-disp_locale=fr :  display_variant=AZE_DERBEND
-disp_locale=de :  display_variant=AZE_DERBEND
+disp_locale=en :  display_variant=(AZE_DERBEND)?
+disp_locale=fr :  display_variant=(AZE_DERBEND)?
+disp_locale=de :  display_variant=(AZE_DERBEND)?
 -----------------
 locale='zh-min'
 disp_locale=en :  display_variant=
@@ -253,9 +253,9 @@ disp_locale=fr :  display_variant=A_MYEXT_X_PRIVATE
 disp_locale=de :  display_variant=A_MYEXT_X_PRIVATE
 -----------------
 locale='en-a-myExt-b-another'
-disp_locale=en :  display_variant=MYEXT_B_ANOTHER
-disp_locale=fr :  display_variant=MYEXT_B_ANOTHER
-disp_locale=de :  display_variant=MYEXT_B_ANOTHER
+disp_locale=en :  display_variant=(MYEXT_B_ANOTHER)?
+disp_locale=fr :  display_variant=(MYEXT_B_ANOTHER)?
+disp_locale=de :  display_variant=(MYEXT_B_ANOTHER)?
 -----------------
 locale='de-419-DE'
 disp_locale=en :  display_variant=DE
@@ -268,7 +268,7 @@ disp_locale=fr :  display_variant=
 disp_locale=de :  display_variant=
 -----------------
 locale='ar-a-aaa-b-bbb-a-ccc'
-disp_locale=en :  display_variant=AAA_B_BBB_A_CCC
-disp_locale=fr :  display_variant=AAA_B_BBB_A_CCC
-disp_locale=de :  display_variant=AAA_B_BBB_A_CCC
+disp_locale=en :  display_variant=(AAA_B_BBB_A_CCC)?
+disp_locale=fr :  display_variant=(AAA_B_BBB_A_CCC)?
+disp_locale=de :  display_variant=(AAA_B_BBB_A_CCC)?
 -----------------
index e62855e5605c4cc598f6170c560043f204633659..0bebb331a82d1d6146d6b1310af341d3b5bca22b 100755 (executable)
@@ -99,8 +99,8 @@ sr-Cyrl:  region=''
 sr-Latn:  region=''
 zh-Hans-CN:  region='CN'
 sr-Latn-CS:  region='CS'
-sl-rozaj:  region='ROZAJ'
-sl-nedis:  region='NEDIS'
+sl-rozaj:  region=''
+sl-nedis:  region=''
 de-CH-1901:  region='CH'
 sl-IT-nedis:  region='IT'
 sl-Latn-IT-nedis:  region='IT'
@@ -108,7 +108,7 @@ de-DE:  region='DE'
 en-US:  region='US'
 es-419:  region='419'
 de-CH-x-phonebk:  region='CH'
-az-Arab-x-AZE-derbend:  region='X'
+az-Arab-x-AZE-derbend:  region=''
 zh-min:  region=''
 zh-min-nan-Hant-CN:  region='MIN'
 x-whatever:  region=''
@@ -117,7 +117,7 @@ sr-Latn-QM:  region='QM'
 sr-Qaaa-CS:  region='CS'
 en-US-u-islamCal:  region='US'
 zh-CN-a-myExt-x-private:  region='CN'
-en-a-myExt-b-another:  region='A'
+en-a-myExt-b-another:  region=''
 de-419-DE:  region='419'
 a-DE:  region='DE'
-ar-a-aaa-b-bbb-a-ccc:  region='A'
+ar-a-aaa-b-bbb-a-ccc:  region=''
index e670b31a1331faee0b4fa0c63c607c4c4c7cf141..e47f71830a62c48f4570d80802ff35c48c5df4fb 100755 (executable)
@@ -138,10 +138,10 @@ sr-Latn-CS:
 language : 'sr' , script : 'Latn' , region : 'CS' , 
 ---------------------
 sl-rozaj: 
-language : 'sl' , region : 'ROZAJ' , 
+language : 'sl' , 
 ---------------------
 sl-nedis: 
-language : 'sl' , region : 'NEDIS' , 
+language : 'sl' , 
 ---------------------
 de-CH-1901: 
 language : 'de' , region : 'CH' , variant0 : '1901' ,