cachetest

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package cachetest provides a black-box conformance suite for storage.Cache implementations.

Every implementation must pass the same suite. A contract exercised by only one implementation is not a contract: the previous AdapterCache was shaped around Redis, its Redis implementation was removed, and the remaining in-memory one emulated the shape with string concatenation — nothing checked that the two ever agreed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(t *testing.T, newCache Factory)

Run executes the full suite against the implementation built by newCache.

func RunQueue

func RunQueue(t *testing.T, newQueue QueueFactory)

RunQueue executes the queue conformance suite against newQueue.

Types

type Factory

type Factory func(t *testing.T) storage.Cache

Factory builds a Cache for a single test. Cleanup is the caller's business; the suite always calls Close.

type QueueFactory

type QueueFactory func(t *testing.T) storage.Queue

QueueFactory builds a Queue for a single case.

Jump to

Keyboard shortcuts

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