summaryrefslogtreecommitdiffstats
path: root/ninja_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ninja_test.cc')
-rw-r--r--ninja_test.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/ninja_test.cc b/ninja_test.cc
index 76175d5..8ed448d 100644
--- a/ninja_test.cc
+++ b/ninja_test.cc
@@ -73,7 +73,7 @@ TEST(Parser, Errors) {
ManifestParser parser(NULL);
string err;
EXPECT_FALSE(parser.Parse("foobar", &err));
- EXPECT_EQ("line 1, col 7: expected '=', got ''", err);
+ EXPECT_EQ("line 1, col 7: expected '=', got eof", err);
}
{
@@ -103,6 +103,21 @@ TEST(Parser, Errors) {
EXPECT_FALSE(parser.Parse("build x: y z\n", &err));
EXPECT_EQ("line 1, col 10: unknown build rule 'y'", err);
}
+
+ {
+ ManifestParser parser(&state);
+ string err;
+ EXPECT_FALSE(parser.Parse("build x:: y z\n", &err));
+ EXPECT_EQ("line 1, col 9: expected build command name", err);
+ }
+
+ {
+ ManifestParser parser(&state);
+ string err;
+ EXPECT_FALSE(parser.Parse("rule cat\ncommand cat ok\nbuild x: cat \\\n :\n",
+ &err));
+ EXPECT_EQ("line 4, col 1: expected newline, got ':'", err);
+ }
}
TEST(Parser, BuildDir) {