3 ms·
22 assertions in a test is a lot better than 22 separate tests that fail for the same reason.
by mrits 4y ago
22 assertions in a test is a lot better than 22 separate tests that fail for the same reason.
- bluGill 4y agoThey are the same. I don't care, as I'll fix them one at a time, and if the fix happens to fix more than one great.
- Jabbles 4y agoWith 22 separate tests you have the possibility of knowing that only a subset of them fail. Knowing which fail and which pass may help you debug. In Go, in general, tests fail and continue, rather than causing the test to stop early, so you can tell which of those 22 checks failed. Other languages may have the option to do something similar. https://pkg.go.dev/testing#T.Fail https://pkg.go.dev/testing#T.Fail