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

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

Issue 20745006: Add a flush operations to IOSink (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix merge issue Created 7 years, 1 month 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/io/file_test.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_write_as_test.dart
diff --git a/tests/standalone/io/file_write_as_test.dart b/tests/standalone/io/file_write_as_test.dart
index 462292db5d8db96db08df9eedf61d9e2d3125a3c..a5fb96b1d83ccf86374905de6e90811cd4bfb493 100644
--- a/tests/standalone/io/file_write_as_test.dart
+++ b/tests/standalone/io/file_write_as_test.dart
@@ -10,10 +10,10 @@ import "package:expect/expect.dart";
testWriteAsBytesSync(dir) {
var f = new File('${dir.path}/bytes_sync.txt');
- var data = [50,50,50];
+ var data = [50, 50, 50];
f.writeAsBytesSync(data);
Expect.listEquals(data, f.readAsBytesSync());
- f.writeAsBytesSync(data, mode: FileMode.APPEND);
+ f.writeAsBytesSync(data, mode: FileMode.APPEND, flush: true);
var expected = [50, 50, 50, 50, 50, 50];
Expect.listEquals(expected, f.readAsBytesSync());
}
@@ -23,19 +23,19 @@ testWriteAsStringSync(dir) {
var data = 'asdf';
f.writeAsStringSync(data);
Expect.equals(data, f.readAsStringSync());
- f.writeAsStringSync(data, mode: FileMode.APPEND);
+ f.writeAsStringSync(data, mode: FileMode.APPEND, flush: true);
Expect.equals('$data$data', f.readAsStringSync());
}
Future testWriteAsBytes(dir) {
var completer = new Completer();
var f = new File('${dir.path}/bytes.txt');
- var data = [50,50,50];
+ var data = [50, 50, 50];
f.writeAsBytes(data).then((file){
Expect.equals(f, file);
f.readAsBytes().then((bytes) {
Expect.listEquals(data, bytes);
- f.writeAsBytes(data, mode: FileMode.APPEND).then((file) {
+ f.writeAsBytes(data, mode: FileMode.APPEND, flush: true).then((file) {
Expect.equals(f, file);
f.readAsBytes().then((bytes) {
var expected = [50, 50, 50, 50, 50, 50];
@@ -56,7 +56,7 @@ Future testWriteAsString(dir) {
Expect.equals(f, file);
f.readAsString().then((str) {
Expect.equals(data, str);
- f.writeAsString(data, mode: FileMode.APPEND).then((file) {
+ f.writeAsString(data, mode: FileMode.APPEND, flush: true).then((file) {
Expect.equals(f, file);
f.readAsString().then((str) {
Expect.equals('$data$data', str);
« no previous file with comments | « tests/standalone/io/file_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698