diff options
author | Michael Ploujnikov <ploujj@gmail.com> | 2016-03-30 06:53:47 +0000 |
---|---|---|
committer | Jakob Borg <jakob@nym.se> | 2016-03-30 06:53:47 +0000 |
commit | 66f480519b5f6ca606edcef052e56c00632c965a (patch) | |
tree | 266db2c57935865f77fb360b33c51bd97c2fa854 /test | |
parent | 8044522691b1104b20e75ff7d4d0f659406e762f (diff) |
lib/model: Refactor out scanning method from rwfolder.Serve loop
Diffstat (limited to 'test')
-rw-r--r-- | test/symlink_test.go | 12 | ||||
-rw-r--r-- | test/util.go | 11 |
2 files changed, 11 insertions, 12 deletions
diff --git a/test/symlink_test.go b/test/symlink_test.go index 635f8d8e92..d6baf3967c 100644 --- a/test/symlink_test.go +++ b/test/symlink_test.go @@ -9,10 +9,8 @@ package integration import ( - "io/ioutil" "log" "os" - "path/filepath" "testing" "github.com/syncthing/syncthing/lib/config" @@ -21,16 +19,6 @@ import ( "github.com/syncthing/syncthing/lib/symlinks" ) -func symlinksSupported() bool { - tmp, err := ioutil.TempDir("", "symlink-test") - if err != nil { - return false - } - defer os.RemoveAll(tmp) - err = os.Symlink("tmp", filepath.Join(tmp, "link")) - return err == nil -} - func TestSymlinks(t *testing.T) { if !symlinksSupported() { t.Skip("symlinks unsupported") diff --git a/test/util.go b/test/util.go index 5cc49f795d..879f966181 100644 --- a/test/util.go +++ b/test/util.go @@ -14,6 +14,7 @@ import ( "errors" "fmt" "io" + "io/ioutil" "log" "math/rand" "os" @@ -544,3 +545,13 @@ func startInstance(t *testing.T, i int) *rc.Process { p.AwaitStartup() return p } + +func symlinksSupported() bool { + tmp, err := ioutil.TempDir("", "symlink-test") + if err != nil { + return false + } + defer os.RemoveAll(tmp) + err = os.Symlink("tmp", filepath.Join(tmp, "link")) + return err == nil +} |