testutil

package
v2.1.9 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Utilities for unit testing this project.

Index

Constants

View Source
const InitialCommitSubject = "Initial empty commit"

Variables

View Source
var TestWorkingDir string

Functions

func AddCommit

func AddCommit(commitMessage string, filename string)

func CommitFileChange

func CommitFileChange(commitMessage string, filename string, fileContents string)

func InitTest

func InitTest(t *testing.T, logLevel slog.Level) *util.TestExecutor

CD into repository directory and set any global DI variables (slog, sleep, and executor).

func SetupSecondaryWorktree added in v2.1.1

func SetupSecondaryWorktree(t *testing.T) string

SetupSecondaryWorktree creates a secondary worktree from the current repo and changes into it. Resets cached branch values. Returns the main worktree path.

func WaitForDone added in v2.1.0

func WaitForDone(t *testing.T, done <-chan struct{})

WaitForDone waits for the channel to close, or fails the test after 10 seconds.

func WaitForOutput added in v2.1.0

func WaitForOutput(t *testing.T, out fmt.Stringer, expected string)

WaitForOutput polls the stringer until its output contains the expected substring, or fails the test after 10 seconds.

Types

This section is empty.

Jump to

Keyboard shortcuts

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