| Index: sdk/lib/_internal/pub/test/get/hosted/does_no_network_requests_when_possible_test.dart
|
| diff --git a/sdk/lib/_internal/pub/test/get/hosted/cached_pubspec_test.dart b/sdk/lib/_internal/pub/test/get/hosted/does_no_network_requests_when_possible_test.dart
|
| similarity index 58%
|
| copy from sdk/lib/_internal/pub/test/get/hosted/cached_pubspec_test.dart
|
| copy to sdk/lib/_internal/pub/test/get/hosted/does_no_network_requests_when_possible_test.dart
|
| index 3024336930cdfb591243deb9c1d25ef57c564b72..44532fd01b92c00beac6bcacbcd811737f8a6356 100644
|
| --- a/sdk/lib/_internal/pub/test/get/hosted/cached_pubspec_test.dart
|
| +++ b/sdk/lib/_internal/pub/test/get/hosted/does_no_network_requests_when_possible_test.dart
|
| @@ -12,10 +12,16 @@ import '../../test_pub.dart';
|
| main() {
|
| initConfig();
|
|
|
| - integration('does not request a pubspec for a cached package', () {
|
| - servePackages([packageMap("foo", "1.2.3")]);
|
| + integration('does not request versions if the lockfile is up to date', () {
|
| + servePackages([
|
| + packageMap("foo", "1.0.0"),
|
| + packageMap("foo", "1.1.0"),
|
| + packageMap("foo", "1.2.0")
|
| + ]);
|
|
|
| - d.appDir({"foo": "1.2.3"}).create();
|
| + d.appDir({
|
| + "foo": "any"
|
| + }).create();
|
|
|
| // Get once so it gets cached.
|
| pubGet();
|
| @@ -24,15 +30,16 @@ main() {
|
| // the initial get.
|
| getRequestedPaths();
|
|
|
| - d.cacheDir({"foo": "1.2.3"}).validate();
|
| - d.packagesDir({"foo": "1.2.3"}).validate();
|
| -
|
| // Run the solver again now that it's cached.
|
| pubGet();
|
|
|
| - // The get should not have requested the pubspec since it's local already.
|
| + d.cacheDir({"foo": "1.2.0"}).validate();
|
| + d.packagesDir({"foo": "1.2.0"}).validate();
|
| +
|
| + // The get should not have done any network requests since the lock file is
|
| + // up to date.
|
| getRequestedPaths().then((paths) {
|
| - expect(paths, isNot(contains("packages/foo/versions/1.2.3.yaml")));
|
| + expect(paths, isEmpty);
|
| });
|
| });
|
| }
|
|
|