OLD | NEW |
1 part of unittest; | 1 part of unittest; |
2 | 2 |
3 /// Setup and teardown functions for a group and its parents, the latter | 3 /// Setup and teardown functions for a group and its parents, the latter |
4 /// for chaining. | 4 /// for chaining. |
5 class _GroupContext { | 5 class _GroupContext { |
6 final _GroupContext parent; | 6 final _GroupContext parent; |
7 | 7 |
8 /// Description text of the current test group. | 8 /// Description text of the current test group. |
9 final String _name; | 9 final String _name; |
10 | 10 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 var f = teardown(); | 47 var f = teardown(); |
48 if (f is Future) { | 48 if (f is Future) { |
49 return f.then((_) => postTeardown()); | 49 return f.then((_) => postTeardown()); |
50 } else { | 50 } else { |
51 return postTeardown(); | 51 return postTeardown(); |
52 } | 52 } |
53 }; | 53 }; |
54 } | 54 } |
55 } | 55 } |
56 | 56 |
57 String get fullName => (parent == null || parent == _rootContext) | 57 String get fullName => (parent == null || parent == _environment.rootContext) |
58 ? _name | 58 ? _name |
59 : "${parent.fullName}$groupSep$_name"; | 59 : "${parent.fullName}$groupSep$_name"; |
60 | 60 |
61 _GroupContext([this.parent, this._name = '']) { | 61 _GroupContext([this.parent, this._name = '']) { |
62 _testSetup = parentSetup; | 62 _testSetup = parentSetup; |
63 _testTeardown = parentTeardown; | 63 _testTeardown = parentTeardown; |
64 } | 64 } |
65 } | 65 } |
OLD | NEW |