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

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

Issue 11316102: Add utility methods to write the contents of a file as one operation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 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_write_as_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/process_non_ascii_test.dart
diff --git a/tests/standalone/io/process_non_ascii_test.dart b/tests/standalone/io/process_non_ascii_test.dart
index d06c6a7440cb6fa97312fb52c4c00e26ef9b9119..e7b31e3b075721d52d11073ba251b5136085bb3d 100644
--- a/tests/standalone/io/process_non_ascii_test.dart
+++ b/tests/standalone/io/process_non_ascii_test.dart
@@ -12,8 +12,7 @@ main() {
var nonAsciiDir = new Directory('${tempDir.path}/æøå');
nonAsciiDir.createSync();
var nonAsciiFile = new File('${nonAsciiDir.path}/æøå.dart');
- var opened = nonAsciiFile.openSync(FileMode.WRITE);
- opened.writeStringSync(
+ nonAsciiFile.writeAsStringSync(
"""
import 'dart:io';
@@ -21,11 +20,8 @@ main() {
Expect.equals('æøå', new File('æøå.txt').readAsStringSync());
}
""");
- opened.closeSync();
var nonAsciiTxtFile = new File('${nonAsciiDir.path}/æøå.txt');
- opened = nonAsciiTxtFile.openSync(FileMode.WRITE);
- opened.writeStringSync('æøå');
- opened.closeSync();
+ nonAsciiTxtFile.writeAsStringSync('æøå');
var options = new ProcessOptions();
options.workingDirectory = nonAsciiDir.path;
var script = nonAsciiFile.name;
« no previous file with comments | « tests/standalone/io/file_write_as_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698