test for FieldError.Also(nil) (#545)

This commit is contained in:
Spencer Peterson 2019-07-28 09:36:04 -07:00 committed by Knative Prow Robot
parent fe4877abb6
commit 154a0848d4
1 changed files with 12 additions and 0 deletions

View File

@ -599,6 +599,18 @@ not without this: bar.C`,
}
}
func TestAlsoNil(t *testing.T) {
errs := &FieldError{
Message: "original",
Paths: []string{"foo"},
}
errs = errs.Also(nil)
if got, want := errs.Error(), "original: foo"; got != want {
t.Errorf("TestAlsoNil: Also(nil).Error() = %v, wanted %v", got, want)
}
}
func TestMergeFieldErrors(t *testing.T) {
tests := []struct {
name string