fix error message in validation test

pull/6/head
Daniel Smith 2014-10-07 13:54:41 -07:00
parent 3a62089790
commit 7ffe791486
1 changed files with 2 additions and 2 deletions

View File

@ -28,8 +28,8 @@ import (
func expectPrefix(t *testing.T, prefix string, errs errors.ErrorList) {
for i := range errs {
if !strings.HasPrefix(errs[i].(errors.ValidationError).Field, prefix) {
t.Errorf("expected prefix '%s' for %v", errs[i])
if f, p := errs[i].(errors.ValidationError).Field, prefix; !strings.HasPrefix(f, p) {
t.Errorf("expected prefix '%s' for field '%s' (%v)", p, f, errs[i])
}
}
}