| Index: tests/standalone/io/process_stdin_transform_unsubscribe_script.dart
|
| diff --git a/tests/standalone/io/process_stdin_transform_unsubscribe_script.dart b/tests/standalone/io/process_stdin_transform_unsubscribe_script.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..071112488a9d03915796316a3d51a058b0a830cf
|
| --- /dev/null
|
| +++ b/tests/standalone/io/process_stdin_transform_unsubscribe_script.dart
|
| @@ -0,0 +1,18 @@
|
| +// 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.
|
| +//
|
| +// Utility script to echo stdin to stdout or stderr or both.
|
| +
|
| +import "dart:io";
|
| +
|
| +main() {
|
| + var subscription;
|
| + subscription = stdin
|
| + .transform(new StringDecoder())
|
| + .transform(new LineTransformer())
|
| + .listen((String line) {
|
| + // Unsubscribe after the first line.
|
| + subscription.cancel();
|
| + });
|
| +}
|
|
|