Fix a case where a missing call to Done following Defer wasn't detected: the (weired) case where Defer is called from a defered function.
First commit is the failing test.
Second commit is the fix. It also refactors the detection by using two separate calls to TB.Cleanup: one to defer the function, one for the 'missing Done' detection.
Fix a case where a missing call to Done following Defer wasn't detected: the (weired) case where Defer is called from a defered function.
First commit is the failing test.
Second commit is the fix. It also refactors the detection by using two separate calls to TB.Cleanup: one to defer the function, one for the 'missing Done' detection.