| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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.generated.compile_time_error_code_test; | 5 library analyzer.test.generated.compile_time_error_code_test; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analyzer/error/error.dart'; | 9 import 'package:analyzer/error/error.dart'; |
| 10 import 'package:analyzer/src/error/codes.dart'; | 10 import 'package:analyzer/src/error/codes.dart'; |
| (...skipping 6156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6167 assertErrors(source, [CompileTimeErrorCode.URI_DOES_NOT_EXIST]); | 6167 assertErrors(source, [CompileTimeErrorCode.URI_DOES_NOT_EXIST]); |
| 6168 } | 6168 } |
| 6169 | 6169 |
| 6170 test_uriDoesNotExist_import_appears_after_deleting_target() async { | 6170 test_uriDoesNotExist_import_appears_after_deleting_target() async { |
| 6171 Source test = addSource("import 'target.dart';"); | 6171 Source test = addSource("import 'target.dart';"); |
| 6172 Source target = addNamedSource("/target.dart", ""); | 6172 Source target = addNamedSource("/target.dart", ""); |
| 6173 await computeAnalysisResult(test); | 6173 await computeAnalysisResult(test); |
| 6174 assertErrors(test, [HintCode.UNUSED_IMPORT]); | 6174 assertErrors(test, [HintCode.UNUSED_IMPORT]); |
| 6175 | 6175 |
| 6176 // Remove the overlay in the same way as AnalysisServer. | 6176 // Remove the overlay in the same way as AnalysisServer. |
| 6177 resourceProvider.deleteFile(resourceProvider.convertPath('/target.dart')); | 6177 resourceProvider.deleteFile(target.fullName); |
| 6178 analysisContext2.setContents(target, null); | 6178 if (enableNewAnalysisDriver) { |
| 6179 ChangeSet changeSet = new ChangeSet()..removedSource(target); | 6179 driver.removeFile(target.fullName); |
| 6180 analysisContext2.applyChanges(changeSet); | 6180 } else { |
| 6181 analysisContext2.setContents(target, null); |
| 6182 ChangeSet changeSet = new ChangeSet()..removedSource(target); |
| 6183 analysisContext2.applyChanges(changeSet); |
| 6184 } |
| 6181 | 6185 |
| 6182 await computeAnalysisResult(test); | 6186 await computeAnalysisResult(test); |
| 6183 assertErrors(test, [CompileTimeErrorCode.URI_DOES_NOT_EXIST]); | 6187 assertErrors(test, [CompileTimeErrorCode.URI_DOES_NOT_EXIST]); |
| 6184 } | 6188 } |
| 6185 | 6189 |
| 6186 test_uriDoesNotExist_import_disappears_when_fixed() async { | 6190 test_uriDoesNotExist_import_disappears_when_fixed() async { |
| 6187 Source source = addSource("import 'target.dart';"); | 6191 Source source = addSource("import 'target.dart';"); |
| 6188 await computeAnalysisResult(source); | 6192 await computeAnalysisResult(source); |
| 6189 assertErrors(source, [CompileTimeErrorCode.URI_DOES_NOT_EXIST]); | 6193 assertErrors(source, [CompileTimeErrorCode.URI_DOES_NOT_EXIST]); |
| 6190 | 6194 |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6453 source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR]); | 6457 source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR]); |
| 6454 verify([source]); | 6458 verify([source]); |
| 6455 reset(); | 6459 reset(); |
| 6456 } | 6460 } |
| 6457 | 6461 |
| 6458 Future<Null> _check_wrongNumberOfParametersForOperator1(String name) async { | 6462 Future<Null> _check_wrongNumberOfParametersForOperator1(String name) async { |
| 6459 await _check_wrongNumberOfParametersForOperator(name, ""); | 6463 await _check_wrongNumberOfParametersForOperator(name, ""); |
| 6460 await _check_wrongNumberOfParametersForOperator(name, "a, b"); | 6464 await _check_wrongNumberOfParametersForOperator(name, "a, b"); |
| 6461 } | 6465 } |
| 6462 } | 6466 } |
| OLD | NEW |