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

Side by Side Diff: pkg/analyzer/test/generated/parser_test.dart

Issue 2750503012: Re-land "Add support for metadata on type variables to Fasta parser." (with fixes). (Closed)
Patch Set: Created 3 years, 9 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.test.generated.parser_test; 5 library analyzer.test.generated.parser_test;
6 6
7 import 'package:analyzer/dart/ast/ast.dart'; 7 import 'package:analyzer/dart/ast/ast.dart';
8 import 'package:analyzer/dart/ast/standard_ast_factory.dart'; 8 import 'package:analyzer/dart/ast/standard_ast_factory.dart';
9 import 'package:analyzer/dart/ast/token.dart'; 9 import 'package:analyzer/dart/ast/token.dart';
10 import 'package:analyzer/dart/ast/visitor.dart'; 10 import 'package:analyzer/dart/ast/visitor.dart';
(...skipping 14711 matching lines...) Expand 10 before | Expand all | Expand 10 after
14722 expect(functionType.returnType, isNotNull); 14722 expect(functionType.returnType, isNotNull);
14723 expect(functionType.typeParameters, isNull); 14723 expect(functionType.typeParameters, isNull);
14724 } 14724 }
14725 14725
14726 void test_parseTypeAlias_genericFunction_withDocComment() { 14726 void test_parseTypeAlias_genericFunction_withDocComment() {
14727 createParser('/// Doc\ntypedef F = bool Function();'); 14727 createParser('/// Doc\ntypedef F = bool Function();');
14728 var typeAlias = parseFullCompilationUnitMember() as GenericTypeAlias; 14728 var typeAlias = parseFullCompilationUnitMember() as GenericTypeAlias;
14729 expectCommentText(typeAlias.documentationComment, '/// Doc'); 14729 expectCommentText(typeAlias.documentationComment, '/// Doc');
14730 } 14730 }
14731 14731
14732 void test_parseTypeVariable_withDocumentationComment() {
14733 createParser('''
14734 class A<
14735 /// Doc
14736 B> {}
14737 ''');
14738 var classDeclaration = parseFullCompilationUnitMember() as ClassDeclaration;
14739 var typeVariable = classDeclaration.typeParameters.typeParameters[0];
14740 expectCommentText(typeVariable.documentationComment, '/// Doc');
14741 }
14742
14732 /** 14743 /**
14733 * Assert that the given [name] is in declaration context. 14744 * Assert that the given [name] is in declaration context.
14734 */ 14745 */
14735 void _assertIsDeclarationName(SimpleIdentifier name) { 14746 void _assertIsDeclarationName(SimpleIdentifier name) {
14736 expect(name.inDeclarationContext(), isTrue); 14747 expect(name.inDeclarationContext(), isTrue);
14737 } 14748 }
14738 } 14749 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698