Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Side by Side Diff: sdk/lib/_internal/pub_generated/test/get/hosted/avoid_network_requests_test.dart

Issue 896623005: Use native async/await support in pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 library pub_tests;
6
7 import 'package:scheduled_test/scheduled_test.dart';
8
9 import '../../descriptor.dart' as d;
10 import '../../test_pub.dart';
11
12 main() {
13 initConfig();
14
15 integration('only requests versions that are needed during solving', () {
16 servePackages((builder) {
17 builder.serve("foo", "1.0.0");
18 builder.serve("foo", "1.1.0");
19 builder.serve("foo", "1.2.0");
20 builder.serve("bar", "1.0.0");
21 builder.serve("bar", "1.1.0");
22 builder.serve("bar", "1.2.0");
23 });
24
25 d.appDir({
26 "foo": "any"
27 }).create();
28
29 // Get once so it gets cached.
30 pubGet();
31
32 // Clear the cache. We don't care about anything that was served during
33 // the initial get.
34 getRequestedPaths();
35
36 // Add "bar" to the dependencies.
37 d.appDir({
38 "foo": "any",
39 "bar": "any"
40 }).create();
41
42 // Run the solver again.
43 pubGet();
44
45 d.packagesDir({
46 "foo": "1.2.0",
47 "bar": "1.2.0"
48 }).validate();
49
50 // The get should not have done any network requests since the lock file is
51 // up to date.
52 getRequestedPaths().then((paths) {
53 expect(
54 paths,
55 unorderedEquals([// Bar should be requested because it's new, but not foo.
56 "api/packages/bar", // Should only request the most recent version.
57 "api/packages/bar/versions/1.2.0", // Need to download it.
58 "packages/bar/versions/1.2.0.tar.gz"]));
59 });
60 });
61 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698