Skip to main content

Module testing

Module testing 

Source
Expand description

Testing utilities.

This is inside src rather than tests since we use this code in some unit tests.

Modules§

pty
Utilities for testing in a virtual terminal (PTY).

Structs§

Git
Wrapper around the Git executable, for testing.
GitInitOptions
Options for Git::init_repo_with_options.
GitRunOptions
Options for Git::run_with_options.
GitWorktreeWrapper
Represents a Git worktree for an existing Git repository on disk.
GitWrapper
Wrapper around a Git instance which cleans up the repository once dropped.
GitWrapperWithRemoteRepo
Represents a pair of directories that will be cleaned up after this value dropped. The two directories need to be inited and cloneed by the caller, respectively.

Functions§

extract_hint_command
Find and extract the command to disable the hint mentioned in the output. Returns the arguments to git which would disable the hint.
make_git
Create a temporary directory for testing and a Git instance to use with it.
make_git_with_remote_repo
Create a GitWrapperWithRemoteRepo.
make_git_worktree
Create a new worktree for the provided repository.
remove_nondeterministic_lines
Remove lines which are not present or different between Git versions.
remove_rebase_lines
Remove some of the output from git rebase, as it seems to be non-deterministic as to whether or not it appears.
trim_lines
Remove whitespace from the end of each line in the provided string.