summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorScott Graham <scottmg@chromium.org>2012-06-15 21:57:22 (GMT)
committerScott Graham <scottmg@chromium.org>2012-06-15 21:57:22 (GMT)
commit36aa519f52c7ff443cc7f2a43283a5d4c0807639 (patch)
treefa1d2bacf1ebb1cda31e701d7baa0e8f24ce1a28 /src
parente0dd93a2586d20ca261e7a028dff01ac6100c4ad (diff)
downloadNinja-36aa519f52c7ff443cc7f2a43283a5d4c0807639.zip
Ninja-36aa519f52c7ff443cc7f2a43283a5d4c0807639.tar.gz
Ninja-36aa519f52c7ff443cc7f2a43283a5d4c0807639.tar.bz2
improve test
Diffstat (limited to 'src')
-rw-r--r--src/parsers_test.cc15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/parsers_test.cc b/src/parsers_test.cc
index 3cb16a7..fc83946 100644
--- a/src/parsers_test.cc
+++ b/src/parsers_test.cc
@@ -115,22 +115,21 @@ TEST_F(ParserTest, ResponseFiles) {
EXPECT_EQ("[$in]", rule->rspfile_content().Serialize());
}
-TEST_F(ParserTest, ResponseFilesInNewline) {
+TEST_F(ParserTest, InNewline) {
ASSERT_NO_FATAL_FAILURE(AssertParse(
"rule cat_rsp\n"
-" command = cat $rspfile > $out\n"
-" rspfile = $rspfile\n"
-" rspfile_content = $in_newline\n"
+" command = cat $in_newline > $out\n"
"\n"
-"build out: cat_rsp in\n"
+"build out: cat_rsp in in2\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());
+ EXPECT_EQ("[cat ][$in_newline][ > ][$out]", rule->command().Serialize());
+
+ Edge* edge = state.edges_[0];
+ EXPECT_EQ("cat in\nin2 > out", edge->EvaluateCommand());
}
TEST_F(ParserTest, Variables) {