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

Method Contains

require/require_forward.go:34–39  ·  view source on GitHub ↗

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

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

Callers 1

TestContainsWrapperFunction · 0.45

Calls 2

ContainsFunction · 0.70
HelperMethod · 0.65

Tested by 1

TestContainsWrapperFunction · 0.36