JSONEquals asserts the content of the string with the encoded json of the provided instance.
(t assert.TestingT, obj interface{}, expected string)
| 20 | |
| 21 | // JSONEquals asserts the content of the string with the encoded json of the provided instance. |
| 22 | func JSONEquals(t assert.TestingT, obj interface{}, expected string) { |
| 23 | bytes, err := json.Marshal(obj) |
| 24 | assert.Nil(t, err) |
| 25 | objJSON := string(bytes) |
| 26 | |
| 27 | assert.JSONEq(t, expected, objJSON) |
| 28 | } |
| 29 | |
| 30 | type unreadableReader struct{} |
| 31 |
no outgoing calls
searching dependent graphs…