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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #library('pub_tests'); 5 #library('pub_tests');
6 6
7 #import('dart:io'); 7 #import('dart:io');
8 8
9 #import('test_pub.dart'); 9 #import('test_pub.dart');
10 #import('../../../pkg/unittest/unittest.dart'); 10 #import('../../../pkg/unittest/unittest.dart');
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 schedulePub(args: ['update', 'bar'], 68 schedulePub(args: ['update', 'bar'],
69 output: const RegExp(@"Dependencies updated!$")); 69 output: const RegExp(@"Dependencies updated!$"));
70 70
71 packagesDir({ 71 packagesDir({
72 "foo": "2.0.0", 72 "foo": "2.0.0",
73 "bar": "2.0.0" 73 "bar": "2.0.0"
74 }).scheduleValidate(); 74 }).scheduleValidate();
75 75
76 run(); 76 run();
77 }); 77 });
78
79 test("removes a dependency that's been removed from the pubspec", () {
80 servePackages([
81 package("foo", "1.0.0"),
82 package("bar", "1.0.0")
83 ]);
84
85 appDir([dependency("foo"), dependency("bar")]).scheduleCreate();
86
87 schedulePub(args: ['update'],
88 output: const RegExp(@"Dependencies updated!$"));
89
90 packagesDir({
91 "foo": "1.0.0",
92 "bar": "1.0.0"
93 }).scheduleValidate();
94
95 appDir([dependency("foo")]).scheduleCreate();
96
97 schedulePub(args: ['update'],
98 output: const RegExp(@"Dependencies updated!$"));
99
100 packagesDir({
101 "foo": "1.0.0",
102 "bar": null
103 }).scheduleValidate();
104
105 run();
106 });
107
108 test("removes a transitive dependency that's no longer depended on", () {
109 servePackages([
110 package("foo", "1.0.0", [dependency("shared-dep")]),
111 package("bar", "1.0.0", [
112 dependency("shared-dep"),
113 dependency("bar-dep")
114 ]),
115 package("shared-dep", "1.0.0"),
116 package("bar-dep", "1.0.0")
117 ]);
118
119 appDir([dependency("foo"), dependency("bar")]).scheduleCreate();
120
121 schedulePub(args: ['update'],
122 output: const RegExp(@"Dependencies updated!$"));
123
124 packagesDir({
125 "foo": "1.0.0",
126 "bar": "1.0.0",
127 "shared-dep": "1.0.0",
128 "bar-dep": "1.0.0",
129 }).scheduleValidate();
130
131 appDir([dependency("foo")]).scheduleCreate();
132
133 schedulePub(args: ['update'],
134 output: const RegExp(@"Dependencies updated!$"));
135
136 packagesDir({
137 "foo": "1.0.0",
138 "bar": null,
139 "shared-dep": "1.0.0",
140 "bar-dep": null,
141 }).scheduleValidate();
142
143 run();
144 });
145
146 test("updates dependencies whose constraints have been removed", () {
147 servePackages([
148 package("foo", "1.0.0", [dependency("shared-dep")]),
149 package("bar", "1.0.0", [dependency("shared-dep", "<2.0.0")]),
150 package("shared-dep", "1.0.0"),
151 package("shared-dep", "2.0.0")
152 ]);
153
154 appDir([dependency("foo"), dependency("bar")]).scheduleCreate();
155
156 schedulePub(args: ['update'],
157 output: const RegExp(@"Dependencies updated!$"));
158
159 packagesDir({
160 "foo": "1.0.0",
161 "bar": "1.0.0",
162 "shared-dep": "1.0.0"
163 }).scheduleValidate();
164
165 appDir([dependency("foo")]).scheduleCreate();
166
167 schedulePub(args: ['update'],
168 output: const RegExp(@"Dependencies updated!$"));
169
170 packagesDir({
171 "foo": "1.0.0",
172 "bar": null,
173 "shared-dep": "2.0.0"
174 }).scheduleValidate();
175
176 run();
177 });
78 } 178 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698