Slice operator compares the contents of a slice or a pointer on a
slice against the values of model and the values of
expectedEntries. Entries with zero values of model are ignored
if the same entry is present in expectedEntries, otherwise they
are taken into account. An entry cannot be present in both model
and expectedEntries, except if it is a zero-value in model. At
the end, all entries are checked. To check only some entries of a
slice, see SuperSliceOf operator.
model must be the same type as compared data.
expectedEntries can be omitted, if no zero entries are expected and
no TestDeep operators are involved. If expectedEntries contains
more than one item, all items are merged before their use, from
left to right.
args… are optional and allow to name the test. This name is
used in case of failure to qualify the test. If len(args) > 1 and
the first item of args is a string and contains a ‘%’ rune then
fmt.Fprintf is used to compose the name, else args are passed to
fmt.Fprint. Do not forget it is the name of the test, not the
reason of a potential failure.
Slice optional parameter expectedEntries is here mandatory.
nil value should be passed to mimic its absence in
original Slice call.
Returns true if the test is OK, false if it fails.
args… are optional and allow to name the test. This name is
used in case of failure to qualify the test. If len(args) > 1 and
the first item of args is a string and contains a ‘%’ rune then
fmt.Fprintf is used to compose the name, else args are passed to
fmt.Fprint. Do not forget it is the name of the test, not the
reason of a potential failure.