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

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

Issue 37033002: dart:io | Remove uses of Options class from standalone tests. Mark Options deprecated. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove commented lines from standalone.status. Created 7 years, 2 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
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 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 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 // Utility script to echo stdin to stdout or stderr or both. 5 // Utility script to echo stdin to stdout or stderr or both.
6 6
7 import "dart:io"; 7 import "dart:io";
8 8
9 main() { 9 main(List<String> arguments) {
10 var options = new Options();
11 if (stdioType(stdin) is !StdioType) exit(1); 10 if (stdioType(stdin) is !StdioType) exit(1);
12 if (stdioType(stdout) is !StdioType) exit(1); 11 if (stdioType(stdout) is !StdioType) exit(1);
13 if (stdioType(stderr) is !StdioType) exit(1); 12 if (stdioType(stderr) is !StdioType) exit(1);
14 if (stdioType(stdin).name != options.arguments[1]) { 13 if (stdioType(stdin).name != arguments[1]) {
15 throw stdioType(stdin).name; 14 throw stdioType(stdin).name;
16 } 15 }
17 if (stdioType(stdout).name != options.arguments[2]) { 16 if (stdioType(stdout).name != arguments[2]) {
18 throw stdioType(stdout).name; 17 throw stdioType(stdout).name;
19 } 18 }
20 if (stdioType(stderr).name != options.arguments[3]) { 19 if (stdioType(stderr).name != arguments[3]) {
21 throw stdioType(stderr).name; 20 throw stdioType(stderr).name;
22 } 21 }
23 if (options.arguments.length > 0) { 22 if (arguments.length > 0) {
24 if (options.arguments[0] == "0") { 23 if (arguments[0] == "0") {
25 stdin.pipe(stdout); 24 stdin.pipe(stdout);
26 } else if (options.arguments[0] == "1") { 25 } else if (arguments[0] == "1") {
27 stdin.pipe(stderr); 26 stdin.pipe(stderr);
28 } else if (options.arguments[0] == "2") { 27 } else if (arguments[0] == "2") {
29 stdin.listen((data) { 28 stdin.listen((data) {
30 stdout.add(data); 29 stdout.add(data);
31 stderr.add(data); 30 stderr.add(data);
32 }); 31 });
33 } 32 }
34 } 33 }
35 } 34 }
OLDNEW
« no previous file with comments | « tests/standalone/http_launch_data/http_spawn_main.dart ('k') | tests/standalone/io/http_cross_process_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698