diff --git a/dynamic/spec_test.go b/dynamic/spec_test.go index e0eb6a8..535d9e3 100644 --- a/dynamic/spec_test.go +++ b/dynamic/spec_test.go @@ -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 {