(t *testing.T)
| 55 | } |
| 56 | |
| 57 | func TestComposeDecodeHookFunc_kinds(t *testing.T) { |
| 58 | var f2From reflect.Kind |
| 59 | |
| 60 | f1 := func( |
| 61 | f reflect.Kind, |
| 62 | t reflect.Kind, |
| 63 | data interface{}) (interface{}, error) { |
| 64 | return int(42), nil |
| 65 | } |
| 66 | |
| 67 | f2 := func( |
| 68 | f reflect.Kind, |
| 69 | t reflect.Kind, |
| 70 | data interface{}) (interface{}, error) { |
| 71 | f2From = f |
| 72 | return data, nil |
| 73 | } |
| 74 | |
| 75 | f := ComposeDecodeHookFunc(f1, f2) |
| 76 | |
| 77 | _, err := DecodeHookExec( |
| 78 | f, reflect.ValueOf(""), reflect.ValueOf([]byte(""))) |
| 79 | if err != nil { |
| 80 | t.Fatalf("bad: %s", err) |
| 81 | } |
| 82 | if f2From != reflect.Int { |
| 83 | t.Fatalf("bad: %#v", f2From) |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | func TestOrComposeDecodeHookFunc(t *testing.T) { |
| 88 | f1 := func( |
nothing calls this directly
no test coverage detected
searching dependent graphs…