strconv: add missing function name to Errorf string

This commit is contained in:
Luka Krmpotić 2023-08-21 11:09:26 +02:00
parent 50f2b7b764
commit d70fa2760a
1 changed files with 4 additions and 4 deletions

View File

@ -39,19 +39,19 @@ func TestParseBool(t *testing.T) {
if test.err != nil {
// expect an error
if e == nil {
t.Errorf("%s: expected %s but got nil", test.in, test.err)
t.Errorf("ParseBool(%s): expected %s but got nil", test.in, test.err)
} else {
// NumError assertion must succeed; it's the only thing we return.
if test.err != e.(*NumError).Err {
t.Errorf("%s: expected %s but got %s", test.in, test.err, e)
t.Errorf("ParseBool(%s): expected %s but got %s", test.in, test.err, e)
}
}
} else {
if e != nil {
t.Errorf("%s: expected no error but got %s", test.in, e)
t.Errorf("ParseBool(%s): expected no error but got %s", test.in, e)
}
if b != test.out {
t.Errorf("%s: expected %t but got %t", test.in, test.out, b)
t.Errorf("ParseBool(%s): expected %t but got %t", test.in, test.out, b)
}
}
}