forked from fl00r/go-tarantool-1.6
-
Notifications
You must be signed in to change notification settings - Fork 60
Closed
Labels
bugSomething isn't workingSomething isn't workingcode healthImprove code readability, simplify maintenance and so onImprove code readability, simplify maintenance and so on
Description
We use t.Errorf
in tests, for example
go-tarantool/uuid/uuid_test.go
Line 56 in bec9f72
t.Errorf("Failed to connect: %s", err.Error()) |
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.
ligurio
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingcode healthImprove code readability, simplify maintenance and so onImprove code readability, simplify maintenance and so on