MCPcopy Index your code
hub / github.com/cortexlabs/cortex / TestInterfaceToInterfaceInterfaceMap

Function TestInterfaceToInterfaceInterfaceMap

pkg/lib/cast/interface_test.go:165–188  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

163}
164
165func TestInterfaceToInterfaceInterfaceMap(t *testing.T) {
166 var ok bool
167 var in interface{}
168 var casted map[interface{}]interface{}
169 var expected map[interface{}]interface{}
170
171 in = map[string]string{"test": "str"}
172 expected = map[interface{}]interface{}{"test": "str"}
173 casted, ok = InterfaceToInterfaceInterfaceMap(in)
174 require.True(t, ok)
175 require.Equal(t, expected, casted)
176
177 in = map[int]bool{2: true}
178 expected = map[interface{}]interface{}{int(2): true}
179 casted, ok = InterfaceToInterfaceInterfaceMap(in)
180 require.True(t, ok)
181 require.Equal(t, expected, casted)
182
183 in = map[interface{}]float32{"test": float32(2.2)}
184 expected = map[interface{}]interface{}{"test": float32(2.2)}
185 casted, ok = InterfaceToInterfaceInterfaceMap(in)
186 require.True(t, ok)
187 require.Equal(t, expected, casted)
188}
189
190func TestJSONMarshallable(t *testing.T) {
191 var ok bool

Callers

nothing calls this directly

Calls 2

EqualMethod · 0.80

Tested by

no test coverage detected