Documentation
¶
Overview ¶
Package testutil provides testing utilities for Claudio tests.
Index ¶
- func CheckoutBranch(t *testing.T, repoDir, branch string)
- func CommitFile(t *testing.T, repoDir, path, content, message string)
- func CreateBranch(t *testing.T, repoDir, branch string)
- func GetCommitCount(t *testing.T, repoDir string) int
- func GetCurrentBranch(t *testing.T, repoDir string) string
- func HasUncommittedChanges(t *testing.T, repoDir string) bool
- func ListWorktrees(t *testing.T, repoDir string) []string
- func SetupTestRepo(t *testing.T) string
- func SetupTestRepoWithContent(t *testing.T, files map[string]string) string
- func SetupTestRepoWithRemote(t *testing.T) (repoDir, remoteDir string)
- func SkipIfNoGit(t *testing.T)
- func SkipIfNoTmux(t *testing.T)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckoutBranch ¶
CheckoutBranch switches to a branch.
func CommitFile ¶
CommitFile creates or updates a file and commits it.
func CreateBranch ¶
CreateBranch creates a new branch in the repository.
func GetCommitCount ¶
GetCommitCount returns the number of commits in the repository.
func GetCurrentBranch ¶
GetCurrentBranch returns the current branch name.
func HasUncommittedChanges ¶
HasUncommittedChanges returns true if the repository has uncommitted changes.
func ListWorktrees ¶
ListWorktrees returns all worktrees in the repository.
func SetupTestRepo ¶
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 ¶
SetupTestRepoWithContent creates a test repository with specified files. The files map contains relative paths to file contents.
func SetupTestRepoWithRemote ¶
SetupTestRepoWithRemote creates a test repository with a fake remote. This is useful for testing push/pull operations.
func SkipIfNoGit ¶
SkipIfNoGit skips the test if git is not installed.
func SkipIfNoTmux ¶
SkipIfNoTmux skips the test if tmux is not installed.
Types ¶
This section is empty.