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

Function Subsetf

require/require.go:2050–2058  ·  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. require.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

2048// require.Subsetf(t, [1, 2, 3], {1: "one", 2: "two"}, "error message %s", "formatted")
2049// require.Subsetf(t, {"x": 1, "y": 2}, ["x"], "error message %s", "formatted")
2050func Subsetf(t TestingT, list interface{}, subset interface{}, msg string, args ...interface{}) {
2051 if h, ok := t.(tHelper); ok {
2052 h.Helper()
2053 }
2054 if assert.Subsetf(t, list, subset, msg, args...) {
2055 return
2056 }
2057 t.FailNow()
2058}
2059
2060// True asserts that the specified value is true.
2061//

Callers 1

SubsetfMethod · 0.70

Calls 3

SubsetfFunction · 0.92
HelperMethod · 0.65
FailNowMethod · 0.65

Tested by

no test coverage detected