mirror of https://github.com/knative/pkg.git
test for FieldError.Also(nil) (#545)
This commit is contained in:
parent
fe4877abb6
commit
154a0848d4
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue