| 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 test.src.task.strong_mode_test; | 5 library test.src.task.strong_mode_test; |
| 6 | 6 |
| 7 import 'package:analyzer/src/generated/ast.dart'; | 7 import 'package:analyzer/src/generated/ast.dart'; |
| 8 import 'package:analyzer/src/generated/element.dart'; | 8 import 'package:analyzer/src/generated/element.dart'; |
| 9 import 'package:analyzer/src/generated/source.dart'; | 9 import 'package:analyzer/src/generated/source.dart'; |
| 10 import 'package:analyzer/src/task/dart.dart'; | 10 import 'package:analyzer/src/task/dart.dart'; |
| 11 import 'package:analyzer/src/task/strong_mode.dart'; | 11 import 'package:analyzer/src/task/strong_mode.dart'; |
| 12 import 'package:analyzer/task/dart.dart'; | 12 import 'package:analyzer/task/dart.dart'; |
| 13 import 'package:unittest/unittest.dart'; | 13 import 'package:unittest/unittest.dart'; |
| 14 | 14 |
| 15 import '../../reflective_tests.dart'; | 15 import '../../reflective_tests.dart'; |
| 16 import '../../utils.dart'; | 16 import '../../utils.dart'; |
| 17 import '../context/abstract_context.dart'; | 17 import '../context/abstract_context.dart'; |
| 18 | 18 |
| 19 main() { | 19 main() { |
| 20 initializeTestEnvironment(); | 20 initializeTestEnvironment(); |
| 21 runReflectiveTests(InstanceMemberInferrerTest); | 21 runReflectiveTests(InstanceMemberInferrerTest); |
| 22 runReflectiveTests(VariableGathererTest); | 22 runReflectiveTests(VariableGathererTest); |
| 23 } | 23 } |
| 24 | 24 |
| 25 @reflectiveTest | 25 @reflectiveTest |
| 26 class InstanceMemberInferrerTest extends AbstractContextTest { | 26 class InstanceMemberInferrerTest extends AbstractContextTest { |
| 27 InstanceMemberInferrer get createInferrer => | 27 InstanceMemberInferrer get createInferrer => |
| 28 new InstanceMemberInferrer(context.typeProvider); | 28 new InstanceMemberInferrer(context.typeProvider, context.typeSystem); |
| 29 | 29 |
| 30 /** | 30 /** |
| 31 * Add a source with the given [content] and return the result of resolving | 31 * Add a source with the given [content] and return the result of resolving |
| 32 * the source. | 32 * the source. |
| 33 */ | 33 */ |
| 34 CompilationUnitElement resolve(String content) { | 34 CompilationUnitElement resolve(String content) { |
| 35 Source source = addSource('/test.dart', content); | 35 Source source = addSource('/test.dart', content); |
| 36 return context.resolveCompilationUnit2(source, source).element; | 36 return context.resolveCompilationUnit2(source, source).element; |
| 37 } | 37 } |
| 38 | 38 |
| (...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 901 } | 901 } |
| 902 } | 902 } |
| 903 } | 903 } |
| 904 '''); | 904 '''); |
| 905 CompilationUnit unit = context.resolveCompilationUnit2(source, source); | 905 CompilationUnit unit = context.resolveCompilationUnit2(source, source); |
| 906 VariableGatherer gatherer = new VariableGatherer(filter); | 906 VariableGatherer gatherer = new VariableGatherer(filter); |
| 907 unit.accept(gatherer); | 907 unit.accept(gatherer); |
| 908 return gatherer.results; | 908 return gatherer.results; |
| 909 } | 909 } |
| 910 } | 910 } |
| OLD | NEW |