Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 523bdeb

Browse filesBrowse files
committed
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.
1 parent 0426a5f commit 523bdeb
Copy full SHA for 523bdeb

File tree

1 file changed

+5
-0
lines changed
Filter options

1 file changed

+5
-0
lines changed

‎tests/testing/chdir/chdir.go

Copy file name to clipboardExpand all lines: tests/testing/chdir/chdir.go
+5
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ func main() {
2020
}
2121
if runtime.GOOS == "windows" {
2222
cwd = filepath.ToSlash(cwd)
23+
} else {
24+
expectDir, err = filepath.EvalSymlinks(expectDir)
25+
if err != nil {
26+
log.Fatal(err)
27+
}
2328
}
2429
if cwd != expectDir {
2530
log.Fatalf("expected:\"%v\" != os.Getwd():\"%v\"", expectDir, cwd)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.