The way how I prevent 200 lines for preparing test fixture is using test fixture builder. The builder builds test fixture with default values, however can specify case-by-case fixture with "withX" functions, which saves a lot of lines of repeatedly code but still get to the point of the fixture.
@catallergiccat5 жыл бұрын
Cannot agree with having testing purpose code such as "Test bool" in main code is a great idea. 30:45
@silentassassin89595 жыл бұрын
Awesome video! More people need to watch this
@NovikArthur3 жыл бұрын
7:50 an error in example. Should be "tc.Expected" instead of "expected".
@zhangjimmy66195 жыл бұрын
Great! my testing code is bad to compare with this
@mbigras5 жыл бұрын
At kzbin.info/www/bejne/bpm0eGqHoch_eM0 the plus sign + is the repetition operator, putting it in quotes solves the probably go test -v -run TestAdd/"\+1"
@nicocesar4 жыл бұрын
14:12 he mentions a good way to show Diff(actual, expected) ... but I can't understand what library he is referring to. Anyone has a clue?
@tracefindertracefinder72154 жыл бұрын
Perhaps, it's about pkg.go.dev/github.com/google/go-cmp/cmp#Diff
@pulsarglider Жыл бұрын
go-cmp package
@aaronyu4 жыл бұрын
Does anyone know where can I get the slides? Cause I can not understand the content that quickly... Thanks a lot.