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

Unified Diff: json/string_escape_unittest.cc

Issue 2050803003: Update to Chromium //base at Chromium commit e3a753f17bac62738b0dbf0b36510f767b081e4b. (Closed) Base URL: https://github.com/domokit/base.git@master
Patch Set: Created 4 years, 6 months 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 | « json/string_escape.cc ('k') | logging.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: json/string_escape_unittest.cc
diff --git a/json/string_escape_unittest.cc b/json/string_escape_unittest.cc
index 100373fccd3ee7df36c8e11f89d06e04ab1734fa..738a65777b89bbfc4fd07a801cde9106c1443d41 100644
--- a/json/string_escape_unittest.cc
+++ b/json/string_escape_unittest.cc
@@ -15,12 +15,13 @@ TEST(JSONStringEscapeTest, EscapeUTF8) {
const char* to_escape;
const char* escaped;
} cases[] = {
- {"\b\001aZ\"\\wee", "\\b\\u0001aZ\\\"\\\\wee"},
- {"a\b\f\n\r\t\v\1\\.\"z",
- "a\\b\\f\\n\\r\\t\\u000B\\u0001\\\\.\\\"z"},
- {"b\x0f\x7f\xf0\xff!", // \xf0\xff is not a valid UTF-8 unit.
- "b\\u000F\x7F\xEF\xBF\xBD\xEF\xBF\xBD!"},
- {"c<>d", "c\\u003C>d"},
+ {"\b\001aZ\"\\wee", "\\b\\u0001aZ\\\"\\\\wee"},
+ {"a\b\f\n\r\t\v\1\\.\"z", "a\\b\\f\\n\\r\\t\\u000B\\u0001\\\\.\\\"z"},
+ {"b\x0f\x7f\xf0\xff!", // \xf0\xff is not a valid UTF-8 unit.
+ "b\\u000F\x7F\xEF\xBF\xBD\xEF\xBF\xBD!"},
+ {"c<>d", "c\\u003C>d"},
+ {"Hello\xe2\x80\xa8world", "Hello\\u2028world"},
+ {"\xe2\x80\xa9purple", "\\u2029purple"},
};
for (size_t i = 0; i < arraysize(cases); ++i) {
@@ -73,12 +74,13 @@ TEST(JSONStringEscapeTest, EscapeUTF16) {
const wchar_t* to_escape;
const char* escaped;
} cases[] = {
- {L"b\uffb1\u00ff", "b\xEF\xBE\xB1\xC3\xBF"},
- {L"\b\001aZ\"\\wee", "\\b\\u0001aZ\\\"\\\\wee"},
- {L"a\b\f\n\r\t\v\1\\.\"z",
- "a\\b\\f\\n\\r\\t\\u000B\\u0001\\\\.\\\"z"},
- {L"b\x0f\x7f\xf0\xff!", "b\\u000F\x7F\xC3\xB0\xC3\xBF!"},
- {L"c<>d", "c\\u003C>d"},
+ {L"b\uffb1\u00ff", "b\xEF\xBE\xB1\xC3\xBF"},
+ {L"\b\001aZ\"\\wee", "\\b\\u0001aZ\\\"\\\\wee"},
+ {L"a\b\f\n\r\t\v\1\\.\"z", "a\\b\\f\\n\\r\\t\\u000B\\u0001\\\\.\\\"z"},
+ {L"b\x0f\x7f\xf0\xff!", "b\\u000F\x7F\xC3\xB0\xC3\xBF!"},
+ {L"c<>d", "c\\u003C>d"},
+ {L"Hello\u2028world", "Hello\\u2028world"},
+ {L"\u2029purple", "\\u2029purple"},
};
for (size_t i = 0; i < arraysize(cases); ++i) {
« no previous file with comments | « json/string_escape.cc ('k') | logging.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698