Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: tests/standalone/io/file_error_test.dart

Issue 13527004: Add comments to the synchronous file methods stating that they throw (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/io/file_impl.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 testRepeatedlyCloseFileSync() { 446 testRepeatedlyCloseFileSync() {
447 createTestFile((file, port) { 447 createTestFile((file, port) {
448 var openedFile = file.openSync(); 448 var openedFile = file.openSync();
449 openedFile.closeSync(); 449 openedFile.closeSync();
450 Expect.throws(openedFile.closeSync, 450 Expect.throws(openedFile.closeSync,
451 (e) => e is FileIOException); 451 (e) => e is FileIOException);
452 port.send(null); 452 port.send(null);
453 }); 453 });
454 } 454 }
455 455
456 testReadSyncBigInt() {
457 createTestFile((file, port) {
458 var bigint = 100000000000000000000000000000000000000000;
459 var openedFile = file.openSync();
460 Expect.throws(() => openedFile.readSync(bigint),
461 (e) => e is FileIOException);
462 port.send(null);
463 });
464 }
465
466 testReadSyncClosedFile() {
467 createTestFile((file, port) {
468 var openedFile = file.openSync();
469 openedFile.closeSync();
470 Expect.throws(() => openedFile.readSync(1),
471 (e) => e is FileIOException);
472 port.send(null);
473 });
474 }
475
456 main() { 476 main() {
457 testOpenNonExistent(); 477 testOpenNonExistent();
458 testDeleteNonExistent(); 478 testDeleteNonExistent();
459 testLengthNonExistent(); 479 testLengthNonExistent();
460 testCreateInNonExistentDirectory(); 480 testCreateInNonExistentDirectory();
461 testFullPathOnNonExistentDirectory(); 481 testFullPathOnNonExistentDirectory();
462 testDirectoryInNonExistentDirectory(); 482 testDirectoryInNonExistentDirectory();
463 testReadAsBytesNonExistent(); 483 testReadAsBytesNonExistent();
464 testReadAsTextNonExistent(); 484 testReadAsTextNonExistent();
465 testReadAsLinesNonExistent(); 485 testReadAsLinesNonExistent();
466 testWriteByteToReadOnlyFile(); 486 testWriteByteToReadOnlyFile();
467 testWriteListToReadOnlyFile(); 487 testWriteListToReadOnlyFile();
468 testTruncateReadOnlyFile(); 488 testTruncateReadOnlyFile();
469 testOperateOnClosedFile(); 489 testOperateOnClosedFile();
470 testRepeatedlyCloseFile(); 490 testRepeatedlyCloseFile();
471 testRepeatedlyCloseFileSync(); 491 testRepeatedlyCloseFileSync();
492 testReadSyncBigInt();
493 testReadSyncClosedFile();
472 } 494 }
OLDNEW
« no previous file with comments | « sdk/lib/io/file_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698