diff options
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 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" |