Skip to content

Commit

Permalink
MacOS: don't test symlinks longer than 1000 bytes
Browse files Browse the repository at this point in the history
The limit is much lower than on Linux.

#213
  • Loading branch information
rfjakob committed Feb 28, 2018
1 parent 90f2fea commit c5243fc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/syscallcompat/sys_common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package syscallcompat
import (
"bytes"
"os"
"runtime"
"syscall"
"testing"
)
Expand All @@ -12,6 +13,11 @@ func TestReadlinkat(t *testing.T) {
target := string(bytes.Repeat([]byte("x"), targetLen))
err := os.Symlink(target, tmpDir+"/readlinkat")
if err != nil {
if targetLen > 1000 && runtime.GOOS == "darwin" {
// Symlinks longer than 1024 (?) bytes are not supported on
// MacOS
continue
}
t.Fatal(err)
}
target2, err := Readlinkat(tmpDirFd, "readlinkat")
Expand Down

0 comments on commit c5243fc

Please sign in to comment.