Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Unified Diff: pkg/analyzer/test/generated/compile_time_error_code_test.dart

Issue 1737693004: Update SOURCE_KIND when a missing source file appears (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: oops, fix the test Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/context/context.dart ('k') | pkg/analyzer/test/src/context/context_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/compile_time_error_code_test.dart
diff --git a/pkg/analyzer/test/generated/compile_time_error_code_test.dart b/pkg/analyzer/test/generated/compile_time_error_code_test.dart
index 7c0c15adb3ea2c31093a0760f848b482c055c40e..50ea5db63d460f2b9e6662671b0ca5693bf5c256 100644
--- a/pkg/analyzer/test/generated/compile_time_error_code_test.dart
+++ b/pkg/analyzer/test/generated/compile_time_error_code_test.dart
@@ -7,6 +7,7 @@ library analyzer.test.generated.compile_time_error_code_test;
import 'package:analyzer/src/generated/error.dart';
import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode;
import 'package:analyzer/src/generated/source_io.dart';
+import 'package:unittest/unittest.dart' show expect;
import '../reflective_tests.dart';
import '../utils.dart';
@@ -6043,6 +6044,27 @@ main() {
assertErrors(source, [CompileTimeErrorCode.URI_DOES_NOT_EXIST]);
}
+ void test_uriDoesNotExist_import_then_fixed() {
+ Source source = addSource("import 'target.dart';");
+ computeLibrarySourceErrors(source);
+ assertErrors(source, [CompileTimeErrorCode.URI_DOES_NOT_EXIST]);
+
+ // Check that the file is represented as missing.
+ Source target =
+ analysisContext2.getSourcesWithFullName("/target.dart").first;
+ expect(analysisContext2.getModificationStamp(target), -1);
+
+ // Add an overlay in the same way as AnalysisServer.
+ analysisContext2
+ ..setContents(target, "")
+ ..handleContentsChanged(target, null, "", true);
+
+ // Make sure the error goes away.
+ // TODO(skybrian) why isn't there an unused import hint?
+ computeLibrarySourceErrors(source);
+ assertErrors(source, [HintCode.UNUSED_IMPORT]);
+ }
+
void test_uriDoesNotExist_part() {
Source source = addSource(r'''
library lib;
« no previous file with comments | « pkg/analyzer/lib/src/context/context.dart ('k') | pkg/analyzer/test/src/context/context_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698