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

Side by Side Diff: tests/lib/async/future_test.dart

Issue 54723007: Fix warnings in library-tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments Created 7 years, 1 month 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
« no previous file with comments | « tests/lib/async/event_helper.dart ('k') | tests/lib/async/future_value_chain4_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 library future_test; 5 library future_test;
6 6
7 import 'package:async_helper/async_helper.dart'; 7 import 'package:async_helper/async_helper.dart';
8 import "package:expect/expect.dart"; 8 import "package:expect/expect.dart";
9 import 'dart:async'; 9 import 'dart:async';
10 10
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 compare(() { 48 compare(() {
49 hasExecuted = true; 49 hasExecuted = true;
50 return 499; 50 return 499;
51 }); 51 });
52 Expect.isTrue(hasExecuted); 52 Expect.isTrue(hasExecuted);
53 } 53 }
54 54
55 void testNeverComplete() { 55 void testNeverComplete() {
56 final completer = new Completer<int>(); 56 final completer = new Completer<int>();
57 final future = completer.future; 57 final future = completer.future;
58 future.then((v) => Expect.fails("Value not expected")); 58 future.then((v) => Expect.fail("Value not expected"));
59 future.catchError((e) => Expect.fails("Value not expected")); 59 future.catchError((e) => Expect.fail("Value not expected"));
60 } 60 }
61 61
62 void testComplete() { 62 void testComplete() {
63 final completer = new Completer<int>(); 63 final completer = new Completer<int>();
64 final future = completer.future; 64 final future = completer.future;
65 Expect.isFalse(completer.isCompleted); 65 Expect.isFalse(completer.isCompleted);
66 66
67 completer.complete(3); 67 completer.complete(3);
68 Expect.isTrue(completer.isCompleted); 68 Expect.isTrue(completer.isCompleted);
69 69
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after
805 CustomFuture(this._realFuture); 805 CustomFuture(this._realFuture);
806 Future then(action(result), {Function onError}) => 806 Future then(action(result), {Function onError}) =>
807 _realFuture.then(action, onError: onError); 807 _realFuture.then(action, onError: onError);
808 Future catchError(Function onError, {bool test(e)}) => 808 Future catchError(Function onError, {bool test(e)}) =>
809 _realFuture.catchError(onError, test: test); 809 _realFuture.catchError(onError, test: test);
810 Future whenComplete(action()) => _realFuture.whenComplete(action); 810 Future whenComplete(action()) => _realFuture.whenComplete(action);
811 Stream asStream() => _realFuture.asStream(); 811 Stream asStream() => _realFuture.asStream();
812 String toString() => "CustomFuture@${_realFuture.hashCode}"; 812 String toString() => "CustomFuture@${_realFuture.hashCode}";
813 int get hashCode => _realFuture.hashCode; 813 int get hashCode => _realFuture.hashCode;
814 } 814 }
OLDNEW
« no previous file with comments | « tests/lib/async/event_helper.dart ('k') | tests/lib/async/future_value_chain4_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698