From 00fa66ab0c6e2cfd47b204b032163097461d21d3 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Fri, 2 Feb 2018 14:48:13 +1100 Subject: [PATCH] Bug 1435144 - Fix the last part of the prefs parser gtest. r=glandium MozReview-Commit-ID: KPG5SX2vwce --- modules/libpref/test/gtest/Parser.cpp | 33 ++++++--------------------- 1 file changed, 7 insertions(+), 26 deletions(-) diff --git a/modules/libpref/test/gtest/Parser.cpp b/modules/libpref/test/gtest/Parser.cpp index 2e22fbc8964d..11bbb0c01c7c 100644 --- a/modules/libpref/test/gtest/Parser.cpp +++ b/modules/libpref/test/gtest/Parser.cpp @@ -497,48 +497,29 @@ pref("parse.error", true);; //------------------------------------------------------------------------- // In all of the following we have a \n, a \r, a \r\n, and then an error, so - // the error is on line 4. + // the error is on line 4. (Note: these ones don't use raw string literals + // because MSVC somehow swallows any \r that appears in them.) -// XXX: these are temporarily commented out due to differing results on Windows -#if 0 - - P(R"( - -bad - )", + P("\n \r \r\n bad", "test:4: prefs parse error: unknown keyword" ); - P(R"(# -# # -bad - )", + P("#\n#\r#\r\n bad", "test:4: prefs parse error: unknown keyword" ); - P(R"(// -// // -bad - )", + P("//\n//\r//\r\n bad", "test:4: prefs parse error: unknown keyword" ); - P(R"(/* - -*/ bad - )", + P("/*\n \r \r\n*/ bad", "test:4: prefs parse error: unknown keyword" ); // Note: the escape sequences do *not* affect the line number. - P(R"(pref("foo\n -\r foo\r\n -foo", bad - )", + P("pref(\"foo\\n\n foo\\r\r foo\\r\\n\r\n foo\", bad);", "test:4: prefs parse error: unknown keyword" ); -#endif - // clang-format on }