| 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 '../../../../pkg/scheduled_test/lib/scheduled_test.dart'; | 9 import '../../../../pkg/unittest/lib/unittest.dart'; |
| 10 | |
| 11 import '../descriptor.dart' as d; | |
| 12 import '../test_pub.dart'; | 10 import '../test_pub.dart'; |
| 13 | 11 |
| 14 main() { | 12 main() { |
| 15 // 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. |
| 16 // 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 |
| 17 // 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. |
| 18 // So just skip it. | 16 // So just skip it. |
| 19 if (Platform.operatingSystem == "windows") return; | 17 if (Platform.operatingSystem == "windows") return; |
| 20 | 18 |
| 21 initConfig(); | 19 initConfig(); |
| 22 integration('uses a relative symlink for the self link', () { | 20 integration('uses a relative symlink for the self link', () { |
| 23 d.dir(appPath, [ | 21 dir(appPath, [ |
| 24 d.appPubspec([]), | 22 appPubspec([]), |
| 25 d.libDir('foo') | 23 libDir('foo') |
| 26 ]).create(); | 24 ]).scheduleCreate(); |
| 27 | 25 |
| 28 schedulePub(args: ['install'], | 26 schedulePub(args: ['install'], |
| 29 output: new RegExp(r"Dependencies installed!$")); | 27 output: new RegExp(r"Dependencies installed!$")); |
| 30 | 28 |
| 31 scheduleRename(appPath, "moved"); | 29 scheduleRename(appPath, "moved"); |
| 32 | 30 |
| 33 d.dir("moved", [ | 31 dir("moved", [ |
| 34 d.dir("packages", [ | 32 dir("packages", [ |
| 35 d.dir("myapp", [ | 33 dir("myapp", [ |
| 36 d.file('foo.dart', 'main() => "foo";') | 34 file('foo.dart', 'main() => "foo";') |
| 37 ]) | 35 ]) |
| 38 ]) | 36 ]) |
| 39 ]).validate(); | 37 ]).scheduleValidate(); |
| 40 }); | 38 }); |
| 41 | 39 |
| 42 integration('uses a relative symlink for secondary packages directory', () { | 40 integration('uses a relative symlink for secondary packages directory', () { |
| 43 d.dir(appPath, [ | 41 dir(appPath, [ |
| 44 d.appPubspec([]), | 42 appPubspec([]), |
| 45 d.libDir('foo'), | 43 libDir('foo'), |
| 46 d.dir("bin") | 44 dir("bin") |
| 47 ]).create(); | 45 ]).scheduleCreate(); |
| 48 | 46 |
| 49 schedulePub(args: ['install'], | 47 schedulePub(args: ['install'], |
| 50 output: new RegExp(r"Dependencies installed!$")); | 48 output: new RegExp(r"Dependencies installed!$")); |
| 51 | 49 |
| 52 scheduleRename(appPath, "moved"); | 50 scheduleRename(appPath, "moved"); |
| 53 | 51 |
| 54 d.dir("moved", [ | 52 dir("moved", [ |
| 55 d.dir("bin", [ | 53 dir("bin", [ |
| 56 d.dir("packages", [ | 54 dir("packages", [ |
| 57 d.dir("myapp", [ | 55 dir("myapp", [ |
| 58 d.file('foo.dart', 'main() => "foo";') | 56 file('foo.dart', 'main() => "foo";') |
| 59 ]) | 57 ]) |
| 60 ]) | 58 ]) |
| 61 ]) | 59 ]) |
| 62 ]).validate(); | 60 ]).scheduleValidate(); |
| 63 }); | 61 }); |
| 64 } | 62 } |
| OLD | NEW |