From f01a0cba6bc20c1c0bfc40023aacfa9ab48ab068 Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Tue, 4 Jan 2011 03:24:38 +0000 Subject: [PATCH] fix unit tests for intl in accordance with new ICU releases --- ext/intl/grapheme/grapheme_string.c | 134 +++++++++--------- ext/intl/tests/collator_get_locale.phpt | 2 - ext/intl/tests/collator_get_sort_key.phpt | 10 +- .../tests/dateformat_set_timezone_id.phpt | 14 +- ext/intl/tests/formatter_format.phpt | 34 ++--- ext/intl/tests/formatter_format_currency.phpt | 12 +- ext/intl/tests/grapheme.phpt | 4 +- ext/intl/tests/locale_get_display_name.phpt | 44 +++--- ext/intl/tests/locale_get_display_region.phpt | 30 ++-- ext/intl/tests/locale_get_display_script.phpt | 8 +- .../tests/locale_get_display_variant.phpt | 20 +-- ext/intl/tests/locale_get_region.phpt | 10 +- ext/intl/tests/locale_parse_locale.phpt | 4 +- 13 files changed, 163 insertions(+), 163 deletions(-) diff --git a/ext/intl/grapheme/grapheme_string.c b/ext/intl/grapheme/grapheme_string.c index 6ad8769619..1784d028a8 100755 --- a/ext/intl/grapheme/grapheme_string.c +++ b/ext/intl/grapheme/grapheme_string.c @@ -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); } diff --git a/ext/intl/tests/collator_get_locale.phpt b/ext/intl/tests/collator_get_locale.phpt index 2fab35eb47..3f5dbaa0eb 100755 --- a/ext/intl/tests/collator_get_locale.phpt +++ b/ext/intl/tests/collator_get_locale.phpt @@ -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 diff --git a/ext/intl/tests/collator_get_sort_key.phpt b/ext/intl/tests/collator_get_sort_key.phpt index 0186c26f66..0fedde0fff 100755 --- a/ext/intl/tests/collator_get_sort_key.phpt +++ b/ext/intl/tests/collator_get_sort_key.phpt @@ -2,6 +2,8 @@ collator_get_sort_key() --SKIPIF-- +--XFAIL-- +Sort keys are not fixed, comparing them to fixed strings doesn't work. --FILE-- $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' -'миллион два сто тридцать четыре тысяча пять сто шестьдесят восемь' -'1 234 567' +'один миллион двасти тридцать четыре тысяч пятьсот шестьдесят семь запятая восемь девять один два три четыре пять семь' +'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 diff --git a/ext/intl/tests/formatter_format_currency.phpt b/ext/intl/tests/formatter_format_currency.phpt index 715f12256c..c53f831b75 100755 --- a/ext/intl/tests/formatter_format_currency.phpt +++ b/ext/intl/tests/formatter_format_currency.phpt @@ -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 diff --git a/ext/intl/tests/grapheme.phpt b/ext/intl/tests/grapheme.phpt index d65c90900d..def9110d0d 100755 --- a/ext/intl/tests/grapheme.phpt +++ b/ext/intl/tests/grapheme.phpt @@ -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 diff --git a/ext/intl/tests/locale_get_display_name.phpt b/ext/intl/tests/locale_get_display_name.phpt index 1e84bc2b96..cf89498657 100755 --- a/ext/intl/tests/locale_get_display_name.phpt +++ b/ext/intl/tests/locale_get_display_name.phpt @@ -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#)? ----------------- diff --git a/ext/intl/tests/locale_get_display_region.phpt b/ext/intl/tests/locale_get_display_region.phpt index 47ebeb7af6..354fc06231 100755 --- a/ext/intl/tests/locale_get_display_region.phpt +++ b/ext/intl/tests/locale_get_display_region.phpt @@ -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? ----------------- diff --git a/ext/intl/tests/locale_get_display_script.phpt b/ext/intl/tests/locale_get_display_script.phpt index 1b74e90c96..916441b5fa 100755 --- a/ext/intl/tests/locale_get_display_script.phpt +++ b/ext/intl/tests/locale_get_display_script.phpt @@ -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' diff --git a/ext/intl/tests/locale_get_display_variant.phpt b/ext/intl/tests/locale_get_display_variant.phpt index 7a58ba34d3..25bfef15d0 100755 --- a/ext/intl/tests/locale_get_display_variant.phpt +++ b/ext/intl/tests/locale_get_display_variant.phpt @@ -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)? ----------------- diff --git a/ext/intl/tests/locale_get_region.phpt b/ext/intl/tests/locale_get_region.phpt index e62855e560..0bebb331a8 100755 --- a/ext/intl/tests/locale_get_region.phpt +++ b/ext/intl/tests/locale_get_region.phpt @@ -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='' diff --git a/ext/intl/tests/locale_parse_locale.phpt b/ext/intl/tests/locale_parse_locale.phpt index e670b31a13..e47f71830a 100755 --- a/ext/intl/tests/locale_parse_locale.phpt +++ b/ext/intl/tests/locale_parse_locale.phpt @@ -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' , -- 2.40.0