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

Method Containsf

assert/assertion_forward.go:46–51  ·  view source on GitHub ↗

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

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

Source from the content-addressed store, hash-verified

44// a.Containsf(["Hello", "World"], "World", "error message %s", "formatted")
45// a.Containsf({"Hello": "World"}, "Hello", "error message %s", "formatted")
46func (a *Assertions) Containsf(s interface{}, contains interface{}, msg string, args ...interface{}) bool {
47 if h, ok := a.t.(tHelper); ok {
48 h.Helper()
49 }
50 return Containsf(a.t, s, contains, msg, args...)
51}
52
53// DirExists checks whether a directory exists in the given path. It also fails
54// if the path is a file rather a directory or there is an error checking whether it exists.

Callers

nothing calls this directly

Calls 2

ContainsfFunction · 0.70
HelperMethod · 0.65

Tested by

no test coverage detected