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

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: 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
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..bdaeb49f8cf33490a48bfe3c01a86c7e620f1ed9 100644
--- a/pkg/analyzer/test/generated/compile_time_error_code_test.dart
+++ b/pkg/analyzer/test/generated/compile_time_error_code_test.dart
@@ -4,9 +4,12 @@
library analyzer.test.generated.compile_time_error_code_test;
+import 'package:analyzer/src/generated/engine.dart' show ChangeSet;
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:analyzer/src/string_source.dart';
+import 'package:unittest/unittest.dart' show expect;
import '../reflective_tests.dart';
import '../utils.dart';
@@ -6043,6 +6046,20 @@ main() {
assertErrors(source, [CompileTimeErrorCode.URI_DOES_NOT_EXIST]);
}
+ void test_uriDoesNotExist_import_then_unused_import() {
+ Source source = addSource("import 'target.dart';");
+ computeLibrarySourceErrors(source);
+ assertErrors(source, [CompileTimeErrorCode.URI_DOES_NOT_EXIST]);
+
+ Source target =
+ analysisContext.sources.firstWhere((s) => s.fullName == "/target.dart");
+ expect(target.modificationStamp, -1);
Brian Wilkerson 2016/02/26 15:07:32 I'm not 100% certain, but given that most of our t
+ changeSource(target, "");
Brian Wilkerson 2016/02/26 15:07:32 When a file that didn't exist is created on disk,
skybrian 2016/02/26 18:09:01 I'm testing the case when the file hasn't been sav
Brian Wilkerson 2016/02/26 18:35:57 Ok. I just didn't realize that we had clients that
+
+ computeLibrarySourceErrors(source);
+ assertErrors(source, [HintCode.UNUSED_IMPORT]);
+ }
+
void test_uriDoesNotExist_part() {
Source source = addSource(r'''
library lib;

Powered by Google App Engine
This is Rietveld 408576698