testutil

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package testutil provides testing utilities for Claudio tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckoutBranch

func CheckoutBranch(t *testing.T, repoDir, branch string)

CheckoutBranch switches to a branch.

func CommitFile

func CommitFile(t *testing.T, repoDir, path, content, message string)

CommitFile creates or updates a file and commits it.

func CreateBranch

func CreateBranch(t *testing.T, repoDir, branch string)

CreateBranch creates a new branch in the repository.

func GetCommitCount

func GetCommitCount(t *testing.T, repoDir string) int

GetCommitCount returns the number of commits in the repository.

func GetCurrentBranch

func GetCurrentBranch(t *testing.T, repoDir string) string

GetCurrentBranch returns the current branch name.

func HasUncommittedChanges

func HasUncommittedChanges(t *testing.T, repoDir string) bool

HasUncommittedChanges returns true if the repository has uncommitted changes.

func ListWorktrees

func ListWorktrees(t *testing.T, repoDir string) []string

ListWorktrees returns all worktrees in the repository.

func SetupTestRepo

func SetupTestRepo(t *testing.T) string

SetupTestRepo creates a temporary git repository for testing. Returns the path to the repository. The repository is automatically cleaned up when the test completes.

func SetupTestRepoWithContent

func SetupTestRepoWithContent(t *testing.T, files map[string]string) string

SetupTestRepoWithContent creates a test repository with specified files. The files map contains relative paths to file contents.

func SetupTestRepoWithRemote

func SetupTestRepoWithRemote(t *testing.T) (repoDir, remoteDir string)

SetupTestRepoWithRemote creates a test repository with a fake remote. This is useful for testing push/pull operations.

func SkipIfNoGit

func SkipIfNoGit(t *testing.T)

SkipIfNoGit skips the test if git is not installed.

func SkipIfNoTmux

func SkipIfNoTmux(t *testing.T)

SkipIfNoTmux skips the test if tmux is not installed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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