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

Function TestJSONSliceInt

map_test.go:117–130  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

115}
116
117func TestJSONSliceInt(t *testing.T) {
118 jsonString :=
119 `{
120 "a": [
121 {"b": 1},
122 {"c": 2}
123 ]
124 }`
125 m, err := objx.FromJSON(jsonString)
126
127 assert.Nil(t, err)
128 require.NotNil(t, m)
129 assert.Equal(t, []objx.Map{{"b": float64(1)}, {"c": float64(2)}}, m.Get("a").ObjxMapSlice())
130}
131
132func TestJSONSliceMixed(t *testing.T) {
133 jsonString :=

Callers

nothing calls this directly

Calls 6

FromJSONFunction · 0.92
ObjxMapSliceMethod · 0.80
GetMethod · 0.80
NilMethod · 0.45
NotNilMethod · 0.45
EqualMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…