diff options
author | Evan Martin <martine@danga.com> | 2012-01-05 04:12:22 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2012-01-05 04:13:35 (GMT) |
commit | eeed724111402fb4746dbd2544c90ab946d03c67 (patch) | |
tree | 160354192a9a234f2373c8b9111f854f0498e0c2 /src/parsers_test.cc | |
parent | 23ab2829f5f3dd66d95e1d3230f9c4bcb70cfabf (diff) | |
download | Ninja-eeed724111402fb4746dbd2544c90ab946d03c67.zip Ninja-eeed724111402fb4746dbd2544c90ab946d03c67.tar.gz Ninja-eeed724111402fb4746dbd2544c90ab946d03c67.tar.bz2 |
make Lexer::Error not emit trailing newline
Now it's consistent with other errors.
Fixes part of issue #187.
Diffstat (limited to 'src/parsers_test.cc')
-rw-r--r-- | src/parsers_test.cc | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/parsers_test.cc b/src/parsers_test.cc index d6b3117..7830917 100644 --- a/src/parsers_test.cc +++ b/src/parsers_test.cc @@ -232,7 +232,7 @@ TEST_F(ParserTest, Errors) { EXPECT_FALSE(parser.ParseTest("foobar", &err)); EXPECT_EQ("input:1: expected '=', got eof\n" "foobar\n" - " ^ near here\n" + " ^ near here" , err); } @@ -242,7 +242,7 @@ TEST_F(ParserTest, Errors) { EXPECT_FALSE(parser.ParseTest("x 3", &err)); EXPECT_EQ("input:1: expected '=', got identifier\n" "x 3\n" - " ^ near here\n" + " ^ near here" , err); } @@ -252,7 +252,7 @@ TEST_F(ParserTest, Errors) { EXPECT_FALSE(parser.ParseTest("x = 3", &err)); EXPECT_EQ("input:1: unexpected EOF\n" "x = 3\n" - " ^ near here\n" + " ^ near here" , err); } @@ -263,7 +263,7 @@ TEST_F(ParserTest, Errors) { EXPECT_FALSE(parser.ParseTest("x = 3\ny 2", &err)); EXPECT_EQ("input:2: expected '=', got identifier\n" "y 2\n" - " ^ near here\n" + " ^ near here" , err); } @@ -274,7 +274,7 @@ TEST_F(ParserTest, Errors) { EXPECT_FALSE(parser.ParseTest("x = $", &err)); EXPECT_EQ("input:1: bad $-escape (literal $ must be written as $$)\n" "x = $\n" - " ^ near here\n" + " ^ near here" , err); } @@ -285,7 +285,7 @@ TEST_F(ParserTest, Errors) { EXPECT_FALSE(parser.ParseTest("x = $\n $[\n", &err)); EXPECT_EQ("input:2: bad $-escape (literal $ must be written as $$)\n" " $[\n" - " ^ near here\n" + " ^ near here" , err); } @@ -305,7 +305,7 @@ TEST_F(ParserTest, Errors) { EXPECT_FALSE(parser.ParseTest("build x: y z\n", &err)); EXPECT_EQ("input:1: unknown build rule 'y'\n" "build x: y z\n" - " ^ near here\n" + " ^ near here" , err); } @@ -316,7 +316,7 @@ TEST_F(ParserTest, Errors) { EXPECT_FALSE(parser.ParseTest("build x:: y z\n", &err)); EXPECT_EQ("input:1: expected build command name\n" "build x:: y z\n" - " ^ near here\n" + " ^ near here" , err); } @@ -329,7 +329,7 @@ TEST_F(ParserTest, Errors) { &err)); EXPECT_EQ("input:4: expected newline, got ':'\n" " :\n" - " ^ near here\n" + " ^ near here" , err); } @@ -352,7 +352,7 @@ TEST_F(ParserTest, Errors) { &err)); EXPECT_EQ("input:2: bad $-escape (literal $ must be written as $$)\n" " command = ${fafsd\n" - " ^ near here\n" + " ^ near here" , err); } @@ -366,7 +366,7 @@ TEST_F(ParserTest, Errors) { &err)); EXPECT_EQ("input:3: bad $-escape (literal $ must be written as $$)\n" "build $: cat foo\n" - " ^ near here\n" + " ^ near here" , err); } @@ -389,7 +389,7 @@ TEST_F(ParserTest, Errors) { &err)); EXPECT_EQ("input:3: unexpected variable 'othervar'\n" " othervar = bar\n" - " ^ near here\n" + " ^ near here" , err); } @@ -402,7 +402,7 @@ TEST_F(ParserTest, Errors) { &err)); EXPECT_EQ("input:3: bad $-escape (literal $ must be written as $$)\n" "build $: cc bar.cc\n" - " ^ near here\n" + " ^ near here" , err); } @@ -414,7 +414,7 @@ TEST_F(ParserTest, Errors) { &err)); EXPECT_EQ("input:1: expected target name\n" "default\n" - " ^ near here\n" + " ^ near here" , err); } @@ -426,7 +426,7 @@ TEST_F(ParserTest, Errors) { &err)); EXPECT_EQ("input:1: unknown target 'nonexistent'\n" "default nonexistent\n" - " ^ near here\n" + " ^ near here" , err); } @@ -440,7 +440,7 @@ TEST_F(ParserTest, Errors) { &err)); EXPECT_EQ("input:4: expected newline, got ':'\n" "default b:\n" - " ^ near here\n" + " ^ near here" , err); } @@ -451,7 +451,7 @@ TEST_F(ParserTest, Errors) { EXPECT_FALSE(parser.ParseTest("default $a\n", &err)); EXPECT_EQ("input:1: empty path\n" "default $a\n" - " ^ near here\n" + " ^ near here" , err); } @@ -510,7 +510,7 @@ TEST_F(ParserTest, MissingSubNinja) { EXPECT_FALSE(parser.ParseTest("subninja foo.ninja\n", &err)); EXPECT_EQ("input:1: loading 'foo.ninja': No such file or directory\n" "subninja foo.ninja\n" - " ^ near here\n" + " ^ near here" , err); } |