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

Side by Side Diff: sdk/lib/_internal/pub/test/downgrade/downgrades_dependency_test.dart

Issue 365993007: Support "pub downgrade". (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 5 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) 2014, 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 integration("downgrades a dependency to the lowest matching version", () {
15 servePackages([
16 packageMap("foo", "1.0.0"),
17 packageMap("foo", "2.0.0-dev"),
18 packageMap("foo", "2.0.0"),
19 packageMap("foo", "2.1.0"),
20 ]);
21
22 d.appDir({"foo": ">=2.0.0 <3.0.0"}).create();
23
24 pubGet();
25
26 d.packagesDir({
27 "foo": "2.1.0",
28 }).validate();
29
30 pubDowngrade();
31
32 // 1.0.0 shouldn't be chosen because it's outside the version constraint and
33 // 2.0.0-dev shouldn't be chosen because release versions should be
34 // preferred.
35 d.packagesDir({
36 "foo": "2.0.0",
37 }).validate();
38
39 // The lockfile should be updated.
40 d.dir(appPath, [
41 d.matcherFile("pubspec.lock", contains("2.0.0"))
42 ]).validate();
43 });
44 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698