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

Function Subsetf

assert/assertion_format.go:815–820  ·  view source on GitHub ↗

Subsetf 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. assert.Subsetf(t, [1, 2, 3], [1, 2], "error message %s", "formatted")

(t TestingT, list interface{}, subset interface{}, msg string, args ...interface{})

Source from the content-addressed store, hash-verified

813// assert.Subsetf(t, [1, 2, 3], {1: "one", 2: "two"}, "error message %s", "formatted")
814// assert.Subsetf(t, {"x": 1, "y": 2}, ["x"], "error message %s", "formatted")
815func Subsetf(t TestingT, list interface{}, subset interface{}, msg string, args ...interface{}) bool {
816 if h, ok := t.(tHelper); ok {
817 h.Helper()
818 }
819 return Subset(t, list, subset, append([]interface{}{msg}, args...)...)
820}
821
822// Truef asserts that the specified value is true.
823//

Callers 2

SubsetfFunction · 0.92
SubsetfMethod · 0.70

Calls 2

SubsetFunction · 0.70
HelperMethod · 0.65

Tested by

no test coverage detected