MCPcopy Index your code
hub / github.com/gavv/httpexpect / NotContains

Method NotContains

array.go:1229–1259  ·  view source on GitHub ↗

Deprecated: use NotContainsAll or NotContainsAny instead.

(values ...interface{})

Source from the content-addressed store, hash-verified

1227
1228// Deprecated: use NotContainsAll or NotContainsAny instead.
1229func (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.

Callers 5

TestString_FailedChainFunction · 0.45
TestString_ContainsFunction · 0.45
TestArray_FailedChainFunction · 0.45
TestArray_ContainsFunction · 0.45

Calls 6

canonArrayFunction · 0.85
countElementFunction · 0.85
enterMethod · 0.80
leaveMethod · 0.80
failedMethod · 0.80
failMethod · 0.80

Tested by 5

TestString_FailedChainFunction · 0.36
TestString_ContainsFunction · 0.36
TestArray_FailedChainFunction · 0.36
TestArray_ContainsFunction · 0.36