From 9da5f9bf1daebc571e758bc23939ddd04cbcbbca Mon Sep 17 00:00:00 2001 From: Willie Date: Sat, 10 Oct 2026 00:31:36 +0800 Subject: [PATCH] test(install): build the localhost file URL from a slash path On Windows the temp path starts with a drive letter, so prefixing it onto file://localhost produced file://localhostC:\... instead of a valid URL and the case failed on the Windows runner. Convert to slashes and add the separator explicitly. --- internal/install/install_tracked_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/install/install_tracked_test.go b/internal/install/install_tracked_test.go index f4d082500..18eff9328 100644 --- a/internal/install/install_tracked_test.go +++ b/internal/install/install_tracked_test.go @@ -325,7 +325,7 @@ func TestInstallTrackedRepo_RefusesLocalSourceInsideTheDestination(t *testing.T) {"same path", "", func(p string) string { return p }, false}, {"nested path", "nested", func(p string) string { return p }, false}, {"explicit file URL", "nested", func(p string) string { return fileURL(p) }, false}, - {"localhost file URL", "nested", func(p string) string { return "file://localhost" + p }, false}, + {"localhost file URL", "nested", func(p string) string { return "file://localhost/" + strings.TrimPrefix(filepath.ToSlash(p), "/") }, false}, {"dry run", "nested", func(p string) string { return p }, true}, } for _, tc := range cases {