| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library unittestTest; | 5 library unittestTest; |
| 6 |
| 7 import 'dart:async'; |
| 6 import 'dart:isolate'; | 8 import 'dart:isolate'; |
| 7 import 'dart:async'; | 9 |
| 8 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
| 9 | 11 |
| 10 part 'unittest_test_utils.dart'; | 12 part 'utils.dart'; |
| 11 | 13 |
| 12 var testName = 'async setup teardown test'; | 14 var testName = 'async setup teardown test'; |
| 13 | 15 |
| 14 var testFunction = (_) { | 16 var testFunction = (_) { |
| 15 group('good setup/good teardown', () { | 17 group('good setup/good teardown', () { |
| 16 setUp(() { | 18 setUp(() { |
| 17 return new Future.value(0); | 19 return new Future.value(0); |
| 18 }); | 20 }); |
| 19 tearDown(() { | 21 tearDown(() { |
| 20 return new Future.value(0); | 22 return new Future.value(0); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 46 tearDown(() { | 48 tearDown(() { |
| 47 return new Future.error("Failed to complete tearDown"); | 49 return new Future.error("Failed to complete tearDown"); |
| 48 }); | 50 }); |
| 49 test('foo4', () {}); | 51 test('foo4', () {}); |
| 50 }); | 52 }); |
| 51 // The next test is just to make sure we make steady progress | 53 // The next test is just to make sure we make steady progress |
| 52 // through the tests. | 54 // through the tests. |
| 53 test('post groups', () {}); | 55 test('post groups', () {}); |
| 54 }; | 56 }; |
| 55 | 57 |
| 56 var expected = buildStatusString(2, 0, 3, | 58 final expected = buildStatusString(2, 0, 3, |
| 57 'good setup/good teardown foo1::' | 59 'good setup/good teardown foo1::' |
| 58 'good setup/bad teardown foo2:' | 60 'good setup/bad teardown foo2:' |
| 59 'Teardown failed: Caught Failed to complete tearDown:' | 61 'Teardown failed: Caught Failed to complete tearDown:' |
| 60 'bad setup/good teardown foo3:' | 62 'bad setup/good teardown foo3:' |
| 61 'Setup failed: Caught Failed to complete setUp:' | 63 'Setup failed: Caught Failed to complete setUp:' |
| 62 'bad setup/bad teardown foo4:' | 64 'bad setup/bad teardown foo4:' |
| 63 'Setup failed: Caught Failed to complete setUp:' | 65 'Setup failed: Caught Failed to complete setUp:' |
| 64 'post groups'); | 66 'post groups'); |
| OLD | NEW |