OLD | NEW |
| (Empty) |
1 // Copyright (c) 2012, 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 library pub_tests; | |
6 | |
7 import 'dart:io'; | |
8 | |
9 import 'package:scheduled_test/scheduled_test.dart'; | |
10 | |
11 import '../descriptor.dart' as d; | |
12 import '../test_pub.dart'; | |
13 | |
14 main() { | |
15 // Pub uses NTFS junction points to create links in the packages directory. | |
16 // These (unlike the symlinks that are supported in Vista and later) do not | |
17 // support relative paths. So this test, by design, will not pass on Windows. | |
18 // So just skip it. | |
19 if (Platform.operatingSystem == "windows") return; | |
20 | |
21 initConfig(); | |
22 integration('uses a relative symlink for the self link', () { | |
23 d.dir(appPath, [ | |
24 d.appPubspec([]), | |
25 d.libDir('foo') | |
26 ]).create(); | |
27 | |
28 schedulePub(args: ['install'], | |
29 output: new RegExp(r"Dependencies installed!$")); | |
30 | |
31 scheduleRename(appPath, "moved"); | |
32 | |
33 d.dir("moved", [ | |
34 d.dir("packages", [ | |
35 d.dir("myapp", [ | |
36 d.file('foo.dart', 'main() => "foo";') | |
37 ]) | |
38 ]) | |
39 ]).validate(); | |
40 }); | |
41 | |
42 integration('uses a relative symlink for secondary packages directory', () { | |
43 d.dir(appPath, [ | |
44 d.appPubspec([]), | |
45 d.libDir('foo'), | |
46 d.dir("bin") | |
47 ]).create(); | |
48 | |
49 schedulePub(args: ['install'], | |
50 output: new RegExp(r"Dependencies installed!$")); | |
51 | |
52 scheduleRename(appPath, "moved"); | |
53 | |
54 d.dir("moved", [ | |
55 d.dir("bin", [ | |
56 d.dir("packages", [ | |
57 d.dir("myapp", [ | |
58 d.file('foo.dart', 'main() => "foo";') | |
59 ]) | |
60 ]) | |
61 ]) | |
62 ]).validate(); | |
63 }); | |
64 } | |
OLD | NEW |