summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/parsers.cc2
-rw-r--r--src/parsers_test.cc7
2 files changed, 8 insertions, 1 deletions
diff --git a/src/parsers.cc b/src/parsers.cc
index 506b209..afb097a 100644
--- a/src/parsers.cc
+++ b/src/parsers.cc
@@ -78,7 +78,7 @@ bool ManifestParser::Parse(const string& filename, const string& input,
case Lexer::NEWLINE:
break;
default:
- return lexer_.Error(string("unexpected") + Lexer::TokenName(token),
+ return lexer_.Error(string("unexpected ") + Lexer::TokenName(token),
err);
}
}
diff --git a/src/parsers_test.cc b/src/parsers_test.cc
index 9d46beb..e7047da 100644
--- a/src/parsers_test.cc
+++ b/src/parsers_test.cc
@@ -448,6 +448,13 @@ TEST_F(ParserTest, Errors) {
// as we see them, not after we've read them all!
EXPECT_EQ("input:4: empty path\n", err);
}
+
+ {
+ ManifestParser parser(NULL, NULL);
+ string err;
+ EXPECT_FALSE(parser.ParseTest(" # bad indented comment\n", &err));
+ EXPECT_EQ("input:1: unexpected indent\n", err);
+ }
}
TEST_F(ParserTest, MultipleOutputs)