Fix test error messages

This commit is contained in:
taylorchu 2015-05-30 22:27:08 +02:00 committed by Carlos Martín Nieto
parent 35ff0de855
commit 53c158fbd7
3 changed files with 3 additions and 5 deletions

View File

@ -188,8 +188,7 @@ func checkFatal(t *testing.T, err error) {
// The failure happens at wherever we were called, not here
_, file, line, ok := runtime.Caller(1)
if !ok {
t.Fatal()
t.Fatalf("Unable to get caller")
}
t.Fatalf("Fail at %v:%v; %v", file, line, err)
}

View File

@ -199,8 +199,7 @@ func checkRefType(t *testing.T, ref *Reference, kind ReferenceType) {
// The failure happens at wherever we were called, not here
_, file, line, ok := runtime.Caller(1)
if !ok {
t.Fatal()
t.Fatalf("Unable to get caller")
}
t.Fatalf("Wrong ref type at %v:%v; have %v, expected %v", file, line, ref.Type(), kind)
}

View File

@ -21,6 +21,6 @@ func TestSubmoduleForeach(t *testing.T) {
checkFatal(t, err)
if i != 1 {
t.Fatalf("expected one submodule found but got %i", i)
t.Fatalf("expected one submodule found but got %d", i)
}
}