MCPcopy
hub / github.com/gotify/server / BodyEquals

Function BodyEquals

test/asserts.go:13–19  ·  view source on GitHub ↗

BodyEquals asserts the content from the response recorder with the encoded json of the provided instance.

(t assert.TestingT, obj interface{}, recorder *httptest.ResponseRecorder)

Source from the content-addressed store, hash-verified

11
12// BodyEquals asserts the content from the response recorder with the encoded json of the provided instance.
13func BodyEquals(t assert.TestingT, obj interface{}, recorder *httptest.ResponseRecorder) {
14 bytes, err := io.ReadAll(recorder.Body)
15 assert.Nil(t, err)
16 actual := string(bytes)
17
18 JSONEquals(t, obj, actual)
19}
20
21// JSONEquals asserts the content of the string with the encoded json of the provided instance.
22func JSONEquals(t assert.TestingT, obj interface{}, expected string) {

Calls 1

JSONEqualsFunction · 0.85

Used in the wild real call sites across dependent graphs

searching dependent graphs…