EqualJSON compares two JSON objects for equality.
(t *testing.T, want, got string, savepath string, quiet bool)
| 31 | |
| 32 | // EqualJSON compares two JSON objects for equality. |
| 33 | func EqualJSON(t *testing.T, want, got string, savepath string, quiet bool) bool { |
| 34 | wantMap := UnmarshalJSON(t, want) |
| 35 | gotMap := UnmarshalJSON(t, got) |
| 36 | |
| 37 | return DiffJSONMaps(t, wantMap, gotMap, savepath, quiet) |
| 38 | } |
| 39 | |
| 40 | // UnmarshalJSON unmarshals the given string into a map. |
| 41 | func UnmarshalJSON(t *testing.T, jsonStr string) map[string]interface{} { |