Subset asserts that the specified list(array, slice...) or map contains all elements given in the specified subset list(array, slice...) or map. assert.Subset(t, [1, 2, 3], [1, 2]) assert.Subset(t, {"x": 1, "y": 2}, {"x": 1})
(t TestingT, list interface{}, subset interface{}, msgAndArgs ...interface{})
| 1914 | // assert.Subset(t, [1, 2, 3], [1, 2]) |
| 1915 | // assert.Subset(t, {"x": 1, "y": 2}, {"x": 1}) |
| 1916 | func Subset(t TestingT, list interface{}, subset interface{}, msgAndArgs ...interface{}) { |
| 1917 | if h, ok := t.(tHelper); ok { |
| 1918 | h.Helper() |
| 1919 | } |
| 1920 | if assert.Subset(t, list, subset, msgAndArgs...) { |
| 1921 | return |
| 1922 | } |
| 1923 | t.FailNow() |
| 1924 | } |
| 1925 | |
| 1926 | // Subsetf asserts that the specified list(array, slice...) or map contains all |
| 1927 | // elements given in the specified subset list(array, slice...) or map. |