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

Unified Diff: test/cctest/test-parsing.cc

Issue 2119763003: Recognize HTMLCloseComment after multiline comment (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: add more test cases Created 4 years, 5 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 | « src/parsing/scanner.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-parsing.cc
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc
index 9f7e889968481f85d03986264ff9bf746b27a342..cb08f20e2c1d44f2dc35e4923a197fe6ae9cdf2a 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -120,15 +120,32 @@ TEST(ScanHTMLEndComments) {
// whitespace, even a multiline-comment containing a newline).
// This was not the case if it occurred before the first real token
// in the input.
+ // clang-format off
const char* tests[] = {
// Before first real token.
+ "-->",
+ "--> is eol-comment",
"--> is eol-comment\nvar y = 37;\n",
"\n --> is eol-comment\nvar y = 37;\n",
+ "\n-->is eol-comment\nvar y = 37;\n",
+ "\n-->\nvar y = 37;\n",
"/* precomment */ --> is eol-comment\nvar y = 37;\n",
+ "/* precomment */-->eol-comment\nvar y = 37;\n",
"\n/* precomment */ --> is eol-comment\nvar y = 37;\n",
+ "\n/*precomment*/-->eol-comment\nvar y = 37;\n",
// After first real token.
"var x = 42;\n--> is eol-comment\nvar y = 37;\n",
"var x = 42;\n/* precomment */ --> is eol-comment\nvar y = 37;\n",
+ "x/* precomment\n */ --> is eol-comment\nvar y = 37;\n",
+ "var x = 42; /* precomment\n */ --> is eol-comment\nvar y = 37;\n",
+ "var x = 42;/*\n*/-->is eol-comment\nvar y = 37;\n",
+ // With multiple comments preceding HTMLEndComment
+ "/* MLC \n */ /* SLDC */ --> is eol-comment\nvar y = 37;\n",
+ "/* MLC \n */ /* SLDC1 */ /* SLDC2 */ --> is eol-comment\nvar y = 37;\n",
+ "/* MLC1 \n */ /* MLC2 \n */ --> is eol-comment\nvar y = 37;\n",
+ "/* SLDC */ /* MLC \n */ --> is eol-comment\nvar y = 37;\n",
+ "/* MLC1 \n */ /* SLDC1 */ /* MLC2 \n */ /* SLDC2 */ --> is eol-comment\n"
+ "var y = 37;\n",
NULL
};
@@ -136,11 +153,10 @@ TEST(ScanHTMLEndComments) {
"x --> is eol-comment\nvar y = 37;\n",
"\"\\n\" --> is eol-comment\nvar y = 37;\n",
"x/* precomment */ --> is eol-comment\nvar y = 37;\n",
- "x/* precomment\n */ --> is eol-comment\nvar y = 37;\n",
"var x = 42; --> is eol-comment\nvar y = 37;\n",
- "var x = 42; /* precomment\n */ --> is eol-comment\nvar y = 37;\n",
NULL
};
+ // clang-format on
// Parser/Scanner needs a stack limit.
CcTest::i_isolate()->stack_guard()->SetStackLimit(
« no previous file with comments | « src/parsing/scanner.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698