test: spec add checkOutput() tests for : nil type (ignore type check) ; invalid last output (not api.Error)
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
307021bc88
commit
b48c1d07bf
|
@ -117,6 +117,12 @@ func TestOutputCheck(t *testing.T) {
|
|||
Fn: func() {},
|
||||
Err: ErrMissingHandlerOutput,
|
||||
},
|
||||
// no input -> with last type not api.Error
|
||||
{
|
||||
Output: map[string]reflect.Type{},
|
||||
Fn: func() bool { return true },
|
||||
Err: ErrMissingHandlerErrorOutput,
|
||||
},
|
||||
// no input -> with api.Error
|
||||
{
|
||||
Output: map[string]reflect.Type{},
|
||||
|
@ -185,6 +191,14 @@ func TestOutputCheck(t *testing.T) {
|
|||
Fn: func() (*struct{ Test1 int }, api.Error) { return nil, api.ErrorSuccess },
|
||||
Err: nil,
|
||||
},
|
||||
// ignore type check on nil type
|
||||
{
|
||||
Output: map[string]reflect.Type{
|
||||
"Test1": nil,
|
||||
},
|
||||
Fn: func() (*struct{ Test1 int }, api.Error) { return nil, api.ErrorSuccess },
|
||||
Err: nil,
|
||||
},
|
||||
}
|
||||
|
||||
for i, tcase := range tcases {
|
||||
|
|
Loading…
Reference in New Issue