| 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 'package:analyzer/error/error.dart'; | 7 import 'package:analyzer/error/error.dart'; |
| 8 import 'package:analyzer/src/error/codes.dart'; | 8 import 'package:analyzer/src/error/codes.dart'; |
| 9 import 'package:analyzer/src/generated/engine.dart'; | 9 import 'package:analyzer/src/generated/engine.dart'; |
| 10 import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode; | 10 import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode; |
| (...skipping 6151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6162 assertErrors(test, [CompileTimeErrorCode.URI_DOES_NOT_EXIST]); | 6162 assertErrors(test, [CompileTimeErrorCode.URI_DOES_NOT_EXIST]); |
| 6163 } | 6163 } |
| 6164 | 6164 |
| 6165 void test_uriDoesNotExist_import_disappears_when_fixed() { | 6165 void test_uriDoesNotExist_import_disappears_when_fixed() { |
| 6166 Source source = addSource("import 'target.dart';"); | 6166 Source source = addSource("import 'target.dart';"); |
| 6167 computeLibrarySourceErrors(source); | 6167 computeLibrarySourceErrors(source); |
| 6168 assertErrors(source, [CompileTimeErrorCode.URI_DOES_NOT_EXIST]); | 6168 assertErrors(source, [CompileTimeErrorCode.URI_DOES_NOT_EXIST]); |
| 6169 | 6169 |
| 6170 // Check that the file is represented as missing. | 6170 // Check that the file is represented as missing. |
| 6171 Source target = | 6171 Source target = |
| 6172 analysisContext2.getSourcesWithFullName("/target.dart").first; | 6172 analysisContext2.getSourcesWithFullName(resourceProvider.convertPath("/t
arget.dart")).first; |
| 6173 expect(analysisContext2.getModificationStamp(target), -1); | 6173 expect(analysisContext2.getModificationStamp(target), -1); |
| 6174 | 6174 |
| 6175 // Add an overlay in the same way as AnalysisServer. | 6175 // Add an overlay in the same way as AnalysisServer. |
| 6176 analysisContext2 | 6176 analysisContext2 |
| 6177 ..setContents(target, "") | 6177 ..setContents(target, "") |
| 6178 ..handleContentsChanged(target, null, "", true); | 6178 ..handleContentsChanged(target, null, "", true); |
| 6179 | 6179 |
| 6180 // Make sure the error goes away. | 6180 // Make sure the error goes away. |
| 6181 computeLibrarySourceErrors(source); | 6181 computeLibrarySourceErrors(source); |
| 6182 assertErrors(source, [HintCode.UNUSED_IMPORT]); | 6182 assertErrors(source, [HintCode.UNUSED_IMPORT]); |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6423 source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR]); | 6423 source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR]); |
| 6424 verify([source]); | 6424 verify([source]); |
| 6425 reset(); | 6425 reset(); |
| 6426 } | 6426 } |
| 6427 | 6427 |
| 6428 void _check_wrongNumberOfParametersForOperator1(String name) { | 6428 void _check_wrongNumberOfParametersForOperator1(String name) { |
| 6429 _check_wrongNumberOfParametersForOperator(name, ""); | 6429 _check_wrongNumberOfParametersForOperator(name, ""); |
| 6430 _check_wrongNumberOfParametersForOperator(name, "a, b"); | 6430 _check_wrongNumberOfParametersForOperator(name, "a, b"); |
| 6431 } | 6431 } |
| 6432 } | 6432 } |
| OLD | NEW |