Documentation
¶
Overview ¶
Package raftenginetest provides a shared conformance test suite for raftengine.Engine implementations. Each engine package should call RunConformanceSuite with its own Factory in a _test.go file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunConformanceSuite ¶
func RunConformanceSuite(t *testing.T, factory raftengine.Factory)
RunConformanceSuite runs the shared conformance tests against the given factory. The factory should create single-node, self-bootstrapping engines.
Types ¶
type TestStateMachine ¶
type TestStateMachine struct {
// contains filtered or unexported fields
}
TestStateMachine is a simple in-memory state machine for testing. It records all applied entries and supports snapshot/restore via a binary encoding.
func (*TestStateMachine) Applied ¶
func (s *TestStateMachine) Applied() [][]byte
func (*TestStateMachine) Apply ¶
func (s *TestStateMachine) Apply(data []byte) any
func (*TestStateMachine) Snapshot ¶
func (s *TestStateMachine) Snapshot() (raftengine.Snapshot, error)
Click to show internal directories.
Click to hide internal directories.