MCPcopy Create free account
hub / github.com/stretchr/testify / Subsetf

Function Subsetf

assert/assertion_format.go:790–795  ·  view source on GitHub ↗

Subsetf asserts that the specified list(array, slice...) or map contains all elements given in the specified subset list(array, slice...) or map. assert.Subsetf(t, [1, 2, 3], [1, 2], "error message %s", "formatted") assert.Subsetf(t, {"x": 1, "y": 2}, {"x": 1}, "error message %s", "formatted")

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

Source from the content-addressed store, hash-verified

788// assert.Subsetf(t, [1, 2, 3], [1, 2], "error message %s", "formatted")
789// assert.Subsetf(t, {"x": 1, "y": 2}, {"x": 1}, "error message %s", "formatted")
790func Subsetf(t TestingT, list interface{}, subset interface{}, msg string, args ...interface{}) bool {
791 if h, ok := t.(tHelper); ok {
792 h.Helper()
793 }
794 return Subset(t, list, subset, append([]interface{}{msg}, args...)...)
795}
796
797// Truef asserts that the specified value is true.
798//

Callers 2

SubsetfFunction · 0.92
SubsetfMethod · 0.70

Calls 2

SubsetFunction · 0.70
HelperMethod · 0.65

Tested by

no test coverage detected