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

Side by Side Diff: test/implicit_dependency_test.dart

Issue 2184303002: Make pub strong-mode clean. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Code review changes Created 4 years, 4 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
« no previous file with comments | « test/implicit_barback_dependency_test.dart ('k') | test/package_server.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/src/barback.dart' as barback; 5 import 'package:pub/src/barback.dart' as barback;
6 import 'package:pub_semver/pub_semver.dart'; 6 import 'package:pub_semver/pub_semver.dart';
7 7
8 import 'descriptor.dart' as d; 8 import 'descriptor.dart' as d;
9 import 'test_pub.dart'; 9 import 'test_pub.dart';
10 10
11 main() { 11 main() {
12 forBothPubGetAndUpgrade((command) { 12 forBothPubGetAndUpgrade((command) {
13 integration("implicitly constrains it to versions pub supports", () { 13 integration("implicitly constrains it to versions pub supports", () {
14 servePackages((builder) { 14 servePackages((builder) {
15 builder.serve("barback", current("barback")); 15 builder.serve("barback", current("barback"));
16 builder.serve("stack_trace", previous("stack_trace")); 16 builder.serve("stack_trace", previous("stack_trace"));
17 builder.serve("stack_trace", current("stack_trace")); 17 builder.serve("stack_trace", current("stack_trace"));
18 builder.serve("stack_trace", nextPatch("stack_trace")); 18 builder.serve("stack_trace", nextPatch("stack_trace"));
19 builder.serve("stack_trace", max("stack_trace")); 19 builder.serve("stack_trace", max("stack_trace"));
20 builder.serve("source_span", current("source_span")); 20 builder.serve("source_span", current("source_span"));
21 builder.serve("async", current("async"));
21 }); 22 });
22 23
23 d.appDir({ 24 d.appDir({
24 "barback": "any" 25 "barback": "any"
25 }).create(); 26 }).create();
26 27
27 pubCommand(command); 28 pubCommand(command);
28 29
29 d.packagesDir({"stack_trace": nextPatch("stack_trace")}).validate(); 30 d.packagesDir({"stack_trace": nextPatch("stack_trace")}).validate();
30 }); 31 });
31 32
32 integration("pub's implicit constraint uses the same source and " 33 integration("pub's implicit constraint uses the same source and "
33 "description as a dependency override", () { 34 "description as a dependency override", () {
34 servePackages((builder) { 35 servePackages((builder) {
35 builder.serve("barback", current("barback")); 36 builder.serve("barback", current("barback"));
36 builder.serve("stack_trace", nextPatch("stack_trace")); 37 builder.serve("stack_trace", nextPatch("stack_trace"));
37 builder.serve("source_span", current("source_span")); 38 builder.serve("source_span", current("source_span"));
39 builder.serve("async", current("async"));
38 }); 40 });
39 41
40 d.dir("stack_trace", [ 42 d.dir("stack_trace", [
41 d.libDir("stack_trace", 'stack_trace ${current("stack_trace")}'), 43 d.libDir("stack_trace", 'stack_trace ${current("stack_trace")}'),
42 d.libPubspec("stack_trace", current("stack_trace")) 44 d.libPubspec("stack_trace", current("stack_trace"))
43 ]).create(); 45 ]).create();
44 46
45 d.dir(appPath, [ 47 d.dir(appPath, [
46 d.pubspec({ 48 d.pubspec({
47 "name": "myapp", 49 "name": "myapp",
(...skipping 14 matching lines...) Expand all
62 }); 64 });
63 65
64 integration("doesn't add a constraint if barback isn't in the package " 66 integration("doesn't add a constraint if barback isn't in the package "
65 "graph", () { 67 "graph", () {
66 servePackages((builder) { 68 servePackages((builder) {
67 builder.serve("stack_trace", previous("stack_trace")); 69 builder.serve("stack_trace", previous("stack_trace"));
68 builder.serve("stack_trace", current("stack_trace")); 70 builder.serve("stack_trace", current("stack_trace"));
69 builder.serve("stack_trace", nextPatch("stack_trace")); 71 builder.serve("stack_trace", nextPatch("stack_trace"));
70 builder.serve("stack_trace", max("stack_trace")); 72 builder.serve("stack_trace", max("stack_trace"));
71 builder.serve("source_span", current("source_span")); 73 builder.serve("source_span", current("source_span"));
74 builder.serve("async", current("async"));
72 }); 75 });
73 76
74 d.appDir({ 77 d.appDir({
75 "stack_trace": "any" 78 "stack_trace": "any"
76 }).create(); 79 }).create();
77 80
78 pubCommand(command); 81 pubCommand(command);
79 82
80 d.packagesDir({"stack_trace": max("stack_trace")}).validate(); 83 d.packagesDir({"stack_trace": max("stack_trace")}).validate();
81 }); 84 });
82 }); 85 });
83 86
84 integration("unlocks if the locked version doesn't meet pub's " 87 integration("unlocks if the locked version doesn't meet pub's "
85 "constraint", () { 88 "constraint", () {
86 servePackages((builder) { 89 servePackages((builder) {
87 builder.serve("barback", current("barback")); 90 builder.serve("barback", current("barback"));
88 builder.serve("stack_trace", previous("stack_trace")); 91 builder.serve("stack_trace", previous("stack_trace"));
89 builder.serve("stack_trace", current("stack_trace")); 92 builder.serve("stack_trace", current("stack_trace"));
90 builder.serve("source_span", current("source_span")); 93 builder.serve("source_span", current("source_span"));
94 builder.serve("async", current("async"));
91 }); 95 });
92 96
93 d.appDir({"barback": "any"}).create(); 97 d.appDir({"barback": "any"}).create();
94 98
95 // Hand-create a lockfile to pin the package to an older version. 99 // Hand-create a lockfile to pin the package to an older version.
96 createLockFile("myapp", hosted: { 100 createLockFile("myapp", hosted: {
97 "barback": current("barback"), 101 "barback": current("barback"),
98 "stack_trace": previous("stack_trace") 102 "stack_trace": previous("stack_trace")
99 }); 103 });
100 104
(...skipping 13 matching lines...) Expand all
114 var constraint = barback.pubConstraints[packageName]; 118 var constraint = barback.pubConstraints[packageName];
115 return new Version(constraint.min.major, constraint.min.minor - 1, 0) 119 return new Version(constraint.min.major, constraint.min.minor - 1, 0)
116 .toString(); 120 .toString();
117 } 121 }
118 122
119 String nextPatch(String packageName) => 123 String nextPatch(String packageName) =>
120 barback.pubConstraints[packageName].min.nextPatch.toString(); 124 barback.pubConstraints[packageName].min.nextPatch.toString();
121 125
122 String max(String packageName) => 126 String max(String packageName) =>
123 barback.pubConstraints[packageName].max.toString(); 127 barback.pubConstraints[packageName].max.toString();
OLDNEW
« no previous file with comments | « test/implicit_barback_dependency_test.dart ('k') | test/package_server.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698