test

package
v4.3.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpectItems

func ExpectItems(c *check.C, items, expected []backend.Item)

ExpectItems tests that items equal to expected list

func MakePrefix

func MakePrefix() func(k string) []byte

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

Jump to

Keyboard shortcuts

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