indextest

package
v0.16.355 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package indextest helps a reader's tests hold that it says the same of a transcript whether it reads the file itself or takes the lines from the shared read: two copies of one made-up transcript grow by the same writes, one of them followed by the index as a live conversation's transcript is.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Line

func Line(n int) string

Line is line n of a made-up Claude transcript: a person's message, the agent's words with their usage, a tool call and its output, a title, the end of a turn, over and over.

Types

type Pair

type Pair struct {
	Plain, Followed string
	Index           *transcriptindex.Index
	// contains filtered or unexported fields
}

Pair is two copies of one transcript: Plain is read by a reader on its own, Followed is followed by the index, as the transcript of a live conversation, and read by a reader that takes its lines from there.

func New

func New(t *testing.T, first int) *Pair

New makes the two copies with their first lines written, the index following the second from its end.

func (*Pair) Grow

func (p *Pair) Grow(t *testing.T, first, count int, same func(step string))

Grow writes lines first..first+count-1 to both copies, every other one in two writes, and calls same after every write: there the test holds that its two readers agree.

func (*Pair) ReaderOpens

func (p *Pair) ReaderOpens(f func()) int64

ReaderOpens is how many times the readers opened a file in f: every open but the index's own, which are the live conversation's.

func (*Pair) Rewrite

func (p *Pair) Rewrite(t *testing.T, count int)

Rewrite replaces both copies with the lines 0..count-1.

func (*Pair) Write

func (p *Pair) Write(t *testing.T, s string, flag int)

Write writes s to both copies, and the live conversation looks at its own.

Jump to

Keyboard shortcuts

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