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

Side by Side Diff: test/returning_future_test.dart

Issue 934413002: Replace the existing unittest APIs with the new runner infrastructure. (Closed) Base URL: git@github.com:dart-lang/unittest@master
Patch Set: Code review changes Created 5 years, 10 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
« no previous file with comments | « test/protect_async_test.dart ('k') | test/returning_future_using_runasync_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
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 library unittest.returning_future_test;
6
7 import 'dart:async';
8
9 import 'package:metatest/metatest.dart';
10 import 'package:unittest/unittest.dart';
11
12 void main() => initTests(_test);
13
14 void _test(message) {
15 initMetatest(message);
16
17 expectTestResults('returning futures', () {
18 test("successful", () {
19 return new Future.sync(() {
20 expect(true, true);
21 });
22 });
23 // We repeat the fail and error tests, because during development
24 // I had a situation where either worked fine on their own, and
25 // error/fail worked, but fail/error would time out.
26 test("error1", () {
27 var callback = expectAsync(() {});
28 var excesscallback = expectAsync(() {});
29 return new Future.sync(() {
30 excesscallback();
31 excesscallback();
32 excesscallback();
33 callback();
34 });
35 });
36 test("fail1", () {
37 return new Future.sync(() {
38 expect(true, false);
39 });
40 });
41 test("error2", () {
42 var callback = expectAsync(() {});
43 var excesscallback = expectAsync(() {});
44 return new Future.sync(() {
45 excesscallback();
46 excesscallback();
47 callback();
48 });
49 });
50 test("fail2", () {
51 return new Future.sync(() {
52 fail('failure');
53 });
54 });
55 test('foo5', () {});
56 }, [
57 {'result': 'pass'},
58 {
59 'result': 'fail',
60 'message': 'Callback called more times than expected (1).'
61 },
62 {'result': 'fail', 'message': 'Expected: <false>\n Actual: <true>\n'},
63 {
64 'result': 'fail',
65 'message': 'Callback called more times than expected (1).'
66 },
67 {'result': 'fail', 'message': 'failure'},
68 {'result': 'pass'}
69 ]);
70 }
OLDNEW
« no previous file with comments | « test/protect_async_test.dart ('k') | test/returning_future_using_runasync_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698