MCPcopy
hub / github.com/stretchr/testify / isList

Function isList

assert/assertions.go:1161–1168  ·  view source on GitHub ↗

isList checks that the provided value is array or slice.

(t TestingT, list interface{}, msgAndArgs ...interface{})

Source from the content-addressed store, hash-verified

1159
1160// isList checks that the provided value is array or slice.
1161func isList(t TestingT, list interface{}, msgAndArgs ...interface{}) (ok bool) {
1162 kind := reflect.TypeOf(list).Kind()
1163 if kind != reflect.Array && kind != reflect.Slice {
1164 return Fail(t, fmt.Sprintf("%q has an unsupported type %s, expecting array or slice", list, kind),
1165 msgAndArgs...)
1166 }
1167 return true
1168}
1169
1170// diffLists diffs two arrays/slices and returns slices of elements that are only in A and only in B.
1171// If some element is present multiple times, each instance is counted separately (e.g. if something is 2x in A and

Callers 2

ElementsMatchFunction · 0.85
NotElementsMatchFunction · 0.85

Calls 1

FailFunction · 0.70

Tested by

no test coverage detected