Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3703)

Unified Diff: base/i18n/number_formatting_unittest.cc

Issue 2447513002: Update ICU to 58.1 (Closed)
Patch Set: fix a typo in html comment Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « DEPS ('k') | components/url_formatter/url_formatter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/i18n/number_formatting_unittest.cc
diff --git a/base/i18n/number_formatting_unittest.cc b/base/i18n/number_formatting_unittest.cc
index a131bf3e7d7a078dfbb028316ef91fe73e465a46..baa7ba7d807d26947e16e5d5e4adedf19091fdde 100644
--- a/base/i18n/number_formatting_unittest.cc
+++ b/base/i18n/number_formatting_unittest.cc
@@ -99,11 +99,18 @@ TEST(NumberFormattingTest, FormatPercent) {
int64_t number;
const char* expected_english;
const wchar_t* expected_german; // Note: Space before % isn't \x20.
- const wchar_t* expected_persian; // Note: Non-Arabic numbers and %.
+ // Note: Eastern Arabic-Indic digits (U+06Fx) for Persian and
+ // Arabic-Indic digits (U+066x) for Arabic.
+ // See http://unicode.org/cldr/trac/ticket/9040 for details.
+ const wchar_t* expected_persian;
+ const wchar_t* expected_arabic;
} cases[] = {
- {0, "0%", L"0\xa0%", L"\x6f0\x200f\x66a"},
- {42, "42%", L"42\xa0%", L"\x6f4\x6f2\x200f\x66a"},
- {1024, "1,024%", L"1.024\xa0%", L"\x6f1\x66c\x6f0\x6f2\x6f4\x200f\x66a"},
+ {0, "0%", L"0\xa0%", L"\x200e\x66a\xa0\x6f0", L"\x660\xa0\x66a\x61c"},
+ {42, "42%", L"42\xa0%", L"\x200e\x66a\xa0\x6f4\x6f2",
+ L"\x664\x662\xa0\x66a\x61c"},
+ {1024, "1,024%", L"1.024\xa0%",
+ L"\x200e\x66a\xa0\x6f1\x66c\x6f0\x6f2\x6f4",
+ L"\x661\x66c\x660\x662\x664\xa0\x66a\x61c"},
};
test::ScopedRestoreICUDefaultLocale restore_locale;
@@ -117,6 +124,9 @@ TEST(NumberFormattingTest, FormatPercent) {
i18n::SetICUDefaultLocale("fa");
EXPECT_EQ(WideToUTF16(cases[i].expected_persian),
FormatPercent(cases[i].number));
+ i18n::SetICUDefaultLocale("ar");
+ EXPECT_EQ(WideToUTF16(cases[i].expected_arabic),
+ FormatPercent(cases[i].number));
}
}
« no previous file with comments | « DEPS ('k') | components/url_formatter/url_formatter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698