summaryrefslogtreecommitdiffstats
path: root/ninja_test.cc
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2010-10-24 16:02:52 (GMT)
committerEvan Martin <martine@danga.com>2010-10-24 16:02:52 (GMT)
commit58f2770ae5262bd8380df51c3e55659d2faa590d (patch)
tree328bc5614c49205881e3b5543af1ef3da12ffd61 /ninja_test.cc
parent078774f7316b6afbd67b3b7b8986fae419fbc471 (diff)
downloadNinja-58f2770ae5262bd8380df51c3e55659d2faa590d.zip
Ninja-58f2770ae5262bd8380df51c3e55659d2faa590d.tar.gz
Ninja-58f2770ae5262bd8380df51c3e55659d2faa590d.tar.bz2
syntax change, part 1: commands are indented
Diffstat (limited to 'ninja_test.cc')
-rw-r--r--ninja_test.cc17
1 files changed, 9 insertions, 8 deletions
diff --git a/ninja_test.cc b/ninja_test.cc
index 8ed448d..2c1c4d5 100644
--- a/ninja_test.cc
+++ b/ninja_test.cc
@@ -22,10 +22,10 @@ TEST(Parser, Rules) {
State state;
ASSERT_NO_FATAL_FAILURE(AssertParse(&state,
"rule cat\n"
-"command cat @in > $out\n"
+" command cat @in > $out\n"
"\n"
"rule date\n"
-"command date > $out\n"
+" command date > $out\n"
"\n"
"build result: cat in_1.cc in-2.O\n"));
@@ -39,7 +39,7 @@ TEST(Parser, Variables) {
State state;
ASSERT_NO_FATAL_FAILURE(AssertParse(&state,
"rule link\n"
-"command ld $extra $with_under -o $out @in\n"
+" command ld $extra $with_under -o $out @in\n"
"\n"
"extra = -pthread\n"
"with_under = -under\n"
@@ -54,7 +54,7 @@ TEST(Parser, Continuation) {
State state;
ASSERT_NO_FATAL_FAILURE(AssertParse(&state,
"rule link\n"
-"command foo bar \\\n"
+" command foo bar \\\n"
" baz\n"
"\n"
"build a: link c \\\n"
@@ -114,9 +114,10 @@ TEST(Parser, Errors) {
{
ManifestParser parser(&state);
string err;
- EXPECT_FALSE(parser.Parse("rule cat\ncommand cat ok\nbuild x: cat \\\n :\n",
+ EXPECT_FALSE(parser.Parse("rule cat\n command cat ok\n"
+ "build x: cat \\\n :\n",
&err));
- EXPECT_EQ("line 4, col 1: expected newline, got ':'", err);
+ EXPECT_EQ("line 4, col 2: expected newline, got ':'", err);
}
}
@@ -125,7 +126,7 @@ TEST(Parser, BuildDir) {
ASSERT_NO_FATAL_FAILURE(AssertParse(&state,
"builddir = out\n"
"rule cat\n"
-"command cat @in > $out\n"
+" command cat @in > $out\n"
"build @bin: cat @a.o\n"
"build @a.o: cat a.cc\n"));
state.stat_cache()->Dump();
@@ -178,7 +179,7 @@ struct StateTestWithBuiltinRules : public testing::Test {
StateTestWithBuiltinRules() {
AssertParse(&state_,
"rule cat\n"
-"command cat @in > $out\n");
+" command cat @in > $out\n");
}
Node* GetNode(const string& path) {