| OLD | NEW |
| 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 "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
| 6 import "package:path/path.dart"; | 6 import "package:path/path.dart"; |
| 7 import "dart:async"; | 7 import "dart:async"; |
| 8 import "dart:io"; | 8 import "dart:io"; |
| 9 import "dart:isolate"; | 9 import "dart:isolate"; |
| 10 | 10 |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 testRename(base, file.path); | 197 testRename(base, file.path); |
| 198 testRename(base, dir.path); | 198 testRename(base, dir.path); |
| 199 | 199 |
| 200 baseDir.deleteSync(recursive: true); | 200 baseDir.deleteSync(recursive: true); |
| 201 } | 201 } |
| 202 | 202 |
| 203 void testLinkErrorSync() { | 203 void testLinkErrorSync() { |
| 204 Expect.throws(() => | 204 Expect.throws(() => |
| 205 new Link('some-dir-that-doent exist/some link file/bla/fisk').createSync( | 205 new Link('some-dir-that-doent exist/some link file/bla/fisk').createSync( |
| 206 'bla bla bla/b lalal/blfir/sdfred/es'), | 206 'bla bla bla/b lalal/blfir/sdfred/es'), |
| 207 (e) => e is LinkException); | 207 (e) => e is FileSystemException); |
| 208 } | 208 } |
| 209 | 209 |
| 210 checkExists(String filePath) => Expect.isTrue(new File(filePath).existsSync()); | 210 checkExists(String filePath) => Expect.isTrue(new File(filePath).existsSync()); |
| 211 | 211 |
| 212 testRelativeLinksSync() { | 212 testRelativeLinksSync() { |
| 213 Directory tempDirectory = Directory.systemTemp.createTempSync('dart_link'); | 213 Directory tempDirectory = Directory.systemTemp.createTempSync('dart_link'); |
| 214 String temp = tempDirectory.path; | 214 String temp = tempDirectory.path; |
| 215 String oldWorkingDirectory = Directory.current.path; | 215 String oldWorkingDirectory = Directory.current.path; |
| 216 // Make directories and files to test links. | 216 // Make directories and files to test links. |
| 217 new Directory(join(temp, 'dir1', 'dir2')).createSync(recursive: true); | 217 new Directory(join(temp, 'dir1', 'dir2')).createSync(recursive: true); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 238 tempDirectory.deleteSync(recursive: true); | 238 tempDirectory.deleteSync(recursive: true); |
| 239 } | 239 } |
| 240 | 240 |
| 241 main() { | 241 main() { |
| 242 testCreateSync(); | 242 testCreateSync(); |
| 243 testCreateLoopingLink(); | 243 testCreateLoopingLink(); |
| 244 testRenameSync(); | 244 testRenameSync(); |
| 245 testLinkErrorSync(); | 245 testLinkErrorSync(); |
| 246 testRelativeLinksSync(); | 246 testRelativeLinksSync(); |
| 247 } | 247 } |
| OLD | NEW |