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