Closed
Description
We use t.Errorf
in tests, for example
go-tarantool/uuid/uuid_test.go
Line 56 in bec9f72
It seems that by design t.Errorf
do not stops test function execution, but it is expected in tests:
package main
import (
"testing"
)
func TestEverything(t *testing.T) {
a := "sdf"
if a == "sdf" {
t.Errorf("end")
}
t.Errorf("end 2")
}
=== RUN TestEverything
prog.go:10: end
prog.go:12: end 2
--- FAIL: TestEverything (0.00s)
FAIL
Program exited.
Documentation says:
Errorf is equivalent to Logf followed by Fail.
Fail marks the function as having failed but continues execution.
We should use Fatalf
(doc) or explicit returns where it's expected.