blob: b2d2edebc3beef14fe87af4b75643d59825343e5 [file] [log] [blame]
// Copyright (c) 2011, 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.
// @dart = 2.9
/// @assertion Stream<T> asStream()
/// Creates a Stream containing the result of this future.
/// The stream will produce single data or error event containing the completion
/// result of this future, ...
/// @description Checks that the stream sends this' error to its subscribers.
/// @author kaigorodov
import "dart:async";
import "../../../Utils/expect.dart";
main() {
Error error = new Error();
Future future = new Future.sync(() {throw error;});
Stream stream = future.asStream();
Future f2 = stream.single;
(fValue) {"unexpected value=$fValue");
onError: (Object e){
Expect.identical(error, e);