Documentation
¶
Index ¶
- func Contains[T StringByte](t Testing, s T, substr T)
- func DirExists(t Testing, path string)
- func DirNotExists(t Testing, path string)
- func Empty(t Testing, got any)
- func Equal[T any](t Testing, expected T, actual T)
- func Error(t Testing, err error)
- func ErrorContains(t Testing, err error, substr string)
- func ErrorIs(t Testing, err error, target error)
- func ErrorNotContains(t Testing, err error, substr string)
- func False(t Testing, got bool)
- func FileExists(t Testing, path string)
- func FileNotExists(t Testing, path string)
- func Greater[T cmp.Ordered](t Testing, x T, y T)
- func GreaterOrEqual[T cmp.Ordered](t Testing, x T, y T)
- func HasPrefix[T StringByte](t Testing, s T, prefix T)
- func HasSuffix[T StringByte](t Testing, s T, prefix T)
- func Len(t Testing, object any, length int)
- func Less[T cmp.Ordered](t Testing, x T, y T)
- func LessOrEqual[T cmp.Ordered](t Testing, x T, y T)
- func Nil(t Testing, got any)
- func NoError(t Testing, err error)
- func NotContains[T StringByte](t Testing, s T, substr T)
- func NotEmpty(t Testing, got any)
- func NotEqual[T any](t Testing, expected T, actual T)
- func NotErrorIs(t Testing, err error, target error)
- func NotNil(t Testing, got any)
- func NotPrefix[T StringByte](t Testing, s T, prefix T)
- func NotSamePtr(t Testing, expected any, actual any)
- func NotSuffix[T StringByte](t Testing, s T, prefix T)
- func Panic(t Testing, fn func())
- func SamePtr(t Testing, expected any, actual any)
- func SliceContains[S ~[]E, E comparable](t Testing, values S, items ...E)
- func SliceNotContains[S ~[]E, E comparable](t Testing, values S, items ...E)
- func SliceSortEqual[S ~[]E, E cmp.Ordered](t Testing, expected S, actual S)
- func SliceSortNotEqual[S ~[]E, E cmp.Ordered](t Testing, expected S, actual S)
- func True(t Testing, got bool)
- type HTTPResponseChecker
- type Helper
- type StringByte
- type Testing
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
func Contains[T StringByte](t Testing, s T, substr T)
func DirNotExists ¶
func ErrorContains ¶
func ErrorNotContains ¶
func FileExists ¶
func FileNotExists ¶
func GreaterOrEqual ¶
func HasPrefix ¶
func HasPrefix[T StringByte](t Testing, s T, prefix T)
func HasSuffix ¶
func HasSuffix[T StringByte](t Testing, s T, prefix T)
func LessOrEqual ¶
func NotContains ¶
func NotContains[T StringByte](t Testing, s T, substr T)
func NotErrorIs ¶
func NotPrefix ¶
func NotPrefix[T StringByte](t Testing, s T, prefix T)
func NotSamePtr ¶
func NotSuffix ¶
func NotSuffix[T StringByte](t Testing, s T, prefix T)
func SliceContains ¶
func SliceContains[S ~[]E, E comparable](t Testing, values S, items ...E)
SliceContains 检查 values 是否包含 items
func SliceNotContains ¶
func SliceNotContains[S ~[]E, E comparable](t Testing, values S, items ...E)
SliceNotContains 检查 values 没哟包含 items
func SliceSortEqual ¶
SliceSortEqual 将两个 slice 排序后比较内容是否一样
func SliceSortNotEqual ¶
SliceSortNotEqual 将两个 slice 排序后比较内容是否不一样
Types ¶
type HTTPResponseChecker ¶
type HTTPResponseChecker struct {
// contains filtered or unexported fields
}
func WithHTTPResponse ¶
func WithHTTPResponse(t Testing, resp *http.Response) *HTTPResponseChecker
func (*HTTPResponseChecker) StatusCodeEqual ¶
func (hc *HTTPResponseChecker) StatusCodeEqual(code int) *HTTPResponseChecker
func (*HTTPResponseChecker) StatusCodeNotEqual ¶
func (hc *HTTPResponseChecker) StatusCodeNotEqual(code int) *HTTPResponseChecker
type StringByte ¶
Click to show internal directories.
Click to hide internal directories.