Help us shape the future of Go! Take the 2026 Go Developer Survey

memorytest

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package memorytest checks memory.Store implementations against the contract the built-in stores follow.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(t *testing.T, newStore func(t *testing.T) memory.Store)

Run runs the conformance tests against stores made by newStore, which must return an empty store independent of the others; it is called once per subtest and subtests run in parallel. The contract:

  • Put rejects an entry without an ID and otherwise inserts or replaces the entry with its ID; Get and Delete of a missing entry return memory.ErrNotFound.
  • Every field round-trips: embeddings bit for bit, timestamps to the nanosecond; later changes to entries put or returned are not stored.
  • List returns the entries matching the filter (exact scope, all tags), oldest CreatedAt first, then by ID.
  • IDs and scopes are arbitrary UTF-8 strings of up to 255 bytes, compared exactly: case and trailing spaces matter.
  • A store that implements memory.ScopedDeleter deletes an entry only when its scope matches, atomically.
  • Entries of a megabyte are stored, and concurrent use is safe.

Types

This section is empty.

Jump to

Keyboard shortcuts

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