detached 1056bfc

tui: skip path-quoting tests on windows

normalisePathToken's heuristic only fires for unix-shaped paths
(leading /, ~, or file:// with a / path). On Windows, t.TempDir()
returns paths like C:\Users\RUNNER~1\AppData\Local\Temp\...
which never match those prefixes, so the test inputs never get
quoted and every assertion fails. The function is unix-only by
design (drag-and-drop on macOS/Linux); skip the test on Windows
rather than carry a parallel Windows test that would just
duplicate platform-specific quoting logic.
commit
1056bfc3495549567916656d97d3f8672f56cd51
author
patriceckhart · · 2026-04-27 09:14 UTC
parent
902122e
signature
unsigned
refs
tag: v0.1.25
1 file · +13 -0
M internal/tui/quote_paste_test.go +13 -0
@@ -4,6 +4,7 @@ import (
44 "net/url"
55 "os"
66 "path/filepath"
7+ "runtime"
78 "strings"
89 "testing"
910 )
@@ -25,6 +26,15 @@ func makeFiles(t *testing.T, base string, rels ...string) string {
2526 }
2627
2728 func TestQuotePastedFilePaths(t *testing.T) {
29+ // normalisePathToken's heuristics target Unix-shaped paths
30+ // (leading "/", "~", or "file://" with a "/" path component) —
31+ // the same shapes drag-and-drop produces on macOS and Linux.
32+ // Windows TempDir paths look like C:\Users\... which never
33+ // match those prefixes, so the test fixtures wouldn't exercise
34+ // any real code path on that platform.
35+ if runtime.GOOS == "windows" {
36+ t.Skip("path-quoting heuristics are unix-shaped")
37+ }
2838 dir := t.TempDir()
2939 makeFiles(t, dir,
3040 "foo bar.png",
@@ -106,6 +116,9 @@ func TestQuotePastedFilePaths(t *testing.T) {
106116 // when the home directory contains the candidate. We don't write
107117 // into the user's real home; instead, override HOME for the test.
108118 func TestTildePathExists(t *testing.T) {
119+ if runtime.GOOS == "windows" {
120+ t.Skip("path-quoting heuristics are unix-shaped")
121+ }
109122 tmp := t.TempDir()
110123 makeFiles(t, tmp, "tilde-test.png")
111124 t.Setenv("HOME", tmp)
@@ -4,6 +4,7 @@ import (
4 "net/url"4 "net/url"
5 "os"5 "os"
6 "path/filepath"6 "path/filepath"
7+ "runtime"
7 "strings"8 "strings"
8 "testing"9 "testing"
9 )10 )
@@ -25,6 +26,15 @@ func makeFiles(t *testing.T, base string, rels ...string) string {
25 }26 }
26 27
27 func TestQuotePastedFilePaths(t *testing.T) {28 func TestQuotePastedFilePaths(t *testing.T) {
29+ // normalisePathToken's heuristics target Unix-shaped paths
30+ // (leading "/", "~", or "file://" with a "/" path component) —
31+ // the same shapes drag-and-drop produces on macOS and Linux.
32+ // Windows TempDir paths look like C:\Users\... which never
33+ // match those prefixes, so the test fixtures wouldn't exercise
34+ // any real code path on that platform.
35+ if runtime.GOOS == "windows" {
36+ t.Skip("path-quoting heuristics are unix-shaped")
37+ }
28 dir := t.TempDir()38 dir := t.TempDir()
29 makeFiles(t, dir,39 makeFiles(t, dir,
30 "foo bar.png",40 "foo bar.png",
@@ -106,6 +116,9 @@ func TestQuotePastedFilePaths(t *testing.T) {
106 // when the home directory contains the candidate. We don't write116 // when the home directory contains the candidate. We don't write
107 // into the user's real home; instead, override HOME for the test.117 // into the user's real home; instead, override HOME for the test.
108 func TestTildePathExists(t *testing.T) {118 func TestTildePathExists(t *testing.T) {
119+ if runtime.GOOS == "windows" {
120+ t.Skip("path-quoting heuristics are unix-shaped")
121+ }
109 tmp := t.TempDir()122 tmp := t.TempDir()
110 makeFiles(t, tmp, "tilde-test.png")123 makeFiles(t, tmp, "tilde-test.png")
111 t.Setenv("HOME", tmp)124 t.Setenv("HOME", tmp)

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 476

↑↓ moveenter openesc close