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

Side by Side Diff: utils/tests/pub/install/path/shared_dependency_test.dart

Issue 12335076: Handle shared path dependencies. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Compare resolved paths. Created 7 years, 9 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
« no previous file with comments | « utils/pub/path_source.dart ('k') | utils/tests/pub/test_pub.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 import '../../../../../pkg/pathos/lib/path.dart' as path;
6
7 import '../../test_pub.dart';
8
9 main() {
10 initConfig();
11 integration("shared dependency with same path", () {
12 dir("shared", [
13 libDir("shared"),
14 libPubspec("shared", "0.0.1")
15 ]).scheduleCreate();
16
17 dir("foo", [
18 libDir("foo"),
19 libPubspec("foo", "0.0.1", deps: [
20 {"path": "../shared"}
21 ])
22 ]).scheduleCreate();
23
24 dir("bar", [
25 libDir("bar"),
26 libPubspec("bar", "0.0.1", deps: [
27 {"path": "../shared"}
28 ])
29 ]).scheduleCreate();
30
31 dir(appPath, [
32 pubspec({
33 "name": "myapp",
34 "dependencies": {
35 "foo": {"path": "../foo"},
36 "bar": {"path": "../bar"}
37 }
38 })
39 ]).scheduleCreate();
40
41 schedulePub(args: ["install"],
42 output: new RegExp(r"Dependencies installed!$"));
43
44 dir(packagesPath, [
45 dir("foo", [file("foo.dart", 'main() => "foo";')]),
46 dir("bar", [file("bar.dart", 'main() => "bar";')]),
47 dir("shared", [file("shared.dart", 'main() => "shared";')])
48 ]).scheduleValidate();
49 });
50
51 integration("shared dependency with paths that normalize the same", () {
52 dir("shared", [
53 libDir("shared"),
54 libPubspec("shared", "0.0.1")
55 ]).scheduleCreate();
56
57 dir("foo", [
58 libDir("foo"),
59 libPubspec("foo", "0.0.1", deps: [
60 {"path": "../shared"}
61 ])
62 ]).scheduleCreate();
63
64 dir("bar", [
65 libDir("bar"),
66 libPubspec("bar", "0.0.1", deps: [
67 {"path": "../././shared"}
68 ])
69 ]).scheduleCreate();
70
71 dir(appPath, [
72 pubspec({
73 "name": "myapp",
74 "dependencies": {
75 "foo": {"path": "../foo"},
76 "bar": {"path": "../bar"}
77 }
78 })
79 ]).scheduleCreate();
80
81 schedulePub(args: ["install"],
82 output: new RegExp(r"Dependencies installed!$"));
83
84 dir(packagesPath, [
85 dir("foo", [file("foo.dart", 'main() => "foo";')]),
86 dir("bar", [file("bar.dart", 'main() => "bar";')]),
87 dir("shared", [file("shared.dart", 'main() => "shared";')])
88 ]).scheduleValidate();
89 });
90
91 integration("shared dependency with absolute and relative path", () {
92 dir("shared", [
93 libDir("shared"),
94 libPubspec("shared", "0.0.1")
95 ]).scheduleCreate();
96
97 dir("foo", [
98 libDir("foo"),
99 libPubspec("foo", "0.0.1", deps: [
100 {"path": "../shared"}
101 ])
102 ]).scheduleCreate();
103
104 dir("bar", [
105 libDir("bar"),
106 libPubspec("bar", "0.0.1", deps: [
107 {"path": path.join(sandboxDir, "shared")}
108 ])
109 ]).scheduleCreate();
110
111 dir(appPath, [
112 pubspec({
113 "name": "myapp",
114 "dependencies": {
115 "foo": {"path": "../foo"},
116 "bar": {"path": "../bar"}
117 }
118 })
119 ]).scheduleCreate();
120
121 schedulePub(args: ["install"],
122 output: new RegExp(r"Dependencies installed!$"));
123
124 dir(packagesPath, [
125 dir("foo", [file("foo.dart", 'main() => "foo";')]),
126 dir("bar", [file("bar.dart", 'main() => "bar";')]),
127 dir("shared", [file("shared.dart", 'main() => "shared";')])
128 ]).scheduleValidate();
129 });
130
131 integration("shared dependency with symlink", () {
nweiz 2013/02/25 22:57:04 Is this going to break on Windows?
Bob Nystrom 2013/02/25 23:00:03 I don't believe so, but we'll find out. :)
132 dir("shared", [
133 libDir("shared"),
134 libPubspec("shared", "0.0.1")
135 ]).scheduleCreate();
136
137 dir("foo", [
138 libDir("foo"),
139 libPubspec("foo", "0.0.1", deps: [
140 {"path": "../shared"}
141 ])
142 ]).scheduleCreate();
143
144 dir("bar", [
145 libDir("bar"),
146 libPubspec("bar", "0.0.1", deps: [
147 {"path": "../link/shared"}
148 ])
149 ]).scheduleCreate();
150
151 dir(appPath, [
152 pubspec({
153 "name": "myapp",
154 "dependencies": {
155 "foo": {"path": "../foo"},
156 "bar": {"path": "../bar"}
157 }
158 })
159 ]).scheduleCreate();
160
161 dir("link").scheduleCreate();
162 scheduleSymlink("shared", path.join("link", "shared"));
163
164 schedulePub(args: ["install"],
165 output: new RegExp(r"Dependencies installed!$"));
166
167 dir(packagesPath, [
168 dir("foo", [file("foo.dart", 'main() => "foo";')]),
169 dir("bar", [file("bar.dart", 'main() => "bar";')]),
170 dir("shared", [file("shared.dart", 'main() => "shared";')])
171 ]).scheduleValidate();
172 });
173 }
OLDNEW
« no previous file with comments | « utils/pub/path_source.dart ('k') | utils/tests/pub/test_pub.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698