Bug 1490115 - Add extra tests for comment-only inputs. r=glandium
authorNicholas Nethercote <nnethercote@mozilla.com>
Tue, 11 Sep 2018 09:41:40 +1000
changeset 435630 9533efb267a0d14f343b99f1b5f6183cd1e106b7
parent 435629 f0c8d0f1cb586fddd41516c328150c95843e70bc
child 435631 4453b0554c92e1d898ec223b54450399357ddb7e
push id34616
push usercsabou@mozilla.com
push dateTue, 11 Sep 2018 10:07:11 +0000
treeherdermozilla-central@423bdf7a802b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1490115
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1490115 - Add extra tests for comment-only inputs. r=glandium
modules/libpref/test/gtest/Parser.cpp
--- a/modules/libpref/test/gtest/Parser.cpp
+++ b/modules/libpref/test/gtest/Parser.cpp
@@ -46,27 +46,30 @@ TEST(PrefsParser, Errors)
 pref("bool", true);
 sticky_pref("int", 123);
 user_pref("string", "value");
     )",
     ""
   );
 
   // Totally empty input.
-  DEFAULT("",
-    ""
-  );
+  DEFAULT("", "");
 
   // Whitespace-only input.
   DEFAULT(R"(
 
     )" "\v \t \v \f",
     ""
   );
 
+  // Comment-only inputs.
+  DEFAULT(R"(// blah)", "");
+  DEFAULT(R"(# blah)", "");
+  DEFAULT(R"(/* blah */)", "");
+
   //-------------------------------------------------------------------------
   // All the lexing errors. (To be pedantic, some of the integer literal
   // overflows are triggered in the parser, but put them all here so they're all
   // in the one spot.)
   //-------------------------------------------------------------------------
 
   // Integer overflow errors.
   DEFAULT(R"(