| 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/standard_resolution_map.dart'; | 8 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; |
| 9 import 'package:analyzer/dart/ast/token.dart'; | 9 import 'package:analyzer/dart/ast/token.dart'; |
| 10 import 'package:analyzer/dart/ast/visitor.dart'; | 10 import 'package:analyzer/dart/ast/visitor.dart'; |
| (...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 869 '/partB.dart': ''' | 869 '/partB.dart': ''' |
| 870 part of my_lib; | 870 part of my_lib; |
| 871 ''' | 871 ''' |
| 872 }); | 872 }); |
| 873 if (context.analysisOptions.enableUriInPartOf) { | 873 if (context.analysisOptions.enableUriInPartOf) { |
| 874 // TODO(28522) | 874 // TODO(28522) |
| 875 // Should report that names are wrong. | 875 // Should report that names are wrong. |
| 876 } else { | 876 } else { |
| 877 _assertErrorsWithCodes( | 877 _assertErrorsWithCodes( |
| 878 [ResolverErrorCode.MISSING_LIBRARY_DIRECTIVE_WITH_PART]); | 878 [ResolverErrorCode.MISSING_LIBRARY_DIRECTIVE_WITH_PART]); |
| 879 AnalysisError error = errorListener.errors[0]; | |
| 880 } | 879 } |
| 881 } | 880 } |
| 882 | 881 |
| 883 test_perform_error_missingLibraryDirectiveWithPart_noCommon() { | 882 test_perform_error_missingLibraryDirectiveWithPart_noCommon() { |
| 884 _performBuildTask({ | 883 _performBuildTask({ |
| 885 '/lib.dart': ''' | 884 '/lib.dart': ''' |
| 886 part 'partA.dart'; | 885 part 'partA.dart'; |
| 887 part 'partB.dart'; | 886 part 'partB.dart'; |
| 888 ''', | 887 ''', |
| 889 '/partA.dart': ''' | 888 '/partA.dart': ''' |
| 890 part of libA; | 889 part of libA; |
| 891 ''', | 890 ''', |
| 892 '/partB.dart': ''' | 891 '/partB.dart': ''' |
| 893 part of libB; | 892 part of libB; |
| 894 ''' | 893 ''' |
| 895 }); | 894 }); |
| 896 if (context.analysisOptions.enableUriInPartOf) { | 895 if (context.analysisOptions.enableUriInPartOf) { |
| 897 // TODO(28522) | 896 // TODO(28522) |
| 898 // Should report that names are wrong. | 897 // Should report that names are wrong. |
| 899 } else { | 898 } else { |
| 900 _assertErrorsWithCodes( | 899 _assertErrorsWithCodes( |
| 901 [ResolverErrorCode.MISSING_LIBRARY_DIRECTIVE_WITH_PART]); | 900 [ResolverErrorCode.MISSING_LIBRARY_DIRECTIVE_WITH_PART]); |
| 902 AnalysisError error = errorListener.errors[0]; | |
| 903 } | 901 } |
| 904 } | 902 } |
| 905 | 903 |
| 906 test_perform_error_partDoesNotExist() { | 904 test_perform_error_partDoesNotExist() { |
| 907 _performBuildTask({ | 905 _performBuildTask({ |
| 908 '/lib.dart': ''' | 906 '/lib.dart': ''' |
| 909 library lib; | 907 library lib; |
| 910 part 'part.dart'; | 908 part 'part.dart'; |
| 911 ''' | 909 ''' |
| 912 }); | 910 }); |
| (...skipping 4834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5747 /** | 5745 /** |
| 5748 * Fill [errorListener] with [result] errors in the current [task]. | 5746 * Fill [errorListener] with [result] errors in the current [task]. |
| 5749 */ | 5747 */ |
| 5750 void _fillErrorListener(ResultDescriptor<List<AnalysisError>> result) { | 5748 void _fillErrorListener(ResultDescriptor<List<AnalysisError>> result) { |
| 5751 List<AnalysisError> errors = task.outputs[result] as List<AnalysisError>; | 5749 List<AnalysisError> errors = task.outputs[result] as List<AnalysisError>; |
| 5752 expect(errors, isNotNull, reason: result.name); | 5750 expect(errors, isNotNull, reason: result.name); |
| 5753 errorListener = new GatheringErrorListener(); | 5751 errorListener = new GatheringErrorListener(); |
| 5754 errorListener.addAll(errors); | 5752 errorListener.addAll(errors); |
| 5755 } | 5753 } |
| 5756 } | 5754 } |
| OLD | NEW |