(t *testing.T)
| 246 | } |
| 247 | |
| 248 | func TestValueBinder_CustomFuncWithError(t *testing.T) { |
| 249 | c := createTestContext("/search?nr=en&id=1&id=101", nil, nil) |
| 250 | b := QueryParamsBinder(c) |
| 251 | |
| 252 | id := int64(99) |
| 253 | givenCustomFunc := func(values []string) []error { |
| 254 | assert.Equal(t, []string{"1", "101"}, values) |
| 255 | |
| 256 | return []error{ |
| 257 | errors.New("first error"), |
| 258 | errors.New("second error"), |
| 259 | } |
| 260 | } |
| 261 | err := b.CustomFunc("id", givenCustomFunc).BindError() |
| 262 | |
| 263 | assert.Equal(t, int64(99), id) |
| 264 | assert.EqualError(t, err, "first error") |
| 265 | } |
| 266 | |
| 267 | func TestValueBinder_CustomFunc(t *testing.T) { |
| 268 | var testCases = []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…