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

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

Issue 18516002: Add Stdio.readByteSync and Stdio.readLineSync. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add retainNewlines Created 7 years, 5 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
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 import "dart:io";
6
7 void main() {
8 var script = new Path(Platform.script).directoryPath;
9 script = script.append("stdin_sync_script.dart");
10 print(script.toNativePath());
11 Process.start(Platform.executable, [script.toNativePath()]).then((process) {
12 process.stdin.write("hej\x01\x00\x0d\x0a\x0a4\x0a");
Bill Hesse 2013/07/02 11:31:54 Also try a case with no newline at EOF?
Anders Johnsen 2013/07/02 12:21:27 Done.
13 process.stdin.close();
14 process.stdout
15 .transform(new StringDecoder())
16 .transform(new LineTransformer())
17 .fold(new StringBuffer(), (b, d) => b..write(d))
18 .then((data) {
19 if (data.toString() != 'true') throw "Bad output: '$data'";
20 });
21 });
22 }
OLDNEW
« sdk/lib/io/stdio.dart ('K') | « tests/standalone/io/stdin_sync_script.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698