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

Unified Diff: base/json/string_escape_unittest.cc

Issue 2903773003: Escape invalid code points (Closed)
Patch Set: Update documentation and signed/unsigned comparison Created 3 years, 7 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 | « base/json/string_escape.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/json/string_escape_unittest.cc
diff --git a/base/json/string_escape_unittest.cc b/base/json/string_escape_unittest.cc
index ae3d82ad5e8e85df58d4a516fd1f071e9bf67765..1e962c604184806ab19bf9e54bb49df99506f8d1 100644
--- a/base/json/string_escape_unittest.cc
+++ b/base/json/string_escape_unittest.cc
@@ -18,14 +18,14 @@ 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"},
- {"Hello\xe2\x80\xa8world", "Hello\\u2028world"},
- {"\xe2\x80\xa9purple", "\\u2029purple"},
+ {"\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"},
+ {"\xF3\xBF\xBF\xBF", "\xEF\xBF\xBD"},
};
for (size_t i = 0; i < arraysize(cases); ++i) {
« no previous file with comments | « base/json/string_escape.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698