assert

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equal

func Equal(t *testing.T, exp, got interface{}, args ...interface{})

Equal Judge whether the values are not equal

@param t   test
@param exp expect result
@param got compared value
@param args error prompt content

func IsFalse

func IsFalse(t *testing.T, result bool, args ...interface{})

IsFalse Judge whether the value is false

@param t      test
@param result false
@param args   error prompt content

func IsNull

func IsNull(t *testing.T, got interface{}, args ...interface{})

IsNull Judge whether the value is nil

@param t    test
@param got  want type
@param args error prompt content

func IsTrue

func IsTrue(t *testing.T, result bool, args ...interface{})

IsTrue Judge whether the value is true

@param t      test
@param result true
@param args   error prompt content

func Matches added in v0.0.9

func Matches(t *testing.T, value, expr string)

Matches asserts that a value matches a given regular expression.

@param t test
@param value value
@param expr got

func NotEqual

func NotEqual(t *testing.T, exp, got interface{}, args ...interface{})

NotEqual Judge whether the values are equal

@param t   test
@param exp expect result
@param got compared value
@param args error prompt content

func Panic added in v0.0.9

func Panic(t *testing.T, fn func(), matches string)

Panic asserts that function fn() panics. It assumes that recover() either returns a string or an error and fails if the message does not match the regular expression in 'matches'.

@param t tet
@param fn function
@param matches matcher

Types

This section is empty.

Jump to

Keyboard shortcuts

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