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

Side by Side Diff: sdk/lib/_internal/pub_generated/test/implicit_barback_dependency_test.dart

Issue 887223007: Revert "Use native async/await support in pub." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 'package:pub_semver/pub_semver.dart'; 5 import 'package:pub_semver/pub_semver.dart';
6 6
7 import 'descriptor.dart' as d; 7 import 'descriptor.dart' as d;
8 import 'test_pub.dart'; 8 import 'test_pub.dart';
9 import '../lib/src/barback.dart' as barback; 9 import '../lib/src/barback.dart' as barback;
10 10
11 main() { 11 main() {
12 initConfig(); 12 initConfig();
13 13
14 var constraint = barback.pubConstraints["barback"]; 14 var constraint = barback.pubConstraints["barback"];
15 var current = constraint.min.toString(); 15 var current = constraint.min.toString();
16 var previous = new Version(constraint.min.major, constraint.min.minor - 1, 0) 16 var previous =
17 .toString(); 17 new Version(constraint.min.major, constraint.min.minor - 1, 0).toString();
18 var nextPatch = constraint.min.nextPatch.toString(); 18 var nextPatch = constraint.min.nextPatch.toString();
19 var max = constraint.max.toString(); 19 var max = constraint.max.toString();
20 20
21 var sourceSpanVersion = barback.pubConstraints["source_span"].min.toString(); 21 var sourceSpanVersion = barback.pubConstraints["source_span"].min.toString();
22 var stackTraceVersion = barback.pubConstraints["stack_trace"].min.toString(); 22 var stackTraceVersion = barback.pubConstraints["stack_trace"].min.toString();
23 23
24 forBothPubGetAndUpgrade((command) { 24 forBothPubGetAndUpgrade((command) {
25 integration("implicitly constrains barback to versions pub supports", () { 25 integration("implicitly constrains barback to versions pub supports", () {
26 servePackages((builder) { 26 servePackages((builder) {
27 builder.serve("barback", previous); 27 builder.serve("barback", previous);
(...skipping 18 matching lines...) Expand all
46 integration("discovers transitive dependency on barback", () { 46 integration("discovers transitive dependency on barback", () {
47 servePackages((builder) { 47 servePackages((builder) {
48 builder.serve("barback", previous); 48 builder.serve("barback", previous);
49 builder.serve("barback", current); 49 builder.serve("barback", current);
50 builder.serve("barback", nextPatch); 50 builder.serve("barback", nextPatch);
51 builder.serve("barback", max); 51 builder.serve("barback", max);
52 builder.serve("source_span", sourceSpanVersion); 52 builder.serve("source_span", sourceSpanVersion);
53 builder.serve("stack_trace", stackTraceVersion); 53 builder.serve("stack_trace", stackTraceVersion);
54 }); 54 });
55 55
56 d.dir("foo", [ 56 d.dir(
57 d.libDir("foo", "foo 0.0.1"), 57 "foo",
58 d.libPubspec("foo", "0.0.1", deps: { 58 [d.libDir("foo", "foo 0.0.1"), d.libPubspec("foo", "0.0.1", deps: {
59 "barback": "any" 59 "barback": "any"
60 }) 60 })]).create();
61 ]).create();
62 61
63 d.appDir({ 62 d.appDir({
64 "foo": {"path": "../foo"} 63 "foo": {
64 "path": "../foo"
65 }
65 }).create(); 66 }).create();
66 67
67 pubCommand(command); 68 pubCommand(command);
68 69
69 d.packagesDir({ 70 d.packagesDir({
70 "barback": nextPatch, 71 "barback": nextPatch,
71 "foo": "0.0.1" 72 "foo": "0.0.1"
72 }).validate(); 73 }).validate();
73 }); 74 });
74 75
75 integration("pub's implicit constraint uses the same source and " 76 integration(
76 "description as a dependency override", () { 77 "pub's implicit constraint uses the same source and "
78 "description as a dependency override",
79 () {
77 servePackages((builder) { 80 servePackages((builder) {
78 builder.serve("source_span", sourceSpanVersion); 81 builder.serve("source_span", sourceSpanVersion);
79 builder.serve("stack_trace", stackTraceVersion); 82 builder.serve("stack_trace", stackTraceVersion);
80 }); 83 });
81 84
82 d.dir('barback', [ 85 d.dir(
83 d.libDir('barback', 'barback $current'), 86 'barback',
84 d.libPubspec('barback', current), 87 [
85 ]).create(); 88 d.libDir('barback', 'barback $current'),
89 d.libPubspec('barback', current),]).create();
86 90
87 d.dir(appPath, [ 91 d.dir(appPath, [d.pubspec({
88 d.pubspec({
89 "name": "myapp", 92 "name": "myapp",
90 "dependency_overrides": { 93 "dependency_overrides": {
91 "barback": {"path": "../barback"} 94 "barback": {
95 "path": "../barback"
96 }
92 } 97 }
93 }) 98 })]).create();
94 ]).create();
95 99
96 pubCommand(command); 100 pubCommand(command);
97 101
98 d.packagesDir({ 102 d.packagesDir({
99 "barback": current 103 "barback": current
100 }).validate(); 104 }).validate();
101 }); 105 });
102 }); 106 });
103 107
104 integration("unlock if the locked version doesn't meet pub's constraint", () { 108 integration("unlock if the locked version doesn't meet pub's constraint", () {
105 servePackages((builder) { 109 servePackages((builder) {
106 builder.serve("barback", previous); 110 builder.serve("barback", previous);
107 builder.serve("barback", current); 111 builder.serve("barback", current);
108 builder.serve("source_span", sourceSpanVersion); 112 builder.serve("source_span", sourceSpanVersion);
109 builder.serve("stack_trace", stackTraceVersion); 113 builder.serve("stack_trace", stackTraceVersion);
110 }); 114 });
111 115
112 d.appDir({"barback": "any"}).create(); 116 d.appDir({
117 "barback": "any"
118 }).create();
113 119
114 // Hand-create a lockfile to pin barback to an older version. 120 // Hand-create a lockfile to pin barback to an older version.
115 createLockFile("myapp", hosted: { 121 createLockFile("myapp", hosted: {
116 "barback": previous 122 "barback": previous
117 }); 123 });
118 124
119 pubGet(); 125 pubGet();
120 126
121 // It should be upgraded. 127 // It should be upgraded.
122 d.packagesDir({ 128 d.packagesDir({
123 "barback": current 129 "barback": current
124 }).validate(); 130 }).validate();
125 }); 131 });
126 132
127 integration("includes pub in the error if a solve failed because there " 133 integration(
128 "is no version available", () { 134 "includes pub in the error if a solve failed because there "
135 "is no version available",
136 () {
129 servePackages((builder) { 137 servePackages((builder) {
130 builder.serve("barback", previous); 138 builder.serve("barback", previous);
131 builder.serve("source_span", sourceSpanVersion); 139 builder.serve("source_span", sourceSpanVersion);
132 builder.serve("stack_trace", stackTraceVersion); 140 builder.serve("stack_trace", stackTraceVersion);
133 }); 141 });
134 142
135 d.appDir({"barback": "any"}).create(); 143 d.appDir({
144 "barback": "any"
145 }).create();
136 146
137 pubGet(error: """ 147 pubGet(error: """
138 Package barback 0.12.0 does not match >=$current <$max derived from: 148 Package barback 0.12.0 does not match >=$current <$max derived from:
139 - myapp 0.0.0 depends on version any 149 - myapp 0.0.0 depends on version any
140 - pub itself depends on version >=$current <$max"""); 150 - pub itself depends on version >=$current <$max""");
141 }); 151 });
142 152
143 integration("includes pub in the error if a solve failed because there " 153 integration(
144 "is a disjoint constraint", () { 154 "includes pub in the error if a solve failed because there "
155 "is a disjoint constraint",
156 () {
145 servePackages((builder) { 157 servePackages((builder) {
146 builder.serve("barback", previous); 158 builder.serve("barback", previous);
147 builder.serve("barback", current); 159 builder.serve("barback", current);
148 builder.serve("source_span", sourceSpanVersion); 160 builder.serve("source_span", sourceSpanVersion);
149 builder.serve("stack_trace", stackTraceVersion); 161 builder.serve("stack_trace", stackTraceVersion);
150 }); 162 });
151 163
152 d.appDir({"barback": previous}).create(); 164 d.appDir({
165 "barback": previous
166 }).create();
153 167
154 pubGet(error: """ 168 pubGet(error: """
155 Incompatible version constraints on barback: 169 Incompatible version constraints on barback:
156 - myapp 0.0.0 depends on version $previous 170 - myapp 0.0.0 depends on version $previous
157 - pub itself depends on version >=$current <$max"""); 171 - pub itself depends on version >=$current <$max""");
158 }); 172 });
159 } 173 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698