blob: 541d6cd7b222f52911eb78356e047c598f7835f1 [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.
/// @assertion Future catchError(Function onError, {bool test(Object error)})
/// If test is omitted, it defaults to a function that always returns true.
/// @description Checks that [onError] is called if [test] is omitted and the
/// returned future completes with value returned by [onError] call
/// @author
import "dart:async";
import "../../../Utils/expect.dart";
main() {
Completer completer = new Completer();
Future f = completer.future;
(Object error) {
Expect.equals("!", error);
return "@";
(var value){
Expect.equals("@", value);