Skip to content

Commit 11959a5

Browse files
committed
test: update goldens
1 parent 64b117b commit 11959a5

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

tests/testdata/browse TUI narrow snapshot.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,4 @@
7777

7878
────────────────────────────────────────────────────────────────────────────────
7979
[ q/ctrl+c: quit] [ h: help ] ● Default Workspace ->
80-
/TMPDIR/default [?2004l[?25h[?1002l[?1003l[?1006l
80+
/TMPDIR/default[?2004l[?25h[?1002l[?1003l[?1006l

tests/testdata/browse TUI wide snapshot.golden

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
▌  │ echo 'hello from nameless'
2424
2525
▌  Executable can be found in
26-
▌  /TMPDIR/root.flow [ 🔗
27-
▌  /TMPDIR/root.flow ]
26+
▌  /TMPDIR/root.flow [ 🔗
27+
▌  /TMPDIR/root.flow ]
2828
2929
3030
@@ -85,4 +85,4 @@
8585
8686
8787
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
88-
[ q/ctrl+c: quit] [ h: help ] ● Default Workspace -> /TMPDIR/default [?2004l[?25h[?1002l[?1003l[?1006l
88+
[ q/ctrl+c: quit] [ h: help ] ● Default Workspace -> /TMPDIR/default[?2004l[?25h[?1002l[?1003l[?1006l

tests/utils/golden.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,18 @@ func NormalizeTmpDirs(input string) string {
3636
tmpDir += "/"
3737
}
3838
tmpDirPattern := regexp.QuoteMeta(tmpDir)
39-
// Match temp dir followed by any path
40-
re := regexp.MustCompile(tmpDirPattern + `[^\s\x00-\x1F]*`)
39+
// Match temp dir followed by any path plus any trailing whitespace
40+
re := regexp.MustCompile(tmpDirPattern + `[^\s\x00-\x1F]+\s*`)
4141
result := re.ReplaceAllStringFunc(input, func(m string) string {
4242
pathAfterTmp := m[len(tmpDir):]
43+
// Trim whitespace from the captured path
44+
pathAfterTmp = strings.TrimSpace(pathAfterTmp)
4345
parts := strings.Split(pathAfterTmp, "/")
4446
if len(parts) >= 2 {
4547
// Keep only the last meaningful part
4648
return "/TMPDIR/" + parts[len(parts)-1]
4749
}
48-
return "/TMPDIR/" + pathAfterTmp
50+
return "/TMPDIR/" + pathAfterTmp + " "
4951
})
5052

5153
return result

0 commit comments

Comments
 (0)