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

Unified Diff: runtime/vm/json_test.cc

Issue 22599002: Escape strings when writing to JSON. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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 | « runtime/vm/json_stream.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/json_test.cc
diff --git a/runtime/vm/json_test.cc b/runtime/vm/json_test.cc
index 39a8eeebe097c93a222835def8af3b1dab5e1ed3..bdbfc26aa414636231ee7b33f1360556ed66e07a 100644
--- a/runtime/vm/json_test.cc
+++ b/runtime/vm/json_test.cc
@@ -251,5 +251,12 @@ TEST_CASE(JSON_JSONStream_DartObject) {
tb.buf());
}
+TEST_CASE(JSON_JSONStream_EscapedString) {
+ TextBuffer tb(256);
+ JSONStream js(&tb);
+ js.PrintValue("Hel\"\"lo\r\n\t");
+ EXPECT_STREQ("\"Hel\\\"\\\"lo\\r\\n\\t\"", tb.buf());
+}
+
} // namespace dart
« no previous file with comments | « runtime/vm/json_stream.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698