From ecb410ff953acadef7fb4ffe9bb27b0f2076cfcd Mon Sep 17 00:00:00 2001 From: Willie Date: Mon, 5 Oct 2026 22:58:13 +0800 Subject: [PATCH] test(link): compare canonical paths for the option terminator case macOS temp directories live under /var, a symlink to /private/var, so EvalSymlinks on the created link returns the /private form while the test compared it with the raw t.TempDir() path. Canonicalize the expected path as well so the integration test passes on macOS runners. --- tests/integration/link_test.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/integration/link_test.go b/tests/integration/link_test.go index a3fa055d6..01d487be5 100644 --- a/tests/integration/link_test.go +++ b/tests/integration/link_test.go @@ -141,8 +141,13 @@ func TestLink_OptionTerminatorPath(t *testing.T) { checkout := filepath.Join(sb.Root, "-checkout") sb.WriteFile(filepath.Join(checkout, "foo", "SKILL.md"), "---\nname: foo\n---\n# foo") sb.RunCLIInDir(sb.Root, "link", "--global", "--", "-checkout").AssertSuccess(t) - if got, err := filepath.EvalSymlinks(filepath.Join(sb.SourcePath, "_-checkout")); err != nil || got != checkout { - t.Fatalf("link target = %q, %v; want %s", got, err, checkout) + // macOS temp dirs live under /var -> /private/var, so compare canonical paths. + want, err := filepath.EvalSymlinks(checkout) + if err != nil { + t.Fatal(err) + } + if got, err := filepath.EvalSymlinks(filepath.Join(sb.SourcePath, "_-checkout")); err != nil || got != want { + t.Fatalf("link target = %q, %v; want %s", got, err, want) } }