MCPcopy
hub / github.com/dgraph-io/dgraph / CompareJSON

Function CompareJSON

testutil/json.go:21–25  ·  view source on GitHub ↗

CompareJSON compares two JSON objects (passed as strings).

(t *testing.T, want, got string)

Source from the content-addressed store, hash-verified

19
20// CompareJSON compares two JSON objects (passed as strings).
21func CompareJSON(t *testing.T, want, got string) {
22 wantMap := UnmarshalJSON(t, want)
23 gotMap := UnmarshalJSON(t, got)
24 CompareJSONMaps(t, wantMap, gotMap)
25}
26
27// CompareJSONMaps compares two JSON objects (passed as maps).
28func CompareJSONMaps(t *testing.T, wantMap, gotMap map[string]interface{}) bool {

Callers 15

checkLoadedDataFunction · 0.92
TestUpsertExampleJSONFunction · 0.92
TestUpsertParallelFunction · 0.92
TestUpsertMultiValueFunction · 0.92
TestUpsertMultiValueEdgeFunction · 0.92
TestUpsertSanityCheckFunction · 0.92
TestMultipleMutationFunction · 0.92

Calls 2

UnmarshalJSONFunction · 0.85
CompareJSONMapsFunction · 0.85

Tested by 15

checkLoadedDataFunction · 0.74
TestUpsertExampleJSONFunction · 0.74
TestUpsertParallelFunction · 0.74
TestUpsertMultiValueFunction · 0.74
TestUpsertMultiValueEdgeFunction · 0.74
TestUpsertSanityCheckFunction · 0.74
TestMultipleMutationFunction · 0.74