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

Side by Side Diff: test/dependency_override_test.dart

Issue 2377063002: Make "--no-packages-dir" the default. (Closed)
Patch Set: Revise again. Created 4 years, 2 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 | « lib/src/command/upgrade.dart ('k') | test/descriptor.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:path/path.dart' as path; 5 import 'package:path/path.dart' as path;
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 9
10 main() { 10 main() {
(...skipping 12 matching lines...) Expand all
23 "foo": ">2.0.0" 23 "foo": ">2.0.0"
24 }, 24 },
25 "dependency_overrides": { 25 "dependency_overrides": {
26 "foo": "<3.0.0" 26 "foo": "<3.0.0"
27 } 27 }
28 }) 28 })
29 ]).create(); 29 ]).create();
30 30
31 pubCommand(command); 31 pubCommand(command);
32 32
33 d.packagesDir({ 33 d.appPackagesFile({
34 "foo": "2.0.0" 34 "foo": "2.0.0"
35 }).validate(); 35 }).validate();
36 }); 36 });
37 37
38 integration("treats override as implicit dependency", () { 38 integration("treats override as implicit dependency", () {
39 servePackages((builder) { 39 servePackages((builder) {
40 builder.serve("foo", "1.0.0"); 40 builder.serve("foo", "1.0.0");
41 }); 41 });
42 42
43 d.dir(appPath, [ 43 d.dir(appPath, [
44 d.pubspec({ 44 d.pubspec({
45 "name": "myapp", 45 "name": "myapp",
46 "dependency_overrides": { 46 "dependency_overrides": {
47 "foo": "any" 47 "foo": "any"
48 } 48 }
49 }) 49 })
50 ]).create(); 50 ]).create();
51 51
52 pubCommand(command); 52 pubCommand(command);
53 53
54 d.packagesDir({ 54 d.appPackagesFile({
55 "foo": "1.0.0" 55 "foo": "1.0.0"
56 }).validate(); 56 }).validate();
57 }); 57 });
58 58
59 integration("ignores other constraints on overridden package", () { 59 integration("ignores other constraints on overridden package", () {
60 servePackages((builder) { 60 servePackages((builder) {
61 builder.serve("foo", "1.0.0"); 61 builder.serve("foo", "1.0.0");
62 builder.serve("foo", "2.0.0"); 62 builder.serve("foo", "2.0.0");
63 builder.serve("foo", "3.0.0"); 63 builder.serve("foo", "3.0.0");
64 builder.serve("bar", "1.0.0", pubspec: { 64 builder.serve("bar", "1.0.0", pubspec: {
65 "dependencies": {"foo": "5.0.0-nonexistent"} 65 "dependencies": {"foo": "5.0.0-nonexistent"}
66 }); 66 });
67 }); 67 });
68 68
69 d.dir(appPath, [ 69 d.dir(appPath, [
70 d.pubspec({ 70 d.pubspec({
71 "name": "myapp", 71 "name": "myapp",
72 "dependencies": { 72 "dependencies": {
73 "bar": "any" 73 "bar": "any"
74 }, 74 },
75 "dependency_overrides": { 75 "dependency_overrides": {
76 "foo": "<3.0.0" 76 "foo": "<3.0.0"
77 } 77 }
78 }) 78 })
79 ]).create(); 79 ]).create();
80 80
81 pubCommand(command); 81 pubCommand(command);
82 82
83 d.packagesDir({ 83 d.appPackagesFile({
84 "foo": "2.0.0", 84 "foo": "2.0.0",
85 "bar": "1.0.0" 85 "bar": "1.0.0"
86 }).validate(); 86 }).validate();
87 }); 87 });
88 88
89 integration("ignores SDK constraints", () { 89 integration("ignores SDK constraints", () {
90 servePackages((builder) { 90 servePackages((builder) {
91 builder.serve("foo", "1.0.0", pubspec: { 91 builder.serve("foo", "1.0.0", pubspec: {
92 "environment": { 92 "environment": {
93 "sdk": "5.6.7-fblthp" 93 "sdk": "5.6.7-fblthp"
94 } 94 }
95 }); 95 });
96 }); 96 });
97 97
98 d.dir(appPath, [ 98 d.dir(appPath, [
99 d.pubspec({ 99 d.pubspec({
100 "name": "myapp", 100 "name": "myapp",
101 "dependency_overrides": { 101 "dependency_overrides": {
102 "foo": "any" 102 "foo": "any"
103 } 103 }
104 }) 104 })
105 ]).create(); 105 ]).create();
106 106
107 pubCommand(command); 107 pubCommand(command);
108 108
109 d.packagesDir({ 109 d.appPackagesFile({
110 "foo": "1.0.0" 110 "foo": "1.0.0"
111 }).validate(); 111 }).validate();
112 }); 112 });
113 113
114 integration("warns about overridden dependencies", () { 114 integration("warns about overridden dependencies", () {
115 servePackages((builder) { 115 servePackages((builder) {
116 builder.serve("foo", "1.0.0"); 116 builder.serve("foo", "1.0.0");
117 builder.serve("bar", "1.0.0"); 117 builder.serve("bar", "1.0.0");
118 }); 118 });
119 119
(...skipping 18 matching lines...) Expand all
138 schedulePub(args: [command.name], output: command.success, error: 138 schedulePub(args: [command.name], output: command.success, error:
139 """ 139 """
140 Warning: You are using these overridden dependencies: 140 Warning: You are using these overridden dependencies:
141 ! bar 1.0.0 141 ! bar 1.0.0
142 ! baz 0.0.1 from path $bazPath 142 ! baz 0.0.1 from path $bazPath
143 ! foo 1.0.0 143 ! foo 1.0.0
144 """); 144 """);
145 }); 145 });
146 }); 146 });
147 } 147 }
OLDNEW
« no previous file with comments | « lib/src/command/upgrade.dart ('k') | test/descriptor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698