MCPcopy Create free account
hub / github.com/stretchr/objx / TestTransformKeys

Function TestTransformKeys

mutations_test.go:84–100  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

82}
83
84func TestTransformKeys(t *testing.T) {
85 m := objx.Map{
86 "a": "1",
87 "b": "2",
88 "c": "3",
89 }
90 mapping := map[string]string{
91 "a": "d",
92 "b": "e",
93 }
94 r := m.TransformKeys(mapping)
95 assert.Equal(t, objx.Map{
96 "c": "3",
97 "d": "1",
98 "e": "2",
99 }, r)
100}
101
102func keyToUpper(s string, v interface{}) (string, interface{}) {
103 return strings.ToUpper(s), v

Callers

nothing calls this directly

Calls 2

TransformKeysMethod · 0.95
EqualMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…