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

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

Issue 340773005: Add support for adding/removing pubspec.yaml files. (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
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 a1cb1cdfb3c21cff9a951a2b79a91ca064c6e112..3e11bc391dbdd7791390091958fbac413531bfe3 100644
--- a/pkg/analysis_server/test/context_directory_manager_test.dart
+++ b/pkg/analysis_server/test/context_directory_manager_test.dart
@@ -189,6 +189,16 @@ main() {
});
});
+ test('Add pubspec file', () {
+ manager.setRoots(<String>[projPath], <String>[]);
+ String pubspecPath = posix.join(projPath, 'pubspec.yaml');
+ expect(manager.currentContextPubspecPaths[projPath], isNull);
+ provider.newFile(pubspecPath, 'pubspec');
+ return pumpEventQueue().then((_) {
+ expect(manager.currentContextPubspecPaths[projPath], equals(pubspecPath));
+ });
+ });
+
test('Delete file', () {
String filePath = posix.join(projPath, 'foo.dart');
provider.newFile(filePath, 'contents');
@@ -200,6 +210,17 @@ main() {
return pumpEventQueue().then((_) => expect(filePaths, hasLength(0)));
});
+ test('Delete pubspec file', () {
+ String pubspecPath = posix.join(projPath, 'pubspec.yaml');
+ provider.newFile(pubspecPath, 'pubspec');
+ manager.setRoots(<String>[projPath], <String>[]);
+ expect(manager.currentContextPubspecPaths[projPath], equals(pubspecPath));
+ provider.deleteFile(pubspecPath);
+ return pumpEventQueue().then((_) {
+ expect(manager.currentContextPubspecPaths[projPath], isNull);
+ });
+ });
+
test('Modify file', () {
String filePath = posix.join(projPath, 'foo.dart');
provider.newFile(filePath, 'contents');

Powered by Google App Engine
This is Rietveld 408576698