Documentation ¶
Overview ¶
Package testhelpers contains functions which pretty-print test failures.
Index ¶
- func Assert(tb testing.TB, condition bool, msg string, v ...interface{})
- func AssertProposalSent(t *testing.T, ses protocols.SideEffects, sp consensus_channel.SignedProposal, ...)
- func AssertStateSentTo(t *testing.T, ses protocols.SideEffects, expected state.SignedState, ...)
- func AssertStateSentToEveryone(t *testing.T, ses protocols.SideEffects, expected state.SignedState, ...)
- func Equals(tb testing.TB, want, got interface{})
- func GenerateTempStoreFolder() (dataFolder string, cleanup func())
- func Ok(tb testing.TB, err error)
- func SignState(ss *state.SignedState, secretKey *[]byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Assert ¶
Assert fails the test immediately if the condition is false. If the assertion fails the formatted message will be output to the console.
func AssertProposalSent ¶
func AssertProposalSent(t *testing.T, ses protocols.SideEffects, sp consensus_channel.SignedProposal, to testactors.Actor)
func AssertStateSentTo ¶
func AssertStateSentTo(t *testing.T, ses protocols.SideEffects, expected state.SignedState, to testactors.Actor)
AssertStateSentTo asserts that ses contains a message for the participant This assumes the `PayloadData` is an encoded `state.SignedState`
func AssertStateSentToEveryone ¶
func AssertStateSentToEveryone(t *testing.T, ses protocols.SideEffects, expected state.SignedState, from testactors.Actor, allActors []testactors.Actor)
AssertStateSentToEveryone asserts that ses contains a message for every participant but from This assumes the `PayloadData` is an encoded `state.SignedState`
func Equals ¶
Equals fails the test if want is not deeply equal to got. Equals uses reflect.DeepEqual to compare the two values.
func GenerateTempStoreFolder ¶
func GenerateTempStoreFolder() (dataFolder string, cleanup func())
GenerateTempStoreFolder generates a temporary folder for storing store data and a cleanup function to clean up the folder
func Ok ¶
Ok fails the test immediately if an err is not nil. If the error is not nil the message containing the error will be outputted to the console
func SignState ¶
func SignState(ss *state.SignedState, secretKey *[]byte)
SignState generates a signature on the signed state with the supplied key, and adds that signature. If an error occurs the function panics
Types ¶
This section is empty.