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

Function Containsf

assert/assertion_format.go:25–30  ·  view source on GitHub ↗

Containsf asserts that the specified string, list(array, slice...) or map contains the specified substring or element. assert.Containsf(t, "Hello World", "World", "error message %s", "formatted") assert.Containsf(t, ["Hello", "World"], "World", "error message %s", "formatted") assert.Containsf(t

(t TestingT, s interface{}, contains interface{}, msg string, args ...interface{})

Source from the content-addressed store, hash-verified

23// assert.Containsf(t, ["Hello", "World"], "World", "error message %s", "formatted")
24// assert.Containsf(t, {"Hello": "World"}, "Hello", "error message %s", "formatted")
25func Containsf(t TestingT, s interface{}, contains interface{}, msg string, args ...interface{}) bool {
26 if h, ok := t.(tHelper); ok {
27 h.Helper()
28 }
29 return Contains(t, s, contains, append([]interface{}{msg}, args...)...)
30}
31
32// DirExistsf checks whether a directory exists in the given path. It also fails
33// if the path is a file rather a directory or there is an error checking whether it exists.

Callers 2

ContainsfFunction · 0.92
ContainsfMethod · 0.70

Calls 2

ContainsFunction · 0.70
HelperMethod · 0.65

Tested by

no test coverage detected