Chromium Code Reviews| 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 "dart:async"; | 6 import "dart:async"; |
| 7 import "dart:io"; | 7 import "dart:io"; |
| 8 import "dart:isolate"; | 8 import "dart:isolate"; |
| 9 | 9 |
| 10 // Test the dart:io Link class. | 10 // Test the dart:io Link class. |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 }, | 126 }, |
| 127 onDone: () { | 127 onDone: () { |
| 128 for (var v in expected.values) { | 128 for (var v in expected.values) { |
| 129 Expect.equals('Found', v); | 129 Expect.equals('Found', v); |
| 130 } | 130 } |
| 131 f.complete(null); | 131 f.complete(null); |
| 132 }); | 132 }); |
| 133 } | 133 } |
| 134 } | 134 } |
| 135 Future.wait(futures).then((_) { | 135 Future.wait(futures).then((_) { |
| 136 new Directory(target).deleteSync(recursive: true); | |
| 137 for (bool recursive in [true, false]) { | |
| 138 for (bool followLinks in [true, false]) { | |
| 139 var result = baseDir.listSync(recursive: recursive, | |
| 140 followLinks: followLinks); | |
| 141 print(result); | |
|
Bill Hesse
2013/04/11 10:15:43
Removing the print statement.
| |
| 142 Expect.equals(1, result.length); | |
| 143 Expect.isTrue(result[0] is Link); | |
| 144 } | |
| 145 } | |
| 136 baseDir.deleteSync(recursive: true); | 146 baseDir.deleteSync(recursive: true); |
| 137 }); | 147 }); |
| 138 } | 148 } |
| 139 | 149 |
| 140 testCreateLoopingLink() { | 150 testCreateLoopingLink() { |
| 141 Path base = new Path(new Directory('').createTempSync().path); | 151 Path base = new Path(new Directory('').createTempSync().path); |
| 142 new Directory.fromPath(base.append('a/b/c')).create(recursive: true) | 152 new Directory.fromPath(base.append('a/b/c')).create(recursive: true) |
| 143 .then((_) => | 153 .then((_) => |
| 144 new Link.fromPath(base.append('a/b/c/d')) | 154 new Link.fromPath(base.append('a/b/c/d')) |
| 145 .create(base.append('a/b').toNativePath())) | 155 .create(base.append('a/b').toNativePath())) |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 161 .list(recursive: true, followLinks: true) | 171 .list(recursive: true, followLinks: true) |
| 162 .last) | 172 .last) |
| 163 .then((_) => | 173 .then((_) => |
| 164 new Directory.fromPath(base).delete(recursive: true)); | 174 new Directory.fromPath(base).delete(recursive: true)); |
| 165 } | 175 } |
| 166 | 176 |
| 167 main() { | 177 main() { |
| 168 testCreateSync(); | 178 testCreateSync(); |
| 169 testCreateLoopingLink(); | 179 testCreateLoopingLink(); |
| 170 } | 180 } |
| OLD | NEW |