Documentation ¶
Overview ¶
Package test contains a backend acceptance test suite that is backend implementation independent each backend will use the suite to test itself
Index ¶
- func ExpectItems(c *check.C, items, expected []backend.Item)
- func MakePrefix() func(k string) []byte
- type BackendSuite
- func (s *BackendSuite) CRUD(c *check.C)
- func (s *BackendSuite) CompareAndSwap(c *check.C)
- func (s *BackendSuite) ConcurrentOperations(c *check.C)
- func (s *BackendSuite) DeleteRange(c *check.C)
- func (s *BackendSuite) Events(c *check.C)
- func (s *BackendSuite) Expiration(c *check.C)
- func (s *BackendSuite) KeepAlive(c *check.C)
- func (s *BackendSuite) Locking(c *check.C)
- func (s *BackendSuite) Mirror(c *check.C, b backend.Backend)
- func (s *BackendSuite) PutRange(c *check.C)
- func (s *BackendSuite) Range(c *check.C)
- func (s *BackendSuite) WatchersClose(c *check.C)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpectItems ¶
ExpectItems tests that items equal to expected list
func MakePrefix ¶
MakePrefix returns function that appends unique prefix to any key, used to make test suite concurrent-run proof
Types ¶
type BackendSuite ¶
type BackendSuite struct { B backend.Backend // B2 is a backend opened to the same database, // used for concurrent operations tests B2 backend.Backend NewBackend func() (backend.Backend, error) }
func (*BackendSuite) CRUD ¶
func (s *BackendSuite) CRUD(c *check.C)
CRUD tests create read update scenarios
func (*BackendSuite) CompareAndSwap ¶
func (s *BackendSuite) CompareAndSwap(c *check.C)
CompareAndSwap tests compare and swap functionality
func (*BackendSuite) ConcurrentOperations ¶
func (s *BackendSuite) ConcurrentOperations(c *check.C)
ConcurrentOperations tests concurrent operations on the same shared backend
func (*BackendSuite) DeleteRange ¶
func (s *BackendSuite) DeleteRange(c *check.C)
DeleteRange tests delete items by range
func (*BackendSuite) Events ¶
func (s *BackendSuite) Events(c *check.C)
Events tests scenarios with event watches
func (*BackendSuite) Expiration ¶
func (s *BackendSuite) Expiration(c *check.C)
Expiration tests scenario with expiring values
func (*BackendSuite) KeepAlive ¶
func (s *BackendSuite) KeepAlive(c *check.C)
KeepAlive tests keep alive API
func (*BackendSuite) Locking ¶
func (s *BackendSuite) Locking(c *check.C)
Locking tests locking logic
func (*BackendSuite) Mirror ¶
func (s *BackendSuite) Mirror(c *check.C, b backend.Backend)
Mirror tests mirror mode for backends (used in caches). Only some backends support mirror mode (like memory).
func (*BackendSuite) PutRange ¶
func (s *BackendSuite) PutRange(c *check.C)
PutRange tests scenarios with put range
func (*BackendSuite) Range ¶
func (s *BackendSuite) Range(c *check.C)
Range tests scenarios with range queries
func (*BackendSuite) WatchersClose ¶
func (s *BackendSuite) WatchersClose(c *check.C)
WatchersClose tests scenarios with watches close