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

Unified Diff: pkg/analyzer/test/generated/scanner_test.dart

Issue 1271553002: Issue 23919. Fix for line starts in multiline comments. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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 | « pkg/analyzer/lib/src/generated/scanner.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/scanner_test.dart
diff --git a/pkg/analyzer/test/generated/scanner_test.dart b/pkg/analyzer/test/generated/scanner_test.dart
index c1a6603ebdc7edfbac9a3b205de484144224519a..296be46908c1d2074a18f821128b2965f4cbfd23 100644
--- a/pkg/analyzer/test/generated/scanner_test.dart
+++ b/pkg/analyzer/test/generated/scanner_test.dart
@@ -266,6 +266,25 @@ class ScannerTest {
_assertComment(TokenType.MULTI_LINE_COMMENT, "/* comment */");
}
+ void test_comment_multi_lineEnds() {
+ String code = r'''
+/**
+ * aa
+ * bbb
+ * c
+ */''';
+ GatheringErrorListener listener = new GatheringErrorListener();
+ Scanner scanner = new Scanner(null, new CharSequenceReader(code), listener);
+ scanner.tokenize();
+ expect(scanner.lineStarts, equals(<int>[
+ code.indexOf('/**'),
+ code.indexOf(' * aa'),
+ code.indexOf(' * bbb'),
+ code.indexOf(' * c'),
+ code.indexOf(' */')
+ ]));
+ }
+
void test_comment_multi_unterminated() {
_assertError(ScannerErrorCode.UNTERMINATED_MULTI_LINE_COMMENT, 3, "/* x");
}
« no previous file with comments | « pkg/analyzer/lib/src/generated/scanner.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698