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

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

Issue 807193003: Re-apply "Remove unittest and matcher from the repo." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes 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_using_runasync_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('test returning future using scheduleMicrotask', () {
18 test("successful", () {
19 return new Future.sync(() {
20 scheduleMicrotask(() {
21 expect(true, true);
22 });
23 });
24 });
25 test("fail1", () {
26 var callback = expectAsync(() {});
27 return new Future.sync(() {
28 scheduleMicrotask(() {
29 expect(true, false);
30 callback();
31 });
32 });
33 });
34 test('error1', () {
35 var callback = expectAsync(() {});
36 var excesscallback = expectAsync(() {});
37 return new Future.sync(() {
38 scheduleMicrotask(() {
39 excesscallback();
40 excesscallback();
41 callback();
42 });
43 });
44 });
45 test("fail2", () {
46 var callback = expectAsync(() {});
47 return new Future.sync(() {
48 scheduleMicrotask(() {
49 fail('failure');
50 callback();
51 });
52 });
53 });
54 test('error2', () {
55 var callback = expectAsync(() {});
56 var excesscallback = expectAsync(() {});
57 return new Future.sync(() {
58 scheduleMicrotask(() {
59 excesscallback();
60 excesscallback();
61 excesscallback();
62 callback();
63 });
64 });
65 });
66 test('foo6', () {
67 });
68 }, [{
69 'description': 'successful',
70 'result': 'pass',
71 }, {
72 'description': 'fail1',
73 'message': 'Expected: <false>\n' ' Actual: <true>\n' '',
74 'result': 'fail',
75 }, {
76 'description': 'error1',
77 'message': 'Callback called more times than expected (1).',
78 'result': 'fail',
79 }, {
80 'description': 'fail2',
81 'message': 'failure',
82 'result': 'fail',
83 }, {
84 'description': 'error2',
85 'message': 'Callback called more times than expected (1).',
86 'result': 'fail',
87 }, {
88 'description': 'foo6',
89 'result': 'pass',
90 }]);
91 }
OLDNEW
« no previous file with comments | « pkg/unittest/test/returning_future_test.dart ('k') | pkg/unittest/test/runtests_without_tests_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698