OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 engine.declaration_resolver_test; | 5 library engine.declaration_resolver_test; |
6 | 6 |
7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
8 import 'package:analyzer/dart/element/element.dart'; | 8 import 'package:analyzer/dart/element/element.dart'; |
9 import 'package:analyzer/src/dart/ast/ast.dart'; | 9 import 'package:analyzer/src/dart/ast/ast.dart'; |
10 import 'package:analyzer/src/dart/ast/utilities.dart'; | 10 import 'package:analyzer/src/dart/ast/utilities.dart'; |
11 import 'package:analyzer/src/generated/engine.dart'; | 11 import 'package:analyzer/src/generated/engine.dart'; |
12 import 'package:analyzer/src/generated/resolver.dart'; | 12 import 'package:analyzer/src/generated/resolver.dart'; |
13 import 'package:analyzer/src/generated/source.dart'; | 13 import 'package:analyzer/src/generated/source.dart'; |
14 import 'package:analyzer/src/task/dart.dart'; | 14 import 'package:analyzer/src/task/dart.dart'; |
15 import 'package:analyzer/task/dart.dart'; | 15 import 'package:analyzer/task/dart.dart'; |
16 import 'package:test/test.dart'; | 16 import 'package:test/test.dart'; |
17 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 17 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
18 | 18 |
19 import '../utils.dart'; | |
20 import 'resolver_test_case.dart'; | 19 import 'resolver_test_case.dart'; |
21 import 'test_support.dart'; | 20 import 'test_support.dart'; |
22 | 21 |
23 main() { | 22 main() { |
24 initializeTestEnvironment(); | |
25 defineReflectiveSuite(() { | 23 defineReflectiveSuite(() { |
26 defineReflectiveTests(DeclarationResolverMetadataTest); | 24 defineReflectiveTests(DeclarationResolverMetadataTest); |
27 defineReflectiveTests(DeclarationResolverTest); | 25 defineReflectiveTests(DeclarationResolverTest); |
28 defineReflectiveTests(StrongModeDeclarationResolverTest); | 26 defineReflectiveTests(StrongModeDeclarationResolverTest); |
29 }); | 27 }); |
30 } | 28 } |
31 | 29 |
32 CompilationUnit _cloneResolveUnit(CompilationUnit unit) { | 30 CompilationUnit _cloneResolveUnit(CompilationUnit unit) { |
33 CompilationUnit clonedUnit = AstCloner.clone(unit); | 31 CompilationUnit clonedUnit = AstCloner.clone(unit); |
34 new DeclarationResolver().resolve(clonedUnit, unit.element); | 32 new DeclarationResolver().resolve(clonedUnit, unit.element); |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 expect(element.type.toString(), "<T>(T, T) → T"); | 536 expect(element.type.toString(), "<T>(T, T) → T"); |
539 expect(t.element, same(tElement)); | 537 expect(t.element, same(tElement)); |
540 | 538 |
541 // re-resolve | 539 // re-resolve |
542 CompilationUnit unit2 = _cloneResolveUnit(unit); | 540 CompilationUnit unit2 = _cloneResolveUnit(unit); |
543 node = _findSimpleIdentifier(unit2, code, 'max').parent; | 541 node = _findSimpleIdentifier(unit2, code, 'max').parent; |
544 t = node.typeParameters.typeParameters[0]; | 542 t = node.typeParameters.typeParameters[0]; |
545 expect(t.element, same(tElement)); | 543 expect(t.element, same(tElement)); |
546 } | 544 } |
547 } | 545 } |
OLD | NEW |