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

Unified Diff: tools/gn/parser_unittest.cc

Issue 591373002: gn: start of format command (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gn-more-comment-stuff
Patch Set: change 'copyright header block' to 'standard header block' for android_webview/tools/check_licenses… Created 6 years, 3 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/token.h » ('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 5a428be0d5b538b10a5823d8ab47e93243498e03..226143ac8f6a46d9d128dd7ab4ce41a7a5fc07a6 100644
--- a/tools/gn/parser_unittest.cc
+++ b/tools/gn/parser_unittest.cc
@@ -498,7 +498,7 @@ TEST(Parser, CommentsStandalone) {
"executable(\"wee\") {}\n";
const char* expected =
"BLOCK\n"
- " +BEFORE_COMMENT(\"# Toplevel comment.\")\n"
+ " BLOCK_COMMENT(# Toplevel comment.)\n"
" FUNCTION(executable)\n"
" LIST\n"
" LITERAL(\"wee\")\n"
@@ -614,6 +614,25 @@ TEST(Parser, CommentsSuffixMultiple) {
DoParserPrintTest(input, expected);
}
+TEST(Parser, CommentsConnectedInList) {
+ const char* input =
+ "defines = [\n"
+ "\n"
+ " # Connected comment.\n"
+ " \"WEE\",\n"
+ " \"BLORPY\",\n"
+ "]\n";
+ const char* expected =
+ "BLOCK\n"
+ " BINARY(=)\n"
+ " IDENTIFIER(defines)\n"
+ " LIST\n"
+ " LITERAL(\"WEE\")\n"
+ " +BEFORE_COMMENT(\"# Connected comment.\")\n"
+ " LITERAL(\"BLORPY\")\n";
+ DoParserPrintTest(input, expected);
+}
+
TEST(Parser, HangingIf) {
DoParserErrorTest("if", 1, 1);
}
« no previous file with comments | « tools/gn/parser.cc ('k') | tools/gn/token.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698