frankban / quicktest

Quick helpers for testing Go applications
MIT License
529 stars 27 forks source link

Fix detection of missing done in Defer from Defer #158

Closed dolmen closed 1 year ago

dolmen commented 1 year ago

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.

frankban commented 1 year ago

Released as v1.14.6.