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{})
| 947 | // assert.NotContains(t, ["Hello", "World"], "Earth") |
| 948 | // assert.NotContains(t, {"Hello": "World"}, "Earth") |
| 949 | func NotContains(t TestingT, s, contains interface{}, msgAndArgs ...interface{}) bool { |
| 950 | if h, ok := t.(tHelper); ok { |
| 951 | h.Helper() |
| 952 | } |
| 953 | |
| 954 | ok, found := containsElement(s, contains) |
| 955 | if !ok { |
| 956 | return Fail(t, fmt.Sprintf("%#v could not be applied builtin len()", s), msgAndArgs...) |
| 957 | } |
| 958 | if found { |
| 959 | return Fail(t, fmt.Sprintf("%#v should not contain %#v", s, contains), msgAndArgs...) |
| 960 | } |
| 961 | |
| 962 | return true |
| 963 | |
| 964 | } |
| 965 | |
| 966 | // Subset asserts that the specified list(array, slice...) or map contains all |
| 967 | // elements given in the specified subset list(array, slice...) or map. |
searching dependent graphs…