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

Unified Diff: utils/tests/pub/pub_update_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_update_repo_test.dart
diff --git a/utils/tests/pub/pub_update_repo_test.dart b/utils/tests/pub/pub_update_repo_test.dart
index 4e66d0af3b6b12eed2aec1ea4819a6dff319f863..20ddda854ecf25977fd8e6fe6ea6e8944a41129b 100644
--- a/utils/tests/pub/pub_update_repo_test.dart
+++ b/utils/tests/pub/pub_update_repo_test.dart
@@ -75,4 +75,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: ['update'],
+ output: const RegExp(@"Dependencies updated!$"));
+
+ packagesDir({
+ "foo": "1.0.0",
+ "bar": "1.0.0"
+ }).scheduleValidate();
+
+ appDir([dependency("foo")]).scheduleCreate();
+
+ schedulePub(args: ['update'],
+ output: const RegExp(@"Dependencies updated!$"));
+
+ 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: ['update'],
+ output: const RegExp(@"Dependencies updated!$"));
+
+ 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: ['update'],
+ output: const RegExp(@"Dependencies updated!$"));
+
+ packagesDir({
+ "foo": "1.0.0",
+ "bar": null,
+ "shared-dep": "1.0.0",
+ "bar-dep": null,
+ }).scheduleValidate();
+
+ run();
+ });
+
+ test("updates 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: ['update'],
+ output: const RegExp(@"Dependencies updated!$"));
+
+ packagesDir({
+ "foo": "1.0.0",
+ "bar": "1.0.0",
+ "shared-dep": "1.0.0"
+ }).scheduleValidate();
+
+ appDir([dependency("foo")]).scheduleCreate();
+
+ schedulePub(args: ['update'],
+ output: const RegExp(@"Dependencies updated!$"));
+
+ packagesDir({
+ "foo": "1.0.0",
+ "bar": null,
+ "shared-dep": "2.0.0"
+ }).scheduleValidate();
+
+ run();
+ });
}

Powered by Google App Engine
This is Rietveld 408576698