testutil

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeepEqual

func DeepEqual(t *testing.T, want, got interface{})

func Diff

func Diff(t *testing.T, want, got interface{})

Diff tests want and got are equals. If there are difference, fail test and print diff. See https://pkg.go.dev/github.com/google/go-cmp/cmp#Diff

func ExecuteCommand

func ExecuteCommand(t *testing.T, cmd *cobra.Command, command, in string) string

func FatalIfErrIsUnexpected added in v0.1.4

func FatalIfErrIsUnexpected(t *testing.T, wantErr bool, gotErr error) bool

func MustNewTag added in v0.1.4

func MustNewTag(id model.TagID, name string, index int) *model.Tag

MustNewTag construct and returns Tag. Panic if invalid parameters are provided.

func MustNewUnindexedTag added in v0.1.4

func MustNewUnindexedTag(id model.TagID, name string) *model.UnindexedTag

MustNewUnindexedTag construct and returns UnindexedTag. Panic if invalid parameters are provided.

func MustNewUnregisteredTag added in v0.1.4

func MustNewUnregisteredTag(name string, index int) *model.UnregisteredTag

MustNewUnregisteredTag construct and returns Tag. Panic if invalid parameters are provided.

func MustNewUnregisteredUnindexedTag added in v0.1.4

func MustNewUnregisteredUnindexedTag(name string) *model.UnregisteredUnindexedTag

MustNewUnregisteredUnindexedTag construct and returns UnindexedTag. Panic if invalid parameters are provided.

func NewMockDispatcher added in v0.1.6

func NewMockDispatcher(t *testing.T) *mockDispatcher

func NewTempBoltDB added in v0.1.4

func NewTempBoltDB(t *testing.T) (db *bolt.DB, closeF func() error, removeF func())

func NewTempDBFile

func NewTempDBFile(t *testing.T) (file *os.File, closeF func(), removeF func())

func PanicIfErrExist added in v0.1.4

func PanicIfErrExist(err error)

func ReadAllAssetsFromCh added in v0.1.6

func ReadAllAssetsFromCh(ch <-chan *model.Asset) (assets []*model.Asset)

ReadAllAssetsFromCh read all assets from channel

func UseTempBoltDB added in v0.1.4

func UseTempBoltDB(t *testing.T, f func(db *bolt.DB) error) (err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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