Re:Stop requiring only one assertion per unit test: Multiple...
by Jabbles on Saturday November 05, 2022 @03:20PM
(#33484695)
With 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.
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