isList checks that the provided value is array or slice.
(t TestingT, list interface{}, msgAndArgs ...interface{})
| 1106 | |
| 1107 | // isList checks that the provided value is array or slice. |
| 1108 | func isList(t TestingT, list interface{}, msgAndArgs ...interface{}) (ok bool) { |
| 1109 | kind := reflect.TypeOf(list).Kind() |
| 1110 | if kind != reflect.Array && kind != reflect.Slice { |
| 1111 | return Fail(t, fmt.Sprintf("%q has an unsupported type %s, expecting array or slice", list, kind), |
| 1112 | msgAndArgs...) |
| 1113 | } |
| 1114 | return true |
| 1115 | } |
| 1116 | |
| 1117 | // diffLists diffs two arrays/slices and returns slices of elements that are only in A and only in B. |
| 1118 | // If some element is present multiple times, each instance is counted separately (e.g. if something is 2x in A and |
no test coverage detected
searching dependent graphs…