testutil

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package testutil provides shared test fixtures and helpers for Provenance internal packages. Import this package from any _test.go file that needs an in-memory database or pre-built tasks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsTask

func ContainsTask(tasks []ptypes.Task, id ptypes.TaskID) bool

ContainsTask checks if a task with the given ID is in the slice.

func MakeTask

func MakeTask(ns, title string) ptypes.Task

MakeTask creates a minimal Task with a unique UUIDv7 for testing. The task uses StatusOpen, PriorityMedium, TaskTypeTask, and PhaseUnscoped.

func MakeTaskID

func MakeTaskID(ns string) ptypes.TaskID

MakeTaskID creates a TaskID with a unique UUIDv7 for testing.

func OpenTestDB

func OpenTestDB(t *testing.T) *dbsqlite.DB

OpenTestDB returns a fresh in-memory sqlite.DB for testing. The database is closed automatically when the test ends.

func TestModels

func TestModels() []ptypes.ModelEntry

TestModels returns the default model entries used for testing. These match the canonical Anthropic API model identifiers.

Types

This section is empty.

Jump to

Keyboard shortcuts

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