diff options
author | Scott Graham <scottmg@chromium.org> | 2012-06-15 21:48:43 (GMT) |
---|---|---|
committer | Scott Graham <scottmg@chromium.org> | 2012-06-15 21:48:43 (GMT) |
commit | e0dd93a2586d20ca261e7a028dff01ac6100c4ad (patch) | |
tree | 70fd10fabac051b74290fd28ba093e9c795b2a0d /src/parsers_test.cc | |
parent | 28d20bc0962afa1fec25a00622e30e88b7f681fe (diff) | |
download | Ninja-e0dd93a2586d20ca261e7a028dff01ac6100c4ad.zip Ninja-e0dd93a2586d20ca261e7a028dff01ac6100c4ad.tar.gz Ninja-e0dd93a2586d20ca261e7a028dff01ac6100c4ad.tar.bz2 |
add $in_newline
Diffstat (limited to 'src/parsers_test.cc')
-rw-r--r-- | src/parsers_test.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/parsers_test.cc b/src/parsers_test.cc index c5151b8..3cb16a7 100644 --- a/src/parsers_test.cc +++ b/src/parsers_test.cc @@ -115,6 +115,24 @@ TEST_F(ParserTest, ResponseFiles) { EXPECT_EQ("[$in]", rule->rspfile_content().Serialize()); } +TEST_F(ParserTest, ResponseFilesInNewline) { + ASSERT_NO_FATAL_FAILURE(AssertParse( +"rule cat_rsp\n" +" command = cat $rspfile > $out\n" +" rspfile = $rspfile\n" +" rspfile_content = $in_newline\n" +"\n" +"build out: cat_rsp in\n" +" rspfile=out.rsp\n")); + + ASSERT_EQ(2u, state.rules_.size()); + const Rule* rule = state.rules_.begin()->second; + EXPECT_EQ("cat_rsp", rule->name()); + EXPECT_EQ("[cat ][$rspfile][ > ][$out]", rule->command().Serialize()); + EXPECT_EQ("[$rspfile]", rule->rspfile().Serialize()); + EXPECT_EQ("[$in_newline]", rule->rspfile_content().Serialize()); +} + TEST_F(ParserTest, Variables) { ASSERT_NO_FATAL_FAILURE(AssertParse( "l = one-letter-test\n" |