diff options
author | Evan Martin <martine@danga.com> | 2010-12-21 00:13:34 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2010-12-21 00:13:34 (GMT) |
commit | db022ad64849ccf072a75ea59947e4243f29ba37 (patch) | |
tree | 3b082b90f45934e0136610c2f5a77b9322579294 /src/parsers_test.cc | |
parent | f2a4bac9127124563cd783a798e64dd15204d598 (diff) | |
download | Ninja-db022ad64849ccf072a75ea59947e4243f29ba37.zip Ninja-db022ad64849ccf072a75ea59947e4243f29ba37.tar.gz Ninja-db022ad64849ccf072a75ea59947e4243f29ba37.tar.bz2 |
aggressively eval variables in build blocks
Diffstat (limited to 'src/parsers_test.cc')
-rw-r--r-- | src/parsers_test.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/parsers_test.cc b/src/parsers_test.cc index 58e40b8..6fb418d 100644 --- a/src/parsers_test.cc +++ b/src/parsers_test.cc @@ -59,13 +59,19 @@ TEST_F(ParserTest, Variables) { "with_under = -under\n" "build a: link b c\n" "nested1 = 1\n" -"nested2 = $nested1/2\n")); +"nested2 = $nested1/2\n" +"build supernested: link x\n" +" extra = $nested2/3\n")); - ASSERT_EQ(1, state.edges_.size()); + ASSERT_EQ(2, state.edges_.size()); Edge* edge = state.edges_[0]; EXPECT_EQ("ld one-letter-test -pthread -under -o a b c", edge->EvaluateCommand()); EXPECT_EQ("1/2", state.bindings_.LookupVariable("nested2")); + + edge = state.edges_[1]; + EXPECT_EQ("ld one-letter-test 1/2/3 -under -o supernested x", + edge->EvaluateCommand()); } TEST_F(ParserTest, VariableScope) { |