| 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 'dart:io'; | 5 import 'dart:io'; |
| 6 | 6 |
| 7 import "package:async_helper/async_helper.dart"; | 7 import "package:async_helper/async_helper.dart"; |
| 8 import "package:expect/expect.dart"; | 8 import "package:expect/expect.dart"; |
| 9 | 9 |
| 10 void main() { | 10 void main() { |
| 11 // temp/ | 11 // temp/ |
| 12 // a/ | 12 // a/ |
| 13 // file.txt | 13 // file.txt |
| 14 // b/ | 14 // b/ |
| 15 // a_link -> a | 15 // a_link -> a |
| 16 var d = new Directory("").createTempSync(); | 16 var d = Directory.systemTemp.createTempSync('dart_delete_symlink'); |
| 17 var a = new Directory("${d.path}/a"); | 17 var a = new Directory("${d.path}/a"); |
| 18 a.createSync(); | 18 a.createSync(); |
| 19 | 19 |
| 20 var b = new Directory("${d.path}/b"); | 20 var b = new Directory("${d.path}/b"); |
| 21 b.createSync(); | 21 b.createSync(); |
| 22 | 22 |
| 23 var f = new File("${d.path}/a/file.txt"); | 23 var f = new File("${d.path}/a/file.txt"); |
| 24 f.createSync(); | 24 f.createSync(); |
| 25 Expect.isTrue(f.existsSync()); | 25 Expect.isTrue(f.existsSync()); |
| 26 | 26 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 43 // We should not have recursed through a_link into a. | 43 // We should not have recursed through a_link into a. |
| 44 Expect.isTrue(f.existsSync()); | 44 Expect.isTrue(f.existsSync()); |
| 45 | 45 |
| 46 // Clean up after ourselves. | 46 // Clean up after ourselves. |
| 47 d.deleteSync(recursive: true); | 47 d.deleteSync(recursive: true); |
| 48 | 48 |
| 49 // Terminate now that we are done with everything. | 49 // Terminate now that we are done with everything. |
| 50 asyncEnd(); | 50 asyncEnd(); |
| 51 }); | 51 }); |
| 52 } | 52 } |
| OLD | NEW |