MCPcopy Create free account
hub / github.com/chain/txvm / IsJSONSubset

Function IsJSONSubset

testutil/deepequal.go:187–201  ·  view source on GitHub ↗
(t testing.TB, a, b []byte, opts ...func(a, b interface{}))

Source from the content-addressed store, hash-verified

185}
186
187func IsJSONSubset(t testing.TB, a, b []byte, opts ...func(a, b interface{})) bool {
188 var aval, bval interface{}
189 err := json.Unmarshal(a, &aval)
190 if err != nil {
191 t.Fatalf("a: %s is not valid json", string(a))
192 }
193 err = json.Unmarshal(b, &bval)
194 if err != nil {
195 t.Fatalf("b: %s is not valid json", string(b))
196 }
197 for _, o := range opts {
198 o(aval, bval)
199 }
200 return IsSubset(aval, bval)
201}
202
203func IsSubset(a, b interface{}) bool {
204 if reflect.TypeOf(a) != reflect.TypeOf(b) {

Callers

nothing calls this directly

Calls 1

IsSubsetFunction · 0.85

Tested by

no test coverage detected