diff options
author | Evan Martin <martine@danga.com> | 2011-05-23 16:17:39 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2011-05-23 16:17:39 (GMT) |
commit | 2bdd317515b574582467c8c284e4fdfa6c161f15 (patch) | |
tree | d7120928e692f4c6ba49c88f7d58bf08ad6ebf9d /src/parsers_test.cc | |
parent | 91e0f9ff96cc688c48973696d7d1dd2f4e356e3e (diff) | |
download | Ninja-2bdd317515b574582467c8c284e4fdfa6c161f15.zip Ninja-2bdd317515b574582467c8c284e4fdfa6c161f15.tar.gz Ninja-2bdd317515b574582467c8c284e4fdfa6c161f15.tar.bz2 |
refactor parser, check in some failing tests
Diffstat (limited to 'src/parsers_test.cc')
-rw-r--r-- | src/parsers_test.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/parsers_test.cc b/src/parsers_test.cc index f21cccf..6e3d7dd 100644 --- a/src/parsers_test.cc +++ b/src/parsers_test.cc @@ -274,6 +274,27 @@ TEST_F(ParserTest, Errors) { State state; ManifestParser parser(&state, NULL); string err; + EXPECT_FALSE(parser.Parse("rule cat\n command = ${fafsd\n foo = bar\n", + &err)); + // XXX EXPECT_EQ("line 2, col 20: expected closing curly after ${", err); + EXPECT_EQ("line 3, col 0: expected closing curly after ${", err); + } + + + { + State state; + ManifestParser parser(&state, NULL); + string err; + EXPECT_FALSE(parser.Parse("rule cat\n command = cat\nbuild $: cat foo\n", + &err)); + // XXX EXPECT_EQ("line 3, col 7: expected variable after $", err); + EXPECT_EQ("line 4, col 1: expected variable after $", err); + } + + { + State state; + ManifestParser parser(&state, NULL); + string err; EXPECT_FALSE(parser.Parse("rule %foo\n", &err)); EXPECT_EQ("line 1, col 6: expected rule name, got unknown '%'", err); @@ -296,6 +317,7 @@ TEST_F(ParserTest, Errors) { string err; EXPECT_FALSE(parser.Parse("rule cc\n command = foo\n othervar = bar\n", &err)); + // XXX EXPECT_EQ("line 3, col 3: unexpected variable 'othervar'", err); EXPECT_EQ("line 4, col 0: unexpected variable 'othervar'", err); } |