summaryrefslogtreecommitdiffstats
path: root/src/parsers_test.cc
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2011-12-20 18:33:42 (GMT)
committerEvan Martin <martine@danga.com>2011-12-20 18:33:42 (GMT)
commit2e7ab7514207ea7faad40faedf3fc9d72b3adf7a (patch)
tree496d4c007c80a9492c7d0dabbf11a158034a4768 /src/parsers_test.cc
parent60fdf57cbc2b6201564d17b991f3612edcd65351 (diff)
parent9be1597a218e61fd6f7f5b3c3a52ebd2e51cac6b (diff)
downloadNinja-2e7ab7514207ea7faad40faedf3fc9d72b3adf7a.zip
Ninja-2e7ab7514207ea7faad40faedf3fc9d72b3adf7a.tar.gz
Ninja-2e7ab7514207ea7faad40faedf3fc9d72b3adf7a.tar.bz2
Merge pull request #146 from nornagon/escape-spaces
Escape spaces
Diffstat (limited to 'src/parsers_test.cc')
-rw-r--r--src/parsers_test.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/parsers_test.cc b/src/parsers_test.cc
index 71cfed3..5a4425a 100644
--- a/src/parsers_test.cc
+++ b/src/parsers_test.cc
@@ -149,6 +149,19 @@ TEST_F(ParserTest, Dollars) {
EXPECT_EQ("$dollarbar$baz$blah", state.edges_[0]->EvaluateCommand());
}
+TEST_F(ParserTest, EscapeSpaces) {
+ ASSERT_NO_FATAL_FAILURE(AssertParse(
+"rule has$ spaces\n"
+" command = something\n"
+"build foo$ bar: has$ spaces $$one two$$$ three\n"
+));
+ EXPECT_TRUE(state.LookupNode("foo bar"));
+ EXPECT_EQ(state.edges_[0]->outputs_[0]->file_->path_, "foo bar");
+ EXPECT_EQ(state.edges_[0]->inputs_[0]->file_->path_, "$one");
+ EXPECT_EQ(state.edges_[0]->inputs_[1]->file_->path_, "two$ three");
+ EXPECT_EQ(state.edges_[0]->EvaluateCommand(), "something");
+}
+
TEST_F(ParserTest, CanonicalizeFile) {
ASSERT_NO_FATAL_FAILURE(AssertParse(
"rule cat\n"