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