| 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 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 974 expect(libraryElement.entryPoint, isNotNull); | 974 expect(libraryElement.entryPoint, isNotNull); |
| 975 } | 975 } |
| 976 | 976 |
| 977 test_perform_noSuchFilePart() { | 977 test_perform_noSuchFilePart() { |
| 978 _performBuildTask({ | 978 _performBuildTask({ |
| 979 '/lib.dart': ''' | 979 '/lib.dart': ''' |
| 980 library lib; | 980 library lib; |
| 981 part 'no-such-file.dart'; | 981 part 'no-such-file.dart'; |
| 982 ''' | 982 ''' |
| 983 }); | 983 }); |
| 984 expect(libraryElement.parts, isEmpty); | 984 expect(libraryElement.parts, hasLength(1)); |
| 985 CompilationUnitElement part = libraryElement.parts[0]; |
| 986 expect(part, isNotNull); |
| 987 expect(part.source, isNotNull); |
| 988 expect(part.library, same(libraryElement)); |
| 989 expect(context.exists(part.source), isFalse); |
| 985 } | 990 } |
| 986 | 991 |
| 987 test_perform_patchTopLevelAccessors() { | 992 test_perform_patchTopLevelAccessors() { |
| 988 _performBuildTask({ | 993 _performBuildTask({ |
| 989 '/lib.dart': ''' | 994 '/lib.dart': ''' |
| 990 library lib; | 995 library lib; |
| 991 part 'part1.dart'; | 996 part 'part1.dart'; |
| 992 part 'part2.dart'; | 997 part 'part2.dart'; |
| 993 ''', | 998 ''', |
| 994 '/part1.dart': ''' | 999 '/part1.dart': ''' |
| (...skipping 1654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2649 /** | 2654 /** |
| 2650 * Fill [errorListener] with [result] errors in the current [task]. | 2655 * Fill [errorListener] with [result] errors in the current [task]. |
| 2651 */ | 2656 */ |
| 2652 void _fillErrorListener(ResultDescriptor<List<AnalysisError>> result) { | 2657 void _fillErrorListener(ResultDescriptor<List<AnalysisError>> result) { |
| 2653 List<AnalysisError> errors = task.outputs[result]; | 2658 List<AnalysisError> errors = task.outputs[result]; |
| 2654 expect(errors, isNotNull, reason: result.name); | 2659 expect(errors, isNotNull, reason: result.name); |
| 2655 errorListener = new GatheringErrorListener(); | 2660 errorListener = new GatheringErrorListener(); |
| 2656 errorListener.addAll(errors); | 2661 errorListener.addAll(errors); |
| 2657 } | 2662 } |
| 2658 } | 2663 } |
| OLD | NEW |