3 ms·
This has been encouraged by test frameworks for more than a decade; see e.g. https://testing.googleblog.com/2008/07/tott-expect-vs-assert.html https://testing.g
by chrchang523 6y ago
This has been encouraged by test frameworks for more than a decade; see e.g. https://testing.googleblog.com/2008/07/tott-expect-vs-assert.html https://testing.googleblog.com/2008/07/tott-expect-vs-assert... .
- r0s 6y agoYes! I'm stoking the flames for these ideas because they were quite beneficial in my experience. In particular, the code reuse aspect, which I haven't seen any advocacy for previously.
- marcosdumay 6y agoI'm not sure how that would work. After an expect fails, why would I trust the results of any other that is passing of failing? It is true that the tests should be independent, so that one of them failing wouldn't imply on the other being useless. But that requires much more than simply continuing after an error.
- chrchang523 6y agoThat's why both assert and expect are in that framework. You still use assert when that particular test failure may prevent other tests from working as designed, but you try to use expect for all independent "leaf" tests.