From d281f2252e4a32d3e6ee9bc2075769b97647d94c Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Tue, 31 Dec 2024 02:00:17 -0500 Subject: [PATCH] Normalize expected path for chdir tests The expected path comes from a simple string concatenation in shell, but `os.Getwd` appears to have the normalized working directory, so this can fail if any parent directory is a symlink. --- tests/testing/chdir/chdir.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/testing/chdir/chdir.go b/tests/testing/chdir/chdir.go index 75281c21f0..7fa3c9683d 100644 --- a/tests/testing/chdir/chdir.go +++ b/tests/testing/chdir/chdir.go @@ -14,6 +14,10 @@ argument. */ func main() { expectDir := os.Getenv("EXPECT_DIR") + expectDir, err := filepath.EvalSymlinks(expectDir) + if err != nil { + log.Fatal(err) + } cwd, err := os.Getwd() if err != nil { log.Fatal(err)