testutil

package
v0.0.0-...-e2ff964 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package testutil provides shared test helpers for internal packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AgentTaskRepository

func AgentTaskRepository(tb testing.TB, connection *sql.DB) *database.AgentTaskRepository

AgentTaskRepository constructs an agent-task repository or fails the test.

func DocumentRepository

func DocumentRepository(tb testing.TB, connection *sql.DB) *database.DocumentRepository

DocumentRepository constructs a document repository or fails the test.

func NewAuthStorage

func NewAuthStorage(t *testing.T, credentials map[string]auth.Credential) *auth.Storage

NewAuthStorage creates file-backed auth storage seeded with credentials.

func SessionRepository

func SessionRepository(tb testing.TB, connection *sql.DB) *database.SessionRepository

SessionRepository constructs a session repository or fails the test.

func TaskRepository

func TaskRepository(tb testing.TB, connection *sql.DB) *database.TaskRepository

TaskRepository constructs a task repository or fails the test.

func TestMainHome

func TestMainHome(packageName string) func(code int)

TestMainHome creates and configures an isolated librecode home and returns a TestMain cleanup callback that removes it before exiting with code.

func ToolArgumentFields

func ToolArgumentFields(input tool.Arguments) map[string]any

ToolArgumentFields decodes tool arguments into generic fields for assertions.

func ToolArguments

func ToolArguments(input map[string]any) tool.Arguments

ToolArguments converts a generic test argument map into validated tool arguments.

func ToolArgumentsJSON

func ToolArgumentsJSON(input string) tool.Arguments

ToolArgumentsJSON converts raw test JSON into validated tool arguments.

func WorkflowRepository

func WorkflowRepository(tb testing.TB, connection *sql.DB) *database.WorkflowRepository

WorkflowRepository constructs a workflow repository or fails the test.

Types

This section is empty.

Jump to

Keyboard shortcuts

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