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

Unified Diff: base/json_reader_unittest.cc

Issue 147220: Use platform-appropriate newlines in JSON output (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 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 | « base/file_util_unittest.cc ('k') | base/json_writer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/json_reader_unittest.cc
===================================================================
--- base/json_reader_unittest.cc (revision 19366)
+++ base/json_reader_unittest.cc (working copy)
@@ -308,8 +308,28 @@
root2.reset(JSONReader::Read(
"{\"number\":9.87654321, \"null\":null , \"\\x53\" : \"str\", }", true));
+ ASSERT_TRUE(root2.get());
EXPECT_TRUE(root->Equals(root2.get()));
+ // Test newline equivalence.
+ root2.reset(JSONReader::Read(
+ "{\n"
+ " \"number\":9.87654321,\n"
+ " \"null\":null,\n"
+ " \"\\x53\":\"str\",\n"
+ "}\n", true));
+ ASSERT_TRUE(root2.get());
+ EXPECT_TRUE(root->Equals(root2.get()));
+
+ root2.reset(JSONReader::Read(
+ "{\r\n"
+ " \"number\":9.87654321,\r\n"
+ " \"null\":null,\r\n"
+ " \"\\x53\":\"str\",\r\n"
+ "}\r\n", true));
+ ASSERT_TRUE(root2.get());
+ EXPECT_TRUE(root->Equals(root2.get()));
+
// Test nesting
root.reset(JSONReader::Read(
"{\"inner\":{\"array\":[true]},\"false\":false,\"d\":{}}", false));
« no previous file with comments | « base/file_util_unittest.cc ('k') | base/json_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698