test dynfunc package; standardize and refactor api #14
|
@ -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