test_util

package
v0.12.4 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

View Source
const (
	BlsOptional = 0
	BlsRequired = 1
	BlsIgnored  = 2
)

Variables

This section is empty.

Functions

func Check added in v0.8.2

func Check(t *testing.T, err error)

func CompareStates added in v0.12.1

func CompareStates(spec *beacon.Spec, a *beacon.BeaconStateView, b *beacon.BeaconStateView) (diff string, err error)

func LoadSSZ added in v0.8.2

func LoadSSZ(t *testing.T, name string, dst codec.Deserializable, readPart TestPartReader) bool

func LoadSpecObj added in v0.12.2

func LoadSpecObj(t *testing.T, name string, dst beacon.SpecObj, readPart TestPartReader) bool

func LoadState added in v0.12.1

func LoadState(t *testing.T, name string, readPart TestPartReader) *beacon.BeaconStateView

func RunHandler added in v0.8.2

func RunHandler(t *testing.T, handlerPath string, caseRunner CaseRunner, spec *beacon.Spec)

func RunTransitionTest added in v0.8.2

func RunTransitionTest(t *testing.T, runnerName string, handlerName string, mkr TransitionCaseMaker)

Types

type BLSMeta added in v0.8.2

type BLSMeta struct {
	BlsSetting int `yaml:"bls_setting"`
}

type BaseTransitionTest added in v0.8.2

type BaseTransitionTest struct {
	Spec *beacon.Spec
	Pre  *beacon.BeaconStateView
	Post *beacon.BeaconStateView
}

func (*BaseTransitionTest) Check added in v0.8.2

func (c *BaseTransitionTest) Check(t *testing.T)

func (*BaseTransitionTest) ExpectingFailure added in v0.8.2

func (c *BaseTransitionTest) ExpectingFailure() bool

func (*BaseTransitionTest) Load added in v0.8.2

func (c *BaseTransitionTest) Load(t *testing.T, readPart TestPartReader)

type CaseRunner added in v0.8.2

type CaseRunner func(t *testing.T, readPart TestPartReader)

Runs a test case

func HandleBLS added in v0.8.2

func HandleBLS(testRunner CaseRunner) CaseRunner

type TestPart added in v0.8.2

type TestPart interface {
	io.Reader
	io.Closer
	Size() (uint64, error)
	Exists() bool
}

type TestPartReader added in v0.8.2

type TestPartReader interface {
	Part(name string) TestPart
	Spec() *beacon.Spec
}

type TransitionCaseMaker added in v0.8.2

type TransitionCaseMaker func() TransitionTest

type TransitionTest added in v0.8.2

type TransitionTest interface {
	Load(t *testing.T, readPart TestPartReader)
	ExpectingFailure() bool
	Run() error
	Check(t *testing.T)
}

Jump to

Keyboard shortcuts

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