Chromium Code Reviews| Index: pkg/unittest/lib/src/test_case.dart |
| =================================================================== |
| --- pkg/unittest/lib/src/test_case.dart (revision 39431) |
| +++ pkg/unittest/lib/src/test_case.dart (working copy) |
| @@ -15,13 +15,13 @@ |
| final String description; |
| /// The setup function to call before the test, if any. |
| - final Function _setUp; |
| + Function _setUp; |
| /// The teardown function to call after the test, if any. |
| - final Function _tearDown; |
| + Function _tearDown; |
| /// The body of the test case. |
| - final TestFunction _testFunction; |
| + TestFunction _testFunction; |
| /// Remaining number of callbacks functions that must reach a 'done' state |
| /// to wait for before the test completes. |
| @@ -120,7 +120,9 @@ |
| } else if (_tearDown != null) { |
| return _tearDown(); |
| } |
| - }).catchError(_errorHandler('Teardown')); |
| + }).catchError(_errorHandler('Teardown')).whenComplete(() { |
| + _setUp = _tearDown = _testFunction = null; |
|
Bob Nystrom
2014/08/20 23:39:30
Nit, but using chained = feels a bit cute to me. D
|
| + }); |
| } |
| // Set the results, notify the config, and return true if this |