| 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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 }); | 262 }); |
| 263 | 263 |
| 264 _requiresPubGet('The pubspec.lock file has changed since the .packages ' | 264 _requiresPubGet('The pubspec.lock file has changed since the .packages ' |
| 265 'file was generated, please run "pub get" again.'); | 265 'file was generated, please run "pub get" again.'); |
| 266 }); | 266 }); |
| 267 | 267 |
| 268 group("the lock file's SDK constraint doesn't match the current SDK", () { | 268 group("the lock file's SDK constraint doesn't match the current SDK", () { |
| 269 setUp(() { | 269 setUp(() { |
| 270 // Avoid using a path dependency because it triggers the full validation | 270 // Avoid using a path dependency because it triggers the full validation |
| 271 // logic. We want to be sure SDK-validation works without that logic. | 271 // logic. We want to be sure SDK-validation works without that logic. |
| 272 servePackages((builder) { | 272 globalPackageServer.add((builder) { |
| 273 builder.serve("foo", "3.0.0", pubspec: { | 273 builder.serve("foo", "3.0.0", pubspec: { |
| 274 "environment": {"sdk": ">=1.0.0 <2.0.0"} | 274 "environment": {"sdk": ">=1.0.0 <2.0.0"} |
| 275 }); | 275 }); |
| 276 }); | 276 }); |
| 277 | 277 |
| 278 d.dir(appPath, [ | 278 d.dir(appPath, [ |
| 279 d.appPubspec({"foo": "3.0.0"}) | 279 d.appPubspec({"foo": "3.0.0"}) |
| 280 ]).create(); | 280 ]).create(); |
| 281 | 281 |
| 282 pubGet(environment: {"_PUB_TEST_SDK_VERSION": "1.2.3+4"}); | 282 pubGet(environment: {"_PUB_TEST_SDK_VERSION": "1.2.3+4"}); |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 void _touch(String path) { | 412 void _touch(String path) { |
| 413 schedule(() async { | 413 schedule(() async { |
| 414 // Delay a bit to make sure the modification times are noticeably different. | 414 // Delay a bit to make sure the modification times are noticeably different. |
| 415 // 1s seems to be the finest granularity that dart:io reports. | 415 // 1s seems to be the finest granularity that dart:io reports. |
| 416 await new Future.delayed(new Duration(seconds: 1)); | 416 await new Future.delayed(new Duration(seconds: 1)); |
| 417 | 417 |
| 418 path = p.join(sandboxDir, "myapp", path); | 418 path = p.join(sandboxDir, "myapp", path); |
| 419 touch(path); | 419 touch(path); |
| 420 }, "touching $path"); | 420 }, "touching $path"); |
| 421 } | 421 } |
| OLD | NEW |