| 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 3358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3369 Iterable<String> shortNames = sources.map((s) => s.shortName); | 3369 Iterable<String> shortNames = sources.map((s) => s.shortName); |
| 3370 if (shortNames.length == 2) { | 3370 if (shortNames.length == 2) { |
| 3371 expect(shortNames, unorderedEquals(['core.dart', expectedShortName])); | 3371 expect(shortNames, unorderedEquals(['core.dart', expectedShortName])); |
| 3372 } else { | 3372 } else { |
| 3373 expect(shortNames, unorderedEquals([expectedShortName])); | 3373 expect(shortNames, unorderedEquals([expectedShortName])); |
| 3374 } | 3374 } |
| 3375 } | 3375 } |
| 3376 | 3376 |
| 3377 void _performParseTask(String content) { | 3377 void _performParseTask(String content) { |
| 3378 if (content == null) { | 3378 if (content == null) { |
| 3379 source = resourceProvider.getFile('/test.dart').createSource(); | 3379 source = resourceProvider |
| 3380 .getFile(resourceProvider.convertPath('/test.dart')) |
| 3381 .createSource(); |
| 3380 } else { | 3382 } else { |
| 3381 source = newSource('/test.dart', content); | 3383 source = newSource('/test.dart', content); |
| 3382 } | 3384 } |
| 3383 computeResult(source, PARSED_UNIT, matcher: isParseDartTask); | 3385 computeResult(source, PARSED_UNIT, matcher: isParseDartTask); |
| 3384 } | 3386 } |
| 3385 | 3387 |
| 3386 static void _assertHasCore(dynamic sourceList, int lenght) { | 3388 static void _assertHasCore(dynamic sourceList, int lenght) { |
| 3387 List<Source> sources = sourceList as List<Source>; | 3389 List<Source> sources = sourceList as List<Source>; |
| 3388 expect(sources, hasLength(lenght)); | 3390 expect(sources, hasLength(lenght)); |
| 3389 expect(sources, contains(predicate((Source s) { | 3391 expect(sources, contains(predicate((Source s) { |
| (...skipping 2263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5653 /** | 5655 /** |
| 5654 * Fill [errorListener] with [result] errors in the current [task]. | 5656 * Fill [errorListener] with [result] errors in the current [task]. |
| 5655 */ | 5657 */ |
| 5656 void _fillErrorListener(ResultDescriptor<List<AnalysisError>> result) { | 5658 void _fillErrorListener(ResultDescriptor<List<AnalysisError>> result) { |
| 5657 List<AnalysisError> errors = task.outputs[result] as List<AnalysisError>; | 5659 List<AnalysisError> errors = task.outputs[result] as List<AnalysisError>; |
| 5658 expect(errors, isNotNull, reason: result.name); | 5660 expect(errors, isNotNull, reason: result.name); |
| 5659 errorListener = new GatheringErrorListener(); | 5661 errorListener = new GatheringErrorListener(); |
| 5660 errorListener.addAll(errors); | 5662 errorListener.addAll(errors); |
| 5661 } | 5663 } |
| 5662 } | 5664 } |
| OLD | NEW |