-
-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port Contains
method
#4
Conversation
Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Some comment, WDYT?
testutil/testutil.go
Outdated
@@ -92,6 +92,52 @@ func FaultOrPanicToErr(f func()) (err error) { | |||
return err | |||
} | |||
|
|||
// Contains fails the test if needle is not contained within haystack, if haystack or needle is | |||
// an empty slice, or if needle is longer than haystack. | |||
func Contains(tb testing.TB, haystack, needle []string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be.... generic? ;p
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise, let's use ContainsStringSlice
function name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right! Something generic would suit here. Let me try to tackle that in next PR. Changing name for now! 🙂
Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This ports the
Contains
method from Thanostestutil
package.