| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 unittest.group; | 5 library unittest.backend.group; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'utils.dart'; | 9 import '../utils.dart'; |
| 10 | 10 |
| 11 /// A group contains multiple tests and subgroups. | 11 /// A group contains multiple tests and subgroups. |
| 12 /// | 12 /// |
| 13 /// A group has a description that is prepended to that of all nested tests and | 13 /// A group has a description that is prepended to that of all nested tests and |
| 14 /// subgroups. It also has [setUp] and [tearDown] functions which are scoped to | 14 /// subgroups. It also has [setUp] and [tearDown] functions which are scoped to |
| 15 /// the tests and groups it contains. | 15 /// the tests and groups it contains. |
| 16 class Group { | 16 class Group { |
| 17 /// The parent group, or `null` if this is the root group. | 17 /// The parent group, or `null` if this is the root group. |
| 18 final Group parent; | 18 final Group parent; |
| 19 | 19 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 if (parent != null) { | 67 if (parent != null) { |
| 68 return new Future.sync(() { | 68 return new Future.sync(() { |
| 69 if (tearDown != null) return tearDown(); | 69 if (tearDown != null) return tearDown(); |
| 70 }).then((_) => parent.runTearDown()); | 70 }).then((_) => parent.runTearDown()); |
| 71 } | 71 } |
| 72 | 72 |
| 73 if (tearDown != null) return new Future.sync(tearDown); | 73 if (tearDown != null) return new Future.sync(tearDown); |
| 74 return new Future.value(); | 74 return new Future.value(); |
| 75 } | 75 } |
| 76 } | 76 } |
| OLD | NEW |