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

Unified Diff: tests/standalone/src/io/FileTest.dart

Issue 10065013: Support length operation without opening file. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix error message and fix Windows port Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/standalone/src/io/FileErrorTest.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/src/io/FileTest.dart
diff --git a/tests/standalone/src/io/FileTest.dart b/tests/standalone/src/io/FileTest.dart
index 6e5a8cd647e0189200bc3edaead611f223c72bde..196aac3bc3a37884edce1a82d756f538de429889 100644
--- a/tests/standalone/src/io/FileTest.dart
+++ b/tests/standalone/src/io/FileTest.dart
@@ -531,19 +531,26 @@ class FileTest {
// Test for file length functionality.
static void testLength() {
String filename = getFilename("tests/vm/data/fixed_length_file");
- RandomAccessFile input = (new File(filename)).openSync();
- input.onError = (e) => Expect.fail("No errors expected");
- input.length((length) {
+ File file = new File(filename);
+ RandomAccessFile openedFile = file.openSync();
+ openedFile.onError = (e) => Expect.fail("No errors expected");
+ file.onError = (e) => Expect.fail("No errors expected");
+ openedFile.length((length) {
+ Expect.equals(42, length);
+ openedFile.close(() => null);
+ });
+ file.length((length) {
Expect.equals(42, length);
- input.close(() => null);
});
}
static void testLengthSync() {
String filename = getFilename("tests/vm/data/fixed_length_file");
- RandomAccessFile input = (new File(filename)).openSync();
- Expect.equals(42, input.lengthSync());
- input.closeSync();
+ File file = new File(filename);
+ RandomAccessFile openedFile = file.openSync();
+ Expect.equals(42, file.lengthSync());
+ Expect.equals(42, openedFile.lengthSync());
+ openedFile.closeSync();
}
// Test for file position functionality.
« no previous file with comments | « tests/standalone/src/io/FileErrorTest.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698