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, item E)
- func SliceNotContains[S ~[]E, E comparable](t Testing, values S, item 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 ¶ added in v0.0.4
func Contains[T StringByte](t Testing, s T, substr T)
func DirNotExists ¶
func ErrorContains ¶ added in v0.0.6
func ErrorNotContains ¶ added in v0.0.6
func FileExists ¶
func FileNotExists ¶
func GreaterOrEqual ¶ added in v0.0.2
func HasPrefix ¶ added in v0.0.4
func HasPrefix[T StringByte](t Testing, s T, prefix T)
func HasSuffix ¶ added in v0.0.4
func HasSuffix[T StringByte](t Testing, s T, prefix T)
func LessOrEqual ¶ added in v0.0.2
func NotContains ¶ added in v0.0.4
func NotContains[T StringByte](t Testing, s T, substr T)
func NotErrorIs ¶ added in v0.0.2
func NotPrefix ¶ added in v0.0.4
func NotPrefix[T StringByte](t Testing, s T, prefix T)
func NotSamePtr ¶
func NotSuffix ¶ added in v0.0.4
func NotSuffix[T StringByte](t Testing, s T, prefix T)
func SliceContains ¶
func SliceContains[S ~[]E, E comparable](t Testing, values S, item E)
func SliceNotContains ¶
func SliceNotContains[S ~[]E, E comparable](t Testing, values S, item E)
func SliceSortEqual ¶ added in v0.0.6
SliceSortEqual 将两个 slice 排序后比较内容是否一样
func SliceSortNotEqual ¶ added in v0.0.6
SliceSortNotEqual 将两个 slice 排序后比较内容是否不一样
Types ¶
type HTTPResponseChecker ¶ added in v0.0.6
type HTTPResponseChecker struct {
// contains filtered or unexported fields
}
func WithHTTPResponse ¶ added in v0.0.6
func WithHTTPResponse(t Testing, resp *http.Response) *HTTPResponseChecker
func (*HTTPResponseChecker) StatusCodeEqual ¶ added in v0.0.6
func (hc *HTTPResponseChecker) StatusCodeEqual(code int) *HTTPResponseChecker
func (*HTTPResponseChecker) StatusCodeNotEqual ¶ added in v0.0.6
func (hc *HTTPResponseChecker) StatusCodeNotEqual(code int) *HTTPResponseChecker
type StringByte ¶ added in v0.0.4
Click to show internal directories.
Click to hide internal directories.