stas            Thu Sep  4 19:59:37 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/ext/intl/tests     formatter_format.phpt 
                                formatter_format_currency.phpt 
                                formatter_get_locale.phpt 
                                formatter_get_set_pattern.phpt 
  Log:
  fix formatter tests for ICU 3.8
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/intl/tests/formatter_format.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u
Index: php-src/ext/intl/tests/formatter_format.phpt
diff -u php-src/ext/intl/tests/formatter_format.phpt:1.1.2.1 
php-src/ext/intl/tests/formatter_format.phpt:1.1.2.2
--- php-src/ext/intl/tests/formatter_format.phpt:1.1.2.1        Mon Jul  7 
22:51:04 2008
+++ php-src/ext/intl/tests/formatter_format.phpt        Thu Sep  4 19:59:37 2008
@@ -9,6 +9,10 @@
  * 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.
+ */
 
 function ut_main()
 {
@@ -25,10 +29,15 @@
         1234999, // bad one
     );
 
+   $integer = array(
+        NumberFormatter::ORDINAL => '',
+        NumberFormatter::DURATION => '',
+   );
     $locales = array(
         'en_US',
         'ru_UA',
         'de',
+        'fr',
         'en_UK'
     );
 
@@ -37,7 +46,7 @@
 
     foreach( $locales as $locale )
     {
-        $str_res .= "\n  Locale is: $locale\n";
+        $str_res .= "\nLocale is: $locale\n";
         foreach( $styles as $style => $pattern )
         {
             $fmt = ut_nfmt_create( $locale, $style, $pattern );
@@ -46,7 +55,7 @@
                                $str_res .= "Bad formatter!\n";
                                continue;
                        }
-            $str_res .= dump( ut_nfmt_format( $fmt, $number ) ) . "\n";
+            $str_res .= dump( isset($integer[$style])?ut_nfmt_format( $fmt, 
$number, NumberFormatter::TYPE_INT32):ut_nfmt_format( $fmt, $number ) ) . "\n";
         }
     }
     return $str_res;
@@ -58,7 +67,7 @@
 ut_run();
 
 ?>
---EXPECT--
+--EXPECTF--
 Locale is: en_US
 '1234567.89123457'
 '1,234,567.891'
@@ -66,43 +75,55 @@
 '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,568th'
-'342:56:08'
+'1,234,567th'
+'342:56:07'
 '#####.###'
 Bad formatter!
 
-  Locale is: ru_UA
+Locale is: ru_UA
 '1234567,89123457'
 '1 234 567,891'
 '1 234 567,89 грн.'
-'123 456 789%'
+'123 456 789 %'
 '1,23456789123457E6'
 'миллион два сто тридцать четыре тысяча 
пять сто шестьдесят восемь'
-'1 234 568'
-'1 234 568'
+'1 234 567'
+'1 234 567'
 '#####.###'
 Bad formatter!
 
-  Locale is: de
+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.568'
-'1.234.568'
+'1.234.567'
+'1.234.567'
 '#####.###'
 Bad formatter!
 
-  Locale is: en_UK
+Locale is: fr
+'1234567,89123457'
+'1 234 567,891'
+'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'
+'1 234 567'
+'#####.###'
+Bad formatter!
+
+Locale is: en_UK
 '1234567.89123457'
 '1,234,567.891'
 '¤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,568th'
-'342:56:08'
+'1,234,567th'
+'342:56:07'
 '#####.###'
-Bad formatter!
+Bad formatter!
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/intl/tests/formatter_format_currency.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u
Index: php-src/ext/intl/tests/formatter_format_currency.phpt
diff -u php-src/ext/intl/tests/formatter_format_currency.phpt:1.1.2.1 
php-src/ext/intl/tests/formatter_format_currency.phpt:1.1.2.2
--- php-src/ext/intl/tests/formatter_format_currency.phpt:1.1.2.1       Mon Jul 
 7 22:51:04 2008
+++ php-src/ext/intl/tests/formatter_format_currency.phpt       Thu Sep  4 
19:59:37 2008
@@ -8,6 +8,10 @@
 /*
  * Format a number using misc currencies/locales.
  */
+/* 
+ * TODO: doesn't pass on ICU 3.6 because 'ru' and 'uk' locales changed
+ * currency formatting.
+ */
 
 
 function ut_main()
@@ -40,6 +44,6 @@
 --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'
+ru: '1 234 567,89 р.'
+uk: '1 234 567,89 грн.'
+en: 'UAH1,234,567.89'
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/intl/tests/formatter_get_locale.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u
Index: php-src/ext/intl/tests/formatter_get_locale.phpt
diff -u php-src/ext/intl/tests/formatter_get_locale.phpt:1.1.2.1 
php-src/ext/intl/tests/formatter_get_locale.phpt:1.1.2.2
--- php-src/ext/intl/tests/formatter_get_locale.phpt:1.1.2.1    Mon Jul  7 
22:51:04 2008
+++ php-src/ext/intl/tests/formatter_get_locale.phpt    Thu Sep  4 19:59:37 2008
@@ -14,7 +14,7 @@
     $locales = array(
         'en_UK',
         '[EMAIL PROTECTED]',
-        'uk',
+        'fr_CA',
     );
 
     $loc_types = array(
@@ -46,4 +46,4 @@
 --EXPECT--
 en_UK:  actual='en' valid='en'
 [EMAIL PROTECTED]:  actual='en' valid='en'
-uk:  actual='root' valid='uk'
+fr_CA:  actual='fr_CA' valid='fr_CA'
http://cvs.php.net/viewvc.cgi/php-src/ext/intl/tests/formatter_get_set_pattern.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u
Index: php-src/ext/intl/tests/formatter_get_set_pattern.phpt
diff -u php-src/ext/intl/tests/formatter_get_set_pattern.phpt:1.1.2.1 
php-src/ext/intl/tests/formatter_get_set_pattern.phpt:1.1.2.2
--- php-src/ext/intl/tests/formatter_get_set_pattern.phpt:1.1.2.1       Mon Jul 
 7 22:51:04 2008
+++ php-src/ext/intl/tests/formatter_get_set_pattern.phpt       Thu Sep  4 
19:59:37 2008
@@ -43,8 +43,8 @@
 ut_run();
 
 ?>
---EXPECT--
-Default pattern: 
'#.#####################################################################################################################################################################################################################################################################################################################'
+--EXPECTF--
+Default pattern: 
'#.####################################################################################################################################################################################################################################################################################################################%s'
 Formatting result: 12345.123456
 New pattern: '#0.0'
 Formatted number: 12345.1



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to