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

Method Subset

assert/assertion_forward.go:1610–1615  ·  view source on GitHub ↗

Subset asserts that the list (array, slice, or map) contains all elements given in the subset (array, slice, or map). Map elements are key-value pairs unless compared with an array or slice where only the map key is evaluated. a.Subset([1, 2, 3], [1, 2]) a.Subset({"x": 1, "y": 2}, {"x": 1}) a.Su

(list interface{}, subset interface{}, msgAndArgs ...interface{})

Source from the content-addressed store, hash-verified

1608// a.Subset([1, 2, 3], {1: "one", 2: "two"})
1609// a.Subset({"x": 1, "y": 2}, ["x"])
1610func (a *Assertions) Subset(list interface{}, subset interface{}, msgAndArgs ...interface{}) bool {
1611 if h, ok := a.t.(tHelper); ok {
1612 h.Helper()
1613 }
1614 return Subset(a.t, list, subset, msgAndArgs...)
1615}
1616
1617// Subsetf asserts that the list (array, slice, or map) contains all elements
1618// given in the subset (array, slice, or map).

Callers

nothing calls this directly

Calls 2

SubsetFunction · 0.70
HelperMethod · 0.65

Tested by

no test coverage detected