mirror of
https://github.com/stretchr/testify.git
synced 2025-04-27 21:24:09 +00:00
Fix #117: Update require.Contains docs
This commit is contained in:
parent
8254b8f76b
commit
0d5a14c5a4
@ -137,9 +137,12 @@ func NotEqual(t TestingT, expected, actual interface{}, msgAndArgs ...interface{
|
||||
}
|
||||
}
|
||||
|
||||
// Contains asserts that the specified string contains the specified substring.
|
||||
// Contains asserts that the specified string, list(array, slice...) or map contains the
|
||||
// specified substring or element.
|
||||
//
|
||||
// require.Contains(t, "Hello World", "World", "But 'Hello World' does contain 'World'")
|
||||
// require.Contains(t, ["Hello", "World"], "World", "But ["Hello", "World"] does contain 'World'")
|
||||
// require.Contains(t, {"Hello": "World"}, "Hello", "But {'Hello': 'World'} does contain 'Hello'")
|
||||
func Contains(t TestingT, s, contains interface{}, msgAndArgs ...interface{}) {
|
||||
if !assert.Contains(t, s, contains, msgAndArgs...) {
|
||||
t.FailNow()
|
||||
|
Loading…
x
Reference in New Issue
Block a user