Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Unified Diff: tools/gn/parser_unittest.cc

Issue 1275853006: Fix some crashes in GN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/parser.cc ('k') | tools/gn/tokenizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/parser_unittest.cc
diff --git a/tools/gn/parser_unittest.cc b/tools/gn/parser_unittest.cc
index f5adb04ac679e4c269182d50ea2869320f2b0833..39b69b7845c619f1d2709b2ae3330957d7944d69 100644
--- a/tools/gn/parser_unittest.cc
+++ b/tools/gn/parser_unittest.cc
@@ -181,6 +181,9 @@ TEST(Parser, UnaryOp) {
DoExpressionPrintTest("!foo",
"UNARY(!)\n"
" IDENTIFIER(foo)\n");
+
+ // No contents for binary operator.
+ DoExpressionErrorTest("a = !", 1, 5);
}
TEST(Parser, List) {
@@ -215,6 +218,8 @@ TEST(Parser, Assignment) {
" BINARY(=)\n"
" IDENTIFIER(a)\n"
" LITERAL(2)\n");
+
+ DoExpressionErrorTest("a = ", 1, 3);
}
TEST(Parser, Accessor) {
« no previous file with comments | « tools/gn/parser.cc ('k') | tools/gn/tokenizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698