Documentation
¶
Index ¶
- func Abs[T ~int | ~int8 | ~int16 | ~int32 | ~int64 | ~float32 | ~float64](num T) T
- func AssertEqual(t *testing.T, got, want any)
- func AssertFalse(t *testing.T, res bool)
- func AssertTrue(t *testing.T, res bool)
- func BitCountUint32(i uint32) int
- func BitCountUint64(i uint64) int
- func Contain[T comparable](container []T, target T) bool
- func ContainEqual[T constraints.Ordered](arrs [][]T, target []T) bool
- func Copy[T any](src []T) []T
- func ElementEqual[T constraints.Ordered](a []T, b []T) bool
- func EmbeddedSliceEqual[T constraints.Ordered](a [][]T, b [][]T) bool
- func PanicHelper(t *testing.T, fn func(), shouldPanic bool)
- func ShouldNotPanic(t *testing.T, fn func())
- func ShouldPanic(t *testing.T, fn func())
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertEqual ¶
func AssertFalse ¶
func AssertTrue ¶
func BitCountUint32 ¶
BitCountUint32 Returns the number of one-bits of the specified uint32 value.
func BitCountUint64 ¶
BitCountUint64 Returns the number of one-bits of the specified uint64 value.
func Contain ¶
func Contain[T comparable](container []T, target T) bool
Contain returns true if target is the element of container.
func ContainEqual ¶
func ContainEqual[T constraints.Ordered](arrs [][]T, target []T) bool
func Copy ¶
func Copy[T any](src []T) []T
Copy returns the copy of given slice. Maybe shallow copy depending on the type T, eg: pointer or map
func ElementEqual ¶
func ElementEqual[T constraints.Ordered](a []T, b []T) bool
ElementEqual 查看两个slice是否元素相同,不区分元素顺序
func EmbeddedSliceEqual ¶
func EmbeddedSliceEqual[T constraints.Ordered](a [][]T, b [][]T) bool
EmbeddedSliceEqual 判断内嵌的slice是否相同,不区分元素顺序
func PanicHelper ¶
PanicHelper wraps panic branch
func ShouldNotPanic ¶
ShouldNotPanic will report test error if panic
func ShouldPanic ¶
ShouldPanic will report test error if not panic
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.