From b820fa691ddae7b3111de823c8a45666f9e59c70 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Mon, 5 Mar 2018 21:23:57 +0100 Subject: [PATCH] macos: adjust TestTooLongSymlink length for darwin Limit is much lower than on linux --- tests/reverse/correctness_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/reverse/correctness_test.go b/tests/reverse/correctness_test.go index 15eb18b..214c747 100644 --- a/tests/reverse/correctness_test.go +++ b/tests/reverse/correctness_test.go @@ -5,6 +5,7 @@ import ( "fmt" "io/ioutil" "os" + "runtime" "syscall" "testing" @@ -185,8 +186,12 @@ func TestEnoent(t *testing.T) { // returning an I/O error to the user. // https://github.com/rfjakob/gocryptfs/issues/167 func TestTooLongSymlink(t *testing.T) { + l := 4000 + if runtime.GOOS == "darwin" { + l = 1000 // max length is much lower on darwin + } fn := dirA + "/TooLongSymlink" - target := string(bytes.Repeat([]byte("x"), 4000)) + target := string(bytes.Repeat([]byte("x"), l)) err := os.Symlink(target, fn) if err != nil { t.Fatal(err)