I am using:
cd project && go test *.go
I have:
project/
main.go
pkg_test.go
in pkg_test.go I have:
package main
import "testing"
func TestMain(t *testing.T) {
t.Fail()
main()
}
but my test script at the cmd line doesn't fail, it passes, so it's not picking up the TestMain func. Any idea why?
Aucun commentaire:
Enregistrer un commentaire