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

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

Issue 12285010: Support relative paths in path dependencies. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tweak some comments. Created 7 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 '../../../../../pkg/path/lib/path.dart' as path; 5 import '../../../../../pkg/path/lib/path.dart' as path;
6 6
7 import '../../../../pub/exit_codes.dart' as exit_codes;
7 import '../../test_pub.dart'; 8 import '../../test_pub.dart';
8 9
9 main() { 10 main() {
10 initConfig(); 11 initConfig();
11 integration('path dependency with absolute path', () { 12 integration("generates a symlink with a relative path if the dependency "
12 dir('foo', [ 13 "path was relative", () {
13 libDir('foo'), 14 dir("foo", [
14 libPubspec('foo', '0.0.1') 15 libDir("foo"),
16 libPubspec("foo", "0.0.1")
15 ]).scheduleCreate(); 17 ]).scheduleCreate();
16 18
17 dir(appPath, [ 19 dir(appPath, [
18 pubspec({ 20 pubspec({
19 "name": "myapp", 21 "name": "myapp",
20 "dependencies": { 22 "dependencies": {
21 "foo": {"path": path.join(sandboxDir, "foo")} 23 "foo": {"path": "../foo"}
22 } 24 }
23 }) 25 })
24 ]).scheduleCreate(); 26 ]).scheduleCreate();
25 27
26 schedulePub(args: ["install"], 28 schedulePub(args: ["install"],
27 output: new RegExp(r"Dependencies installed!$")); 29 output: new RegExp(r"Dependencies installed!$"));
28 30
29 dir(packagesPath, [ 31 dir("moved").scheduleCreate();
30 dir("foo", [
31 file("foo.dart", 'main() => "foo";')
32 ])
33 ]).scheduleValidate();
34 32
35 // Move the packages directory and ensure the symlink still works. That 33 // Move the app and package. Since they are still next to each other, it
36 // will validate that we actually created an absolute symlink. 34 // should still be found.
37 dir("moved").scheduleCreate(); 35 scheduleRename("foo", path.join("moved", "foo"));
38 scheduleRename(packagesPath, "moved/packages"); 36 scheduleRename(appPath, path.join("moved", appPath));
39 37
40 dir("moved/packages", [ 38 dir("moved", [
41 dir("foo", [ 39 dir(packagesPath, [
42 file("foo.dart", 'main() => "foo";') 40 dir("foo", [
41 file("foo.dart", 'main() => "foo";')
42 ])
43 ]) 43 ])
44 ]).scheduleValidate(); 44 ]).scheduleValidate();
45 }); 45 });
46 } 46 }
OLDNEW
« no previous file with comments | « utils/tests/pub/install/path/relative_path_test.dart ('k') | utils/tests/pub/lock_file_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698