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 881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
892 '/partB.dart': ''' | 892 '/partB.dart': ''' |
893 part of libB; | 893 part of libB; |
894 ''' | 894 ''' |
895 }); | 895 }); |
896 _assertErrorsWithCodes( | 896 _assertErrorsWithCodes( |
897 [ResolverErrorCode.MISSING_LIBRARY_DIRECTIVE_WITH_PART]); | 897 [ResolverErrorCode.MISSING_LIBRARY_DIRECTIVE_WITH_PART]); |
898 AnalysisError error = errorListener.errors[0]; | 898 AnalysisError error = errorListener.errors[0]; |
899 expect(error.getProperty(ErrorProperty.PARTS_LIBRARY_NAME), isNull); | 899 expect(error.getProperty(ErrorProperty.PARTS_LIBRARY_NAME), isNull); |
900 } | 900 } |
901 | 901 |
| 902 test_perform_error_partDoesNotExist() { |
| 903 _performBuildTask({ |
| 904 '/lib.dart': ''' |
| 905 library lib; |
| 906 part 'part.dart'; |
| 907 ''' |
| 908 }); |
| 909 // we already report URI_DOES_NOT_EXIST, no need to report other errors |
| 910 _assertErrorsWithCodes([]); |
| 911 } |
| 912 |
902 test_perform_error_partOfDifferentLibrary() { | 913 test_perform_error_partOfDifferentLibrary() { |
903 _performBuildTask({ | 914 _performBuildTask({ |
904 '/lib.dart': ''' | 915 '/lib.dart': ''' |
905 library lib; | 916 library lib; |
906 part 'part.dart'; | 917 part 'part.dart'; |
907 ''', | 918 ''', |
908 '/part.dart': ''' | 919 '/part.dart': ''' |
909 part of someOtherLib; | 920 part of someOtherLib; |
910 ''' | 921 ''' |
911 }); | 922 }); |
(...skipping 1612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2524 /** | 2535 /** |
2525 * Fill [errorListener] with [result] errors in the current [task]. | 2536 * Fill [errorListener] with [result] errors in the current [task]. |
2526 */ | 2537 */ |
2527 void _fillErrorListener(ResultDescriptor<List<AnalysisError>> result) { | 2538 void _fillErrorListener(ResultDescriptor<List<AnalysisError>> result) { |
2528 List<AnalysisError> errors = task.outputs[result]; | 2539 List<AnalysisError> errors = task.outputs[result]; |
2529 expect(errors, isNotNull, reason: result.name); | 2540 expect(errors, isNotNull, reason: result.name); |
2530 errorListener = new GatheringErrorListener(); | 2541 errorListener = new GatheringErrorListener(); |
2531 errorListener.addAll(errors); | 2542 errorListener.addAll(errors); |
2532 } | 2543 } |
2533 } | 2544 } |
OLD | NEW |