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

Function Containsf

require/require.go:56–64  ·  view source on GitHub ↗

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

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

Source from the content-addressed store, hash-verified

54// require.Containsf(t, ["Hello", "World"], "World", "error message %s", "formatted")
55// require.Containsf(t, {"Hello": "World"}, "Hello", "error message %s", "formatted")
56func Containsf(t TestingT, s interface{}, contains interface{}, msg string, args ...interface{}) {
57 if h, ok := t.(tHelper); ok {
58 h.Helper()
59 }
60 if assert.Containsf(t, s, contains, msg, args...) {
61 return
62 }
63 t.FailNow()
64}
65
66// DirExists checks whether a directory exists in the given path. It also fails
67// if the path is a file rather a directory or there is an error checking whether it exists.

Callers 1

ContainsfMethod · 0.70

Calls 3

ContainsfFunction · 0.92
HelperMethod · 0.65
FailNowMethod · 0.65

Tested by

no test coverage detected