Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Run ¶
func Run(t *testing.T, db TestableDB)
Run should be used to test any implementation of the storage.BeaconDB interface. An implementation interface should at least have one test method that calls this test-suite.
Types ¶
type TestableDB ¶
type TestableDB interface { storage.BeaconDB // We force all test implementations to implement cleanable. This ensures that we // explicitly have to opt-out of testing the clean-up functionality. This is a lot // safer than opting-in to testing it via interface smuggling. // To opt-out, simply define a "IgnoreCleanup" method on the type under test. beacon.Cleanable // Prepare should reset the internal state so that the db is empty and is ready to be tested. Prepare(*testing.T, context.Context) }
TestableDB extends the beacon db interface with methods that are needed for testing.
Click to show internal directories.
Click to hide internal directories.