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

Unified Diff: pkg/analyzer/test/src/dart/analysis/file_state_test.dart

Issue 2613683005: Issue 28149. Don't include non-Dart file into FileState. (Closed)
Patch Set: Created 3 years, 11 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/test/src/dart/analysis/driver_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/dart/analysis/file_state_test.dart
diff --git a/pkg/analyzer/test/src/dart/analysis/file_state_test.dart b/pkg/analyzer/test/src/dart/analysis/file_state_test.dart
index bb45ad1dd7f4432e7d2dc481c1b3096bf51bd83d..99f28e1308d8f3087bb7772b9a5340966584dc16 100644
--- a/pkg/analyzer/test/src/dart/analysis/file_state_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/file_state_test.dart
@@ -324,6 +324,30 @@ class A1 {}
expect(fileSystemState.getFilesForPath(a1), [file]);
}
+ test_getFileForPath_onlyDartFiles() {
+ String a = _p('/test/lib/a.dart');
+ String b = _p('/test/lib/b.dart');
+ String c = _p('/test/lib/c.dart');
+ String d = _p('/test/lib/d.dart');
+ provider.newFile(
+ a,
+ r'''
+library lib;
+import 'dart:math';
+import 'b.dart';
+import 'not_dart.txt';
+export 'c.dart';
+export 'not_dart.txt';
+part 'd.dart';
+part 'not_dart.txt';
+''');
+ FileState file = fileSystemState.getFileForPath(a);
+ expect(file.importedFiles.map((f) => f.path), [b]);
+ expect(file.exportedFiles.map((f) => f.path), [c]);
+ expect(file.partedFiles.map((f) => f.path), [d]);
+ expect(fileSystemState.knownFilePaths, unorderedEquals([a, b, c, d]));
+ }
+
test_getFileForPath_part() {
String a1 = _p('/aaa/lib/a1.dart');
String a2 = _p('/aaa/lib/a2.dart');
« no previous file with comments | « pkg/analyzer/test/src/dart/analysis/driver_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698