| 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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 d.appPubspec({"foo": "1.0.0"}) | 345 d.appPubspec({"foo": "1.0.0"}) |
| 346 ]).create(); | 346 ]).create(); |
| 347 | 347 |
| 348 pubGet(); | 348 pubGet(); |
| 349 | 349 |
| 350 _touch("pubspec.lock"); | 350 _touch("pubspec.lock"); |
| 351 }); | 351 }); |
| 352 | 352 |
| 353 _runsSuccessfully(); | 353 _runsSuccessfully(); |
| 354 }); | 354 }); |
| 355 |
| 356 group("an overridden dependency's SDK constraint is unmatched", () { |
| 357 setUp(() { |
| 358 globalPackageServer.add((builder) { |
| 359 builder.serve("bar", "1.0.0", pubspec: { |
| 360 "environment": {"sdk": "0.0.0-fake"} |
| 361 }); |
| 362 }); |
| 363 |
| 364 d.dir(appPath, [ |
| 365 d.pubspec({ |
| 366 "name": "myapp", |
| 367 "dependency_overrides": {"bar": "1.0.0"} |
| 368 }) |
| 369 ]).create(); |
| 370 |
| 371 pubGet(); |
| 372 |
| 373 _touch("pubspec.lock"); |
| 374 }); |
| 375 |
| 376 _runsSuccessfully(); |
| 377 }); |
| 355 }); | 378 }); |
| 356 } | 379 } |
| 357 | 380 |
| 358 /// Runs every command that care about the world being up-to-date, and asserts | 381 /// Runs every command that care about the world being up-to-date, and asserts |
| 359 /// that it prints [message] as part of its error. | 382 /// that it prints [message] as part of its error. |
| 360 void _requiresPubGet(String message) { | 383 void _requiresPubGet(String message) { |
| 361 for (var command in ["build", "serve", "run", "deps"]) { | 384 for (var command in ["build", "serve", "run", "deps"]) { |
| 362 integration("for pub $command", () { | 385 integration("for pub $command", () { |
| 363 var args = [command]; | 386 var args = [command]; |
| 364 if (command == "run") args.add("script"); | 387 if (command == "run") args.add("script"); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 void _touch(String path) { | 439 void _touch(String path) { |
| 417 schedule(() async { | 440 schedule(() async { |
| 418 // Delay a bit to make sure the modification times are noticeably different. | 441 // Delay a bit to make sure the modification times are noticeably different. |
| 419 // 1s seems to be the finest granularity that dart:io reports. | 442 // 1s seems to be the finest granularity that dart:io reports. |
| 420 await new Future.delayed(new Duration(seconds: 1)); | 443 await new Future.delayed(new Duration(seconds: 1)); |
| 421 | 444 |
| 422 path = p.join(sandboxDir, "myapp", path); | 445 path = p.join(sandboxDir, "myapp", path); |
| 423 touch(path); | 446 touch(path); |
| 424 }, "touching $path"); | 447 }, "touching $path"); |
| 425 } | 448 } |
| OLD | NEW |