Commit ee57439e55

ee57439e5511ec0b91780bb464a95513f6821074

parent: 72eaa3a587

Verified · cmc

cmc <hello@cleberg.net> · 2026-10-02 03:19 UTC

e2e: tell terminal output by padding, not the header row

Ref #317

Layout: unified · split

e2e/term_test.go +5 −5
@@ -21,11 +21,11 @@ func TestTermEnvSelectsTerminalOutput(t *testing.T) {
2121 }
2222
2323 plain, _, _ := inst.sshTerm(t, key, "", "repo", "list")
24 if strings.Contains(plain, "PATH") || !strings.Contains(plain, "alice/app\t") {
24 if strings.Contains(plain, "alice/app ") || !strings.Contains(plain, "alice/app\t") {
2525 t.Errorf("plain repo list: %q", plain)
2626 }
2727 term, _, _ := inst.sshTerm(t, key, "80,color", "repo", "list")
28 if !strings.HasPrefix(term, "\x1b[2mPATH") {
28 if !strings.HasPrefix(term, "\x1b[2malice/app\x1b[0m ") {
2929 t.Errorf("terminal repo list: %q", term)
3030 }
3131}
@@ -75,13 +75,13 @@ func TestTermEnvOverMultiplexedSession(t *testing.T) {
7575 exec.Command("ssh", "-o", "ControlPath="+sock, "-O", "exit", "git@127.0.0.1").Run()
7676 })
7777
78 if out := mux("80"); !strings.HasPrefix(out, "PATH") {
78 if out := mux("80"); !strings.HasPrefix(out, "alice/app ") {
7979 t.Fatalf("master session: %q", out)
8080 }
81 if out := mux("80,color"); !strings.HasPrefix(out, "\x1b[2mPATH") {
81 if out := mux("80,color"); !strings.HasPrefix(out, "\x1b[2malice/app") {
8282 t.Errorf("second session kept the master's GITBAY_TERM: %q", out)
8383 }
84 if out := mux(""); strings.Contains(out, "PATH") {
84 if out := mux(""); !strings.HasPrefix(out, "alice/app\t") {
8585 t.Errorf("session without GITBAY_TERM got terminal output: %q", out)
8686 }
8787}