MCPcopy
hub / github.com/stretchr/testify / Contains

Method Contains

assert/assertion_forward.go:33–38  ·  assert/assertion_forward.go::Assertions.Contains

Contains asserts that the specified string, list(array, slice...) or map contains the specified substring or element. a.Contains("Hello World", "World") a.Contains(["Hello", "World"], "World") a.Contains({"Hello": "World"}, "Hello")

(s interface{}, contains interface{}, msgAndArgs ...interface{})

Source from the content-addressed store, hash-verified

31// a.Contains(["Hello", "World"], "World")
32// a.Contains({"Hello": "World"}, "Hello")
33func (a *Assertions) Contains(s interface{}, contains interface{}, msgAndArgs ...interface{}) bool {
34 if h, ok := a.t.(tHelper); ok {
35 h.Helper()
36 }
37 return Contains(a.t, s, contains, msgAndArgs...)
38}
39
40// Containsf asserts that the specified string, list(array, slice...) or map contains the
41// specified substring or element.

Callers 14

TestContainsWrapperFunction · 0.45
TestHTTPSuccessFunction · 0.45
TestHTTPRedirectFunction · 0.45
TestHTTPErrorFunction · 0.45
TestHTTPStatusCodeFunction · 0.45
TestHttpBodyFunction · 0.45
HTTPBodyContainsFunction · 0.45
HTTPBodyNotContainsFunction · 0.45
TestEqualExportedValuesFunction · 0.45
TestSubsetNotSubsetFunction · 0.45

Calls 2

ContainsFunction · 0.70
HelperMethod · 0.65

Tested by 10

TestContainsWrapperFunction · 0.36
TestHTTPSuccessFunction · 0.36
TestHTTPRedirectFunction · 0.36
TestHTTPErrorFunction · 0.36
TestHTTPStatusCodeFunction · 0.36
TestHttpBodyFunction · 0.36
TestEqualExportedValuesFunction · 0.36
TestSubsetNotSubsetFunction · 0.36