diff options
author | Evan Martin <martine@danga.com> | 2011-05-25 02:04:11 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2011-05-25 02:04:11 (GMT) |
commit | c2af394e833879ca57ffb37a47d70d2782dd81bc (patch) | |
tree | edd8d0b91326b885e61370838defa0b0c7574689 /src/parsers_test.cc | |
parent | 939597fb21015670131dbd843b1dc823843aa84c (diff) | |
download | Ninja-c2af394e833879ca57ffb37a47d70d2782dd81bc.zip Ninja-c2af394e833879ca57ffb37a47d70d2782dd81bc.tar.gz Ninja-c2af394e833879ca57ffb37a47d70d2782dd81bc.tar.bz2 |
add more test coverage for makefile parsing
Diffstat (limited to 'src/parsers_test.cc')
-rw-r--r-- | src/parsers_test.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/parsers_test.cc b/src/parsers_test.cc index 12a9ef8..7acfe33 100644 --- a/src/parsers_test.cc +++ b/src/parsers_test.cc @@ -399,6 +399,8 @@ TEST(MakefileParser, Basic) { "build/ninja.o: ninja.cc ninja.h eval_env.h manifest_parser.h\n", &err)); ASSERT_EQ("", err); + EXPECT_EQ("build/ninja.o", parser.out_); + EXPECT_EQ(4u, parser.ins_.size()); } TEST(MakefileParser, EarlyNewlineAndWhitespace) { @@ -411,3 +413,14 @@ TEST(MakefileParser, EarlyNewlineAndWhitespace) { ASSERT_EQ("", err); } +TEST(MakefileParser, Continuation) { + MakefileParser parser; + string err; + EXPECT_TRUE(parser.Parse( +"foo.o: \\\n" +" bar.h baz.h\n", + &err)); + ASSERT_EQ("", err); + EXPECT_EQ("foo.o", parser.out_); + EXPECT_EQ(2u, parser.ins_.size()); +} |