Chromium Code Reviews| Index: base/strings/string_util_unittest.cc |
| diff --git a/base/strings/string_util_unittest.cc b/base/strings/string_util_unittest.cc |
| index 187e49e6698160e5629283371766f3df4629b09a..27274083ea2bf77b055c101e7c84ec21d06348bd 100644 |
| --- a/base/strings/string_util_unittest.cc |
| +++ b/base/strings/string_util_unittest.cc |
| @@ -1080,6 +1080,23 @@ TEST(StringUtilTest, EqualsCaseInsensitiveASCII) { |
| EXPECT_FALSE(EqualsCaseInsensitiveASCII("Asdf", "aSDFz")); |
| } |
| +TEST(StringUtilTest, IsUnicodeWhitespace) { |
| + // NOT unicode white space. |
| + EXPECT_FALSE(IsUnicodeWhitespace(L'\0')); |
| + EXPECT_FALSE(IsUnicodeWhitespace(L'A')); |
| + EXPECT_FALSE(IsUnicodeWhitespace(L'0')); |
| + EXPECT_FALSE(IsUnicodeWhitespace(L'.')); |
| + EXPECT_FALSE(IsUnicodeWhitespace(L';')); |
| + |
| + // Actual unicode whitespace. |
| + EXPECT_TRUE(IsUnicodeWhitespace(L' ')); |
| + EXPECT_TRUE(IsUnicodeWhitespace(L'\t')); |
| + EXPECT_TRUE(IsUnicodeWhitespace(L'\r')); |
| + EXPECT_TRUE(IsUnicodeWhitespace(L'\v')); |
| + EXPECT_TRUE(IsUnicodeWhitespace(L'\f')); |
| + EXPECT_TRUE(IsUnicodeWhitespace(L'\n')); |
|
brettw
2015/10/13 21:41:51
Can you add a non-ASCII one as well, like:
0xA0 (
eroman
2015/10/13 22:04:22
Done. (Also added a non-ASCII non-whitespace test)
|
| +} |
| + |
| class WriteIntoTest : public testing::Test { |
| protected: |
| static void WritesCorrectly(size_t num_chars) { |