Documentation
¶
Overview ¶
Package testutil provides test helpers for Kiseki.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTestDB ¶
NewTestDB creates an in-memory SQLite database fully initialized via db.InitDB. Uses cache=shared so all connections in the pool share the same in-memory DB. This is critical for MultiLayerSearch tests which use goroutines (each goroutine may get a different connection from the pool).
Types ¶
type MockEmbedder ¶
type MockEmbedder struct {
// Dimension is the vector size. Defaults to db.EmbedDimension if 0.
Dimension int
// CallCount tracks how many times Embed was called.
CallCount int
// contains filtered or unexported fields
}
MockEmbedder implements ollama.Embedder with deterministic vectors. It generates consistent embeddings based on text content using FNV hashing, producing vectors that have meaningful cosine similarity (similar words → closer vectors).
Click to show internal directories.
Click to hide internal directories.