Index: base/json/json_parser_unittest.cc |
=================================================================== |
--- base/json/json_parser_unittest.cc (revision 177738) |
+++ base/json/json_parser_unittest.cc (working copy) |
@@ -219,6 +219,17 @@ |
error_message); |
EXPECT_EQ(JSONReader::JSON_SYNTAX_ERROR, error_code); |
+ // Test line and column counting with "\r\n" line ending |
+ const char* big_json_crlf = |
+ "[\r\n0,\r\n1,\r\n2,\r\n3,4,5,6 7,\r\n8,\r\n9\r\n]"; |
+ // error here --------------------^ |
+ root.reset(JSONReader::ReadAndReturnError(big_json_crlf, JSON_PARSE_RFC, |
+ &error_code, &error_message)); |
+ EXPECT_FALSE(root.get()); |
+ EXPECT_EQ(JSONParser::FormatErrorMessage(5, 10, JSONReader::kSyntaxError), |
+ error_message); |
+ EXPECT_EQ(JSONReader::JSON_SYNTAX_ERROR, error_code); |
+ |
// Test each of the error conditions |
root.reset(JSONReader::ReadAndReturnError("{},{}", JSON_PARSE_RFC, |
&error_code, &error_message)); |