threadtest

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package threadtest is the shared conformance table for thread.Storage backends — the executable form of ADR 0011 §5's promises. Every backend runs it before it may call itself a backend (the store's storetest precedent: LangGraph ships one table for its savers and got five backends out of it); Run takes a factory so each subtest gets fresh storage.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(t *testing.T, open func(t *testing.T) thread.Storage)

Run executes the conformance table against a backend. open returns fresh storage for each subtest; the table never shares state between them. The corruption rows — unknown kind, newer "v", malformed and torn lines — need a backend that can hold undecodable data, so they run only when the storage also implements RawInjector and skip otherwise: Memory holds the raw bytes (it implements the hook), and a backend that cannot hold them at all pins its loudness where its format lives.

Types

type RawInjector

type RawInjector interface {
	Inject(ctx context.Context, session string, data []byte) error
}

RawInjector is the optional hook a durable backend implements so the table can exercise the loud rows the Storage interface itself cannot express: it appends raw bytes to a session's stored data, verbatim — the way a crashed or newer writer would have left them. The test controls the bytes exactly, torn tails included (no trailing newline).

Jump to

Keyboard shortcuts

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