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

Unified Diff: tests/standalone/io/file_test.dart

Issue 12315129: Make File.readSync return only the bytes read (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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
« runtime/bin/file.cc ('K') | « sdk/lib/io/file_impl.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/file_test.dart
diff --git a/tests/standalone/io/file_test.dart b/tests/standalone/io/file_test.dart
index 0c7e4f0388b0d87a81bc368d2cb6f0385fb2936c..ad5f2fcbe16775aabda15413b23deeb7ed9b524c 100644
--- a/tests/standalone/io/file_test.dart
+++ b/tests/standalone/io/file_test.dart
@@ -244,6 +244,17 @@ class FileTest {
Expect.equals(103, buffer[9]); // represents 'g' in the file.
Expect.equals(104, buffer[10]); // represents 'h' in the file.
Expect.equals(116, buffer[11]); // represents 't' in the file.
+
+ filename = getFilename("tests/vm/data/fixed_length_file");
+ file = new File(filename);
+ int len = file.lengthSync();
+ Expect.equals(0, file.openSync().readSync(0).length);
+ Expect.equals(1, file.openSync().readSync(1).length);
+ Expect.equals(len - 1, file.openSync().readSync(len - 1).length);
+ Expect.equals(len, file.openSync().readSync(len).length);
+ Expect.equals(len, file.openSync().readSync(len + 1).length);
+ Expect.equals(len, file.openSync().readSync(len * 2).length);
+ Expect.equals(len, file.openSync().readSync(len * 10).length);
}
// Test for file read and write functionality.
« runtime/bin/file.cc ('K') | « sdk/lib/io/file_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698