NotContains asserts that the specified string, list(array, slice...) or map does NOT contain the specified substring or element. assert.NotContains(t, "Hello World", "Earth") assert.NotContains(t, ["Hello", "World"], "Earth") assert.NotContains(t, {"Hello": "World"}, "Earth")
(t TestingT, s, contains interface{}, msgAndArgs ...interface{})
| 980 | // assert.NotContains(t, ["Hello", "World"], "Earth") |
| 981 | // assert.NotContains(t, {"Hello": "World"}, "Earth") |
| 982 | func NotContains(t TestingT, s, contains interface{}, msgAndArgs ...interface{}) bool { |
| 983 | if h, ok := t.(tHelper); ok { |
| 984 | h.Helper() |
| 985 | } |
| 986 | |
| 987 | ok, found := containsElement(s, contains) |
| 988 | if !ok { |
| 989 | return Fail(t, fmt.Sprintf("%#v could not be applied builtin len()", s), msgAndArgs...) |
| 990 | } |
| 991 | if found { |
| 992 | return Fail(t, fmt.Sprintf("%#v should not contain %#v", s, contains), msgAndArgs...) |
| 993 | } |
| 994 | |
| 995 | return true |
| 996 | } |
| 997 | |
| 998 | // Subset asserts that the list (array, slice, or map) contains all elements |
| 999 | // given in the subset (array, slice, or map). |