OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 import 'dart:async'; | 5 import 'dart:async'; |
6 import 'dart:io'; | 6 import 'dart:io'; |
7 | 7 |
8 import 'package:path/path.dart' as p; | 8 import 'package:path/path.dart' as p; |
9 import 'package:pub/src/exit_codes.dart' as exit_codes; | 9 import 'package:pub/src/exit_codes.dart' as exit_codes; |
10 import 'package:pub/src/io.dart'; | 10 import 'package:pub/src/io.dart'; |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 ]).create(); | 332 ]).create(); |
333 | 333 |
334 pubGet(); | 334 pubGet(); |
335 | 335 |
336 _touch("pubspec.yaml"); | 336 _touch("pubspec.yaml"); |
337 }); | 337 }); |
338 | 338 |
339 _runsSuccessfully(); | 339 _runsSuccessfully(); |
340 }); | 340 }); |
341 | 341 |
| 342 // Regression test for #1416 |
| 343 group("a path dependency has a dependency on the root package", () { |
| 344 setUp(() { |
| 345 d.dir("foo", [ |
| 346 d.libPubspec("foo", "1.0.0", deps: {"myapp": "any"}) |
| 347 ]).create(); |
| 348 |
| 349 d.dir(appPath, [ |
| 350 d.appPubspec({"foo": {"path": "../foo"}}) |
| 351 ]).create(); |
| 352 |
| 353 pubGet(); |
| 354 |
| 355 _touch("pubspec.lock"); |
| 356 }); |
| 357 |
| 358 _runsSuccessfully(); |
| 359 }); |
| 360 |
342 group("the lockfile is newer than .packages, but they're up-to-date", () { | 361 group("the lockfile is newer than .packages, but they're up-to-date", () { |
343 setUp(() { | 362 setUp(() { |
344 d.dir(appPath, [ | 363 d.dir(appPath, [ |
345 d.appPubspec({"foo": "1.0.0"}) | 364 d.appPubspec({"foo": "1.0.0"}) |
346 ]).create(); | 365 ]).create(); |
347 | 366 |
348 pubGet(); | 367 pubGet(); |
349 | 368 |
350 _touch("pubspec.lock"); | 369 _touch("pubspec.lock"); |
351 }); | 370 }); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 void _touch(String path) { | 458 void _touch(String path) { |
440 schedule(() async { | 459 schedule(() async { |
441 // Delay a bit to make sure the modification times are noticeably different. | 460 // Delay a bit to make sure the modification times are noticeably different. |
442 // 1s seems to be the finest granularity that dart:io reports. | 461 // 1s seems to be the finest granularity that dart:io reports. |
443 await new Future.delayed(new Duration(seconds: 1)); | 462 await new Future.delayed(new Duration(seconds: 1)); |
444 | 463 |
445 path = p.join(sandboxDir, "myapp", path); | 464 path = p.join(sandboxDir, "myapp", path); |
446 touch(path); | 465 touch(path); |
447 }, "touching $path"); | 466 }, "touching $path"); |
448 } | 467 } |
OLD | NEW |