| 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.non_error_resolver_test; | 5 library analyzer.test.generated.non_error_resolver_test; |
| 6 | 6 |
| 7 import 'package:analyzer/dart/element/element.dart'; | 7 import 'package:analyzer/dart/element/element.dart'; |
| 8 import 'package:analyzer/src/generated/ast.dart'; | 8 import 'package:analyzer/src/generated/ast.dart'; |
| 9 import 'package:analyzer/src/generated/engine.dart'; | 9 import 'package:analyzer/src/generated/engine.dart'; |
| 10 import 'package:analyzer/src/generated/error.dart'; | 10 import 'package:analyzer/src/generated/error.dart'; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 Source source = addSource(r''' | 28 Source source = addSource(r''' |
| 29 enum E { ONE } | 29 enum E { ONE } |
| 30 E e() { | 30 E e() { |
| 31 return E.TWO; | 31 return E.TWO; |
| 32 }'''); | 32 }'''); |
| 33 computeLibrarySourceErrors(source); | 33 computeLibrarySourceErrors(source); |
| 34 assertNoErrors(source); | 34 assertNoErrors(source); |
| 35 verify([source]); | 35 verify([source]); |
| 36 } | 36 } |
| 37 | 37 |
| 38 void test_class_type_alias_documentationComment() { |
| 39 Source source = addSource(''' |
| 40 /** |
| 41 * Documentation |
| 42 */ |
| 43 class C = D with E; |
| 44 |
| 45 class D {} |
| 46 class E {}'''); |
| 47 computeLibrarySourceErrors(source); |
| 48 computeLibrarySourceErrors(source); |
| 49 assertNoErrors(source); |
| 50 verify([source]); |
| 51 CompilationUnit unit = _getResolvedLibraryUnit(source); |
| 52 ClassElement classC = unit.element.getType('C'); |
| 53 expect(classC.documentationComment, isNotNull); |
| 54 } |
| 55 |
| 38 void test_ambiguousExport() { | 56 void test_ambiguousExport() { |
| 39 Source source = addSource(r''' | 57 Source source = addSource(r''' |
| 40 library L; | 58 library L; |
| 41 export 'lib1.dart'; | 59 export 'lib1.dart'; |
| 42 export 'lib2.dart';'''); | 60 export 'lib2.dart';'''); |
| 43 addNamedSource( | 61 addNamedSource( |
| 44 "/lib1.dart", | 62 "/lib1.dart", |
| 45 r''' | 63 r''' |
| 46 library lib1; | 64 library lib1; |
| 47 class M {}'''); | 65 class M {}'''); |
| (...skipping 5994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6042 reset(); | 6060 reset(); |
| 6043 } | 6061 } |
| 6044 | 6062 |
| 6045 void _check_wrongNumberOfParametersForOperator1(String name) { | 6063 void _check_wrongNumberOfParametersForOperator1(String name) { |
| 6046 _check_wrongNumberOfParametersForOperator(name, "a"); | 6064 _check_wrongNumberOfParametersForOperator(name, "a"); |
| 6047 } | 6065 } |
| 6048 | 6066 |
| 6049 CompilationUnit _getResolvedLibraryUnit(Source source) => | 6067 CompilationUnit _getResolvedLibraryUnit(Source source) => |
| 6050 analysisContext.getResolvedCompilationUnit2(source, source); | 6068 analysisContext.getResolvedCompilationUnit2(source, source); |
| 6051 } | 6069 } |
| OLD | NEW |