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

Unified Diff: utils/tests/pub/pub_install_repo_test.dart

Issue 10867070: Support removing dead packages with `pub install`. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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: utils/tests/pub/pub_install_repo_test.dart
diff --git a/utils/tests/pub/pub_install_repo_test.dart b/utils/tests/pub/pub_install_repo_test.dart
index fb03dfc9b2cd713333ae1e4ed023d41c653410ca..af7d08c13aea0086f6d8da0f02d0c052e781326a 100644
--- a/utils/tests/pub/pub_install_repo_test.dart
+++ b/utils/tests/pub/pub_install_repo_test.dart
@@ -229,4 +229,104 @@ main() {
run();
});
+
+ test("removes a dependency that's been removed from the pubspec", () {
+ servePackages([
+ package("foo", "1.0.0"),
+ package("bar", "1.0.0")
+ ]);
+
+ appDir([dependency("foo"), dependency("bar")]).scheduleCreate();
+
+ schedulePub(args: ['install'],
+ output: const RegExp(@"Dependencies installed!$"));
+
+ packagesDir({
+ "foo": "1.0.0",
+ "bar": "1.0.0"
+ }).scheduleValidate();
+
+ appDir([dependency("foo")]).scheduleCreate();
+
+ schedulePub(args: ['install'],
+ output: const RegExp(@"Dependencies installed!$"));
+
+ packagesDir({
+ "foo": "1.0.0",
+ "bar": null
+ }).scheduleValidate();
+
+ run();
+ });
+
+ test("removes a transitive dependency that's no longer depended on", () {
+ servePackages([
+ package("foo", "1.0.0", [dependency("shared-dep")]),
+ package("bar", "1.0.0", [
+ dependency("shared-dep"),
+ dependency("bar-dep")
+ ]),
+ package("shared-dep", "1.0.0"),
+ package("bar-dep", "1.0.0")
+ ]);
+
+ appDir([dependency("foo"), dependency("bar")]).scheduleCreate();
+
+ schedulePub(args: ['install'],
+ output: const RegExp(@"Dependencies installed!$"));
+
+ packagesDir({
+ "foo": "1.0.0",
+ "bar": "1.0.0",
+ "shared-dep": "1.0.0",
+ "bar-dep": "1.0.0",
+ }).scheduleValidate();
+
+ appDir([dependency("foo")]).scheduleCreate();
+
+ schedulePub(args: ['install'],
+ output: const RegExp(@"Dependencies installed!$"));
+
+ packagesDir({
+ "foo": "1.0.0",
+ "bar": null,
+ "shared-dep": "1.0.0",
+ "bar-dep": null,
+ }).scheduleValidate();
+
+ run();
+ });
+
+ test("doesn't update dependencies whose constraints have been removed", () {
+ servePackages([
+ package("foo", "1.0.0", [dependency("shared-dep")]),
+ package("bar", "1.0.0", [dependency("shared-dep", "<2.0.0")]),
+ package("shared-dep", "1.0.0"),
+ package("shared-dep", "2.0.0")
+ ]);
+
+ appDir([dependency("foo"), dependency("bar")]).scheduleCreate();
+
+ schedulePub(args: ['install'],
+ output: const RegExp(@"Dependencies installed!$"));
+
+ packagesDir({
+ "foo": "1.0.0",
+ "bar": "1.0.0",
+ "shared-dep": "1.0.0"
+ }).scheduleValidate();
+
+ appDir([dependency("foo")]).scheduleCreate();
+
+ schedulePub(args: ['install'],
+ output: const RegExp(@"Dependencies installed!$"));
+
+ packagesDir({
+ "foo": "1.0.0",
+ "bar": null,
+ "shared-dep": "1.0.0"
+ }).scheduleValidate();
+
+ run();
+ });
}

Powered by Google App Engine
This is Rietveld 408576698