Documentation ¶
Index ¶
- func Contains(tb testing.TB, container interface{}, item interface{}, ...)
- func Empty(tb testing.TB, v interface{}, msgAndArgs ...interface{})
- func Equal(tb testing.TB, expected, actual interface{}, msgAndArgs ...interface{})
- func Error(tb testing.TB, err error, msgAndArgs ...interface{})
- func False(tb testing.TB, v bool, msgAndArgs ...interface{})
- func Implement(tb testing.TB, v, iface interface{}, msgAndArgs ...interface{})
- func Nil(tb testing.TB, v interface{}, msgAndArgs ...interface{})
- func NoError(tb testing.TB, err error, msgAndArgs ...interface{})
- func NotContains(tb testing.TB, container interface{}, item interface{}, ...)
- func NotEmpty(tb testing.TB, v interface{}, msgAndArgs ...interface{})
- func NotEqual(tb testing.TB, expected, actual interface{}, msgAndArgs ...interface{})
- func NotNil(tb testing.TB, v interface{}, msgAndArgs ...interface{})
- func NotPanic(tb testing.TB, f func(), msgAndArgs ...interface{})
- func Panic(tb testing.TB, f func(), msgAndArgs ...interface{})
- func Range(tb testing.TB, actual, start, end interface{}, msgAndArgs ...interface{})
- func Same(tb testing.TB, expected, actual interface{}, msgAndArgs ...interface{})
- func True(tb testing.TB, v bool, msgAndArgs ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
Contains asserts that the specified string, list(array, slice...) or map contains the specified substring or element.
assert.Contains(t, "Hello World", "World", "But 'Hello World' does contain 'World'") assert.Contains(t, ["Hello", "World"], "World", "But ["Hello", "World"] does contain 'World'") assert.Contains(t, {"Hello": "World"}, "Hello", "But {'Hello': 'World'} does contain 'Hello'")
func Empty ¶
Empty asserts that the specified object is empty. I.e. nil, "", false, 0 or either a slice or a channel with len == 0.
func Implement ¶
Implement asserts that the object implements the interface type u.
Implement(t, &bytes.Buffer{}, (*io.Writer)(nil))
func NotContains ¶
NotContains asserts that the specified string, list(array, slice...) or map does NOT contain the specified substring or element.
assert.NotContains(t, "Hello World", "Earth", "But 'Hello World' does NOT contain 'Earth'") assert.NotContains(t, ["Hello", "World"], "Earth", "But ['Hello', 'World'] does NOT contain 'Earth'") assert.NotContains(t, {"Hello": "World"}, "Earth", "But {'Hello': 'World'} does NOT contain 'Earth'")
func NotPanic ¶
NotPanic asserts that the code inside the specified PanicTestFunc does NOT panic.
assert.NotPanic(t, func(){ Safe() }, "Calling Safe() should not panic")
func Panic ¶
Panic asserts that the code inside the specified PanicTestFunc panics.
assert.Panic(t, func(){ Fatal() }, "Calling Fatal() should panic")
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.