Index: base/strings/string_util_unittest.cc |
diff --git a/base/strings/string_util_unittest.cc b/base/strings/string_util_unittest.cc |
index eb6cd7ecfc14d873e3b88d8af1b34dd031e88a22..187e49e6698160e5629283371766f3df4629b09a 100644 |
--- a/base/strings/string_util_unittest.cc |
+++ b/base/strings/string_util_unittest.cc |
@@ -503,30 +503,30 @@ TEST(StringUtilTest, ConvertASCII) { |
EXPECT_EQ(0, string_with_nul.compare(narrow_with_nul)); |
} |
+TEST(StringUtilTest, ToLowerASCII) { |
+ EXPECT_EQ('c', ToLowerASCII('C')); |
+ EXPECT_EQ('c', ToLowerASCII('c')); |
+ EXPECT_EQ('2', ToLowerASCII('2')); |
+ |
+ EXPECT_EQ(static_cast<char16>('c'), ToLowerASCII(static_cast<char16>('C'))); |
+ EXPECT_EQ(static_cast<char16>('c'), ToLowerASCII(static_cast<char16>('c'))); |
+ EXPECT_EQ(static_cast<char16>('2'), ToLowerASCII(static_cast<char16>('2'))); |
+ |
+ EXPECT_EQ("cc2", ToLowerASCII("Cc2")); |
+ EXPECT_EQ(ASCIIToUTF16("cc2"), ToLowerASCII(ASCIIToUTF16("Cc2"))); |
+} |
+ |
TEST(StringUtilTest, ToUpperASCII) { |
EXPECT_EQ('C', ToUpperASCII('C')); |
EXPECT_EQ('C', ToUpperASCII('c')); |
EXPECT_EQ('2', ToUpperASCII('2')); |
- EXPECT_EQ(L'C', ToUpperASCII(L'C')); |
- EXPECT_EQ(L'C', ToUpperASCII(L'c')); |
- EXPECT_EQ(L'2', ToUpperASCII(L'2')); |
- |
- std::string in_place_a("Cc2"); |
- StringToUpperASCII(&in_place_a); |
- EXPECT_EQ("CC2", in_place_a); |
- |
- std::wstring in_place_w(L"Cc2"); |
- StringToUpperASCII(&in_place_w); |
- EXPECT_EQ(L"CC2", in_place_w); |
- |
- std::string original_a("Cc2"); |
- std::string upper_a = StringToUpperASCII(original_a); |
- EXPECT_EQ("CC2", upper_a); |
+ EXPECT_EQ(static_cast<char16>('C'), ToUpperASCII(static_cast<char16>('C'))); |
+ EXPECT_EQ(static_cast<char16>('C'), ToUpperASCII(static_cast<char16>('c'))); |
+ EXPECT_EQ(static_cast<char16>('2'), ToUpperASCII(static_cast<char16>('2'))); |
- std::wstring original_w(L"Cc2"); |
- std::wstring upper_w = StringToUpperASCII(original_w); |
- EXPECT_EQ(L"CC2", upper_w); |
+ EXPECT_EQ("CC2", ToUpperASCII("Cc2")); |
+ EXPECT_EQ(ASCIIToUTF16("CC2"), ToUpperASCII(ASCIIToUTF16("Cc2"))); |
} |
TEST(StringUtilTest, LowerCaseEqualsASCII) { |