| 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 6154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6165 | 6165 |
| 6166 await computeAnalysisResult(test); | 6166 await computeAnalysisResult(test); |
| 6167 assertErrors(test, [CompileTimeErrorCode.URI_DOES_NOT_EXIST]); | 6167 assertErrors(test, [CompileTimeErrorCode.URI_DOES_NOT_EXIST]); |
| 6168 } | 6168 } |
| 6169 | 6169 |
| 6170 test_uriDoesNotExist_import_disappears_when_fixed() async { | 6170 test_uriDoesNotExist_import_disappears_when_fixed() async { |
| 6171 Source source = addSource("import 'target.dart';"); | 6171 Source source = addSource("import 'target.dart';"); |
| 6172 await computeAnalysisResult(source); | 6172 await computeAnalysisResult(source); |
| 6173 assertErrors(source, [CompileTimeErrorCode.URI_DOES_NOT_EXIST]); | 6173 assertErrors(source, [CompileTimeErrorCode.URI_DOES_NOT_EXIST]); |
| 6174 | 6174 |
| 6175 // Check that the file is represented as missing. | 6175 String targetPath = resourceProvider.convertPath('/target.dart'); |
| 6176 Source target = analysisContext2 | 6176 if (enableNewAnalysisDriver) { |
| 6177 .getSourcesWithFullName(resourceProvider.convertPath("/target.dart")) | 6177 // Add an overlay in the same way as AnalysisServer. |
| 6178 .first; | 6178 fileContentOverlay[targetPath] = ''; |
| 6179 expect(analysisContext2.getModificationStamp(target), -1); | 6179 driver.changeFile(targetPath); |
| 6180 } else { |
| 6181 // Check that the file is represented as missing. |
| 6182 Source target = analysisContext2.getSourcesWithFullName(targetPath).first; |
| 6183 expect(analysisContext2.getModificationStamp(target), -1); |
| 6180 | 6184 |
| 6181 // Add an overlay in the same way as AnalysisServer. | 6185 // Add an overlay in the same way as AnalysisServer. |
| 6182 analysisContext2 | 6186 analysisContext2 |
| 6183 ..setContents(target, "") | 6187 ..setContents(target, "") |
| 6184 ..handleContentsChanged(target, null, "", true); | 6188 ..handleContentsChanged(target, null, "", true); |
| 6189 } |
| 6185 | 6190 |
| 6186 // Make sure the error goes away. | 6191 // Make sure the error goes away. |
| 6187 await computeAnalysisResult(source); | 6192 await computeAnalysisResult(source); |
| 6188 assertErrors(source, [HintCode.UNUSED_IMPORT]); | 6193 assertErrors(source, [HintCode.UNUSED_IMPORT]); |
| 6189 } | 6194 } |
| 6190 | 6195 |
| 6191 test_uriDoesNotExist_part() async { | 6196 test_uriDoesNotExist_part() async { |
| 6192 Source source = addSource(r''' | 6197 Source source = addSource(r''' |
| 6193 library lib; | 6198 library lib; |
| 6194 part 'unknown.dart';'''); | 6199 part 'unknown.dart';'''); |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6432 source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR]); | 6437 source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR]); |
| 6433 verify([source]); | 6438 verify([source]); |
| 6434 reset(); | 6439 reset(); |
| 6435 } | 6440 } |
| 6436 | 6441 |
| 6437 Future<Null> _check_wrongNumberOfParametersForOperator1(String name) async { | 6442 Future<Null> _check_wrongNumberOfParametersForOperator1(String name) async { |
| 6438 await _check_wrongNumberOfParametersForOperator(name, ""); | 6443 await _check_wrongNumberOfParametersForOperator(name, ""); |
| 6439 await _check_wrongNumberOfParametersForOperator(name, "a, b"); | 6444 await _check_wrongNumberOfParametersForOperator(name, "a, b"); |
| 6440 } | 6445 } |
| 6441 } | 6446 } |
| OLD | NEW |