Ariel Shaqed (Scolnicov)
01/27/2021, 8:37 AMt.Fatal
on an unexpected failure because it has nothing better to do, and t.Fatal
is broken and doesn't work in goroutines.
This is a good argument for not using gomock at all in new code -- it is extremely dependent on the implementation. For now I may rewrite batch_test.go to use fakes. Any better ideas?Barak Amar
Barak Amar
Barak Amar
type TestReporter interface {
Errorf(format string, args ...interface{})
Fatalf(format string, args ...interface{})
}
Ariel Shaqed (Scolnicov)
01/27/2021, 9:53 AMFatalf
in a language that doesn't support exceptions: there is no way to specify what the method should return when a call has no matches. If I did specify an Any()(, Any(), Any(), ...
matcher then it could return an error -- but then mock cannot test that the correct calls occurred, and (more importantly) it doesn't call Fatalf
so the problem goes away...Barak Amar