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.dart_test; | 5 library test.src.task.dart_test; |
6 | 6 |
7 import 'package:analyzer/src/context/cache.dart'; | 7 import 'package:analyzer/src/context/cache.dart'; |
8 import 'package:analyzer/src/generated/ast.dart'; | 8 import 'package:analyzer/src/generated/ast.dart'; |
9 import 'package:analyzer/src/generated/constant.dart'; | 9 import 'package:analyzer/src/generated/constant.dart'; |
10 import 'package:analyzer/src/generated/element.dart'; | 10 import 'package:analyzer/src/generated/element.dart'; |
(...skipping 2349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2360 } | 2360 } |
2361 | 2361 |
2362 void setUp() { | 2362 void setUp() { |
2363 super.setUp(); | 2363 super.setUp(); |
2364 emptySource = newSource('/test.dart'); | 2364 emptySource = newSource('/test.dart'); |
2365 } | 2365 } |
2366 | 2366 |
2367 void _computeResult(AnalysisTarget target, ResultDescriptor result) { | 2367 void _computeResult(AnalysisTarget target, ResultDescriptor result) { |
2368 oldOutputs = outputs; | 2368 oldOutputs = outputs; |
2369 task = analysisDriver.computeResult(target, result); | 2369 task = analysisDriver.computeResult(target, result); |
| 2370 expect(task, isNotNull); |
2370 expect(task.caughtException, isNull); | 2371 expect(task.caughtException, isNull); |
2371 outputs = task.outputs; | 2372 outputs = task.outputs; |
2372 } | 2373 } |
2373 | 2374 |
2374 /** | 2375 /** |
2375 * Fill [errorListener] with [result] errors in the current [task]. | 2376 * Fill [errorListener] with [result] errors in the current [task]. |
2376 */ | 2377 */ |
2377 void _fillErrorListener(ResultDescriptor<List<AnalysisError>> result) { | 2378 void _fillErrorListener(ResultDescriptor<List<AnalysisError>> result) { |
2378 List<AnalysisError> errors = task.outputs[result]; | 2379 List<AnalysisError> errors = task.outputs[result]; |
2379 expect(errors, isNotNull, reason: result.name); | 2380 expect(errors, isNotNull, reason: result.name); |
2380 errorListener = new GatheringErrorListener(); | 2381 errorListener = new GatheringErrorListener(); |
2381 errorListener.addAll(errors); | 2382 errorListener.addAll(errors); |
2382 } | 2383 } |
2383 } | 2384 } |
OLD | NEW |