| Index: tests/standalone/io/directory_test.dart
|
| diff --git a/tests/standalone/io/directory_test.dart b/tests/standalone/io/directory_test.dart
|
| index 14685b105db00a29ecf491ec09132ea8b98b3b58..990d98266b224f01032367b64dab9d03ac477593 100644
|
| --- a/tests/standalone/io/directory_test.dart
|
| +++ b/tests/standalone/io/directory_test.dart
|
| @@ -603,14 +603,24 @@ testRename() {
|
| Expect.isTrue(temp2.existsSync());
|
| Expect.equals(temp3.path, temp2.path);
|
|
|
| - temp2.rename(temp1.path).then((temp4) {
|
| - Expect.isFalse(temp3.existsSync());
|
| - Expect.isFalse(temp2.existsSync());
|
| - Expect.isTrue(temp1.existsSync());
|
| - Expect.isTrue(temp4.existsSync());
|
| - Expect.equals(temp1.path, temp4.path);
|
| - temp1.deleteSync(recursive: true);
|
| - });
|
| + var temp4 = temp2.renameSync(temp1.path);
|
| + Expect.isFalse(temp3.existsSync());
|
| + Expect.isFalse(temp2.existsSync());
|
| + Expect.isTrue(temp1.existsSync());
|
| + Expect.isTrue(temp4.existsSync());
|
| + Expect.equals(temp1.path, temp4.path);
|
| + temp1.deleteSync(recursive: true);
|
| +
|
| + var file = new File('${temp4.path}/foo');
|
| + try {
|
| + new Directory('${temp4.path}/foo').renameSync('${temp4.path}/bar');
|
| + Expect.fail('Directory.rename should fail to rename a non-directory');
|
| + } catch (e) {
|
| + Expect.isTrue(e is FileSystemException);
|
| + if (Platform.isLinux || Platform.isMacOS) {
|
| + Expect.isTrue(e.osError.message.contains('No such file or directory'));
|
| + }
|
| + }
|
| }
|
|
|
| main() {
|
|
|