summaryrefslogtreecommitdiffstats
path: root/src/parsers_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/parsers_test.cc')
-rw-r--r--src/parsers_test.cc18
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"