| 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.resolver_test; | 5 library analyzer.test.generated.resolver_test; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
| 10 import 'package:analyzer/dart/ast/visitor.dart'; | 10 import 'package:analyzer/dart/ast/visitor.dart'; |
| (...skipping 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1597 _listener.assertNoErrors(); | 1597 _listener.assertNoErrors(); |
| 1598 } | 1598 } |
| 1599 | 1599 |
| 1600 void test_visitEnumDeclaration() { | 1600 void test_visitEnumDeclaration() { |
| 1601 ClassElementImpl enumElement = | 1601 ClassElementImpl enumElement = |
| 1602 ElementFactory.enumElement(_typeProvider, ('E')); | 1602 ElementFactory.enumElement(_typeProvider, ('E')); |
| 1603 EnumDeclaration enumNode = AstFactory.enumDeclaration2('E', []); | 1603 EnumDeclaration enumNode = AstFactory.enumDeclaration2('E', []); |
| 1604 Annotation annotationNode = | 1604 Annotation annotationNode = |
| 1605 AstFactory.annotation(AstFactory.identifier3('a')); | 1605 AstFactory.annotation(AstFactory.identifier3('a')); |
| 1606 annotationNode.element = ElementFactory.classElement2('A'); | 1606 annotationNode.element = ElementFactory.classElement2('A'); |
| 1607 annotationNode.elementAnnotation = new ElementAnnotationImpl(enumElement); |
| 1607 enumNode.metadata.add(annotationNode); | 1608 enumNode.metadata.add(annotationNode); |
| 1608 enumNode.name.staticElement = enumElement; | 1609 enumNode.name.staticElement = enumElement; |
| 1610 List<ElementAnnotation> metadata = <ElementAnnotation>[ |
| 1611 annotationNode.elementAnnotation |
| 1612 ]; |
| 1609 _resolveNode(enumNode); | 1613 _resolveNode(enumNode); |
| 1610 List<ElementAnnotation> metadata = enumElement.metadata; | 1614 expect(metadata[0].element, annotationNode.element); |
| 1611 expect(metadata, hasLength(1)); | |
| 1612 } | 1615 } |
| 1613 | 1616 |
| 1614 void test_visitExportDirective_noCombinators() { | 1617 void test_visitExportDirective_noCombinators() { |
| 1615 ExportDirective directive = AstFactory.exportDirective2(null); | 1618 ExportDirective directive = AstFactory.exportDirective2(null); |
| 1616 directive.element = ElementFactory | 1619 directive.element = ElementFactory |
| 1617 .exportFor(ElementFactory.library(_definingLibrary.context, "lib")); | 1620 .exportFor(ElementFactory.library(_definingLibrary.context, "lib")); |
| 1618 _resolveNode(directive); | 1621 _resolveNode(directive); |
| 1619 _listener.assertNoErrors(); | 1622 _listener.assertNoErrors(); |
| 1620 } | 1623 } |
| 1621 | 1624 |
| (...skipping 15407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 17029 | 17032 |
| 17030 void _resolveTestUnit(String code) { | 17033 void _resolveTestUnit(String code) { |
| 17031 testCode = code; | 17034 testCode = code; |
| 17032 testSource = addSource(testCode); | 17035 testSource = addSource(testCode); |
| 17033 LibraryElement library = resolve2(testSource); | 17036 LibraryElement library = resolve2(testSource); |
| 17034 assertNoErrors(testSource); | 17037 assertNoErrors(testSource); |
| 17035 verify([testSource]); | 17038 verify([testSource]); |
| 17036 testUnit = resolveCompilationUnit(testSource, library); | 17039 testUnit = resolveCompilationUnit(testSource, library); |
| 17037 } | 17040 } |
| 17038 } | 17041 } |
| OLD | NEW |