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

Unified Diff: sdk/lib/_internal/pub/test/implicit_barback_dependency_test.dart

Issue 105473002: Implicitly constrain barback to versions pub supports. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise. Created 7 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/version.dart ('k') | sdk/lib/_internal/pub/test/test_pub.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/test/implicit_barback_dependency_test.dart
diff --git a/sdk/lib/_internal/pub/test/implicit_barback_dependency_test.dart b/sdk/lib/_internal/pub/test/implicit_barback_dependency_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..02f23630c71cbab722aa7d31dd6ec96c380a547a
--- /dev/null
+++ b/sdk/lib/_internal/pub/test/implicit_barback_dependency_test.dart
@@ -0,0 +1,84 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'descriptor.dart' as d;
+import 'test_pub.dart';
+import '../lib/src/barback.dart' as barback;
+import '../lib/src/version.dart';
+
+main() {
+ initConfig();
+
+ var previousVersion = new Version(
+ barback.supportedVersion.major, barback.supportedVersion.minor - 1, 0);
+
+ forBothPubGetAndUpgrade((command) {
+ integration("implicitly constrains barback to versions pub supports", () {
+ servePackages([
+ packageMap("barback", previousVersion.toString()),
+ packageMap("barback", barback.supportedVersion.toString()),
+ packageMap("barback", barback.supportedVersion.nextPatch.toString()),
+ packageMap("barback", barback.supportedVersion.nextMinor.toString())
+ ]);
+
+ d.appDir({
+ "barback": "any"
+ }).create();
+
+ pubCommand(command);
+
+ d.packagesDir({
+ "barback": barback.supportedVersion.nextPatch.toString()
+ }).validate();
+ });
+
+ integration("discovers transitive dependency on barback", () {
+ servePackages([
+ packageMap("barback", previousVersion.toString()),
+ packageMap("barback", barback.supportedVersion.toString()),
+ packageMap("barback", barback.supportedVersion.nextPatch.toString()),
+ packageMap("barback", barback.supportedVersion.nextMinor.toString())
+ ]);
+
+ d.dir("foo", [
+ d.libDir("foo", "foo 0.0.1"),
+ d.libPubspec("foo", "0.0.1", deps: {
+ "barback": "any"
+ })
+ ]).create();
+
+ d.appDir({
+ "foo": {"path": "../foo"}
+ }).create();
+
+ pubCommand(command);
+
+ d.packagesDir({
+ "barback": barback.supportedVersion.nextPatch.toString(),
+ "foo": "0.0.1"
+ }).validate();
+ });
+ });
+
+ integration("unlock if the locked version doesn't meet pub's constraint", () {
+ servePackages([
+ packageMap("barback", previousVersion.toString()),
+ packageMap("barback", barback.supportedVersion.toString())
+ ]);
+
+ d.appDir({"barback": "any"}).create();
+
+ // Hand-create a lockfile to pin barback to an older version.
+ createLockFile("myapp", hosted: {
+ "barback": previousVersion.toString()
+ });
+
+ pubGet();
+
+ // It should be upgraded.
+ d.packagesDir({
+ "barback": barback.supportedVersion.toString()
+ }).validate();
+ });
+}
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/version.dart ('k') | sdk/lib/_internal/pub/test/test_pub.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698