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{})
| 23 | // assert.Containsf(t, ["Hello", "World"], "World", "error message %s", "formatted") |
| 24 | // assert.Containsf(t, {"Hello": "World"}, "Hello", "error message %s", "formatted") |
| 25 | func 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. |