assert

package
v1.4.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 12 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(tb testing.TB, value string, msgAndArgs ...string)

func DeepEqual

func DeepEqual(expected, actual any) bool

DeepEqual Ref: stretchr/testify

func Empty

func Empty(tb testing.TB, value any, msgAndArgs ...any)

func Equal

func Equal(tb testing.TB, expected, actual any, msgAndArgs ...any)

Equal checks if values are equal Ref: gofiber/utils

func False

func False(tb testing.TB, value bool, msgAndArgs ...any)

func IsEmpty

func IsEmpty(o any) bool

IsEmpty gets whether the specified object is considered empty or not. Ref: stretchr/testify

func IsNil

func IsNil(o any) bool

IsNil 判断 nil 接口, 以及接口中保存的 channel, func, interface, map, pointer, slice 或 unsafe.Pointer 是否为 nil. 接口只有在动态类型和值均为空时才等于 nil; 保存带类型的 nil 指针时, 接口本身不等于 nil, 本函数仍会通过反射将该值识别为 nil. struct, int 等不可为 nil 的类型返回 false.

Ref: stretchr/testify

func Nil

func Nil(tb testing.TB, value any, msgAndArgs ...any)

func NotEmpty

func NotEmpty(tb testing.TB, value any, msgAndArgs ...any)

func NotEqual

func NotEqual(tb testing.TB, expected, actual any, msgAndArgs ...any)

func NotNil

func NotNil(tb testing.TB, value any, msgAndArgs ...any)

func Panics

func Panics(t *testing.T, title string, f func())

Panics 断言 panic

func True

func True(tb testing.TB, value bool, msgAndArgs ...any)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL