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

Side by Side Diff: pkg/unittest/test/returning_future_test.dart

Issue 814953002: Remove unittest and matcher from the repo. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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
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 }, [{
58 'result': 'pass'
59 }, {
60 'result': 'fail',
61 'message': 'Callback called more times than expected (1).'
62 }, {
63 'result': 'fail',
64 'message': 'Expected: <false>\n Actual: <true>\n'
65 }, {
66 'result': 'fail',
67 'message': 'Callback called more times than expected (1).'
68 }, {
69 'result': 'fail',
70 'message': 'failure'
71 }, {
72 'result': 'pass'
73 }]);
74 }
OLDNEW
« no previous file with comments | « pkg/unittest/test/protect_async_test.dart ('k') | pkg/unittest/test/returning_future_using_runasync_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698