Skip to content

Commit fdfc8a1

Browse files
committed
refactor: improve e2e test consistency
- Move runGitWtWithStderr to helper_test.go for shared access - Replace manual git add/commit blocks with commitUnmergedChange helper in delete_test.go - Convert shell-variant subtests (bash/zsh/fish) to table-driven style in config_test.go - Apply gofmt formatting to basic_test.go
1 parent 5776f94 commit fdfc8a1

4 files changed

Lines changed: 163 additions & 301 deletions

File tree

e2e/basic_test.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -820,16 +820,3 @@ func TestE2E_LegacyBaseDirMigration(t *testing.T) {
820820
}
821821
})
822822
}
823-
824-
// runGitWtWithStderr runs git-wt and returns stdout, stderr, and error separately.
825-
func runGitWtWithStderr(t *testing.T, binPath, dir string, args ...string) (string, string, error) {
826-
t.Helper()
827-
cmd := exec.CommandContext(t.Context(), binPath, args...)
828-
cmd.Dir = dir
829-
cmd.Env = append(os.Environ(), "HOME="+t.TempDir())
830-
var stdout, stderr strings.Builder
831-
cmd.Stdout = &stdout
832-
cmd.Stderr = &stderr
833-
err := cmd.Run()
834-
return strings.TrimSpace(stdout.String()), strings.TrimSpace(stderr.String()), err
835-
}

0 commit comments

Comments
 (0)