Documentation
¶
Index ¶
- func CompareChanges(t *testing.T, want, got file.Changes)
- func CompareGoldenFile(t *testing.T, tc *TestCase)
- func CompareSourcePath(t *testing.T, want []string, changes file.Changes)
- func CompareTargetPath(t *testing.T, want []string, changes file.Changes)
- func GetConfig(t *testing.T, tc *TestCase, testDir string) *config.Config
- func ProcessTestCaseChanges(t *testing.T, cases []TestCase)
- func RunTestCase(t *testing.T, tc *TestCase, runFunc func(t *testing.T, tc *TestCase))
- func SetupFileSystem(tb testing.TB, testName string, fileSystem []string) string
- func UpdateBaseDir(expected []string, testDir string)
- func UpdateFileChanges(files file.Changes)
- type TestCase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareChanges ¶
CompareChanges compares the expected file changes to the ones received.
func CompareGoldenFile ¶
CompareGoldenFile verifies that the output of an operation matches the expected output.
func CompareSourcePath ¶
CompareSourcePath compares the expected source paths to the actual source paths.
func CompareTargetPath ¶
CompareTargetPath verifies that the renaming target matches expectations.
func ProcessTestCaseChanges ¶
func RunTestCase ¶
func SetupFileSystem ¶
SetupFileSystem creates all required files and folders for the tests and returns the absolute path to the root directory.
func UpdateBaseDir ¶
UpdateBaseDir adds the testDir to each expected path for easy comparison.
func UpdateFileChanges ¶
Types ¶
type TestCase ¶
type TestCase struct {
Error error `json:"error"`
SetEnv map[string]string `json:"env"`
SetupFunc func(t *testing.T, testDir string) (teardown func()) `json:"-"`
StdoutGoldenFile string `json:"stdout_golden_file"`
DefaultOpts string `json:"default_opts"`
Name string `json:"name"`
StderrGoldenFile string `json:"stderr_golden_file"`
SnapShot struct {
Stdout []byte
Stderr []byte
} `json:"-"`
Args []string `json:"args"`
PathArgs []string `json:"path_args"`
Changes file.Changes `json:"changes"`
Want []string `json:"want"`
ConflictDetected bool `json:"conflict_detected"`
PipeOutput bool `json:"pipe_output"`
}
TestCase represents a unique test case.
Click to show internal directories.
Click to hide internal directories.