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

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

Issue 334573005: Unit test context removal (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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 | « no previous file | pkg/analysis_server/test/mocks.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/context_directory_manager_test.dart
diff --git a/pkg/analysis_server/test/context_directory_manager_test.dart b/pkg/analysis_server/test/context_directory_manager_test.dart
index 0bebce08a6586ddfba987b4922b0a4744c26639e..7f27224a4a2c601b6d57287d8060ba181c07962b 100644
--- a/pkg/analysis_server/test/context_directory_manager_test.dart
+++ b/pkg/analysis_server/test/context_directory_manager_test.dart
@@ -106,6 +106,28 @@ main() {
expect(filePaths, contains(filePath));
});
+ test('remove folder with pubspec', () {
+ String projPath = '/my/proj';
+ String pubspecPath = posix.join(projPath, 'pubspec.yaml');
+ provider.newFolder(projPath);
+ provider.newFile(pubspecPath, 'pubspec');
+ manager.setRoots(<String>[projPath], <String>[]);
+ manager.setRoots(<String>[], <String>[]);
+ expect(manager.currentContextPaths, hasLength(0));
+ expect(manager.currentContextPubspecPaths, hasLength(0));
+ expect(manager.currentContextFilePaths, hasLength(0));
+ });
+
+ test('remove folder without pubspec', () {
+ String projPath = '/my/proj';
+ provider.newFolder(projPath);
+ manager.setRoots(<String>[projPath], <String>[]);
+ manager.setRoots(<String>[], <String>[]);
+ expect(manager.currentContextPaths, hasLength(0));
+ expect(manager.currentContextPubspecPaths, hasLength(0));
+ expect(manager.currentContextFilePaths, hasLength(0));
+ });
+
test('ignore files in packages dir', () {
String projPath = '/my/proj';
provider.newFolder(projPath);
« no previous file with comments | « no previous file | pkg/analysis_server/test/mocks.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698