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{})
| 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") |
| 815 | func 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 | // |