OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 // OtherResources=stdio_nonblocking_script.dart | 5 // OtherResources=stdio_nonblocking_script.dart |
6 | 6 |
7 import "dart:convert"; | 7 import "dart:convert"; |
8 import "dart:io"; | 8 import "dart:io"; |
9 | 9 |
10 import "package:expect/expect.dart"; | 10 import "package:expect/expect.dart"; |
11 | 11 |
12 void main() { | 12 void main() { |
13 var script = | 13 var script = |
14 Platform.script.resolve("stdio_nonblocking_script.dart").toFilePath(); | 14 Platform.script.resolve("stdio_nonblocking_script.dart").toFilePath(); |
15 Process.run(Platform.executable, | 15 Process |
16 [script], | 16 .run(Platform.executable, [script], |
17 stdoutEncoding: ASCII, | 17 stdoutEncoding: ASCII, stderrEncoding: ASCII) |
18 stderrEncoding: ASCII).then((result) { | 18 .then((result) { |
19 print(result.stdout); | 19 print(result.stdout); |
20 print(result.stderr); | 20 print(result.stderr); |
21 Expect.equals(1, result.exitCode); | 21 Expect.equals(1, result.exitCode); |
22 Expect.equals('stdout\n\ntuodts\nABCDEFGHIJKLM\n', result.stdout); | 22 Expect.equals('stdout\n\ntuodts\nABCDEFGHIJKLM\n', result.stdout); |
23 Expect.equals('stderr\n\nrredts\nABCDEFGHIJKLM\n', result.stderr); | 23 Expect.equals('stderr\n\nrredts\nABCDEFGHIJKLM\n', result.stderr); |
24 }); | 24 }); |
25 } | 25 } |
OLD | NEW |