| 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 // Dart test program for testing error handling in directory I/O. | 5 // Dart test program for testing error handling in directory I/O. |
| 6 | 6 |
| 7 #import("dart:io"); | 7 import "dart:io"; |
| 8 #import("dart:isolate"); | 8 import "dart:isolate"; |
| 9 | 9 |
| 10 Directory tempDir() { | 10 Directory tempDir() { |
| 11 return new Directory('').createTempSync(); | 11 return new Directory('').createTempSync(); |
| 12 } | 12 } |
| 13 | 13 |
| 14 | 14 |
| 15 bool checkCreateInNonExistentFileException(e) { | 15 bool checkCreateInNonExistentFileException(e) { |
| 16 Expect.isTrue(e is DirectoryIOException); | 16 Expect.isTrue(e is DirectoryIOException); |
| 17 Expect.isTrue(e.osError != null); | 17 Expect.isTrue(e.osError != null); |
| 18 Expect.isTrue(e.toString().indexOf("Creation failed") != -1); | 18 Expect.isTrue(e.toString().indexOf("Creation failed") != -1); |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 main() { | 216 main() { |
| 217 runTest(testCreateInNonExistent); | 217 runTest(testCreateInNonExistent); |
| 218 runTest(testCreateTempInNonExistent); | 218 runTest(testCreateTempInNonExistent); |
| 219 runTest(testDeleteNonExistent); | 219 runTest(testDeleteNonExistent); |
| 220 runTest(testDeleteRecursivelyNonExistent); | 220 runTest(testDeleteRecursivelyNonExistent); |
| 221 runTest(testListNonExistent); | 221 runTest(testListNonExistent); |
| 222 runTest(testRenameNonExistent); | 222 runTest(testRenameNonExistent); |
| 223 runTest(testRenameFileAsDirectory); | 223 runTest(testRenameFileAsDirectory); |
| 224 runTest(testRenameOverwriteFile); | 224 runTest(testRenameOverwriteFile); |
| 225 } | 225 } |
| OLD | NEW |