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