diff options
author | Evan Martin <martine@danga.com> | 2011-05-22 17:15:11 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2011-05-27 02:35:39 (GMT) |
commit | 55fd4232d35de1f163310333d216d81a35cc0ef1 (patch) | |
tree | 1b0f3dedb6bc5b216ba8ae0809f78d20e45323f6 /src/parsers_test.cc | |
parent | 976166706db05dcd4496586ae995b7fdb1afab35 (diff) | |
download | Ninja-55fd4232d35de1f163310333d216d81a35cc0ef1.zip Ninja-55fd4232d35de1f163310333d216d81a35cc0ef1.tar.gz Ninja-55fd4232d35de1f163310333d216d81a35cc0ef1.tar.bz2 |
switch to $ as the line continuation char
This means that backslashes are passed through without interpretation,
allowing us to support Windows paths without worrying about escaping.
Diffstat (limited to 'src/parsers_test.cc')
-rw-r--r-- | src/parsers_test.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/parsers_test.cc b/src/parsers_test.cc index 7acfe33..abbfb2f 100644 --- a/src/parsers_test.cc +++ b/src/parsers_test.cc @@ -109,10 +109,10 @@ TEST_F(ParserTest, VariableScope) { TEST_F(ParserTest, Continuation) { ASSERT_NO_FATAL_FAILURE(AssertParse( "rule link\n" -" command = foo bar \\\n" +" command = foo bar $\n" " baz\n" "\n" -"build a: link c \\\n" +"build a: link c $\n" " d e f\n")); ASSERT_EQ(2u, state.rules_.size()); @@ -215,15 +215,15 @@ TEST_F(ParserTest, Errors) { State state; ManifestParser parser(&state, NULL); string err; - EXPECT_FALSE(parser.Parse("x = $\n", &err)); - EXPECT_EQ("line 1, col 6: expected variable after $", err); + EXPECT_FALSE(parser.Parse("x = $", &err)); + EXPECT_EQ("line 1, col 3: unexpected eof", err); } { State state; ManifestParser parser(&state, NULL); string err; - EXPECT_FALSE(parser.Parse("x = \\\n $[\n", &err)); + EXPECT_FALSE(parser.Parse("x = $\n $[\n", &err)); EXPECT_EQ("line 2, col 3: expected variable after $", err); } @@ -231,8 +231,8 @@ TEST_F(ParserTest, Errors) { State state; ManifestParser parser(&state, NULL); string err; - EXPECT_FALSE(parser.Parse("x = a\\\n b\\\n $\n", &err)); - EXPECT_EQ("line 3, col 3: expected variable after $", err); + EXPECT_FALSE(parser.Parse("x = a$\n b$\n $\n", &err)); + EXPECT_EQ("line 4, col 1: expected newline, got eof", err); } { @@ -256,7 +256,7 @@ TEST_F(ParserTest, Errors) { ManifestParser parser(&state, NULL); string err; EXPECT_FALSE(parser.Parse("rule cat\n command = cat ok\n" - "build x: cat \\\n :\n", + "build x: cat $\n :\n", &err)); EXPECT_EQ("line 4, col 2: expected newline, got ':'", err); } |