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

Side by Side Diff: tools/gn/tokenizer_unittest.cc

Issue 595753002: gn: handle continued suffix comments (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gn-append-comment
Patch Set: 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 unified diff | Download patch
« tools/gn/parser_unittest.cc ('K') | « tools/gn/tokenizer.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "testing/gtest/include/gtest/gtest.h" 5 #include "testing/gtest/include/gtest/gtest.h"
6 #include "tools/gn/input_file.h" 6 #include "tools/gn/input_file.h"
7 #include "tools/gn/token.h" 7 #include "tools/gn/token.h"
8 #include "tools/gn/tokenizer.h" 8 #include "tools/gn/tokenizer.h"
9 9
10 namespace { 10 namespace {
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 165
166 TEST(Tokenizer, Comments) { 166 TEST(Tokenizer, Comments) {
167 TokenExpectation fn[] = { 167 TokenExpectation fn[] = {
168 { Token::LINE_COMMENT, "# Stuff" }, 168 { Token::LINE_COMMENT, "# Stuff" },
169 { Token::IDENTIFIER, "fun" }, 169 { Token::IDENTIFIER, "fun" },
170 { Token::LEFT_PAREN, "(" }, 170 { Token::LEFT_PAREN, "(" },
171 { Token::STRING, "\"foo\"" }, 171 { Token::STRING, "\"foo\"" },
172 { Token::RIGHT_PAREN, ")" }, 172 { Token::RIGHT_PAREN, ")" },
173 { Token::LEFT_BRACE, "{" }, 173 { Token::LEFT_BRACE, "{" },
174 { Token::SUFFIX_COMMENT, "# Things" }, 174 { Token::SUFFIX_COMMENT, "# Things" },
175 { Token::LINE_COMMENT, "#Wee" }, 175 { Token::SUFFIX_COMMENT, "#Wee" },
176 { Token::IDENTIFIER, "foo" }, 176 { Token::IDENTIFIER, "foo" },
177 { Token::EQUAL, "=" }, 177 { Token::EQUAL, "=" },
178 { Token::INTEGER, "12" }, 178 { Token::INTEGER, "12" },
179 { Token::SUFFIX_COMMENT, "#Zip" }, 179 { Token::SUFFIX_COMMENT, "#Zip" },
180 { Token::RIGHT_BRACE, "}" }, 180 { Token::RIGHT_BRACE, "}" },
181 }; 181 };
182 EXPECT_TRUE(CheckTokenizer( 182 EXPECT_TRUE(CheckTokenizer(
183 "# Stuff\nfun(\"foo\") { # Things\n#Wee\nfoo = 12 #Zip\n}", fn)); 183 "# Stuff\n"
184 "fun(\"foo\") { # Things\n"
185 "#Wee\n"
186 "foo = 12 #Zip\n"
187 "}",
188 fn));
184 } 189 }
OLDNEW
« tools/gn/parser_unittest.cc ('K') | « tools/gn/tokenizer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698