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

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

Issue 2654303003: Ignore files that are hidden by generated files. (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
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 79323c15234139793611ab39a225e66b8971915e..656c63f5e9d1e19e41d0f80c1af3f956348e38ec 100644
--- a/pkg/analyzer/test/src/dart/analysis/file_state_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/file_state_test.dart
@@ -275,29 +275,6 @@ class A2 {}
expect(file.unlinked.classes, isEmpty);
}
- test_getFileForPath_generatedFile() {
- Uri uri = Uri.parse('package:aaa/foo.dart');
- String templatePath = _p('/aaa/lib/foo.dart');
- String generatedPath = _p('/generated/aaa/lib/foo.dart');
-
- Source generatedSource = new _SourceMock();
- when(generatedSource.fullName).thenReturn(generatedPath);
- when(generatedSource.uri).thenReturn(uri);
-
- when(generatedUriResolver.resolveAbsolute(uri, uri))
- .thenReturn(generatedSource);
-
- FileState generatedFile = fileSystemState.getFileForUri(uri);
- expect(generatedFile.path, generatedPath);
- expect(generatedFile.uri, uri);
-
- FileState templateFile = fileSystemState.getFileForPath(templatePath);
- expect(templateFile.path, templatePath);
- expect(templateFile.uri, uri);
-
- expect(fileSystemState.getFilesForPath(templatePath), [templateFile]);
- }
-
test_getFileForPath_library() {
String a1 = _p('/aaa/lib/a1.dart');
String a2 = _p('/aaa/lib/a2.dart');
@@ -464,6 +441,22 @@ part 'not-a2.dart';
expect(files, [filePackageUri, fileFileUri]);
}
+ test_hasUri() {
+ Uri uri = Uri.parse('package:aaa/foo.dart');
+ String templatePath = _p('/aaa/lib/foo.dart');
+ String generatedPath = _p('/generated/aaa/lib/foo.dart');
+
+ Source generatedSource = new _SourceMock();
+ when(generatedSource.fullName).thenReturn(generatedPath);
+ when(generatedSource.uri).thenReturn(uri);
+
+ when(generatedUriResolver.resolveAbsolute(uri, uri))
+ .thenReturn(generatedSource);
+
+ expect(fileSystemState.hasUri(templatePath), isFalse);
+ expect(fileSystemState.hasUri(generatedPath), isTrue);
+ }
+
test_referencedNames() {
String path = _p('/aaa/lib/a.dart');
provider.newFile(

Powered by Google App Engine
This is Rietveld 408576698