Chromium Code Reviews| Index: tests/standalone/io/stdin_sync_test.dart |
| diff --git a/tests/standalone/io/stdin_sync_test.dart b/tests/standalone/io/stdin_sync_test.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..31cf14d81509a41ad4d3957ea73312ca5815524c |
| --- /dev/null |
| +++ b/tests/standalone/io/stdin_sync_test.dart |
| @@ -0,0 +1,22 @@ |
| +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +import "dart:io"; |
| + |
| +void main() { |
| + var script = new Path(Platform.script).directoryPath; |
| + script = script.append("stdin_sync_script.dart"); |
| + print(script.toNativePath()); |
| + Process.start(Platform.executable, [script.toNativePath()]).then((process) { |
| + 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.
|
| + process.stdin.close(); |
| + process.stdout |
| + .transform(new StringDecoder()) |
| + .transform(new LineTransformer()) |
| + .fold(new StringBuffer(), (b, d) => b..write(d)) |
| + .then((data) { |
| + if (data.toString() != 'true') throw "Bad output: '$data'"; |
| + }); |
| + }); |
| +} |