| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |