Documentation
¶
Index ¶
- func AssertCurrentBranch(t *testing.T, repo *TestRepo, expected string)
- func AssertEqual(t *testing.T, expected, actual any)
- func AssertError(t *testing.T, err error)
- func AssertErrorContains(t *testing.T, err error, expected string)
- func AssertFalse(t *testing.T, condition bool, message string)
- func AssertFileContains(t *testing.T, repo *TestRepo, path, content string)
- func AssertFileExists(t *testing.T, repo *TestRepo, path string)
- func AssertFileNotExists(t *testing.T, repo *TestRepo, path string)
- func AssertHelpfulError(t *testing.T, output string)
- func AssertMultipleStringsInOutput(t *testing.T, output string, expected []string)
- func AssertNoError(t *testing.T, err error)
- func AssertNotEqual(t *testing.T, notExpected, actual any)
- func AssertOutputContains(t *testing.T, output, expected string)
- func AssertTrue(t *testing.T, condition bool, message string)
- func AssertWorktreeCount(t *testing.T, repo *TestRepo, expected int)
- func AssertWorktreeCreated(t *testing.T, output, branch string)
- func AssertWorktreeExists(t *testing.T, repo *TestRepo, path string)
- func AssertWorktreeNotExists(t *testing.T, repo *TestRepo, path string)
- func WithTimeout(timeout time.Duration) func(cmd *exec.Cmd)
- type TestEnvironment
- func (e *TestEnvironment) Cleanup()
- func (e *TestEnvironment) CreateNonRepoDir(name string) *TestRepo
- func (e *TestEnvironment) CreateTestRepo(name string) *TestRepo
- func (e *TestEnvironment) FileExists(path string) bool
- func (e *TestEnvironment) RunInDir(dir, command string, args ...string) string
- func (e *TestEnvironment) RunWTP(args ...string) (string, error)
- func (e *TestEnvironment) TmpDir() string
- func (e *TestEnvironment) WriteFile(path, content string)
- type TestRepo
- func (r *TestRepo) AddRemote(name, url string)
- func (r *TestRepo) CheckoutBranch(name string)
- func (r *TestRepo) CommitFile(filename, content, message string)
- func (r *TestRepo) CreateBranch(name string)
- func (r *TestRepo) CreateRemoteBranch(remote, branch string)
- func (r *TestRepo) CurrentBranch() string
- func (r *TestRepo) GetBranchCommitHash(branch string) string
- func (r *TestRepo) GetCommitHash() string
- func (r *TestRepo) GitStatus() string
- func (r *TestRepo) HasFile(path string) bool
- func (r *TestRepo) ListWorktrees() []string
- func (r *TestRepo) Path() string
- func (r *TestRepo) ReadFile(path string) string
- func (r *TestRepo) RunWTP(args ...string) (string, error)
- func (r *TestRepo) WriteConfig(content string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertEqual ¶
func AssertError ¶
func AssertFileContains ¶
func AssertHelpfulError ¶
func AssertNoError ¶
func AssertNotEqual ¶
func AssertOutputContains ¶
func AssertWorktreeCreated ¶
func AssertWorktreeNotExists ¶
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) 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) CheckoutBranch ¶ added in v1.0.0
func (*TestRepo) CommitFile ¶ added in v1.0.0
func (*TestRepo) CreateBranch ¶
func (*TestRepo) CreateRemoteBranch ¶
func (*TestRepo) CurrentBranch ¶
func (*TestRepo) GetBranchCommitHash ¶ added in v1.0.0
func (*TestRepo) GetCommitHash ¶
func (*TestRepo) ListWorktrees ¶
func (*TestRepo) WriteConfig ¶
Click to show internal directories.
Click to hide internal directories.