OLD | NEW |
| (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'); | |
OLD | NEW |