MCPcopy
hub / github.com/gofiber/fiber / Test_parseToMap_Extended

Function Test_parseToMap_Extended

binder/mapping_test.go:429–448  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

427}
428
429func Test_parseToMap_Extended(t *testing.T) {
430 t.Parallel()
431 data := map[string][]string{
432 "empty": {},
433 "key1": {"value1"},
434 }
435
436 m := make(map[string]string)
437 err := parseToMap(reflect.ValueOf(m), data)
438 require.NoError(t, err)
439 require.Empty(t, m["empty"])
440
441 m2 := make(map[string][]int)
442 err = parseToMap(reflect.ValueOf(m2), data)
443 require.ErrorIs(t, err, ErrMapNotConvertible)
444
445 m3 := make(map[string]int)
446 err = parseToMap(reflect.ValueOf(m3), data)
447 require.NoError(t, err)
448}
449
450func Test_decoderPoolMapInit(t *testing.T) {
451 t.Parallel()

Callers

nothing calls this directly

Calls 1

parseToMapFunction · 0.85

Tested by

no test coverage detected