MCPcopy
hub / github.com/expr-lang/expr / HTTPBodyContains

Function HTTPBodyContains

internal/testify/require/require.go:663–671  ·  view source on GitHub ↗

HTTPBodyContains asserts that a specified handler returns a body that contains a string. assert.HTTPBodyContains(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky") Returns whether the assertion was successful (true) or not (false).

(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msgAndArgs ...interface{})

Source from the content-addressed store, hash-verified

661//
662// Returns whether the assertion was successful (true) or not (false).
663func HTTPBodyContains(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) {
664 if h, ok := t.(tHelper); ok {
665 h.Helper()
666 }
667 if assert.HTTPBodyContains(t, handler, method, url, values, str, msgAndArgs...) {
668 return
669 }
670 t.FailNow()
671}
672
673// HTTPBodyContainsf asserts that a specified handler returns a
674// body that contains a string.

Callers 1

HTTPBodyContainsMethod · 0.70

Calls 3

HTTPBodyContainsFunction · 0.92
FailNowMethod · 0.65
HelperMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…