| 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 analyzer.test.src.task.dart_test; | 5 library analyzer.test.src.task.dart_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/token.dart'; | 8 import 'package:analyzer/dart/ast/token.dart'; |
| 9 import 'package:analyzer/dart/ast/visitor.dart'; | 9 import 'package:analyzer/dart/ast/visitor.dart'; |
| 10 import 'package:analyzer/dart/element/element.dart'; | 10 import 'package:analyzer/dart/element/element.dart'; |
| (...skipping 4051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4062 } | 4062 } |
| 4063 | 4063 |
| 4064 @reflectiveTest | 4064 @reflectiveTest |
| 4065 class ResolveVariableReferencesTaskTest extends _AbstractDartTaskTest { | 4065 class ResolveVariableReferencesTaskTest extends _AbstractDartTaskTest { |
| 4066 /** | 4066 /** |
| 4067 * Verify that the mutated states of the given [variable] correspond to the | 4067 * Verify that the mutated states of the given [variable] correspond to the |
| 4068 * [mutatedInClosure] and [mutatedInScope] matchers. | 4068 * [mutatedInClosure] and [mutatedInScope] matchers. |
| 4069 */ | 4069 */ |
| 4070 void expectMutated(FunctionBody body, VariableElement variable, | 4070 void expectMutated(FunctionBody body, VariableElement variable, |
| 4071 bool mutatedInClosure, bool mutatedInScope) { | 4071 bool mutatedInClosure, bool mutatedInScope) { |
| 4072 expect(variable.isPotentiallyMutatedInClosure, mutatedInClosure); | |
| 4073 expect(variable.isPotentiallyMutatedInScope, mutatedInScope); | |
| 4074 expect(body.isPotentiallyMutatedInClosure(variable), mutatedInClosure); | 4072 expect(body.isPotentiallyMutatedInClosure(variable), mutatedInClosure); |
| 4075 expect(body.isPotentiallyMutatedInScope(variable), mutatedInScope); | 4073 expect(body.isPotentiallyMutatedInScope(variable), mutatedInScope); |
| 4076 } | 4074 } |
| 4077 | 4075 |
| 4078 test_created_resolved_unit() { | 4076 test_created_resolved_unit() { |
| 4079 Source source = newSource( | 4077 Source source = newSource( |
| 4080 '/test.dart', | 4078 '/test.dart', |
| 4081 r''' | 4079 r''' |
| 4082 library lib; | 4080 library lib; |
| 4083 class A {} | 4081 class A {} |
| (...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4963 /** | 4961 /** |
| 4964 * Fill [errorListener] with [result] errors in the current [task]. | 4962 * Fill [errorListener] with [result] errors in the current [task]. |
| 4965 */ | 4963 */ |
| 4966 void _fillErrorListener(ResultDescriptor<List<AnalysisError>> result) { | 4964 void _fillErrorListener(ResultDescriptor<List<AnalysisError>> result) { |
| 4967 List<AnalysisError> errors = task.outputs[result]; | 4965 List<AnalysisError> errors = task.outputs[result]; |
| 4968 expect(errors, isNotNull, reason: result.name); | 4966 expect(errors, isNotNull, reason: result.name); |
| 4969 errorListener = new GatheringErrorListener(); | 4967 errorListener = new GatheringErrorListener(); |
| 4970 errorListener.addAll(errors); | 4968 errorListener.addAll(errors); |
| 4971 } | 4969 } |
| 4972 } | 4970 } |
| OLD | NEW |