mirror of
https://github.com/kubernetes/client-go.git
synced 2025-07-04 02:37:39 +00:00
Clean up brace whitespace in **/validation_test.go
This was making my eyes bleed as I read over code. I used the following in vim. I made them up on the fly, but they seemed to pass manual inspection. :g/},\n\s*{$/s//}, {/ :w :g/{$\n\s*{$/s//{{/ :w :g/^\(\s*\)},\n\1},$/s//}},/ :w :g/^\(\s*\)},$\n\1}$/s//}}/ :w Kubernetes-commit: d55b67b349021b6c46fc6ce78f2a36bd4217145f
This commit is contained in:
parent
1513f87e7a
commit
54190dfee5
@ -748,37 +748,31 @@ func TestErrConfigurationInvalidWithErrorsIs(t *testing.T) {
|
|||||||
err error
|
err error
|
||||||
matchAgainst error
|
matchAgainst error
|
||||||
expectMatch bool
|
expectMatch bool
|
||||||
}{
|
}{{
|
||||||
{
|
name: "no match",
|
||||||
name: "no match",
|
err: errConfigurationInvalid{errors.New("my-error"), errors.New("my-other-error")},
|
||||||
err: errConfigurationInvalid{errors.New("my-error"), errors.New("my-other-error")},
|
matchAgainst: fmt.Errorf("no entry %s", "here"),
|
||||||
matchAgainst: fmt.Errorf("no entry %s", "here"),
|
}, {
|
||||||
},
|
name: "match via .Is()",
|
||||||
{
|
err: errConfigurationInvalid{errors.New("forbidden"), alwaysMatchingError{}},
|
||||||
name: "match via .Is()",
|
matchAgainst: errors.New("unauthorized"),
|
||||||
err: errConfigurationInvalid{errors.New("forbidden"), alwaysMatchingError{}},
|
expectMatch: true,
|
||||||
matchAgainst: errors.New("unauthorized"),
|
}, {
|
||||||
expectMatch: true,
|
name: "match via equality",
|
||||||
},
|
err: errConfigurationInvalid{errors.New("err"), someError{}},
|
||||||
{
|
matchAgainst: someError{},
|
||||||
name: "match via equality",
|
expectMatch: true,
|
||||||
err: errConfigurationInvalid{errors.New("err"), someError{}},
|
}, {
|
||||||
matchAgainst: someError{},
|
name: "match via nested aggregate",
|
||||||
expectMatch: true,
|
err: errConfigurationInvalid{errors.New("closed today"), errConfigurationInvalid{errConfigurationInvalid{someError{}}}},
|
||||||
},
|
matchAgainst: someError{},
|
||||||
{
|
expectMatch: true,
|
||||||
name: "match via nested aggregate",
|
}, {
|
||||||
err: errConfigurationInvalid{errors.New("closed today"), errConfigurationInvalid{errConfigurationInvalid{someError{}}}},
|
name: "match via wrapped aggregate",
|
||||||
matchAgainst: someError{},
|
err: fmt.Errorf("wrap: %w", errConfigurationInvalid{errors.New("err"), someError{}}),
|
||||||
expectMatch: true,
|
matchAgainst: someError{},
|
||||||
},
|
expectMatch: true,
|
||||||
{
|
}}
|
||||||
name: "match via wrapped aggregate",
|
|
||||||
err: fmt.Errorf("wrap: %w", errConfigurationInvalid{errors.New("err"), someError{}}),
|
|
||||||
matchAgainst: someError{},
|
|
||||||
expectMatch: true,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
t.Run(tc.name, func(t *testing.T) {
|
t.Run(tc.name, func(t *testing.T) {
|
||||||
|
Loading…
Reference in New Issue
Block a user