storagetest

package
v1.3.8 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package storagetest verifies that storage interfaces behave correctly

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunMapStorageTests

func RunMapStorageTests(t *testing.T, storageFactory MapStorageFactory)

RunMapStorageTests runs all the map storage tests against the provided map storage implementation.

Types

type MapStorageFactory

type MapStorageFactory func(ctx context.Context, t *testing.T) (storage.MapStorage, storage.AdminStorage)

MapStorageFactory creates MapStorage and AdminStorage for a test to use.

type MapStorageTest

type MapStorageTest func(ctx context.Context, t *testing.T, s storage.MapStorage, as storage.AdminStorage)

MapStorageTest executes a test using the given storage implementations.

type MapTests

type MapTests struct{}

MapTests is a suite of tests to run against the storage.MapTest interface.

func (*MapTests) TestCheckDatabaseAccessible

func (*MapTests) TestCheckDatabaseAccessible(ctx context.Context, t *testing.T, s storage.MapStorage, _ storage.AdminStorage)

TestCheckDatabaseAccessible fails the test if the map storage is not accessible.

func (*MapTests) TestMapSnapshot

func (*MapTests) TestMapSnapshot(ctx context.Context, t *testing.T, s storage.MapStorage, as storage.AdminStorage)

TestMapSnapshot fails the test if MapStorage.SnapshotForTree() does not behave correctly.

Jump to

Keyboard shortcuts

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