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

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

Issue 1916063003: We don't use path filter in SingleContextManager. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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/analysis_server/lib/src/single_context_manager.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/single_context_manager_test.dart
diff --git a/pkg/analysis_server/test/single_context_manager_test.dart b/pkg/analysis_server/test/single_context_manager_test.dart
index e1fc9887ae284c220f30fbea669b5a07400a0670..34265058d56275d492fec9790903220ae6b7159c 100644
--- a/pkg/analysis_server/test/single_context_manager_test.dart
+++ b/pkg/analysis_server/test/single_context_manager_test.dart
@@ -83,6 +83,54 @@ class SingleContextManagerTest {
resourceProvider.newFolder(projPath);
}
+ void test_isIgnored_false() {
+ String project = '/project';
+ manager.setRoots(<String>[project], <String>[], <String, String>{});
+ expect(manager.isIgnored('$project/file.dart'), isFalse);
+ }
+
+ void test_isIgnored_true_inDotFolder() {
+ String project = '/project';
+ manager.setRoots(<String>[project], <String>[], <String, String>{});
+ expect(manager.isIgnored('$project/foo/.bar/file.dart'), isTrue);
+ }
+
+ void test_isIgnored_true_inExcludedPath() {
+ String project = '/project';
+ String excludedPath = '/project/excluded';
+ manager.setRoots(
+ <String>[project], <String>[excludedPath], <String, String>{});
+ expect(manager.isIgnored('$excludedPath/file.dart'), isTrue);
+ }
+
+ void test_isIgnored_true_notInRoot() {
+ String root1 = '/context/root1';
+ String root2 = '/context/root2';
+ manager.setRoots(<String>[root1, root2], <String>[], <String, String>{});
+ expect(manager.isIgnored('$context/root3/file.dart'), isTrue);
+ }
+
+ void test_isInAnalysisRoot_false_inExcludedPath() {
+ String project = '/project';
+ String excludedPath = '/project/excluded';
+ manager.setRoots(
+ <String>[project], <String>[excludedPath], <String, String>{});
+ expect(manager.isInAnalysisRoot('$excludedPath/file.dart'), isFalse);
+ }
+
+ void test_isInAnalysisRoot_false_notInRoot() {
+ String root1 = '/context/root1';
+ String root2 = '/context/root2';
+ manager.setRoots(<String>[root1, root2], <String>[], <String, String>{});
+ expect(manager.isInAnalysisRoot('$context/root3/file.dart'), isFalse);
+ }
+
+ void test_isInAnalysisRoot_true() {
+ String project = '/project';
+ manager.setRoots(<String>[project], <String>[], <String, String>{});
+ expect(manager.isInAnalysisRoot('$project/file.dart'), isTrue);
+ }
+
void test_setRoots_addFolderWithDartFile() {
String filePath = posix.join(projPath, 'lib', 'foo.dart');
resourceProvider.newFile(filePath, 'contents');
« no previous file with comments | « pkg/analysis_server/lib/src/single_context_manager.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698