testhelpers

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: Apache-2.0, MIT Imports: 12 Imported by: 0

Documentation

Overview

Package testhelpers contains functions which pretty-print test failures.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assert

func Assert(tb testing.TB, condition bool, msg string, v ...interface{})

Assert fails the test immediately if the condition is false. If the assertion fails the formatted message will be output to the console.

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

func Equals(tb testing.TB, want, got interface{})

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

func Ok(tb testing.TB, err error)

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.

Jump to

Keyboard shortcuts

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