| 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 // Dart test program for testing error handling in file I/O. | 5 // Dart test program for testing error handling in file 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() { |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 port.send(null); | 452 port.send(null); |
| 453 }); | 453 }); |
| 454 } | 454 } |
| 455 | 455 |
| 456 testReadSyncBigInt() { | 456 testReadSyncBigInt() { |
| 457 createTestFile((file, port) { | 457 createTestFile((file, port) { |
| 458 var bigint = 100000000000000000000000000000000000000000; | 458 var bigint = 100000000000000000000000000000000000000000; |
| 459 var openedFile = file.openSync(); | 459 var openedFile = file.openSync(); |
| 460 Expect.throws(() => openedFile.readSync(bigint), | 460 Expect.throws(() => openedFile.readSync(bigint), |
| 461 (e) => e is FileIOException); | 461 (e) => e is FileIOException); |
| 462 openedFile.closeSync(); |
| 462 port.send(null); | 463 port.send(null); |
| 463 }); | 464 }); |
| 464 } | 465 } |
| 465 | 466 |
| 466 testReadSyncClosedFile() { | 467 testReadSyncClosedFile() { |
| 467 createTestFile((file, port) { | 468 createTestFile((file, port) { |
| 468 var openedFile = file.openSync(); | 469 var openedFile = file.openSync(); |
| 469 openedFile.closeSync(); | 470 openedFile.closeSync(); |
| 470 Expect.throws(() => openedFile.readSync(1), | 471 Expect.throws(() => openedFile.readSync(1), |
| 471 (e) => e is FileIOException); | 472 (e) => e is FileIOException); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 485 testReadAsLinesNonExistent(); | 486 testReadAsLinesNonExistent(); |
| 486 testWriteByteToReadOnlyFile(); | 487 testWriteByteToReadOnlyFile(); |
| 487 testWriteListToReadOnlyFile(); | 488 testWriteListToReadOnlyFile(); |
| 488 testTruncateReadOnlyFile(); | 489 testTruncateReadOnlyFile(); |
| 489 testOperateOnClosedFile(); | 490 testOperateOnClosedFile(); |
| 490 testRepeatedlyCloseFile(); | 491 testRepeatedlyCloseFile(); |
| 491 testRepeatedlyCloseFileSync(); | 492 testRepeatedlyCloseFileSync(); |
| 492 testReadSyncBigInt(); | 493 testReadSyncBigInt(); |
| 493 testReadSyncClosedFile(); | 494 testReadSyncClosedFile(); |
| 494 } | 495 } |
| OLD | NEW |