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

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

Issue 319983005: pkg/unittest: test cleanup (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase Created 6 years, 6 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 | 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 unittestTest;
6 import 'dart:isolate';
7 import 'dart:async';
8 import 'package:unittest/unittest.dart';
9
10 part 'unittest_test_utils.dart';
11
12 var testName = 'async setup teardown test';
13
14 var testFunction = (_) {
15 group('good setup/good teardown', () {
16 setUp(() {
17 return new Future.value(0);
18 });
19 tearDown(() {
20 return new Future.value(0);
21 });
22 test('foo1', () {});
23 });
24 group('good setup/bad teardown', () {
25 setUp(() {
26 return new Future.value(0);
27 });
28 tearDown(() {
29 return new Future.error("Failed to complete tearDown");
30 });
31 test('foo2', () {});
32 });
33 group('bad setup/good teardown', () {
34 setUp(() {
35 return new Future.error("Failed to complete setUp");
36 });
37 tearDown(() {
38 return new Future.value(0);
39 });
40 test('foo3', () {});
41 });
42 group('bad setup/bad teardown', () {
43 setUp(() {
44 return new Future.error("Failed to complete setUp");
45 });
46 tearDown(() {
47 return new Future.error("Failed to complete tearDown");
48 });
49 test('foo4', () {});
50 });
51 // The next test is just to make sure we make steady progress
52 // through the tests.
53 test('post groups', () {});
54 };
55
56 var expected = buildStatusString(2, 0, 3,
57 'good setup/good teardown foo1::'
58 'good setup/bad teardown foo2:'
59 'Teardown failed: Caught Failed to complete tearDown:'
60 'bad setup/good teardown foo3:'
61 'Setup failed: Caught Failed to complete setUp:'
62 'bad setup/bad teardown foo4:'
63 'Setup failed: Caught Failed to complete setUp:'
64 'post groups');
OLDNEW
« no previous file with comments | « pkg/unittest/test/unittest_async_exception_test.dart ('k') | pkg/unittest/test/unittest_completion_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698