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{})
| 1929 | // assert.Subsetf(t, [1, 2, 3], [1, 2], "error message %s", "formatted") |
| 1930 | // assert.Subsetf(t, {"x": 1, "y": 2}, {"x": 1}, "error message %s", "formatted") |
| 1931 | func Subsetf(t TestingT, list interface{}, subset interface{}, msg string, args ...interface{}) { |
| 1932 | if h, ok := t.(tHelper); ok { |
| 1933 | h.Helper() |
| 1934 | } |
| 1935 | if assert.Subsetf(t, list, subset, msg, args...) { |
| 1936 | return |
| 1937 | } |
| 1938 | t.FailNow() |
| 1939 | } |
| 1940 | |
| 1941 | // True asserts that the specified value is true. |
| 1942 | // |