Skip to content

Commit b936ae3

Browse files
committed
Add map support doc comments to Subset and NotSubset
Signed-off-by: Justin Chadwell <[email protected]>
1 parent 4ae48e9 commit b936ae3

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
@@ -927,10 +927,11 @@ func NotContains(t TestingT, s, contains interface{}, msgAndArgs ...interface{})
927927

928928
}
929929

930-
// Subset asserts that the specified list(array, slice...) contains all
931-
// elements given in the specified subset(array, slice...).
930+
// Subset asserts that the specified list(array, slice...) or map contains all
931+
// elements given in the specified subset list(array, slice...) or map.
932932
//
933-
// assert.Subset(t, [1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]")
933+
// assert.Subset(t, [1, 2, 3], [1, 2])
934+
// assert.Subset(t, {"x": 1, "y": 2}, {"x": 1})
934935
func Subset(t TestingT, list, subset interface{}, msgAndArgs ...interface{}) (ok bool) {
935936
if h, ok := t.(tHelper); ok {
936937
h.Helper()
@@ -983,10 +984,12 @@ func Subset(t TestingT, list, subset interface{}, msgAndArgs ...interface{}) (ok
983984
return true
984985
}
985986

986-
// NotSubset asserts that the specified list(array, slice...) contains not all
987-
// elements given in the specified subset(array, slice...).
987+
// NotSubset asserts that the specified list(array, slice...) or map does NOT
988+
// contain all elements given in the specified subset list(array, slice...) or
989+
// map.
988990
//
989-
// assert.NotSubset(t, [1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]")
991+
// assert.NotSubset(t, [1, 3, 4], [1, 2])
992+
// assert.NotSubset(t, {"x": 1, "y": 2}, {"z": 3})
990993
func NotSubset(t TestingT, list, subset interface{}, msgAndArgs ...interface{}) (ok bool) {
991994
if h, ok := t.(tHelper); ok {
992995
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)