testing

package
v0.1.19 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: MIT Imports: 12 Imported by: 3

Documentation

Overview

Package testing provides a testing object, and actors and rules for automatic testing.

Package testing provides a testing object T with a predefined context and functions for classical unit testing. In addition there is a testing object TF with additianal features for functional testing in the actor-based integrator environment.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckMessage

func CheckMessage(ctx *b.Context, spec m.Map, msg *b.Message)

func Panic

func Panic(ctx *b.Context, spec m.Map, msg *b.Message)

Types

type T

type T struct {
	*st.T
	Ctx *b.Context
}

func MakeT

func MakeT(tbase *testing.T) *T

func SetUp

func SetUp(tbase *testing.T) *T

func (*T) Run

func (t *T) Run(name string, f func(*T)) bool

type TF added in v0.1.8

type TF struct {
	*T
	WaitGroup *sync.WaitGroup

	Tester *b.Context
	// contains filtered or unexported fields
}

func MakeTF added in v0.1.8

func MakeTF(tbase *testing.T) *TF

func SetUpF added in v0.1.8

func SetUpF(tbase *testing.T, home string, conf m.Map, logger b.Logger) *TF

func SetUpFWithForge added in v0.1.19

func SetUpFWithForge(tbase *testing.T, home string, conf m.Map,
	logger b.Logger, fe *forge.ForgeEnv) *TF

func (*TF) AddCheck added in v0.1.13

func (t *TF) AddCheck(f func())

func (*TF) AssertNoUncheckedMessages added in v0.1.8

func (t *TF) AssertNoUncheckedMessages()

AssertNoUncheckedMessages is called during TearDown and logs an error if there are any expected messages (added via ExpectMsg()) left that have not been received by the test receiver / `check-message` handler.

func (*TF) Check added in v0.1.13

func (t *TF) Check()

Check is called during TearDown and calls all check functions added via AddCheck()

func (*TF) ExpectMsg added in v0.1.8

func (t *TF) ExpectMsg(key, value string)

func (*TF) GetSession added in v0.1.19

func (st *TF) GetSession(sid string) b.Session

func (*TF) GetSessionMailbox added in v0.1.8

func (st *TF) GetSessionMailbox(sid string) b.Mailbox

func (*TF) Run added in v0.1.8

func (t *TF) Run(name string, f func(*TF)) bool

func (*TF) TearDown added in v0.1.8

func (t *TF) TearDown()

Jump to

Keyboard shortcuts

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