Deprecated: use NotContainsAll or NotContainsAny instead.
(values ...interface{})
| 1227 | |
| 1228 | // Deprecated: use NotContainsAll or NotContainsAny instead. |
| 1229 | func (a *Array) NotContains(values ...interface{}) *Array { |
| 1230 | opChain := a.chain.enter("NotContains()") |
| 1231 | defer opChain.leave() |
| 1232 | |
| 1233 | if opChain.failed() { |
| 1234 | return a |
| 1235 | } |
| 1236 | |
| 1237 | elements, ok := canonArray(opChain, values) |
| 1238 | if !ok { |
| 1239 | return a |
| 1240 | } |
| 1241 | |
| 1242 | for _, expected := range elements { |
| 1243 | if !(countElement(a.value, expected) == 0) { |
| 1244 | opChain.fail(AssertionFailure{ |
| 1245 | Type: AssertNotContainsElement, |
| 1246 | Actual: &AssertionValue{a.value}, |
| 1247 | Expected: &AssertionValue{expected}, |
| 1248 | Reference: &AssertionValue{values}, |
| 1249 | Errors: []error{ |
| 1250 | errors.New("expected:" + |
| 1251 | " array does not contain any elements from reference array"), |
| 1252 | }, |
| 1253 | }) |
| 1254 | break |
| 1255 | } |
| 1256 | } |
| 1257 | |
| 1258 | return a |
| 1259 | } |
| 1260 | |
| 1261 | // ContainsAll succeeds if array contains all given elements (in any order). |
| 1262 | // Before comparison, array and all elements are converted to canonical form. |