framework

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertCurrentBranch

func AssertCurrentBranch(t *testing.T, repo *TestRepo, expected string)

func AssertEqual

func AssertEqual(t *testing.T, expected, actual any)

func AssertError

func AssertError(t *testing.T, err error)

func AssertErrorContains

func AssertErrorContains(t *testing.T, err error, expected string)

func AssertFalse

func AssertFalse(t *testing.T, condition bool, message string)

func AssertFileContains

func AssertFileContains(t *testing.T, repo *TestRepo, path, content string)

func AssertFileExists

func AssertFileExists(t *testing.T, repo *TestRepo, path string)

func AssertFileNotExists

func AssertFileNotExists(t *testing.T, repo *TestRepo, path string)

func AssertHelpfulError

func AssertHelpfulError(t *testing.T, output string)

func AssertMultipleStringsInOutput

func AssertMultipleStringsInOutput(t *testing.T, output string, expected []string)

func AssertNoError

func AssertNoError(t *testing.T, err error)

func AssertNotEqual

func AssertNotEqual(t *testing.T, notExpected, actual any)

func AssertOutputContains

func AssertOutputContains(t *testing.T, output, expected string)

func AssertTrue

func AssertTrue(t *testing.T, condition bool, message string)

func AssertWorktreeCount

func AssertWorktreeCount(t *testing.T, repo *TestRepo, expected int)

func AssertWorktreeCreated

func AssertWorktreeCreated(t *testing.T, output, branch string)

func AssertWorktreeExists

func AssertWorktreeExists(t *testing.T, repo *TestRepo, path string)

func AssertWorktreeNotExists

func AssertWorktreeNotExists(t *testing.T, repo *TestRepo, path string)

func WithTimeout

func WithTimeout(timeout time.Duration) func(cmd *exec.Cmd)

Types

type TestEnvironment

type TestEnvironment struct {
	// contains filtered or unexported fields
}

func NewTestEnvironment

func NewTestEnvironment(t *testing.T) *TestEnvironment

func (*TestEnvironment) Cleanup

func (e *TestEnvironment) Cleanup()

func (*TestEnvironment) CreateNonRepoDir

func (e *TestEnvironment) CreateNonRepoDir(name string) *TestRepo

func (*TestEnvironment) CreateTestRepo

func (e *TestEnvironment) CreateTestRepo(name string) *TestRepo

func (*TestEnvironment) FileExists

func (e *TestEnvironment) FileExists(path string) bool

func (*TestEnvironment) RunInDir

func (e *TestEnvironment) RunInDir(dir, command string, args ...string) string

func (*TestEnvironment) RunWTP

func (e *TestEnvironment) RunWTP(args ...string) (string, error)

func (*TestEnvironment) TmpDir

func (e *TestEnvironment) TmpDir() string

func (*TestEnvironment) WriteFile

func (e *TestEnvironment) WriteFile(path, content string)

type TestRepo

type TestRepo struct {
	// contains filtered or unexported fields
}

func (*TestRepo) AddRemote

func (r *TestRepo) AddRemote(name, url string)

func (*TestRepo) CheckoutBranch added in v1.0.0

func (r *TestRepo) CheckoutBranch(name string)

func (*TestRepo) CommitFile added in v1.0.0

func (r *TestRepo) CommitFile(filename, content, message string)

func (*TestRepo) CreateBranch

func (r *TestRepo) CreateBranch(name string)

func (*TestRepo) CreateRemoteBranch

func (r *TestRepo) CreateRemoteBranch(remote, branch string)

func (*TestRepo) CurrentBranch

func (r *TestRepo) CurrentBranch() string

func (*TestRepo) GetBranchCommitHash added in v1.0.0

func (r *TestRepo) GetBranchCommitHash(branch string) string

func (*TestRepo) GetCommitHash

func (r *TestRepo) GetCommitHash() string

func (*TestRepo) GitStatus

func (r *TestRepo) GitStatus() string

func (*TestRepo) HasFile

func (r *TestRepo) HasFile(path string) bool

func (*TestRepo) ListWorktrees

func (r *TestRepo) ListWorktrees() []string

func (*TestRepo) Path

func (r *TestRepo) Path() string

func (*TestRepo) ReadFile

func (r *TestRepo) ReadFile(path string) string

func (*TestRepo) RunWTP

func (r *TestRepo) RunWTP(args ...string) (string, error)

func (*TestRepo) WriteConfig

func (r *TestRepo) WriteConfig(content string)

Jump to

Keyboard shortcuts

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