From 298f317209c4f968cad9df9d5ec72a847c17309d Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 10 Jun 2026 21:59:42 +0000 Subject: [PATCH] test: make find-links resolution test cross-platform (Windows abs paths) /abs/wheels isn't absolute on Windows (no drive letter), so it was joined to the root and the assertion failed. Use a real absolute temp dir and a TOML literal string so backslashes survive. Co-authored-by: Jason Hall --- pymage/internal/project/project_test.go | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/pymage/internal/project/project_test.go b/pymage/internal/project/project_test.go index b26c8b3..a066135 100644 --- a/pymage/internal/project/project_test.go +++ b/pymage/internal/project/project_test.go @@ -55,13 +55,11 @@ func TestDiscoverExample(t *testing.T) { func TestConfigFindLinksRelativeToRoot(t *testing.T) { dir := t.TempDir() - pyproject := `[project] -name = "demo" -version = "0.1.0" - -[tool.pymage] -find-links = ["wheelhouse", "/abs/wheels"] -` + absWheels := t.TempDir() // absolute on every OS (incl. Windows drive letters) + // TOML literal strings (single quotes) so Windows backslashes aren't treated + // as escapes. + pyproject := "[project]\nname = \"demo\"\nversion = \"0.1.0\"\n\n" + + "[tool.pymage]\nfind-links = ['wheelhouse', '" + absWheels + "']\n" mustWrite(t, filepath.Join(dir, "pyproject.toml"), pyproject) mustWrite(t, filepath.Join(dir, "requirements.txt"), "alpha==1.0\n") @@ -70,8 +68,8 @@ find-links = ["wheelhouse", "/abs/wheels"] t.Fatal(err) } want := filepath.Join(dir, "wheelhouse") - if got := info.Config.FindLinks; len(got) != 2 || got[0] != want || got[1] != "/abs/wheels" { - t.Fatalf("find-links = %v, want [%s /abs/wheels]", got, want) + if got := info.Config.FindLinks; len(got) != 2 || got[0] != want || got[1] != absWheels { + t.Fatalf("find-links = %v, want [%s %s]", got, want, absWheels) } }