diff options
author | Evan Martin <martine@danga.com> | 2011-05-27 03:15:05 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2011-05-27 03:15:05 (GMT) |
commit | 511613ce2552528c00719ca59c8b2411518f12db (patch) | |
tree | 78140983ba179baeb488a1afd3c62812e6ca8469 /src/parsers_test.cc | |
parent | 55fd4232d35de1f163310333d216d81a35cc0ef1 (diff) | |
download | Ninja-511613ce2552528c00719ca59c8b2411518f12db.zip Ninja-511613ce2552528c00719ca59c8b2411518f12db.tar.gz Ninja-511613ce2552528c00719ca59c8b2411518f12db.tar.bz2 |
expand $$ as $
Diffstat (limited to 'src/parsers_test.cc')
-rw-r--r-- | src/parsers_test.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/parsers_test.cc b/src/parsers_test.cc index abbfb2f..2c2bdf2 100644 --- a/src/parsers_test.cc +++ b/src/parsers_test.cc @@ -137,6 +137,18 @@ TEST_F(ParserTest, Comment) { EXPECT_EQ("not # a comment", state.bindings_.LookupVariable("foo")); } +TEST_F(ParserTest, Dollars) { + ASSERT_NO_FATAL_FAILURE(AssertParse( +"rule foo\n" +" command = ${out}bar$$baz$$$\n" +"blah\n" +"x = $$dollar\n" +"build $x: foo y\n" +)); + EXPECT_EQ("$dollar", state.bindings_.LookupVariable("x")); + EXPECT_EQ("$dollarbar$baz$blah", state.edges_[0]->EvaluateCommand()); +} + TEST_F(ParserTest, CanonicalizeFile) { ASSERT_NO_FATAL_FAILURE(AssertParse( "rule cat\n" |