Skip to content

Commit dad0e4d

Browse files
jedevcdolmen
authored andcommitted
Add map support doc comments to Subset and NotSubset
Signed-off-by: Justin Chadwell <me@jedevc.com>
1 parent 43b2ef1 commit dad0e4d

File tree

5 files changed

+72
-48
lines changed

5 files changed

+72
-48
lines changed

assert/assertion_format.go

Lines changed: 9 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assert/assertion_forward.go

Lines changed: 18 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assert/assertions.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -929,10 +929,11 @@ func NotContains(t TestingT, s, contains interface{}, msgAndArgs ...interface{})
929929

930930
}
931931

932-
// Subset asserts that the specified list(array, slice...) contains all
933-
// elements given in the specified subset(array, slice...).
932+
// Subset asserts that the specified list(array, slice...) or map contains all
933+
// elements given in the specified subset list(array, slice...) or map.
934934
//
935-
// assert.Subset(t, [1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]")
935+
// assert.Subset(t, [1, 2, 3], [1, 2])
936+
// assert.Subset(t, {"x": 1, "y": 2}, {"x": 1})
936937
func Subset(t TestingT, list, subset interface{}, msgAndArgs ...interface{}) (ok bool) {
937938
if h, ok := t.(tHelper); ok {
938939
h.Helper()
@@ -985,10 +986,12 @@ func Subset(t TestingT, list, subset interface{}, msgAndArgs ...interface{}) (ok
985986
return true
986987
}
987988

988-
// NotSubset asserts that the specified list(array, slice...) contains not all
989-
// elements given in the specified subset(array, slice...).
989+
// NotSubset asserts that the specified list(array, slice...) or map does NOT
990+
// contain all elements given in the specified subset list(array, slice...) or
991+
// map.
990992
//
991-
// assert.NotSubset(t, [1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]")
993+
// assert.NotSubset(t, [1, 3, 4], [1, 2])
994+
// assert.NotSubset(t, {"x": 1, "y": 2}, {"z": 3})
992995
func NotSubset(t TestingT, list, subset interface{}, msgAndArgs ...interface{}) (ok bool) {
993996
if h, ok := t.(tHelper); ok {
994997
h.Helper()

require/require.go

Lines changed: 18 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

require/require_forward.go

Lines changed: 18 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)