Chromium Code Reviews| Index: tools/gn/parser_unittest.cc |
| diff --git a/tools/gn/parser_unittest.cc b/tools/gn/parser_unittest.cc |
| index a984e8481c349fcd0fba13889498762aec822c3c..8d1d6faac20518f83b40363dcb3ee399bfbc897d 100644 |
| --- a/tools/gn/parser_unittest.cc |
| +++ b/tools/gn/parser_unittest.cc |
| @@ -583,6 +583,32 @@ TEST(Parser, CommentsSuffixDifferentLine) { |
| DoParserPrintTest(input, expected); |
| } |
| +TEST(Parser, CommentsSuffixMultiple) { |
| + const char* input = |
| + "executable(\"wee\") {\n" |
| + " sources = [\n" |
| + " \"a\", # This is a comment,\n" |
| + " # and some more,\n" |
| + " # then the end.\n" |
|
brettw
2014/09/23 21:49:09
What about this code:
sources = [ "a" ] # This s
scottmg
2014/09/23 22:41:01
Yeah, it does treat it as a continuation. I notice
|
| + " ]\n" |
| + "}\n"; |
| + const char* expected = |
| + "BLOCK\n" |
| + " FUNCTION(executable)\n" |
| + " LIST\n" |
| + " LITERAL(\"wee\")\n" |
| + " BLOCK\n" |
| + " BINARY(=)\n" |
| + " IDENTIFIER(sources)\n" |
| + " LIST\n" |
| + " LITERAL(\"a\")\n" |
| + " +SUFFIX_COMMENT(\"# This is a comment,\")\n" |
| + " +SUFFIX_COMMENT(\"# and some more,\")\n" |
| + " +SUFFIX_COMMENT(\"# then the end.\")\n"; |
| + DoParserPrintTest(input, expected); |
| +} |
| + |
| + |
| TEST(Parser, HangingIf) { |
| DoParserErrorTest("if", 1, 1); |
| } |