From 6c9d3e3eb748becfe78a1929c13a66b1a030a174 Mon Sep 17 00:00:00 2001 From: lucuma13 Date: Sun, 4 Oct 2026 11:55:48 +0100 Subject: [PATCH] fix short-path test on ci --- .../integrate/multi_selection_windows_test.go | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/internal/integrate/multi_selection_windows_test.go b/internal/integrate/multi_selection_windows_test.go index ea9bcc8..830b5be 100644 --- a/internal/integrate/multi_selection_windows_test.go +++ b/internal/integrate/multi_selection_windows_test.go @@ -214,8 +214,22 @@ func TestLongPathNameExpandsShortPath(t *testing.T) { t.Skip("no short names on this volume") } - if got := longPathName(short); !strings.EqualFold(got, long) { - t.Errorf("longPathName(%q) = %q, want %q", short, got, long) + // Compared by identity, not by string: the temp dir may itself sit under a + // short-named component (CI's C:\Users\RUNNER~1), which is expanded too. + got := longPathName(short) + if strings.Contains(got, "~") { + t.Errorf("longPathName(%q) = %q, still has short components", short, got) + } + gotInfo, err := os.Stat(got) + if err != nil { + t.Fatal(err) + } + longInfo, err := os.Stat(long) + if err != nil { + t.Fatal(err) + } + if !os.SameFile(gotInfo, longInfo) { + t.Errorf("longPathName(%q) = %q, not the same file as %q", short, got, long) } }