Cannot agree with having testing purpose code such as "Test bool" in main code is a great idea. 30:45
@catallergiccat5 жыл бұрын
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.
@silentassassin89595 жыл бұрын
Awesome video! More people need to watch this
@NovikArthur3 жыл бұрын
7:50 an error in example. Should be "tc.Expected" instead of "expected".
@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
@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"
@frederikcreemers77517 жыл бұрын
At 16:00, What does t.Helper() do? I don't see it in the testing docs.
@ashishacharya40017 жыл бұрын
Helper() is a new method added in 1.9. tip.golang.org/doc/go1.9#test-helper
@aclshumway7 жыл бұрын
It was added in 1.9 golang.org/pkg/testing/#T.Helper
@sashimi806 жыл бұрын
tells to the testing env that the function is an Helper and not a real test function.
@aaronyu4 жыл бұрын
Does anyone know where can I get the slides? Cause I can not understand the content that quickly... Thanks a lot.