xt

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TestHelper = (*testing.T).Helper

Functions

func Assert

func Assert(t *testing.T, condition bool, messages ...string)

Assert checks if condition is true. When not, messages are displayed. This is equivalent as Eq(t, true, condition, messages...).

func Eq

func Eq(t *testing.T, expect, have any, messages ...string)

Eq checks whether the expected value is equal to what we have. Messages are printed after

func KO

func KO(t *testing.T, err error, messages ...string)

KO checks whether err is not nil.

Reverse of OK, and also, well, you know 💥🥊.

This could be replaced with using Eq, but since checking the error in Go is done lots, it is nicer to read in tests.

func MatchString

func MatchString(t *testing.T, pattern, s string, messages ...string)

MatchString tests whether the string s matches the regular expression pattern.

func OK

func OK(t *testing.T, err error, messages ...string)

OK checks whether err is nil. This could be replaced with using Eq, but since checking the error in Go is done lots, it is nicer to read in tests.

func Panics

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

Panics checks if function f panics.

func PanicsEq

func PanicsEq(t *testing.T, exp string, f func())

PanicsEq checks if function f panics and whether the panic message is equal to exp.

Types

This section is empty.

Jump to

Keyboard shortcuts

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