summaryrefslogtreecommitdiffstats
path: root/src/state_test.cc
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2011-12-29 21:00:27 (GMT)
committerEvan Martin <martine@danga.com>2011-12-29 21:14:39 (GMT)
commit8a0c96075786c1983bdfa2f37f32b75200ea0334 (patch)
tree95e2b0c24aedcda9ec5ed09329e69fd7a1925212 /src/state_test.cc
parentad7d9f43f1bd8e04321d8fdb07ebf7b96ab525a1 (diff)
downloadNinja-8a0c96075786c1983bdfa2f37f32b75200ea0334.zip
Ninja-8a0c96075786c1983bdfa2f37f32b75200ea0334.tar.gz
Ninja-8a0c96075786c1983bdfa2f37f32b75200ea0334.tar.bz2
switch the core ninja parser to use re2c for the lexer
- Delete the old "Tokenizer" code. - Write separate tests for the lexer distinct from the parser. - Switch the parser to use the new code. - New lexer error output has file:line numbers so e.g. Emacs can jump your editor to the syntax error. - The EvalEnv ($-interpolation) code is now part of the lexer as well.
Diffstat (limited to 'src/state_test.cc')
-rw-r--r--src/state_test.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/state_test.cc b/src/state_test.cc
index b9e55cb..ca4e60c 100644
--- a/src/state_test.cc
+++ b/src/state_test.cc
@@ -21,11 +21,14 @@ namespace {
TEST(State, Basic) {
State state;
+
Rule* rule = new Rule("cat");
- string err;
- EXPECT_TRUE(rule->command().Parse("cat $in > $out", &err));
- ASSERT_EQ("", err);
+ rule->command_.Add(EvalString::RAW, "cat ");
+ rule->command_.Add(EvalString::SPECIAL, "in");
+ rule->command_.Add(EvalString::RAW, " > ");
+ rule->command_.Add(EvalString::SPECIAL, "out");
state.AddRule(rule);
+
Edge* edge = state.AddEdge(rule);
state.AddIn(edge, "in1");
state.AddIn(edge, "in2");