Documentation
¶
Overview ¶
Package testutil contains functions intended only to be used during testing of ggman.
Functions in this package are not considered part of the stable interface. For this reason most functions are themselves untested.
Index ¶
- Constants
- func CaseSensitive(t *testing.T) bool
- func CommitTestFiles(repo *git.Repository, files map[string]string) (*git.Worktree, plumbing.Hash)
- func NewTestRepo(t *testing.T) (clonePath string, repo *git.Repository)
- func NewTestRepoAt(clonePath, remote string) (repo *git.Repository)
- func ToOSPath(path string) (result string)
- func ToOSPaths(paths []string) []string
Constants ¶
const AuthorEmail = "jane.doe@example.com"
AuthorEmail is the email to be used for email of the author of test git commit-likes.
const AuthorName = "Jane Doe"
AuthorName is the name to be used for authors of test git commit-likes.
Variables ¶
This section is empty.
Functions ¶
func CaseSensitive ¶ added in v1.12.0
CaseSensitive checks if temporary directories exist on a case-sensitive file system.
This function is untested due to unpredictability of runtime environment.
func CommitTestFiles ¶
CommitTestFiles makes a new commit in the repository repo. The commit will contain files with the names and content of the contained map. When the map is nil, a default dummy file will be used instead. The commit will appear to have been authored from a bogus author and have a bogus commit message.
The function returns the worktree of the repository and the commit hash produced ¶
The files will be written out to disk. If an error occurs, panic() is called.
func NewTestRepo ¶
If something goes wrong, the function calls panic().
func NewTestRepoAt ¶
func NewTestRepoAt(clonePath, remote string) (repo *git.Repository)
The 'remote' part of this function is untested.
Types ¶
This section is empty.