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

Function Test_parseToMap_defaultCase

binder/binder_test.go:72–88  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

70}
71
72func Test_parseToMap_defaultCase(t *testing.T) {
73 t.Parallel()
74 m := map[string]int{}
75 err := parseToMap(reflect.ValueOf(m), map[string][]string{"a": {"1"}})
76 require.NoError(t, err)
77 require.Empty(t, m)
78
79 m2 := map[string]string{}
80 err = parseToMap(reflect.ValueOf(m2), map[string][]string{"empty": {}})
81 require.NoError(t, err)
82 require.Empty(t, m2["empty"])
83
84 var zeroStringMap map[string]string
85 err = parseToMap(reflect.ValueOf(&zeroStringMap).Elem(), map[string][]string{"name": {"john"}})
86 require.NoError(t, err)
87 require.Equal(t, "john", zeroStringMap["name"])
88}
89
90func Test_parse_function_maps(t *testing.T) {
91 t.Parallel()

Callers

nothing calls this directly

Calls 1

parseToMapFunction · 0.85

Tested by

no test coverage detected