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

Side by Side Diff: utils/tests/pub/pub_install_hosted_test.dart

Issue 10981031: Convert raw strings in pub (and apidoc) to new syntax. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Respond to review. Created 8 years, 2 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
« no previous file with comments | « utils/tests/pub/pub_install_git_test.dart ('k') | utils/tests/pub/pub_install_sdk_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 run(); 107 run();
108 }); 108 });
109 109
110 test('keeps a pub server package locked to the version in the lockfile', () { 110 test('keeps a pub server package locked to the version in the lockfile', () {
111 servePackages([package("foo", "1.0.0")]); 111 servePackages([package("foo", "1.0.0")]);
112 112
113 appDir([dependency("foo")]).scheduleCreate(); 113 appDir([dependency("foo")]).scheduleCreate();
114 114
115 // This install should lock the foo dependency to version 1.0.0. 115 // This install should lock the foo dependency to version 1.0.0.
116 schedulePub(args: ['install'], 116 schedulePub(args: ['install'],
117 output: const RegExp(@"Dependencies installed!$")); 117 output: const RegExp(r"Dependencies installed!$"));
118 118
119 packagesDir({"foo": "1.0.0"}).scheduleValidate(); 119 packagesDir({"foo": "1.0.0"}).scheduleValidate();
120 120
121 // Delete the packages path to simulate a new checkout of the application. 121 // Delete the packages path to simulate a new checkout of the application.
122 dir(packagesPath).scheduleDelete(); 122 dir(packagesPath).scheduleDelete();
123 123
124 // Start serving a newer package as well. 124 // Start serving a newer package as well.
125 servePackages([package("foo", "1.0.1")]); 125 servePackages([package("foo", "1.0.1")]);
126 126
127 // This install shouldn't update the foo dependency due to the lockfile. 127 // This install shouldn't update the foo dependency due to the lockfile.
128 schedulePub(args: ['install'], 128 schedulePub(args: ['install'],
129 output: const RegExp(@"Dependencies installed!$")); 129 output: const RegExp(r"Dependencies installed!$"));
130 130
131 packagesDir({"foo": "1.0.0"}).scheduleValidate(); 131 packagesDir({"foo": "1.0.0"}).scheduleValidate();
132 132
133 run(); 133 run();
134 }); 134 });
135 135
136 test('updates a locked pub server package with a new incompatible ' 136 test('updates a locked pub server package with a new incompatible '
137 'constraint', () { 137 'constraint', () {
138 servePackages([package("foo", "1.0.0")]); 138 servePackages([package("foo", "1.0.0")]);
139 139
140 appDir([dependency("foo")]).scheduleCreate(); 140 appDir([dependency("foo")]).scheduleCreate();
141 141
142 schedulePub(args: ['install'], 142 schedulePub(args: ['install'],
143 output: const RegExp(@"Dependencies installed!$")); 143 output: const RegExp(r"Dependencies installed!$"));
144 144
145 packagesDir({"foo": "1.0.0"}).scheduleValidate(); 145 packagesDir({"foo": "1.0.0"}).scheduleValidate();
146 146
147 servePackages([package("foo", "1.0.1")]); 147 servePackages([package("foo", "1.0.1")]);
148 148
149 appDir([dependency("foo", ">1.0.0")]).scheduleCreate(); 149 appDir([dependency("foo", ">1.0.0")]).scheduleCreate();
150 150
151 schedulePub(args: ['install'], 151 schedulePub(args: ['install'],
152 output: const RegExp(@"Dependencies installed!$")); 152 output: const RegExp(r"Dependencies installed!$"));
153 153
154 packagesDir({"foo": "1.0.1"}).scheduleValidate(); 154 packagesDir({"foo": "1.0.1"}).scheduleValidate();
155 155
156 run(); 156 run();
157 }); 157 });
158 158
159 test("doesn't update a locked pub server package with a new compatible " 159 test("doesn't update a locked pub server package with a new compatible "
160 "constraint", () { 160 "constraint", () {
161 servePackages([package("foo", "1.0.0")]); 161 servePackages([package("foo", "1.0.0")]);
162 162
163 appDir([dependency("foo")]).scheduleCreate(); 163 appDir([dependency("foo")]).scheduleCreate();
164 164
165 schedulePub(args: ['install'], 165 schedulePub(args: ['install'],
166 output: const RegExp(@"Dependencies installed!$")); 166 output: const RegExp(r"Dependencies installed!$"));
167 167
168 packagesDir({"foo": "1.0.0"}).scheduleValidate(); 168 packagesDir({"foo": "1.0.0"}).scheduleValidate();
169 169
170 servePackages([package("foo", "1.0.1")]); 170 servePackages([package("foo", "1.0.1")]);
171 171
172 appDir([dependency("foo", ">=1.0.0")]).scheduleCreate(); 172 appDir([dependency("foo", ">=1.0.0")]).scheduleCreate();
173 173
174 schedulePub(args: ['install'], 174 schedulePub(args: ['install'],
175 output: const RegExp(@"Dependencies installed!$")); 175 output: const RegExp(r"Dependencies installed!$"));
176 176
177 packagesDir({"foo": "1.0.0"}).scheduleValidate(); 177 packagesDir({"foo": "1.0.0"}).scheduleValidate();
178 178
179 run(); 179 run();
180 }); 180 });
181 181
182 test("unlocks dependencies if necessary to ensure that a new dependency " 182 test("unlocks dependencies if necessary to ensure that a new dependency "
183 "is satisfied", () { 183 "is satisfied", () {
184 servePackages([ 184 servePackages([
185 package("foo", "1.0.0", [dependency("bar", "<2.0.0")]), 185 package("foo", "1.0.0", [dependency("bar", "<2.0.0")]),
186 package("bar", "1.0.0", [dependency("baz", "<2.0.0")]), 186 package("bar", "1.0.0", [dependency("baz", "<2.0.0")]),
187 package("baz", "1.0.0", [dependency("qux", "<2.0.0")]), 187 package("baz", "1.0.0", [dependency("qux", "<2.0.0")]),
188 package("qux", "1.0.0") 188 package("qux", "1.0.0")
189 ]); 189 ]);
190 190
191 appDir([dependency("foo")]).scheduleCreate(); 191 appDir([dependency("foo")]).scheduleCreate();
192 192
193 schedulePub(args: ['install'], 193 schedulePub(args: ['install'],
194 output: const RegExp(@"Dependencies installed!$")); 194 output: const RegExp(r"Dependencies installed!$"));
195 195
196 packagesDir({ 196 packagesDir({
197 "foo": "1.0.0", 197 "foo": "1.0.0",
198 "bar": "1.0.0", 198 "bar": "1.0.0",
199 "baz": "1.0.0", 199 "baz": "1.0.0",
200 "qux": "1.0.0" 200 "qux": "1.0.0"
201 }).scheduleValidate(); 201 }).scheduleValidate();
202 202
203 servePackages([ 203 servePackages([
204 package("foo", "2.0.0", [dependency("bar", "<3.0.0")]), 204 package("foo", "2.0.0", [dependency("bar", "<3.0.0")]),
205 package("bar", "2.0.0", [dependency("baz", "<3.0.0")]), 205 package("bar", "2.0.0", [dependency("baz", "<3.0.0")]),
206 package("baz", "2.0.0", [dependency("qux", "<3.0.0")]), 206 package("baz", "2.0.0", [dependency("qux", "<3.0.0")]),
207 package("qux", "2.0.0"), 207 package("qux", "2.0.0"),
208 package("newdep", "2.0.0", [dependency("baz", ">=1.5.0")]) 208 package("newdep", "2.0.0", [dependency("baz", ">=1.5.0")])
209 ]); 209 ]);
210 210
211 appDir([dependency("foo"), dependency("newdep")]).scheduleCreate(); 211 appDir([dependency("foo"), dependency("newdep")]).scheduleCreate();
212 212
213 schedulePub(args: ['install'], 213 schedulePub(args: ['install'],
214 output: const RegExp(@"Dependencies installed!$")); 214 output: const RegExp(r"Dependencies installed!$"));
215 215
216 packagesDir({ 216 packagesDir({
217 "foo": "2.0.0", 217 "foo": "2.0.0",
218 "bar": "2.0.0", 218 "bar": "2.0.0",
219 "baz": "2.0.0", 219 "baz": "2.0.0",
220 "qux": "1.0.0", 220 "qux": "1.0.0",
221 "newdep": "2.0.0" 221 "newdep": "2.0.0"
222 }).scheduleValidate(); 222 }).scheduleValidate();
223 223
224 run(); 224 run();
225 }); 225 });
226 226
227 test("doesn't unlock dependencies if a new dependency is already " 227 test("doesn't unlock dependencies if a new dependency is already "
228 "satisfied", () { 228 "satisfied", () {
229 servePackages([ 229 servePackages([
230 package("foo", "1.0.0", [dependency("bar", "<2.0.0")]), 230 package("foo", "1.0.0", [dependency("bar", "<2.0.0")]),
231 package("bar", "1.0.0", [dependency("baz", "<2.0.0")]), 231 package("bar", "1.0.0", [dependency("baz", "<2.0.0")]),
232 package("baz", "1.0.0") 232 package("baz", "1.0.0")
233 ]); 233 ]);
234 234
235 appDir([dependency("foo")]).scheduleCreate(); 235 appDir([dependency("foo")]).scheduleCreate();
236 236
237 schedulePub(args: ['install'], 237 schedulePub(args: ['install'],
238 output: const RegExp(@"Dependencies installed!$")); 238 output: const RegExp(r"Dependencies installed!$"));
239 239
240 packagesDir({ 240 packagesDir({
241 "foo": "1.0.0", 241 "foo": "1.0.0",
242 "bar": "1.0.0", 242 "bar": "1.0.0",
243 "baz": "1.0.0" 243 "baz": "1.0.0"
244 }).scheduleValidate(); 244 }).scheduleValidate();
245 245
246 servePackages([ 246 servePackages([
247 package("foo", "2.0.0", [dependency("bar", "<3.0.0")]), 247 package("foo", "2.0.0", [dependency("bar", "<3.0.0")]),
248 package("bar", "2.0.0", [dependency("baz", "<3.0.0")]), 248 package("bar", "2.0.0", [dependency("baz", "<3.0.0")]),
249 package("baz", "2.0.0"), 249 package("baz", "2.0.0"),
250 package("newdep", "2.0.0", [dependency("baz", ">=1.0.0")]) 250 package("newdep", "2.0.0", [dependency("baz", ">=1.0.0")])
251 ]); 251 ]);
252 252
253 appDir([dependency("foo"), dependency("newdep")]).scheduleCreate(); 253 appDir([dependency("foo"), dependency("newdep")]).scheduleCreate();
254 254
255 schedulePub(args: ['install'], 255 schedulePub(args: ['install'],
256 output: const RegExp(@"Dependencies installed!$")); 256 output: const RegExp(r"Dependencies installed!$"));
257 257
258 packagesDir({ 258 packagesDir({
259 "foo": "1.0.0", 259 "foo": "1.0.0",
260 "bar": "1.0.0", 260 "bar": "1.0.0",
261 "baz": "1.0.0", 261 "baz": "1.0.0",
262 "newdep": "2.0.0" 262 "newdep": "2.0.0"
263 }).scheduleValidate(); 263 }).scheduleValidate();
264 264
265 run(); 265 run();
266 }); 266 });
267 267
268 test("removes a dependency that's been removed from the pubspec", () { 268 test("removes a dependency that's been removed from the pubspec", () {
269 servePackages([ 269 servePackages([
270 package("foo", "1.0.0"), 270 package("foo", "1.0.0"),
271 package("bar", "1.0.0") 271 package("bar", "1.0.0")
272 ]); 272 ]);
273 273
274 appDir([dependency("foo"), dependency("bar")]).scheduleCreate(); 274 appDir([dependency("foo"), dependency("bar")]).scheduleCreate();
275 275
276 schedulePub(args: ['install'], 276 schedulePub(args: ['install'],
277 output: const RegExp(@"Dependencies installed!$")); 277 output: const RegExp(r"Dependencies installed!$"));
278 278
279 packagesDir({ 279 packagesDir({
280 "foo": "1.0.0", 280 "foo": "1.0.0",
281 "bar": "1.0.0" 281 "bar": "1.0.0"
282 }).scheduleValidate(); 282 }).scheduleValidate();
283 283
284 appDir([dependency("foo")]).scheduleCreate(); 284 appDir([dependency("foo")]).scheduleCreate();
285 285
286 schedulePub(args: ['install'], 286 schedulePub(args: ['install'],
287 output: const RegExp(@"Dependencies installed!$")); 287 output: const RegExp(r"Dependencies installed!$"));
288 288
289 packagesDir({ 289 packagesDir({
290 "foo": "1.0.0", 290 "foo": "1.0.0",
291 "bar": null 291 "bar": null
292 }).scheduleValidate(); 292 }).scheduleValidate();
293 293
294 run(); 294 run();
295 }); 295 });
296 296
297 test("removes a transitive dependency that's no longer depended on", () { 297 test("removes a transitive dependency that's no longer depended on", () {
298 servePackages([ 298 servePackages([
299 package("foo", "1.0.0", [dependency("shared-dep")]), 299 package("foo", "1.0.0", [dependency("shared-dep")]),
300 package("bar", "1.0.0", [ 300 package("bar", "1.0.0", [
301 dependency("shared-dep"), 301 dependency("shared-dep"),
302 dependency("bar-dep") 302 dependency("bar-dep")
303 ]), 303 ]),
304 package("shared-dep", "1.0.0"), 304 package("shared-dep", "1.0.0"),
305 package("bar-dep", "1.0.0") 305 package("bar-dep", "1.0.0")
306 ]); 306 ]);
307 307
308 appDir([dependency("foo"), dependency("bar")]).scheduleCreate(); 308 appDir([dependency("foo"), dependency("bar")]).scheduleCreate();
309 309
310 schedulePub(args: ['install'], 310 schedulePub(args: ['install'],
311 output: const RegExp(@"Dependencies installed!$")); 311 output: const RegExp(r"Dependencies installed!$"));
312 312
313 packagesDir({ 313 packagesDir({
314 "foo": "1.0.0", 314 "foo": "1.0.0",
315 "bar": "1.0.0", 315 "bar": "1.0.0",
316 "shared-dep": "1.0.0", 316 "shared-dep": "1.0.0",
317 "bar-dep": "1.0.0", 317 "bar-dep": "1.0.0",
318 }).scheduleValidate(); 318 }).scheduleValidate();
319 319
320 appDir([dependency("foo")]).scheduleCreate(); 320 appDir([dependency("foo")]).scheduleCreate();
321 321
322 schedulePub(args: ['install'], 322 schedulePub(args: ['install'],
323 output: const RegExp(@"Dependencies installed!$")); 323 output: const RegExp(r"Dependencies installed!$"));
324 324
325 packagesDir({ 325 packagesDir({
326 "foo": "1.0.0", 326 "foo": "1.0.0",
327 "bar": null, 327 "bar": null,
328 "shared-dep": "1.0.0", 328 "shared-dep": "1.0.0",
329 "bar-dep": null, 329 "bar-dep": null,
330 }).scheduleValidate(); 330 }).scheduleValidate();
331 331
332 run(); 332 run();
333 }); 333 });
334 334
335 test("doesn't update dependencies whose constraints have been removed", () { 335 test("doesn't update dependencies whose constraints have been removed", () {
336 servePackages([ 336 servePackages([
337 package("foo", "1.0.0", [dependency("shared-dep")]), 337 package("foo", "1.0.0", [dependency("shared-dep")]),
338 package("bar", "1.0.0", [dependency("shared-dep", "<2.0.0")]), 338 package("bar", "1.0.0", [dependency("shared-dep", "<2.0.0")]),
339 package("shared-dep", "1.0.0"), 339 package("shared-dep", "1.0.0"),
340 package("shared-dep", "2.0.0") 340 package("shared-dep", "2.0.0")
341 ]); 341 ]);
342 342
343 appDir([dependency("foo"), dependency("bar")]).scheduleCreate(); 343 appDir([dependency("foo"), dependency("bar")]).scheduleCreate();
344 344
345 schedulePub(args: ['install'], 345 schedulePub(args: ['install'],
346 output: const RegExp(@"Dependencies installed!$")); 346 output: const RegExp(r"Dependencies installed!$"));
347 347
348 packagesDir({ 348 packagesDir({
349 "foo": "1.0.0", 349 "foo": "1.0.0",
350 "bar": "1.0.0", 350 "bar": "1.0.0",
351 "shared-dep": "1.0.0" 351 "shared-dep": "1.0.0"
352 }).scheduleValidate(); 352 }).scheduleValidate();
353 353
354 appDir([dependency("foo")]).scheduleCreate(); 354 appDir([dependency("foo")]).scheduleCreate();
355 355
356 schedulePub(args: ['install'], 356 schedulePub(args: ['install'],
357 output: const RegExp(@"Dependencies installed!$")); 357 output: const RegExp(r"Dependencies installed!$"));
358 358
359 packagesDir({ 359 packagesDir({
360 "foo": "1.0.0", 360 "foo": "1.0.0",
361 "bar": null, 361 "bar": null,
362 "shared-dep": "1.0.0" 362 "shared-dep": "1.0.0"
363 }).scheduleValidate(); 363 }).scheduleValidate();
364 364
365 run(); 365 run();
366 }); 366 });
367 } 367 }
OLDNEW
« no previous file with comments | « utils/tests/pub/pub_install_git_test.dart ('k') | utils/tests/pub/pub_install_sdk_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698