diff options
author | Thiago Farina <tfarina@chromium.org> | 2011-12-24 02:08:14 (GMT) |
---|---|---|
committer | Thiago Farina <tfarina@chromium.org> | 2011-12-24 02:08:14 (GMT) |
commit | 8ae23cbc8258728192bd2aeaddc6b03b10dc9416 (patch) | |
tree | 9fa7e91b0a16cd783a3f1742a1c58ff5bc032e43 | |
parent | d89ddd6be801869aff1308f7c57398c072b776d6 (diff) | |
download | Ninja-8ae23cbc8258728192bd2aeaddc6b03b10dc9416.zip Ninja-8ae23cbc8258728192bd2aeaddc6b03b10dc9416.tar.gz Ninja-8ae23cbc8258728192bd2aeaddc6b03b10dc9416.tar.bz2 |
Follow up fix to commit 32bf74f (Fix the TODO in Rule class.)
Signed-off-by: Thiago Farina <tfarina@chromium.org>
-rw-r--r-- | src/graph.h | 1 | ||||
-rw-r--r-- | src/parsers_test.cc | 4 | ||||
-rw-r--r-- | src/state_test.cc | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/src/graph.h b/src/graph.h index fe102d2..b483c6d 100644 --- a/src/graph.h +++ b/src/graph.h @@ -105,6 +105,7 @@ struct Rule { bool restat() const { return restat_; } const EvalString& command() const { return command_; } + EvalString& command() { return command_; } const EvalString& description() const { return description_; } const EvalString& depfile() const { return depfile_; } diff --git a/src/parsers_test.cc b/src/parsers_test.cc index 628e76a..53b4e92 100644 --- a/src/parsers_test.cc +++ b/src/parsers_test.cc @@ -61,7 +61,7 @@ TEST_F(ParserTest, Rules) { ASSERT_EQ(3u, state.rules_.size()); const Rule* rule = state.rules_.begin()->second; EXPECT_EQ("cat", rule->name()); - EXPECT_EQ("cat $in > $out", rule->command_.unparsed()); + EXPECT_EQ("cat $in > $out", rule->command().unparsed()); } TEST_F(ParserTest, Variables) { @@ -118,7 +118,7 @@ TEST_F(ParserTest, Continuation) { ASSERT_EQ(2u, state.rules_.size()); const Rule* rule = state.rules_.begin()->second; EXPECT_EQ("link", rule->name()); - EXPECT_EQ("foo bar baz", rule->command_.unparsed()); + EXPECT_EQ("foo bar baz", rule->command().unparsed()); } TEST_F(ParserTest, Backslash) { diff --git a/src/state_test.cc b/src/state_test.cc index 5d91532..b9e55cb 100644 --- a/src/state_test.cc +++ b/src/state_test.cc @@ -23,7 +23,7 @@ TEST(State, Basic) { State state; Rule* rule = new Rule("cat"); string err; - EXPECT_TRUE(rule->command_.Parse("cat $in > $out", &err)); + EXPECT_TRUE(rule->command().Parse("cat $in > $out", &err)); ASSERT_EQ("", err); state.AddRule(rule); Edge* edge = state.AddEdge(rule); |