(t *testing.T)
| 37 | } |
| 38 | |
| 39 | func TestComposeDecodeHookFunc_err(t *testing.T) { |
| 40 | f1 := func(reflect.Kind, reflect.Kind, interface{}) (interface{}, error) { |
| 41 | return nil, errors.New("foo") |
| 42 | } |
| 43 | |
| 44 | f2 := func(reflect.Kind, reflect.Kind, interface{}) (interface{}, error) { |
| 45 | panic("NOPE") |
| 46 | } |
| 47 | |
| 48 | f := ComposeDecodeHookFunc(f1, f2) |
| 49 | |
| 50 | _, err := DecodeHookExec( |
| 51 | f, reflect.ValueOf(""), reflect.ValueOf([]byte(""))) |
| 52 | if err.Error() != "foo" { |
| 53 | t.Fatalf("bad: %s", err) |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | func TestComposeDecodeHookFunc_kinds(t *testing.T) { |
| 58 | var f2From reflect.Kind |
nothing calls this directly
no test coverage detected
searching dependent graphs…