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

Unified Diff: pkg/analysis_server/test/context_manager_test.dart

Issue 1439723002: Exclude 'doc' folders. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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/analysis_server/test/context_manager_test.dart
diff --git a/pkg/analysis_server/test/context_manager_test.dart b/pkg/analysis_server/test/context_manager_test.dart
index 0baa6fc079faf6effaeb53ab80b7fcedfbb32051..49c199fccb30369f4508748dce16e136f7ded5d3 100644
--- a/pkg/analysis_server/test/context_manager_test.dart
+++ b/pkg/analysis_server/test/context_manager_test.dart
@@ -1013,6 +1013,17 @@ test_pack:lib/
callbacks.assertContextFiles(project, [fileA, fileB]);
}
+ void test_setRoots_ignoreDocFolder() {
+ String project = '/project';
+ String fileA = '$project/foo.dart';
+ String fileB = '$project/doc/bar.dart';
+ resourceProvider.newFile(fileA, '');
+ resourceProvider.newFile(fileB, '');
+ manager.setRoots(<String>[project], <String>[], <String, String>{});
+ callbacks.assertContextPaths([project]);
+ callbacks.assertContextFiles(project, [fileA]);
+ }
+
void test_setRoots_newFolderWithPackageRoot() {
String packageRootPath = '/package';
manager.setRoots(<String>[projPath], <String>[],
@@ -1297,6 +1308,25 @@ analyzer:
});
}
+ test_watch_addFile_inDocFolder() {
+ // prepare paths
+ String project = '/project';
+ String fileA = '$project/a.dart';
+ String fileB = '$project/doc/b.dart';
+ // create files
+ resourceProvider.newFile(fileA, '');
+ // set roots
+ manager.setRoots(<String>[project], <String>[], <String, String>{});
+ callbacks.assertContextPaths([project]);
+ callbacks.assertContextFiles(project, [fileA]);
+ // add a "doc" file, it is ignored
+ resourceProvider.newFile(fileB, '');
+ return pumpEventQueue().then((_) {
+ callbacks.assertContextPaths([project]);
+ callbacks.assertContextFiles(project, [fileA]);
+ });
+ }
+
test_watch_addFile_pathContainsDotFile() async {
// If a file is added and the path to it (relative to the context root)
// contains a folder whose name begins with '.', then the file is ignored.

Powered by Google App Engine
This is Rietveld 408576698