| 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 119d4aa1202328f23994342815051eb0d1ccf971..a0c73558c6307b58c8188699fb59371ab104e72f 100644
|
| --- a/pkg/analyzer/test/generated/scanner_test.dart
|
| +++ b/pkg/analyzer/test/generated/scanner_test.dart
|
| @@ -264,6 +264,18 @@ class ScannerTest {
|
| expect(token.precedingComments, isNull);
|
| }
|
|
|
| + void test_comment_generic_method_type_assign() {
|
| + _assertComment(TokenType.MULTI_LINE_COMMENT, "/*=comment*/");
|
| + _assertComment(TokenType.GENERIC_METHOD_TYPE_ASSIGN, "/*=comment*/",
|
| + genericMethodComments: true);
|
| + }
|
| +
|
| + void test_comment_generic_method_type_list() {
|
| + _assertComment(TokenType.MULTI_LINE_COMMENT, "/*<comment>*/");
|
| + _assertComment(TokenType.GENERIC_METHOD_TYPE_LIST, "/*<comment>*/",
|
| + genericMethodComments: true);
|
| + }
|
| +
|
| void test_comment_multi() {
|
| _assertComment(TokenType.MULTI_LINE_COMMENT, "/* comment */");
|
| }
|
| @@ -1048,11 +1060,12 @@ class ScannerTest {
|
| _scanWithListener("'\${(}'", listener);
|
| }
|
|
|
| - void _assertComment(TokenType commentType, String source) {
|
| + void _assertComment(TokenType commentType, String source,
|
| + {bool genericMethodComments: false}) {
|
| //
|
| // Test without a trailing end-of-line marker
|
| //
|
| - Token token = _scan(source);
|
| + Token token = _scan(source, genericMethodComments: genericMethodComments);
|
| expect(token, isNotNull);
|
| expect(token.type, TokenType.EOF);
|
| Token comment = token.precedingComments;
|
| @@ -1064,7 +1077,7 @@ class ScannerTest {
|
| //
|
| // Test with a trailing end-of-line marker
|
| //
|
| - token = _scan("$source\n");
|
| + token = _scan("$source\n", genericMethodComments: genericMethodComments);
|
| expect(token, isNotNull);
|
| expect(token.type, TokenType.EOF);
|
| comment = token.precedingComments;
|
| @@ -1233,16 +1246,21 @@ class ScannerTest {
|
| expect(token.type, TokenType.EOF);
|
| }
|
|
|
| - Token _scan(String source) {
|
| + Token _scan(String source, {bool genericMethodComments: false}) {
|
| GatheringErrorListener listener = new GatheringErrorListener();
|
| - Token token = _scanWithListener(source, listener);
|
| + Token token = _scanWithListener(source, listener,
|
| + genericMethodComments: genericMethodComments);
|
| listener.assertNoErrors();
|
| return token;
|
| }
|
|
|
| - Token _scanWithListener(String source, GatheringErrorListener listener) {
|
| + Token _scanWithListener(String source, GatheringErrorListener listener,
|
| + {bool genericMethodComments: false}) {
|
| Scanner scanner =
|
| new Scanner(null, new CharSequenceReader(source), listener);
|
| + if (genericMethodComments) {
|
| + scanner.scanGenericMethodComments = true;
|
| + }
|
| Token result = scanner.tokenize();
|
| listener.setLineInfo(new TestSource(), scanner.lineStarts);
|
| return result;
|
|
|