| OLD | NEW |
| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 '''); | 86 '''); |
| 87 }); | 87 }); |
| 88 }); | 88 }); |
| 89 */ | 89 */ |
| 90 } | 90 } |
| 91 | 91 |
| 92 installCommand() { | 92 installCommand() { |
| 93 test('checks out a package from the SDK', () { | 93 test('checks out a package from the SDK', () { |
| 94 dir(sdkPath, [ | 94 dir(sdkPath, [ |
| 95 file('revision', '1234'), | 95 file('revision', '1234'), |
| 96 dir('pkg', [ | 96 dir('pkg', [packageDir("foo", "0.0.1234")]) |
| 97 dir('foo', [ | |
| 98 file('foo.dart', 'main() => "foo";') | |
| 99 ]) | |
| 100 ]) | |
| 101 ]).scheduleCreate(); | 97 ]).scheduleCreate(); |
| 102 | 98 |
| 103 dir(appPath, [ | 99 dir(appPath, [ |
| 104 file('pubspec.yaml', 'dependencies:\n foo:') | 100 pubspec({"dependencies": {"foo": null}}) |
| 105 ]).scheduleCreate(); | 101 ]).scheduleCreate(); |
| 106 | 102 |
| 107 schedulePub(args: ['install'], | 103 schedulePub(args: ['install'], |
| 108 output: ''' | 104 output: ''' |
| 109 Dependencies installed! | 105 Dependencies installed! |
| 110 '''); | 106 '''); |
| 111 | 107 |
| 112 dir(packagesPath, [ | 108 packagesDir({"foo": "0.0.1234"}).scheduleValidate(); |
| 113 dir('foo', [ | |
| 114 file('foo.dart', 'main() => "foo";') | |
| 115 ]) | |
| 116 ]).scheduleValidate(); | |
| 117 | 109 |
| 118 run(); | 110 run(); |
| 119 }); | 111 }); |
| 120 | 112 |
| 121 test('checks out a package from Git', () { | 113 test('checks out a package from Git', () { |
| 122 ensureGit(); | 114 ensureGit(); |
| 123 | 115 |
| 124 git('foo.git', [ | 116 git('foo.git', [ |
| 125 file('foo.dart', 'main() => "foo";') | 117 file('foo.dart', 'main() => "foo";') |
| 126 ]).scheduleCreate(); | 118 ]).scheduleCreate(); |
| 127 | 119 |
| 128 dir(appPath, [ | 120 appDir([{"git": "../foo.git"}]).scheduleCreate(); |
| 129 file('pubspec.yaml', ''' | |
| 130 dependencies: | |
| 131 foo: | |
| 132 git: ../foo.git | |
| 133 ''') | |
| 134 ]).scheduleCreate(); | |
| 135 | 121 |
| 136 schedulePub(args: ['install'], | 122 schedulePub(args: ['install'], |
| 137 output: const RegExp(@"Dependencies installed!$")); | 123 output: const RegExp(@"Dependencies installed!$")); |
| 138 | 124 |
| 139 dir(cachePath, [ | 125 dir(cachePath, [ |
| 140 dir('git', [ | 126 dir('git', [ |
| 141 dir('cache', [ | 127 dir('cache', [gitPackageCacheDir('foo')]), |
| 142 dir(new RegExp(@'foo-[a-f0-9]+'), [ | 128 gitPackageCacheDir('foo') |
| 143 file('foo.dart', 'main() => "foo";') | |
| 144 ]) | |
| 145 ]), | |
| 146 dir(new RegExp(@'foo-[a-f0-9]+'), [ | |
| 147 file('foo.dart', 'main() => "foo";') | |
| 148 ]) | |
| 149 ]) | 129 ]) |
| 150 ]).scheduleValidate(); | 130 ]).scheduleValidate(); |
| 151 | 131 |
| 152 dir(packagesPath, [ | 132 dir(packagesPath, [ |
| 153 dir('foo', [ | 133 dir('foo', [ |
| 154 file('foo.dart', 'main() => "foo";') | 134 file('foo.dart', 'main() => "foo";') |
| 155 ]) | 135 ]) |
| 156 ]).scheduleValidate(); | 136 ]).scheduleValidate(); |
| 157 | 137 |
| 158 run(); | 138 run(); |
| 159 }); | 139 }); |
| 160 | 140 |
| 161 test('checks out packages transitively from Git', () { | 141 test('checks out packages transitively from Git', () { |
| 162 ensureGit(); | 142 ensureGit(); |
| 163 | 143 |
| 164 git('foo.git', [ | 144 git('foo.git', [ |
| 165 file('foo.dart', 'main() => "foo";'), | 145 file('foo.dart', 'main() => "foo";'), |
| 166 file('pubspec.yaml', ''' | 146 appPubspec([{"git": "../bar.git"}]) |
| 167 dependencies: | |
| 168 bar: | |
| 169 git: ../bar.git | |
| 170 ''') | |
| 171 ]).scheduleCreate(); | 147 ]).scheduleCreate(); |
| 172 | 148 |
| 173 git('bar.git', [ | 149 git('bar.git', [ |
| 174 file('bar.dart', 'main() => "bar";') | 150 file('bar.dart', 'main() => "bar";') |
| 175 ]).scheduleCreate(); | 151 ]).scheduleCreate(); |
| 176 | 152 |
| 177 dir(appPath, [ | 153 appDir([{"git": "../foo.git"}]).scheduleCreate(); |
| 178 file('pubspec.yaml', ''' | |
| 179 dependencies: | |
| 180 foo: | |
| 181 git: ../foo.git | |
| 182 ''') | |
| 183 ]).scheduleCreate(); | |
| 184 | 154 |
| 185 schedulePub(args: ['install'], | 155 schedulePub(args: ['install'], |
| 186 output: const RegExp("Dependencies installed!\$")); | 156 output: const RegExp("Dependencies installed!\$")); |
| 187 | 157 |
| 188 dir(cachePath, [ | 158 dir(cachePath, [ |
| 189 dir('git', [ | 159 dir('git', [ |
| 190 dir('cache', [ | 160 dir('cache', [ |
| 191 dir(new RegExp(@'foo-[a-f0-9]+'), [ | 161 gitPackageCacheDir('foo'), |
| 192 file('foo.dart', 'main() => "foo";') | 162 gitPackageCacheDir('bar') |
| 193 ]), | |
| 194 dir(new RegExp(@'bar-[a-f0-9]+'), [ | |
| 195 file('bar.dart', 'main() => "bar";') | |
| 196 ]) | |
| 197 ]), | 163 ]), |
| 198 dir(new RegExp(@'foo-[a-f0-9]+'), [ | 164 gitPackageCacheDir('foo'), |
| 199 file('foo.dart', 'main() => "foo";') | 165 gitPackageCacheDir('bar') |
| 200 ]), | |
| 201 dir(new RegExp(@'bar-[a-f0-9]+'), [ | |
| 202 file('bar.dart', 'main() => "bar";') | |
| 203 ]) | |
| 204 ]) | 166 ]) |
| 205 ]).scheduleValidate(); | 167 ]).scheduleValidate(); |
| 206 | 168 |
| 207 dir(packagesPath, [ | 169 dir(packagesPath, [ |
| 208 dir('foo', [ | 170 dir('foo', [ |
| 209 file('foo.dart', 'main() => "foo";') | 171 file('foo.dart', 'main() => "foo";') |
| 210 ]), | 172 ]), |
| 211 dir('bar', [ | 173 dir('bar', [ |
| 212 file('bar.dart', 'main() => "bar";') | 174 file('bar.dart', 'main() => "bar";') |
| 213 ]) | 175 ]) |
| 214 ]).scheduleValidate(); | 176 ]).scheduleValidate(); |
| 215 | 177 |
| 216 run(); | 178 run(); |
| 217 }); | 179 }); |
| 218 | 180 |
| 219 test('checks out and updates a package from Git', () { | 181 test('checks out and updates a package from Git', () { |
| 220 ensureGit(); | 182 ensureGit(); |
| 221 | 183 |
| 222 git('foo.git', [ | 184 git('foo.git', [ |
| 223 file('foo.dart', 'main() => "foo";') | 185 file('foo.dart', 'main() => "foo";') |
| 224 ]).scheduleCreate(); | 186 ]).scheduleCreate(); |
| 225 | 187 |
| 226 dir(appPath, [ | 188 appDir([{"git": "../foo.git"}]).scheduleCreate(); |
| 227 file('pubspec.yaml', ''' | |
| 228 dependencies: | |
| 229 foo: | |
| 230 git: ../foo.git | |
| 231 ''') | |
| 232 ]).scheduleCreate(); | |
| 233 | 189 |
| 234 schedulePub(args: ['install'], | 190 schedulePub(args: ['install'], |
| 235 output: const RegExp(@"Dependencies installed!$")); | 191 output: const RegExp(@"Dependencies installed!$")); |
| 236 | 192 |
| 237 dir(cachePath, [ | 193 dir(cachePath, [ |
| 238 dir('git', [ | 194 dir('git', [ |
| 239 dir('cache', [ | 195 dir('cache', [gitPackageCacheDir('foo')]), |
| 240 dir(new RegExp(@'foo-[a-f0-9]+'), [ | 196 gitPackageCacheDir('foo') |
| 241 file('foo.dart', 'main() => "foo";') | |
| 242 ]) | |
| 243 ]), | |
| 244 dir(new RegExp(@'foo-[a-f0-9]+'), [ | |
| 245 file('foo.dart', 'main() => "foo";') | |
| 246 ]) | |
| 247 ]) | 197 ]) |
| 248 ]).scheduleValidate(); | 198 ]).scheduleValidate(); |
| 249 | 199 |
| 250 dir(packagesPath, [ | 200 dir(packagesPath, [ |
| 251 dir('foo', [ | 201 dir('foo', [ |
| 252 file('foo.dart', 'main() => "foo";') | 202 file('foo.dart', 'main() => "foo";') |
| 253 ]) | 203 ]) |
| 254 ]).scheduleValidate(); | 204 ]).scheduleValidate(); |
| 255 | 205 |
| 256 // TODO(nweiz): remove this once we support pub update | 206 // TODO(nweiz): remove this once we support pub update |
| 257 dir(packagesPath).scheduleDelete(); | 207 dir(packagesPath).scheduleDelete(); |
| 258 file('$appPath/pubspec.lock', '').scheduleDelete(); | 208 file('$appPath/pubspec.lock', '').scheduleDelete(); |
| 259 | 209 |
| 260 git('foo.git', [ | 210 git('foo.git', [ |
| 261 file('foo.dart', 'main() => "foo 2";') | 211 file('foo.dart', 'main() => "foo 2";') |
| 262 ]).scheduleCommit(); | 212 ]).scheduleCommit(); |
| 263 | 213 |
| 264 schedulePub(args: ['install'], | 214 schedulePub(args: ['install'], |
| 265 output: const RegExp(@"Dependencies installed!$")); | 215 output: const RegExp(@"Dependencies installed!$")); |
| 266 | 216 |
| 267 // When we download a new version of the git package, we should re-use the | 217 // When we download a new version of the git package, we should re-use the |
| 268 // git/cache directory but create a new git/ directory. | 218 // git/cache directory but create a new git/ directory. |
| 269 dir(cachePath, [ | 219 dir(cachePath, [ |
| 270 dir('git', [ | 220 dir('git', [ |
| 271 dir('cache', [ | 221 dir('cache', [gitPackageCacheDir('foo', 2)]), |
| 272 dir(new RegExp(@'foo-[a-f0-9]+'), [ | 222 gitPackageCacheDir('foo'), |
| 273 file('foo.dart', 'main() => "foo 2";') | 223 gitPackageCacheDir('foo', 2) |
| 274 ]) | |
| 275 ]), | |
| 276 dir(new RegExp(@'foo-[a-f0-9]+'), [ | |
| 277 file('foo.dart', 'main() => "foo";') | |
| 278 ]), | |
| 279 dir(new RegExp(@'foo-[a-f0-9]+'), [ | |
| 280 file('foo.dart', 'main() => "foo 2";') | |
| 281 ]) | |
| 282 ]) | 224 ]) |
| 283 ]).scheduleValidate(); | 225 ]).scheduleValidate(); |
| 284 | 226 |
| 285 dir(packagesPath, [ | 227 dir(packagesPath, [ |
| 286 dir('foo', [ | 228 dir('foo', [ |
| 287 file('foo.dart', 'main() => "foo 2";') | 229 file('foo.dart', 'main() => "foo 2";') |
| 288 ]) | 230 ]) |
| 289 ]).scheduleValidate(); | 231 ]).scheduleValidate(); |
| 290 | 232 |
| 291 run(); | 233 run(); |
| 292 }); | 234 }); |
| 293 | 235 |
| 294 test('checks out a package from Git twice', () { | 236 test('checks out a package from Git twice', () { |
| 295 ensureGit(); | 237 ensureGit(); |
| 296 | 238 |
| 297 git('foo.git', [ | 239 git('foo.git', [ |
| 298 file('foo.dart', 'main() => "foo";') | 240 file('foo.dart', 'main() => "foo";') |
| 299 ]).scheduleCreate(); | 241 ]).scheduleCreate(); |
| 300 | 242 |
| 301 dir(appPath, [ | 243 appDir([{"git": "../foo.git"}]).scheduleCreate(); |
| 302 file('pubspec.yaml', ''' | |
| 303 dependencies: | |
| 304 foo: | |
| 305 git: ../foo.git | |
| 306 ''') | |
| 307 ]).scheduleCreate(); | |
| 308 | 244 |
| 309 schedulePub(args: ['install'], | 245 schedulePub(args: ['install'], |
| 310 output: const RegExp(@"Dependencies installed!$")); | 246 output: const RegExp(@"Dependencies installed!$")); |
| 311 | 247 |
| 312 dir(cachePath, [ | 248 dir(cachePath, [ |
| 313 dir('git', [ | 249 dir('git', [ |
| 314 dir('cache', [ | 250 dir('cache', [gitPackageCacheDir('foo')]), |
| 315 dir(new RegExp(@'foo-[a-f0-9]+'), [ | 251 gitPackageCacheDir('foo') |
| 316 file('foo.dart', 'main() => "foo";') | |
| 317 ]) | |
| 318 ]), | |
| 319 dir(new RegExp(@'foo-[a-f0-9]+'), [ | |
| 320 file('foo.dart', 'main() => "foo";') | |
| 321 ]) | |
| 322 ]) | 252 ]) |
| 323 ]).scheduleValidate(); | 253 ]).scheduleValidate(); |
| 324 | 254 |
| 325 dir(packagesPath, [ | 255 dir(packagesPath, [ |
| 326 dir('foo', [ | 256 dir('foo', [ |
| 327 file('foo.dart', 'main() => "foo";') | 257 file('foo.dart', 'main() => "foo";') |
| 328 ]) | 258 ]) |
| 329 ]).scheduleValidate(); | 259 ]).scheduleValidate(); |
| 330 | 260 |
| 331 // TODO(nweiz): remove this once we support pub update | 261 // TODO(nweiz): remove this once we support pub update |
| 332 dir(packagesPath).scheduleDelete(); | 262 dir(packagesPath).scheduleDelete(); |
| 333 | 263 |
| 334 // Verify that nothing breaks if we install a Git revision that's already | 264 // Verify that nothing breaks if we install a Git revision that's already |
| 335 // in the cache. | 265 // in the cache. |
| 336 schedulePub(args: ['install'], | 266 schedulePub(args: ['install'], |
| 337 output: const RegExp(@"Dependencies installed!$")); | 267 output: const RegExp(@"Dependencies installed!$")); |
| 338 | 268 |
| 339 run(); | 269 run(); |
| 340 }); | 270 }); |
| 341 | 271 |
| 342 test('checks out a package at a specific revision from Git', () { | 272 test('checks out a package at a specific revision from Git', () { |
| 343 ensureGit(); | 273 ensureGit(); |
| 344 | 274 |
| 345 var repo = git('foo.git', [ | 275 var repo = git('foo.git', [ |
| 346 file('foo.dart', 'main() => "foo 1";') | 276 file('foo.dart', 'main() => "foo 1";') |
| 347 ]); | 277 ]); |
| 348 repo.scheduleCreate(); | 278 repo.scheduleCreate(); |
| 349 var commitFuture = repo.revParse('HEAD'); | 279 var commit = repo.revParse('HEAD'); |
| 350 | 280 |
| 351 git('foo.git', [ | 281 git('foo.git', [ |
| 352 file('foo.dart', 'main() => "foo 2";') | 282 file('foo.dart', 'main() => "foo 2";') |
| 353 ]).scheduleCommit(); | 283 ]).scheduleCommit(); |
| 354 | 284 |
| 355 dir(appPath, [ | 285 appDir([{"git": {"url": "../foo.git", "ref": commit}}]).scheduleCreate(); |
| 356 async(commitFuture.transform((commit) { | |
| 357 return file('pubspec.yaml', ''' | |
| 358 dependencies: | |
| 359 foo: | |
| 360 git: | |
| 361 url: ../foo.git | |
| 362 ref: $commit | |
| 363 '''); | |
| 364 })) | |
| 365 ]).scheduleCreate(); | |
| 366 | 286 |
| 367 schedulePub(args: ['install'], | 287 schedulePub(args: ['install'], |
| 368 output: const RegExp(@"Dependencies installed!$")); | 288 output: const RegExp(@"Dependencies installed!$")); |
| 369 | 289 |
| 370 dir(packagesPath, [ | 290 dir(packagesPath, [ |
| 371 dir('foo', [ | 291 dir('foo', [ |
| 372 file('foo.dart', 'main() => "foo 1";') | 292 file('foo.dart', 'main() => "foo 1";') |
| 373 ]) | 293 ]) |
| 374 ]).scheduleValidate(); | 294 ]).scheduleValidate(); |
| 375 | 295 |
| 376 run(); | 296 run(); |
| 377 }); | 297 }); |
| 378 | 298 |
| 379 test('checks out a package from a pub server', () { | 299 test('checks out a package from a pub server', () { |
| 380 servePackages("localhost", 3123, ['{name: foo, version: 1.2.3}']); | 300 servePackages([package("foo", "1.2.3")]); |
| 381 | 301 |
| 382 dir(appPath, [ | 302 appDir([dependency("foo", "1.2.3")]).scheduleCreate(); |
| 383 file('pubspec.yaml', ''' | |
| 384 dependencies: | |
| 385 foo: | |
| 386 repo: | |
| 387 name: foo | |
| 388 url: http://localhost:3123 | |
| 389 version: 1.2.3 | |
| 390 ''') | |
| 391 ]).scheduleCreate(); | |
| 392 | 303 |
| 393 schedulePub(args: ['install'], | 304 schedulePub(args: ['install'], |
| 394 output: const RegExp("Dependencies installed!\$")); | 305 output: const RegExp("Dependencies installed!\$")); |
| 395 | 306 |
| 396 dir(cachePath, [ | 307 cacheDir({"foo": "1.2.3"}).scheduleValidate(); |
| 397 dir('repo', [ | 308 packagesDir({"foo": "1.2.3"}).scheduleValidate(); |
| 398 dir('localhost%583123', [ | |
| 399 dir('foo-1.2.3', [ | |
| 400 file('pubspec.yaml', '{name: foo, version: 1.2.3}'), | |
| 401 file('foo.dart', 'main() => print("foo 1.2.3");') | |
| 402 ]) | |
| 403 ]) | |
| 404 ]) | |
| 405 ]).scheduleValidate(); | |
| 406 | |
| 407 dir(packagesPath, [ | |
| 408 dir('foo', [ | |
| 409 file('pubspec.yaml', '{name: foo, version: 1.2.3}'), | |
| 410 file('foo.dart', 'main() => print("foo 1.2.3");') | |
| 411 ]) | |
| 412 ]).scheduleValidate(); | |
| 413 | 309 |
| 414 run(); | 310 run(); |
| 415 }); | 311 }); |
| 416 | 312 |
| 417 test('checks out packages transitively from a pub server', () { | 313 test('checks out packages transitively from a pub server', () { |
| 418 servePackages("localhost", 3123, [ | 314 servePackages([ |
| 419 ''' | 315 package("foo", "1.2.3", [dependency("bar", "2.0.4")]), |
| 420 name: foo | 316 package("bar", "2.0.3"), |
| 421 version: 1.2.3 | 317 package("bar", "2.0.4"), |
| 422 dependencies: | 318 package("bar", "2.0.5") |
| 423 bar: | |
| 424 repo: {name: bar, url: http://localhost:3123} | |
| 425 version: 2.0.4 | |
| 426 ''', | |
| 427 '{name: bar, version: 2.0.3}', | |
| 428 '{name: bar, version: 2.0.4}', | |
| 429 '{name: bar, version: 2.0.5}', | |
| 430 ]); | 319 ]); |
| 431 | 320 |
| 432 dir(appPath, [ | 321 appDir([dependency("foo", "1.2.3")]).scheduleCreate(); |
| 433 file('pubspec.yaml', ''' | |
| 434 dependencies: | |
| 435 foo: | |
| 436 repo: | |
| 437 name: foo | |
| 438 url: http://localhost:3123 | |
| 439 version: 1.2.3 | |
| 440 ''') | |
| 441 ]).scheduleCreate(); | |
| 442 | 322 |
| 443 schedulePub(args: ['install'], | 323 schedulePub(args: ['install'], |
| 444 output: const RegExp("Dependencies installed!\$")); | 324 output: const RegExp("Dependencies installed!\$")); |
| 445 | 325 |
| 446 dir(cachePath, [ | 326 cacheDir({"foo": "1.2.3", "bar": "2.0.4"}).scheduleValidate(); |
| 447 dir('repo', [ | 327 packagesDir({"foo": "1.2.3", "bar": "2.0.4"}).scheduleValidate(); |
| 448 dir('localhost%583123', [ | |
| 449 dir('foo-1.2.3', [ | |
| 450 file('pubspec.yaml', ''' | |
| 451 name: foo | |
| 452 version: 1.2.3 | |
| 453 dependencies: | |
| 454 bar: | |
| 455 repo: {name: bar, url: http://localhost:3123} | |
| 456 version: 2.0.4 | |
| 457 '''), | |
| 458 file('foo.dart', 'main() => print("foo 1.2.3");') | |
| 459 ]), | |
| 460 dir('bar-2.0.4', [ | |
| 461 file('pubspec.yaml', '{name: bar, version: 2.0.4}'), | |
| 462 file('bar.dart', 'main() => print("bar 2.0.4");') | |
| 463 ]) | |
| 464 ]) | |
| 465 ]) | |
| 466 ]).scheduleValidate(); | |
| 467 | |
| 468 dir(packagesPath, [ | |
| 469 dir('foo', [ | |
| 470 file('pubspec.yaml', ''' | |
| 471 name: foo | |
| 472 version: 1.2.3 | |
| 473 dependencies: | |
| 474 bar: | |
| 475 repo: {name: bar, url: http://localhost:3123} | |
| 476 version: 2.0.4 | |
| 477 '''), | |
| 478 file('foo.dart', 'main() => print("foo 1.2.3");') | |
| 479 ]), | |
| 480 dir('bar', [ | |
| 481 file('pubspec.yaml', '{name: bar, version: 2.0.4}'), | |
| 482 file('bar.dart', 'main() => print("bar 2.0.4");') | |
| 483 ]) | |
| 484 ]).scheduleValidate(); | |
| 485 | 328 |
| 486 run(); | 329 run(); |
| 487 }); | 330 }); |
| 488 | 331 |
| 489 test('resolves version constraints from a pub server', () { | 332 test('resolves version constraints from a pub server', () { |
| 490 servePackages("localhost", 3123, [ | 333 servePackages([ |
| 491 ''' | 334 package("foo", "1.2.3", [dependency("baz", ">=2.0.0")]), |
| 492 name: foo | 335 package("bar", "2.3.4", [dependency("baz", "<3.0.0")]), |
| 493 version: 1.2.3 | 336 package("baz", "2.0.3"), |
| 494 dependencies: | 337 package("baz", "2.0.4"), |
| 495 baz: | 338 package("baz", "3.0.1") |
| 496 repo: {name: baz, url: http://localhost:3123} | |
| 497 version: ">=2.0.0" | |
| 498 ''', | |
| 499 ''' | |
| 500 name: bar | |
| 501 version: 2.3.4 | |
| 502 dependencies: | |
| 503 baz: | |
| 504 repo: {name: baz, url: http://localhost:3123} | |
| 505 version: "<3.0.0" | |
| 506 ''', | |
| 507 '{name: baz, version: 2.0.3}', | |
| 508 '{name: baz, version: 2.0.4}', | |
| 509 '{name: baz, version: 3.0.1}', | |
| 510 ]); | 339 ]); |
| 511 | 340 |
| 512 dir(appPath, [ | 341 appDir([dependency("foo"), dependency("bar")]).scheduleCreate(); |
| 513 file('pubspec.yaml', ''' | |
| 514 dependencies: | |
| 515 foo: {repo: {name: foo, url: http://localhost:3123}} | |
| 516 bar: {repo: {name: bar, url: http://localhost:3123}} | |
| 517 ''') | |
| 518 ]).scheduleCreate(); | |
| 519 | 342 |
| 520 schedulePub(args: ['install'], | 343 schedulePub(args: ['install'], |
| 521 output: const RegExp("Dependencies installed!\$")); | 344 output: const RegExp("Dependencies installed!\$")); |
| 522 | 345 |
| 523 dir(cachePath, [ | 346 cacheDir({ |
| 524 dir('repo', [ | 347 "foo": "1.2.3", |
| 525 dir('localhost%583123', [ | 348 "bar": "2.3.4", |
| 526 dir('foo-1.2.3', [ | 349 "baz": "2.0.4" |
| 527 file('pubspec.yaml', ''' | 350 }).scheduleValidate(); |
| 528 name: foo | |
| 529 version: 1.2.3 | |
| 530 dependencies: | |
| 531 baz: | |
| 532 repo: {name: baz, url: http://localhost:3123} | |
| 533 version: ">=2.0.0" | |
| 534 '''), | |
| 535 file('foo.dart', 'main() => print("foo 1.2.3");') | |
| 536 ]), | |
| 537 dir('bar-2.3.4', [ | |
| 538 file('pubspec.yaml', ''' | |
| 539 name: bar | |
| 540 version: 2.3.4 | |
| 541 dependencies: | |
| 542 baz: | |
| 543 repo: {name: baz, url: http://localhost:3123} | |
| 544 version: "<3.0.0" | |
| 545 '''), | |
| 546 file('bar.dart', 'main() => print("bar 2.3.4");') | |
| 547 ]), | |
| 548 dir('baz-2.0.4', [ | |
| 549 file('pubspec.yaml', '{name: baz, version: 2.0.4}'), | |
| 550 file('baz.dart', 'main() => print("baz 2.0.4");') | |
| 551 ]) | |
| 552 ]) | |
| 553 ]) | |
| 554 ]).scheduleValidate(); | |
| 555 | 351 |
| 556 dir(packagesPath, [ | 352 packagesDir({ |
| 557 dir('foo', [ | 353 "foo": "1.2.3", |
| 558 file('pubspec.yaml', ''' | 354 "bar": "2.3.4", |
| 559 name: foo | 355 "baz": "2.0.4" |
| 560 version: 1.2.3 | 356 }).scheduleValidate(); |
| 561 dependencies: | |
| 562 baz: | |
| 563 repo: {name: baz, url: http://localhost:3123} | |
| 564 version: ">=2.0.0" | |
| 565 '''), | |
| 566 file('foo.dart', 'main() => print("foo 1.2.3");') | |
| 567 ]), | |
| 568 dir('bar', [ | |
| 569 file('pubspec.yaml', ''' | |
| 570 name: bar | |
| 571 version: 2.3.4 | |
| 572 dependencies: | |
| 573 baz: | |
| 574 repo: {name: baz, url: http://localhost:3123} | |
| 575 version: "<3.0.0" | |
| 576 '''), | |
| 577 file('bar.dart', 'main() => print("bar 2.3.4");') | |
| 578 ]), | |
| 579 dir('baz', [ | |
| 580 file('pubspec.yaml', '{name: baz, version: 2.0.4}'), | |
| 581 file('baz.dart', 'main() => print("baz 2.0.4");') | |
| 582 ]) | |
| 583 ]).scheduleValidate(); | |
| 584 | 357 |
| 585 run(); | 358 run(); |
| 586 }); | 359 }); |
| 587 | 360 |
| 588 test('keeps a Git package locked to the version in the lockfile', () { | 361 test('keeps a Git package locked to the version in the lockfile', () { |
| 589 ensureGit(); | 362 ensureGit(); |
| 590 | 363 |
| 591 git('foo.git', [ | 364 git('foo.git', [ |
| 592 file('foo.dart', 'main() => "foo";') | 365 file('foo.dart', 'main() => "foo";') |
| 593 ]).scheduleCreate(); | 366 ]).scheduleCreate(); |
| 594 | 367 |
| 595 dir(appPath, [ | 368 appDir([{"git": "../foo.git"}]).scheduleCreate(); |
| 596 file('pubspec.yaml', ''' | |
| 597 dependencies: | |
| 598 foo: | |
| 599 git: ../foo.git | |
| 600 ''') | |
| 601 ]).scheduleCreate(); | |
| 602 | 369 |
| 603 // This install should lock the foo.git dependency to the current revision. | 370 // This install should lock the foo.git dependency to the current revision. |
| 604 schedulePub(args: ['install'], | 371 schedulePub(args: ['install'], |
| 605 output: const RegExp(@"Dependencies installed!$")); | 372 output: const RegExp(@"Dependencies installed!$")); |
| 606 | 373 |
| 607 dir(packagesPath, [ | 374 dir(packagesPath, [ |
| 608 dir('foo', [ | 375 dir('foo', [ |
| 609 file('foo.dart', 'main() => "foo";') | 376 file('foo.dart', 'main() => "foo";') |
| 610 ]) | 377 ]) |
| 611 ]).scheduleValidate(); | 378 ]).scheduleValidate(); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 630 run(); | 397 run(); |
| 631 }); | 398 }); |
| 632 | 399 |
| 633 test('updates a locked Git package with a new incompatible constraint', () { | 400 test('updates a locked Git package with a new incompatible constraint', () { |
| 634 ensureGit(); | 401 ensureGit(); |
| 635 | 402 |
| 636 git('foo.git', [ | 403 git('foo.git', [ |
| 637 file('foo.dart', 'main() => "foo";') | 404 file('foo.dart', 'main() => "foo";') |
| 638 ]).scheduleCreate(); | 405 ]).scheduleCreate(); |
| 639 | 406 |
| 640 dir(appPath, [ | 407 appDir([{"git": "../foo.git"}]).scheduleCreate(); |
| 641 file('pubspec.yaml', ''' | |
| 642 dependencies: | |
| 643 foo: | |
| 644 git: ../foo.git | |
| 645 ''') | |
| 646 ]).scheduleCreate(); | |
| 647 | 408 |
| 648 schedulePub(args: ['install'], | 409 schedulePub(args: ['install'], |
| 649 output: const RegExp(@"Dependencies installed!$")); | 410 output: const RegExp(@"Dependencies installed!$")); |
| 650 | 411 |
| 651 dir(packagesPath, [ | 412 dir(packagesPath, [ |
| 652 dir('foo', [ | 413 dir('foo', [ |
| 653 file('foo.dart', 'main() => "foo";') | 414 file('foo.dart', 'main() => "foo";') |
| 654 ]) | 415 ]) |
| 655 ]).scheduleValidate(); | 416 ]).scheduleValidate(); |
| 656 | 417 |
| 657 git('foo.git', [ | 418 git('foo.git', [ |
| 658 file('foo.dart', 'main() => "foo 1.0.0";'), | 419 file('foo.dart', 'main() => "foo 1.0.0";'), |
| 659 file('pubspec.yaml', 'version: 1.0.0') | 420 libPubspec("foo", "1.0.0") |
| 660 ]).scheduleCommit(); | 421 ]).scheduleCommit(); |
| 661 | 422 |
| 662 dir(appPath, [ | 423 appDir([{"git": "../foo.git", "version": ">=1.0.0"}]).scheduleCreate(); |
| 663 file('pubspec.yaml', ''' | |
| 664 dependencies: | |
| 665 foo: | |
| 666 git: ../foo.git | |
| 667 version: ">=1.0.0" | |
| 668 ''') | |
| 669 ]).scheduleCreate(); | |
| 670 | 424 |
| 671 schedulePub(args: ['install'], | 425 schedulePub(args: ['install'], |
| 672 output: const RegExp(@"Dependencies installed!$")); | 426 output: const RegExp(@"Dependencies installed!$")); |
| 673 | 427 |
| 674 dir(packagesPath, [ | 428 dir(packagesPath, [ |
| 675 dir('foo', [ | 429 dir('foo', [ |
| 676 file('foo.dart', 'main() => "foo 1.0.0";') | 430 file('foo.dart', 'main() => "foo 1.0.0";') |
| 677 ]) | 431 ]) |
| 678 ]).scheduleValidate(); | 432 ]).scheduleValidate(); |
| 679 | 433 |
| 680 run(); | 434 run(); |
| 681 }); | 435 }); |
| 682 | 436 |
| 683 test("doesn't update a locked Git package with a new compatible " | 437 test("doesn't update a locked Git package with a new compatible " |
| 684 "constraint", () { | 438 "constraint", () { |
| 685 ensureGit(); | 439 ensureGit(); |
| 686 | 440 |
| 687 git('foo.git', [ | 441 git('foo.git', [ |
| 688 file('foo.dart', 'main() => "foo 1.0.0";'), | 442 file('foo.dart', 'main() => "foo 1.0.0";'), |
| 689 file('pubspec.yaml', 'version: 1.0.0') | 443 libPubspec("foo", "1.0.0") |
| 690 ]).scheduleCreate(); | 444 ]).scheduleCreate(); |
| 691 | 445 |
| 692 dir(appPath, [ | 446 appDir([{"git": "../foo.git"}]).scheduleCreate(); |
| 693 file('pubspec.yaml', ''' | |
| 694 dependencies: | |
| 695 foo: | |
| 696 git: ../foo.git | |
| 697 ''') | |
| 698 ]).scheduleCreate(); | |
| 699 | 447 |
| 700 schedulePub(args: ['install'], | 448 schedulePub(args: ['install'], |
| 701 output: const RegExp(@"Dependencies installed!$")); | 449 output: const RegExp(@"Dependencies installed!$")); |
| 702 | 450 |
| 703 dir(packagesPath, [ | 451 dir(packagesPath, [ |
| 704 dir('foo', [ | 452 dir('foo', [ |
| 705 file('foo.dart', 'main() => "foo 1.0.0";') | 453 file('foo.dart', 'main() => "foo 1.0.0";') |
| 706 ]) | 454 ]) |
| 707 ]).scheduleValidate(); | 455 ]).scheduleValidate(); |
| 708 | 456 |
| 709 git('foo.git', [ | 457 git('foo.git', [ |
| 710 file('foo.dart', 'main() => "foo 1.0.1";'), | 458 file('foo.dart', 'main() => "foo 1.0.1";'), |
| 711 file('pubspec.yaml', 'version: 1.0.1') | 459 libPubspec("foo", "1.0.1") |
| 712 ]).scheduleCommit(); | 460 ]).scheduleCommit(); |
| 713 | 461 |
| 714 dir(appPath, [ | 462 appDir([{"git": "../foo.git", "version": ">=1.0.0"}]).scheduleCreate(); |
| 715 file('pubspec.yaml', ''' | |
| 716 dependencies: | |
| 717 foo: | |
| 718 git: ../foo.git | |
| 719 version: ">=1.0.0" | |
| 720 ''') | |
| 721 ]).scheduleCreate(); | |
| 722 | 463 |
| 723 schedulePub(args: ['install'], | 464 schedulePub(args: ['install'], |
| 724 output: const RegExp(@"Dependencies installed!$")); | 465 output: const RegExp(@"Dependencies installed!$")); |
| 725 | 466 |
| 726 dir(packagesPath, [ | 467 dir(packagesPath, [ |
| 727 dir('foo', [ | 468 dir('foo', [ |
| 728 file('foo.dart', 'main() => "foo 1.0.0";') | 469 file('foo.dart', 'main() => "foo 1.0.0";') |
| 729 ]) | 470 ]) |
| 730 ]).scheduleValidate(); | 471 ]).scheduleValidate(); |
| 731 | 472 |
| 732 run(); | 473 run(); |
| 733 }); | 474 }); |
| 734 | 475 |
| 735 test('keeps a pub server package locked to the version in the lockfile', () { | 476 test('keeps a pub server package locked to the version in the lockfile', () { |
| 736 servePackages("localhost", 3123, ['{name: foo, version: 1.0.0}']); | 477 servePackages([package("foo", "1.0.0")]); |
| 737 | 478 |
| 738 dir(appPath, [ | 479 appDir([dependency("foo")]).scheduleCreate(); |
| 739 file('pubspec.yaml', ''' | |
| 740 dependencies: | |
| 741 foo: | |
| 742 repo: {name: foo, url: http://localhost:3123} | |
| 743 ''') | |
| 744 ]).scheduleCreate(); | |
| 745 | 480 |
| 746 // This install should lock the foo dependency to version 1.0.0. | 481 // This install should lock the foo dependency to version 1.0.0. |
| 747 schedulePub(args: ['install'], | 482 schedulePub(args: ['install'], |
| 748 output: const RegExp(@"Dependencies installed!$")); | 483 output: const RegExp(@"Dependencies installed!$")); |
| 749 | 484 |
| 750 dir(packagesPath, [ | 485 packagesDir({"foo": "1.0.0"}).scheduleValidate(); |
| 751 dir('foo', [ | |
| 752 file('foo.dart', 'main() => print("foo 1.0.0");') | |
| 753 ]) | |
| 754 ]).scheduleValidate(); | |
| 755 | 486 |
| 756 // Delete the packages path to simulate a new checkout of the application. | 487 // Delete the packages path to simulate a new checkout of the application. |
| 757 dir(packagesPath).scheduleDelete(); | 488 dir(packagesPath).scheduleDelete(); |
| 758 | 489 |
| 759 // Start serving a newer package as well. | 490 // Start serving a newer package as well. |
| 760 servePackages("localhost", 3123, [ | 491 servePackages([package("foo", "1.0.1")]); |
| 761 '{name: foo, version: 1.0.0}', | |
| 762 '{name: foo, version: 1.0.1}' | |
| 763 ]); | |
| 764 | 492 |
| 765 // This install shouldn't update the foo dependency due to the lockfile. | 493 // This install shouldn't update the foo dependency due to the lockfile. |
| 766 schedulePub(args: ['install'], | 494 schedulePub(args: ['install'], |
| 767 output: const RegExp(@"Dependencies installed!$")); | 495 output: const RegExp(@"Dependencies installed!$")); |
| 768 | 496 |
| 769 dir(packagesPath, [ | 497 packagesDir({"foo": "1.0.0"}).scheduleValidate(); |
| 770 dir('foo', [ | |
| 771 file('foo.dart', 'main() => print("foo 1.0.0");') | |
| 772 ]) | |
| 773 ]).scheduleValidate(); | |
| 774 | 498 |
| 775 run(); | 499 run(); |
| 776 }); | 500 }); |
| 777 | 501 |
| 778 test('updates a locked pub server package with a new incompatible ' | 502 test('updates a locked pub server package with a new incompatible ' |
| 779 'constraint', () { | 503 'constraint', () { |
| 780 servePackages("localhost", 3123, ['{name: foo, version: 1.0.0}']); | 504 servePackages([package("foo", "1.0.0")]); |
| 781 | 505 |
| 782 dir(appPath, [ | 506 appDir([dependency("foo")]).scheduleCreate(); |
| 783 file('pubspec.yaml', ''' | |
| 784 dependencies: | |
| 785 foo: | |
| 786 repo: {name: foo, url: http://localhost:3123} | |
| 787 ''') | |
| 788 ]).scheduleCreate(); | |
| 789 | 507 |
| 790 schedulePub(args: ['install'], | 508 schedulePub(args: ['install'], |
| 791 output: const RegExp(@"Dependencies installed!$")); | 509 output: const RegExp(@"Dependencies installed!$")); |
| 792 | 510 |
| 793 dir(packagesPath, [ | 511 packagesDir({"foo": "1.0.0"}).scheduleValidate(); |
| 794 dir('foo', [ | |
| 795 file('foo.dart', 'main() => print("foo 1.0.0");') | |
| 796 ]) | |
| 797 ]).scheduleValidate(); | |
| 798 | 512 |
| 799 servePackages("localhost", 3123, [ | 513 servePackages([package("foo", "1.0.1")]); |
| 800 '{name: foo, version: 1.0.0}', | |
| 801 '{name: foo, version: 1.0.1}' | |
| 802 ]); | |
| 803 | 514 |
| 804 dir(appPath, [ | 515 appDir([dependency("foo", ">1.0.0")]).scheduleCreate(); |
| 805 file('pubspec.yaml', ''' | |
| 806 dependencies: | |
| 807 foo: | |
| 808 repo: {name: foo, url: http://localhost:3123} | |
| 809 version: ">1.0.0" | |
| 810 ''') | |
| 811 ]).scheduleCreate(); | |
| 812 | 516 |
| 813 schedulePub(args: ['install'], | 517 schedulePub(args: ['install'], |
| 814 output: const RegExp(@"Dependencies installed!$")); | 518 output: const RegExp(@"Dependencies installed!$")); |
| 815 | 519 |
| 816 dir(packagesPath, [ | 520 packagesDir({"foo": "1.0.1"}).scheduleValidate(); |
| 817 dir('foo', [ | |
| 818 file('foo.dart', 'main() => print("foo 1.0.1");') | |
| 819 ]) | |
| 820 ]).scheduleValidate(); | |
| 821 | 521 |
| 822 run(); | 522 run(); |
| 823 }); | 523 }); |
| 824 | 524 |
| 825 test("doesn't update a locked pub server package with a new compatible " | 525 test("doesn't update a locked pub server package with a new compatible " |
| 826 "constraint", () { | 526 "constraint", () { |
| 827 servePackages("localhost", 3123, ['{name: foo, version: 1.0.0}']); | 527 servePackages([package("foo", "1.0.0")]); |
| 828 | 528 |
| 829 dir(appPath, [ | 529 appDir([dependency("foo")]).scheduleCreate(); |
| 830 file('pubspec.yaml', ''' | |
| 831 dependencies: | |
| 832 foo: | |
| 833 repo: {name: foo, url: http://localhost:3123} | |
| 834 ''') | |
| 835 ]).scheduleCreate(); | |
| 836 | 530 |
| 837 schedulePub(args: ['install'], | 531 schedulePub(args: ['install'], |
| 838 output: const RegExp(@"Dependencies installed!$")); | 532 output: const RegExp(@"Dependencies installed!$")); |
| 839 | 533 |
| 840 dir(packagesPath, [ | 534 packagesDir({"foo": "1.0.0"}).scheduleValidate(); |
| 841 dir('foo', [ | |
| 842 file('foo.dart', 'main() => print("foo 1.0.0");') | |
| 843 ]) | |
| 844 ]).scheduleValidate(); | |
| 845 | 535 |
| 846 servePackages("localhost", 3123, [ | 536 servePackages([package("foo", "1.0.1")]); |
| 847 '{name: foo, version: 1.0.0}', | |
| 848 '{name: foo, version: 1.0.1}' | |
| 849 ]); | |
| 850 | 537 |
| 851 dir(appPath, [ | 538 appDir([dependency("foo", ">=1.0.0")]).scheduleCreate(); |
| 852 file('pubspec.yaml', ''' | |
| 853 dependencies: | |
| 854 foo: | |
| 855 repo: {name: foo, url: http://localhost:3123} | |
| 856 version: ">=1.0.0" | |
| 857 ''') | |
| 858 ]).scheduleCreate(); | |
| 859 | 539 |
| 860 schedulePub(args: ['install'], | 540 schedulePub(args: ['install'], |
| 861 output: const RegExp(@"Dependencies installed!$")); | 541 output: const RegExp(@"Dependencies installed!$")); |
| 862 | 542 |
| 863 dir(packagesPath, [ | 543 packagesDir({"foo": "1.0.0"}).scheduleValidate(); |
| 864 dir('foo', [ | |
| 865 file('foo.dart', 'main() => print("foo 1.0.0");') | |
| 866 ]) | |
| 867 ]).scheduleValidate(); | |
| 868 | 544 |
| 869 run(); | 545 run(); |
| 870 }); | 546 }); |
| 871 | 547 |
| 872 test("unlocks dependencies if necessary to ensure that a new dependency " | 548 test("unlocks dependencies if necessary to ensure that a new dependency " |
| 873 "is satisfied", () { | 549 "is satisfied", () { |
| 874 servePackages("localhost", 3123, [ | 550 servePackages([ |
| 875 ''' | 551 package("foo", "1.0.0", [dependency("bar", "<2.0.0")]), |
| 876 name: foo | 552 package("bar", "1.0.0", [dependency("baz", "<2.0.0")]), |
| 877 version: 1.0.0 | 553 package("baz", "1.0.0", [dependency("qux", "<2.0.0")]), |
| 878 dependencies: | 554 package("qux", "1.0.0") |
| 879 bar: | 555 ]); |
| 880 version: "<2.0.0" | |
| 881 repo: {name: bar, url: http://localhost:3123} | |
| 882 ''', | |
| 883 ''' | |
| 884 name: bar | |
| 885 version: 1.0.0 | |
| 886 dependencies: | |
| 887 baz: | |
| 888 version: "<2.0.0" | |
| 889 repo: {name: baz, url: http://localhost:3123} | |
| 890 ''', | |
| 891 ''' | |
| 892 name: baz | |
| 893 version: 1.0.0 | |
| 894 dependencies: | |
| 895 qux: | |
| 896 version: "<2.0.0" | |
| 897 repo: {name: qux, url: http://localhost:3123} | |
| 898 ''', | |
| 899 ''' | |
| 900 name: qux | |
| 901 version: 1.0.0 | |
| 902 ''']); | |
| 903 | 556 |
| 904 dir(appPath, [ | 557 appDir([dependency("foo")]).scheduleCreate(); |
| 905 file('pubspec.yaml', ''' | |
| 906 dependencies: | |
| 907 foo: | |
| 908 repo: {name: foo, url: http://localhost:3123} | |
| 909 ''') | |
| 910 ]).scheduleCreate(); | |
| 911 | 558 |
| 912 schedulePub(args: ['install'], | 559 schedulePub(args: ['install'], |
| 913 output: const RegExp(@"Dependencies installed!$")); | 560 output: const RegExp(@"Dependencies installed!$")); |
| 914 | 561 |
| 915 dir(packagesPath, [ | 562 packagesDir({ |
| 916 dir('foo', [ | 563 "foo": "1.0.0", |
| 917 file('foo.dart', 'main() => print("foo 1.0.0");') | 564 "bar": "1.0.0", |
| 918 ]), | 565 "baz": "1.0.0", |
| 919 dir('bar', [ | 566 "qux": "1.0.0" |
| 920 file('bar.dart', 'main() => print("bar 1.0.0");') | 567 }).scheduleValidate(); |
| 921 ]), | |
| 922 dir('baz', [ | |
| 923 file('baz.dart', 'main() => print("baz 1.0.0");') | |
| 924 ]), | |
| 925 dir('qux', [ | |
| 926 file('qux.dart', 'main() => print("qux 1.0.0");') | |
| 927 ]) | |
| 928 ]).scheduleValidate(); | |
| 929 | 568 |
| 930 servePackages("localhost", 3123, [ | 569 servePackages([ |
| 931 ''' | 570 package("foo", "2.0.0", [dependency("bar", "<3.0.0")]), |
| 932 name: foo | 571 package("bar", "2.0.0", [dependency("baz", "<3.0.0")]), |
| 933 version: 1.0.0 | 572 package("baz", "2.0.0", [dependency("qux", "<3.0.0")]), |
| 934 dependencies: | 573 package("qux", "2.0.0"), |
| 935 bar: | 574 package("newdep", "2.0.0", [dependency("baz", ">=1.5.0")]) |
| 936 version: "<2.0.0" | 575 ]); |
| 937 repo: {name: bar, url: http://localhost:3123} | |
| 938 ''', | |
| 939 ''' | |
| 940 name: foo | |
| 941 version: 2.0.0 | |
| 942 dependencies: | |
| 943 bar: | |
| 944 version: "<3.0.0" | |
| 945 repo: {name: bar, url: http://localhost:3123} | |
| 946 ''', | |
| 947 ''' | |
| 948 name: bar | |
| 949 version: 1.0.0 | |
| 950 dependencies: | |
| 951 baz: | |
| 952 version: "<2.0.0" | |
| 953 repo: {name: baz, url: http://localhost:3123} | |
| 954 ''', | |
| 955 ''' | |
| 956 name: bar | |
| 957 version: 2.0.0 | |
| 958 dependencies: | |
| 959 baz: | |
| 960 version: "<3.0.0" | |
| 961 repo: {name: baz, url: http://localhost:3123} | |
| 962 ''', | |
| 963 ''' | |
| 964 name: baz | |
| 965 version: 1.0.0 | |
| 966 dependencies: | |
| 967 qux: | |
| 968 version: "<2.0.0" | |
| 969 repo: {name: qux, url: http://localhost:3123} | |
| 970 ''', | |
| 971 ''' | |
| 972 name: baz | |
| 973 version: 2.0.0 | |
| 974 dependencies: | |
| 975 qux: | |
| 976 version: "<3.0.0" | |
| 977 repo: {name: qux, url: http://localhost:3123} | |
| 978 ''', | |
| 979 ''' | |
| 980 name: qux | |
| 981 version: 1.0.0 | |
| 982 ''', | |
| 983 ''' | |
| 984 name: qux | |
| 985 version: 2.0.0 | |
| 986 ''', | |
| 987 ''' | |
| 988 name: newdep | |
| 989 version: 2.0.0 | |
| 990 dependencies: | |
| 991 baz: | |
| 992 version: ">=1.5.0" | |
| 993 repo: {name: baz, url: http://localhost:3123} | |
| 994 ''']); | |
| 995 | 576 |
| 996 dir(appPath, [ | 577 appDir([dependency("foo"), dependency("newdep")]).scheduleCreate(); |
| 997 file('pubspec.yaml', ''' | |
| 998 dependencies: | |
| 999 foo: | |
| 1000 repo: {name: foo, url: http://localhost:3123} | |
| 1001 newdep: | |
| 1002 repo: {name: newdep, url: http://localhost:3123} | |
| 1003 ''') | |
| 1004 ]).scheduleCreate(); | |
| 1005 | 578 |
| 1006 schedulePub(args: ['install'], | 579 schedulePub(args: ['install'], |
| 1007 output: const RegExp(@"Dependencies installed!$")); | 580 output: const RegExp(@"Dependencies installed!$")); |
| 1008 | 581 |
| 1009 dir(packagesPath, [ | 582 packagesDir({ |
| 1010 dir('foo', [ | 583 "foo": "2.0.0", |
| 1011 file('foo.dart', 'main() => print("foo 2.0.0");') | 584 "bar": "2.0.0", |
| 1012 ]), | 585 "baz": "2.0.0", |
| 1013 dir('bar', [ | 586 "qux": "1.0.0", |
| 1014 file('bar.dart', 'main() => print("bar 2.0.0");') | 587 "newdep": "2.0.0" |
| 1015 ]), | 588 }).scheduleValidate(); |
| 1016 dir('baz', [ | |
| 1017 file('baz.dart', 'main() => print("baz 2.0.0");') | |
| 1018 ]), | |
| 1019 dir('qux', [ | |
| 1020 file('qux.dart', 'main() => print("qux 1.0.0");') | |
| 1021 ]), | |
| 1022 dir('newdep', [ | |
| 1023 file('newdep.dart', 'main() => print("newdep 2.0.0");') | |
| 1024 ]) | |
| 1025 ]).scheduleValidate(); | |
| 1026 | 589 |
| 1027 run(); | 590 run(); |
| 1028 }); | 591 }); |
| 1029 | 592 |
| 1030 test("doesn't unlock dependencies if a new dependency is already " | 593 test("doesn't unlock dependencies if a new dependency is already " |
| 1031 "satisfied", () { | 594 "satisfied", () { |
| 1032 servePackages("localhost", 3123, [ | 595 servePackages([ |
| 1033 ''' | 596 package("foo", "1.0.0", [dependency("bar", "<2.0.0")]), |
| 1034 name: foo | 597 package("bar", "1.0.0", [dependency("baz", "<2.0.0")]), |
| 1035 version: 1.0.0 | 598 package("baz", "1.0.0") |
| 1036 dependencies: | 599 ]); |
| 1037 bar: | |
| 1038 version: "<2.0.0" | |
| 1039 repo: {name: bar, url: http://localhost:3123} | |
| 1040 ''', | |
| 1041 ''' | |
| 1042 name: bar | |
| 1043 version: 1.0.0 | |
| 1044 dependencies: | |
| 1045 baz: | |
| 1046 version: "<2.0.0" | |
| 1047 repo: {name: baz, url: http://localhost:3123} | |
| 1048 ''', | |
| 1049 ''' | |
| 1050 name: baz | |
| 1051 version: 1.0.0 | |
| 1052 ''']); | |
| 1053 | 600 |
| 1054 dir(appPath, [ | 601 appDir([dependency("foo")]).scheduleCreate(); |
| 1055 file('pubspec.yaml', ''' | |
| 1056 dependencies: | |
| 1057 foo: | |
| 1058 repo: {name: foo, url: http://localhost:3123} | |
| 1059 ''') | |
| 1060 ]).scheduleCreate(); | |
| 1061 | 602 |
| 1062 schedulePub(args: ['install'], | 603 schedulePub(args: ['install'], |
| 1063 output: const RegExp(@"Dependencies installed!$")); | 604 output: const RegExp(@"Dependencies installed!$")); |
| 1064 | 605 |
| 1065 dir(packagesPath, [ | 606 packagesDir({ |
| 1066 dir('foo', [ | 607 "foo": "1.0.0", |
| 1067 file('foo.dart', 'main() => print("foo 1.0.0");') | 608 "bar": "1.0.0", |
| 1068 ]), | 609 "baz": "1.0.0" |
| 1069 dir('bar', [ | 610 }).scheduleValidate(); |
| 1070 file('bar.dart', 'main() => print("bar 1.0.0");') | |
| 1071 ]), | |
| 1072 dir('baz', [ | |
| 1073 file('baz.dart', 'main() => print("baz 1.0.0");') | |
| 1074 ]) | |
| 1075 ]).scheduleValidate(); | |
| 1076 | 611 |
| 1077 servePackages("localhost", 3123, [ | 612 servePackages([ |
| 1078 ''' | 613 package("foo", "2.0.0", [dependency("bar", "<3.0.0")]), |
| 1079 name: foo | 614 package("bar", "2.0.0", [dependency("baz", "<3.0.0")]), |
| 1080 version: 1.0.0 | 615 package("baz", "2.0.0"), |
| 1081 dependencies: | 616 package("newdep", "2.0.0", [dependency("baz", ">=1.0.0")]) |
| 1082 bar: | 617 ]); |
| 1083 version: "<2.0.0" | |
| 1084 repo: {name: bar, url: http://localhost:3123} | |
| 1085 ''', | |
| 1086 ''' | |
| 1087 name: foo | |
| 1088 version: 2.0.0 | |
| 1089 dependencies: | |
| 1090 bar: | |
| 1091 version: "<3.0.0" | |
| 1092 repo: {name: bar, url: http://localhost:3123} | |
| 1093 ''', | |
| 1094 ''' | |
| 1095 name: bar | |
| 1096 version: 1.0.0 | |
| 1097 dependencies: | |
| 1098 baz: | |
| 1099 version: "<2.0.0" | |
| 1100 repo: {name: baz, url: http://localhost:3123} | |
| 1101 ''', | |
| 1102 ''' | |
| 1103 name: bar | |
| 1104 version: 2.0.0 | |
| 1105 dependencies: | |
| 1106 baz: | |
| 1107 version: "<3.0.0" | |
| 1108 repo: {name: baz, url: http://localhost:3123} | |
| 1109 ''', | |
| 1110 ''' | |
| 1111 name: baz | |
| 1112 version: 1.0.0 | |
| 1113 ''', | |
| 1114 ''' | |
| 1115 name: baz | |
| 1116 version: 2.0.0 | |
| 1117 ''', | |
| 1118 ''' | |
| 1119 name: newdep | |
| 1120 version: 2.0.0 | |
| 1121 dependencies: | |
| 1122 baz: | |
| 1123 version: ">=1.0.0" | |
| 1124 repo: {name: baz, url: http://localhost:3123} | |
| 1125 ''']); | |
| 1126 | 618 |
| 1127 dir(appPath, [ | 619 appDir([dependency("foo"), dependency("newdep")]).scheduleCreate(); |
| 1128 file('pubspec.yaml', ''' | |
| 1129 dependencies: | |
| 1130 foo: | |
| 1131 repo: {name: foo, url: http://localhost:3123} | |
| 1132 newdep: | |
| 1133 repo: {name: newdep, url: http://localhost:3123} | |
| 1134 ''') | |
| 1135 ]).scheduleCreate(); | |
| 1136 | 620 |
| 1137 schedulePub(args: ['install'], | 621 schedulePub(args: ['install'], |
| 1138 output: const RegExp(@"Dependencies installed!$")); | 622 output: const RegExp(@"Dependencies installed!$")); |
| 1139 | 623 |
| 1140 dir(packagesPath, [ | 624 packagesDir({ |
| 1141 dir('foo', [ | 625 "foo": "1.0.0", |
| 1142 file('foo.dart', 'main() => print("foo 1.0.0");') | 626 "bar": "1.0.0", |
| 1143 ]), | 627 "baz": "1.0.0", |
| 1144 dir('bar', [ | 628 "newdep": "2.0.0" |
| 1145 file('bar.dart', 'main() => print("bar 1.0.0");') | 629 }).scheduleValidate(); |
| 1146 ]), | |
| 1147 dir('baz', [ | |
| 1148 file('baz.dart', 'main() => print("baz 1.0.0");') | |
| 1149 ]), | |
| 1150 dir('newdep', [ | |
| 1151 file('newdep.dart', 'main() => print("newdep 2.0.0");') | |
| 1152 ]) | |
| 1153 ]).scheduleValidate(); | |
| 1154 | 630 |
| 1155 run(); | 631 run(); |
| 1156 }); | 632 }); |
| 1157 } | 633 } |
| 1158 | 634 |
| 1159 updateCommand() { | 635 updateCommand() { |
| 1160 test("updates locked Git packages", () { | 636 test("updates locked Git packages", () { |
| 1161 ensureGit(); | 637 ensureGit(); |
| 1162 | 638 |
| 1163 git('foo.git', [ | 639 git('foo.git', [ |
| 1164 file('foo.dart', 'main() => "foo";') | 640 file('foo.dart', 'main() => "foo";') |
| 1165 ]).scheduleCreate(); | 641 ]).scheduleCreate(); |
| 1166 | 642 |
| 1167 git('bar.git', [ | 643 git('bar.git', [ |
| 1168 file('bar.dart', 'main() => "bar";') | 644 file('bar.dart', 'main() => "bar";') |
| 1169 ]).scheduleCreate(); | 645 ]).scheduleCreate(); |
| 1170 | 646 |
| 1171 dir(appPath, [ | 647 appDir([{"git": "../foo.git"}, {"git": "../bar.git"}]).scheduleCreate(); |
| 1172 file('pubspec.yaml', ''' | |
| 1173 dependencies: | |
| 1174 foo: | |
| 1175 git: ../foo.git | |
| 1176 bar: | |
| 1177 git: ../bar.git | |
| 1178 ''') | |
| 1179 ]).scheduleCreate(); | |
| 1180 | 648 |
| 1181 schedulePub(args: ['install'], | 649 schedulePub(args: ['install'], |
| 1182 output: const RegExp(@"Dependencies installed!$")); | 650 output: const RegExp(@"Dependencies installed!$")); |
| 1183 | 651 |
| 1184 dir(packagesPath, [ | 652 dir(packagesPath, [ |
| 1185 dir('foo', [ | 653 dir('foo', [ |
| 1186 file('foo.dart', 'main() => "foo";') | 654 file('foo.dart', 'main() => "foo";') |
| 1187 ]), | 655 ]), |
| 1188 dir('bar', [ | 656 dir('bar', [ |
| 1189 file('bar.dart', 'main() => "bar";') | 657 file('bar.dart', 'main() => "bar";') |
| (...skipping 28 matching lines...) Expand all Loading... |
| 1218 ensureGit(); | 686 ensureGit(); |
| 1219 | 687 |
| 1220 git('foo.git', [ | 688 git('foo.git', [ |
| 1221 file('foo.dart', 'main() => "foo";') | 689 file('foo.dart', 'main() => "foo";') |
| 1222 ]).scheduleCreate(); | 690 ]).scheduleCreate(); |
| 1223 | 691 |
| 1224 git('bar.git', [ | 692 git('bar.git', [ |
| 1225 file('bar.dart', 'main() => "bar";') | 693 file('bar.dart', 'main() => "bar";') |
| 1226 ]).scheduleCreate(); | 694 ]).scheduleCreate(); |
| 1227 | 695 |
| 1228 dir(appPath, [ | 696 appDir([{"git": "../foo.git"}, {"git": "../bar.git"}]).scheduleCreate(); |
| 1229 file('pubspec.yaml', ''' | |
| 1230 dependencies: | |
| 1231 foo: | |
| 1232 git: ../foo.git | |
| 1233 bar: | |
| 1234 git: ../bar.git | |
| 1235 ''') | |
| 1236 ]).scheduleCreate(); | |
| 1237 | 697 |
| 1238 schedulePub(args: ['install'], | 698 schedulePub(args: ['install'], |
| 1239 output: const RegExp(@"Dependencies installed!$")); | 699 output: const RegExp(@"Dependencies installed!$")); |
| 1240 | 700 |
| 1241 dir(packagesPath, [ | 701 dir(packagesPath, [ |
| 1242 dir('foo', [ | 702 dir('foo', [ |
| 1243 file('foo.dart', 'main() => "foo";') | 703 file('foo.dart', 'main() => "foo";') |
| 1244 ]), | 704 ]), |
| 1245 dir('bar', [ | 705 dir('bar', [ |
| 1246 file('bar.dart', 'main() => "bar";') | 706 file('bar.dart', 'main() => "bar";') |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1269 | 729 |
| 1270 run(); | 730 run(); |
| 1271 }); | 731 }); |
| 1272 | 732 |
| 1273 test("doesn't update one locked Git package's dependencies if it's not " | 733 test("doesn't update one locked Git package's dependencies if it's not " |
| 1274 "necessary", () { | 734 "necessary", () { |
| 1275 ensureGit(); | 735 ensureGit(); |
| 1276 | 736 |
| 1277 git('foo.git', [ | 737 git('foo.git', [ |
| 1278 file('foo.dart', 'main() => "foo";'), | 738 file('foo.dart', 'main() => "foo";'), |
| 1279 file('pubspec.yaml', ''' | 739 libPubspec("foo", "1.0.0", [{"git": "../foo-dep.git"}]) |
| 1280 dependencies: | |
| 1281 foo-dep: | |
| 1282 git: ../foo-dep.git | |
| 1283 ''') | |
| 1284 ]).scheduleCreate(); | 740 ]).scheduleCreate(); |
| 1285 | 741 |
| 1286 git('foo-dep.git', [ | 742 git('foo-dep.git', [ |
| 1287 file('foo-dep.dart', 'main() => "foo-dep";') | 743 file('foo-dep.dart', 'main() => "foo-dep";'), |
| 1288 ]).scheduleCreate(); | 744 ]).scheduleCreate(); |
| 1289 | 745 |
| 1290 dir(appPath, [ | 746 appDir([{"git": "../foo.git"}]).scheduleCreate(); |
| 1291 file('pubspec.yaml', ''' | |
| 1292 dependencies: | |
| 1293 foo: | |
| 1294 git: ../foo.git | |
| 1295 ''') | |
| 1296 ]).scheduleCreate(); | |
| 1297 | 747 |
| 1298 schedulePub(args: ['install'], | 748 schedulePub(args: ['install'], |
| 1299 output: const RegExp(@"Dependencies installed!$")); | 749 output: const RegExp(@"Dependencies installed!$")); |
| 1300 | 750 |
| 1301 dir(packagesPath, [ | 751 dir(packagesPath, [ |
| 1302 dir('foo', [ | 752 dir('foo', [ |
| 1303 file('foo.dart', 'main() => "foo";'), | 753 file('foo.dart', 'main() => "foo";'), |
| 1304 file('pubspec.yaml', ''' | 754 libPubspec("foo", "1.0.0", [{"git": "../foo-dep.git"}]) |
| 1305 dependencies: | |
| 1306 foo-dep: | |
| 1307 git: ../foo-dep.git | |
| 1308 ''') | |
| 1309 ]), | 755 ]), |
| 1310 dir('foo-dep', [ | 756 dir('foo-dep', [ |
| 1311 file('foo-dep.dart', 'main() => "foo-dep";') | 757 file('foo-dep.dart', 'main() => "foo-dep";') |
| 1312 ]) | 758 ]) |
| 1313 ]).scheduleValidate(); | 759 ]).scheduleValidate(); |
| 1314 | 760 |
| 1315 git('foo.git', [ | 761 git('foo.git', [ |
| 1316 file('foo.dart', 'main() => "foo 2";'), | 762 file('foo.dart', 'main() => "foo 2";'), |
| 1317 file('pubspec.yaml', ''' | 763 libPubspec("foo", "1.0.0", [{"git": "../foo-dep.git"}]) |
| 1318 dependencies: | |
| 1319 foo-dep: | |
| 1320 git: ../foo-dep.git | |
| 1321 ''') | |
| 1322 ]).scheduleCreate(); | 764 ]).scheduleCreate(); |
| 1323 | 765 |
| 1324 git('foo-dep.git', [ | 766 git('foo-dep.git', [ |
| 1325 file('foo-dep.dart', 'main() => "foo-dep 2";') | 767 file('foo-dep.dart', 'main() => "foo-dep 2";') |
| 1326 ]).scheduleCommit(); | 768 ]).scheduleCommit(); |
| 1327 | 769 |
| 1328 schedulePub(args: ['update', 'foo'], | 770 schedulePub(args: ['update', 'foo'], |
| 1329 output: const RegExp(@"Dependencies updated!$")); | 771 output: const RegExp(@"Dependencies updated!$")); |
| 1330 | 772 |
| 1331 dir(packagesPath, [ | 773 dir(packagesPath, [ |
| 1332 dir('foo', [ | 774 dir('foo', [ |
| 1333 file('foo.dart', 'main() => "foo 2";'), | 775 file('foo.dart', 'main() => "foo 2";'), |
| 1334 file('pubspec.yaml', ''' | 776 libPubspec("foo", "1.0.0", [{"git": "../foo-dep.git"}]) |
| 1335 dependencies: | |
| 1336 foo-dep: | |
| 1337 git: ../foo-dep.git | |
| 1338 ''') | |
| 1339 ]), | 777 ]), |
| 1340 dir('foo-dep', [ | 778 dir('foo-dep', [ |
| 1341 file('foo-dep.dart', 'main() => "foo-dep";') | 779 file('foo-dep.dart', 'main() => "foo-dep";') |
| 1342 ]), | 780 ]), |
| 1343 ]).scheduleValidate(); | 781 ]).scheduleValidate(); |
| 1344 | 782 |
| 1345 run(); | 783 run(); |
| 1346 }); | 784 }); |
| 1347 | 785 |
| 1348 test("updates one locked pub server package's dependencies if it's " | 786 test("updates one locked pub server package's dependencies if it's " |
| 1349 "necessary", () { | 787 "necessary", () { |
| 1350 servePackages("localhost", 3123, [ | 788 servePackages([ |
| 1351 ''' | 789 package("foo", "1.0.0", [dependency("foo-dep")]), |
| 1352 name: foo | 790 package("foo-dep", "1.0.0") |
| 1353 version: 1.0.0 | |
| 1354 dependencies: | |
| 1355 foo-dep: | |
| 1356 repo: | |
| 1357 name: foo-dep | |
| 1358 url: http://localhost:3123 | |
| 1359 ''', | |
| 1360 '{name: foo-dep, version: 1.0.0}' | |
| 1361 ]); | 791 ]); |
| 1362 | 792 |
| 1363 dir(appPath, [ | 793 appDir([dependency("foo")]).scheduleCreate(); |
| 1364 file('pubspec.yaml', ''' | |
| 1365 dependencies: | |
| 1366 foo: | |
| 1367 repo: | |
| 1368 name: foo | |
| 1369 url: http://localhost:3123 | |
| 1370 ''') | |
| 1371 ]).scheduleCreate(); | |
| 1372 | 794 |
| 1373 schedulePub(args: ['install'], | 795 schedulePub(args: ['install'], |
| 1374 output: const RegExp(@"Dependencies installed!$")); | 796 output: const RegExp(@"Dependencies installed!$")); |
| 1375 | 797 |
| 1376 dir(packagesPath, [ | 798 packagesDir({ |
| 1377 dir('foo', [ | 799 "foo": "1.0.0", |
| 1378 file('foo.dart', 'main() => print("foo 1.0.0");'), | 800 "foo-dep": "1.0.0" |
| 1379 file('pubspec.yaml', ''' | 801 }).scheduleValidate(); |
| 1380 name: foo | |
| 1381 version: 1.0.0 | |
| 1382 dependencies: | |
| 1383 foo-dep: | |
| 1384 repo: | |
| 1385 name: foo-dep | |
| 1386 url: http://localhost:3123 | |
| 1387 ''') | |
| 1388 ]), | |
| 1389 dir('foo-dep', [ | |
| 1390 file('foo-dep.dart', 'main() => print("foo-dep 1.0.0");') | |
| 1391 ]) | |
| 1392 ]).scheduleValidate(); | |
| 1393 | 802 |
| 1394 servePackages("localhost", 3123, [ | 803 servePackages([ |
| 1395 ''' | 804 package("foo", "2.0.0", [dependency("foo-dep", ">1.0.0")]), |
| 1396 name: foo | 805 package("foo-dep", "2.0.0") |
| 1397 version: 2.0.0 | |
| 1398 dependencies: | |
| 1399 foo-dep: | |
| 1400 repo: {name: foo-dep, url: http://localhost:3123} | |
| 1401 version: ">1.0.0" | |
| 1402 ''', | |
| 1403 '{name: foo-dep, version: 2.0.0}' | |
| 1404 ]); | 806 ]); |
| 1405 | 807 |
| 1406 schedulePub(args: ['update', 'foo'], | 808 schedulePub(args: ['update', 'foo'], |
| 1407 output: const RegExp(@"Dependencies updated!$")); | 809 output: const RegExp(@"Dependencies updated!$")); |
| 1408 | 810 |
| 1409 dir(packagesPath, [ | 811 packagesDir({ |
| 1410 dir('foo', [ | 812 "foo": "2.0.0", |
| 1411 file('foo.dart', 'main() => print("foo 2.0.0");'), | 813 "foo-dep": "2.0.0" |
| 1412 file('pubspec.yaml', ''' | 814 }).scheduleValidate(); |
| 1413 name: foo | |
| 1414 version: 2.0.0 | |
| 1415 dependencies: | |
| 1416 foo-dep: | |
| 1417 repo: {name: foo-dep, url: http://localhost:3123} | |
| 1418 version: ">1.0.0" | |
| 1419 ''') | |
| 1420 ]), | |
| 1421 dir('foo-dep', [ | |
| 1422 file('foo-dep.dart', 'main() => print("foo-dep 2.0.0");') | |
| 1423 ]) | |
| 1424 ]).scheduleValidate(); | |
| 1425 | 815 |
| 1426 run(); | 816 run(); |
| 1427 }); | 817 }); |
| 1428 | 818 |
| 1429 test("updates a locked package's dependers in order to get it to max " | 819 test("updates a locked package's dependers in order to get it to max " |
| 1430 "version", () { | 820 "version", () { |
| 1431 servePackages("localhost", 3123, [ | 821 servePackages([ |
| 1432 ''' | 822 package("foo", "1.0.0", [dependency("bar", "<2.0.0")]), |
| 1433 name: foo | 823 package("bar", "1.0.0") |
| 1434 version: 1.0.0 | |
| 1435 dependencies: | |
| 1436 bar: | |
| 1437 version: "<2.0.0" | |
| 1438 repo: {name: bar, url: http://localhost:3123} | |
| 1439 ''', | |
| 1440 '{name: bar, version: 1.0.0}' | |
| 1441 ]); | 824 ]); |
| 1442 | 825 |
| 1443 dir(appPath, [ | 826 appDir([dependency("foo"), dependency("bar")]).scheduleCreate(); |
| 1444 file('pubspec.yaml', ''' | |
| 1445 dependencies: | |
| 1446 foo: | |
| 1447 repo: {name: foo, url: http://localhost:3123} | |
| 1448 bar: | |
| 1449 repo: {name: bar, url: http://localhost:3123} | |
| 1450 ''') | |
| 1451 ]).scheduleCreate(); | |
| 1452 | 827 |
| 1453 schedulePub(args: ['install'], | 828 schedulePub(args: ['install'], |
| 1454 output: const RegExp(@"Dependencies installed!$")); | 829 output: const RegExp(@"Dependencies installed!$")); |
| 1455 | 830 |
| 1456 dir(packagesPath, [ | 831 packagesDir({ |
| 1457 dir('foo', [ | 832 "foo": "1.0.0", |
| 1458 file('foo.dart', 'main() => print("foo 1.0.0");'), | 833 "bar": "1.0.0" |
| 1459 ]), | 834 }).scheduleValidate(); |
| 1460 dir('bar', [ | |
| 1461 file('bar.dart', 'main() => print("bar 1.0.0");') | |
| 1462 ]) | |
| 1463 ]).scheduleValidate(); | |
| 1464 | 835 |
| 1465 servePackages("localhost", 3123, [ | 836 servePackages([ |
| 1466 ''' | 837 package("foo", "2.0.0", [dependency("bar", "<3.0.0")]), |
| 1467 name: foo | 838 package("bar", "2.0.0") |
| 1468 version: 1.0.0 | |
| 1469 dependencies: | |
| 1470 bar: | |
| 1471 version: "<2.0.0" | |
| 1472 repo: {name: bar, url: http://localhost:3123} | |
| 1473 ''', | |
| 1474 ''' | |
| 1475 name: foo | |
| 1476 version: 2.0.0 | |
| 1477 dependencies: | |
| 1478 bar: | |
| 1479 version: "<3.0.0" | |
| 1480 repo: {name: bar, url: http://localhost:3123} | |
| 1481 ''', | |
| 1482 '{name: bar, version: 1.0.0}', | |
| 1483 '{name: bar, version: 2.0.0}' | |
| 1484 ]); | 839 ]); |
| 1485 | 840 |
| 1486 schedulePub(args: ['update', 'bar'], | 841 schedulePub(args: ['update', 'bar'], |
| 1487 output: const RegExp(@"Dependencies updated!$")); | 842 output: const RegExp(@"Dependencies updated!$")); |
| 1488 | 843 |
| 1489 dir(packagesPath, [ | 844 packagesDir({ |
| 1490 dir('foo', [ | 845 "foo": "2.0.0", |
| 1491 file('foo.dart', 'main() => print("foo 2.0.0");'), | 846 "bar": "2.0.0" |
| 1492 ]), | 847 }).scheduleValidate(); |
| 1493 dir('bar', [ | |
| 1494 file('bar.dart', 'main() => print("bar 2.0.0");') | |
| 1495 ]) | |
| 1496 ]).scheduleValidate(); | |
| 1497 | 848 |
| 1498 run(); | 849 run(); |
| 1499 }); | 850 }); |
| 1500 }); | 851 }); |
| 1501 } | 852 } |
| 1502 | 853 |
| 1503 versionCommand() { | 854 versionCommand() { |
| 1504 test('displays the current version', () => | 855 test('displays the current version', () => |
| 1505 runPub(args: ['version'], output: VERSION_STRING)); | 856 runPub(args: ['version'], output: VERSION_STRING)); |
| 1506 } | 857 } |
| OLD | NEW |