Fix tests on Windows

This commit is contained in:
Audrius Butkevicius
2015-02-09 23:56:16 +00:00
parent ee000dabfd
commit acd3dab957
9 changed files with 16 additions and 13 deletions

View File

@@ -26,7 +26,6 @@ import (
"reflect"
"sort"
"strconv"
"strings"
"github.com/calmh/logger"
"github.com/syncthing/protocol"
@@ -262,9 +261,13 @@ func (cfg *Configuration) prepare(myID protocol.DeviceID) {
continue
}
if !strings.HasSuffix(folder.Path, string(filepath.Separator)) {
folder.Path += string(filepath.Separator)
}
// The reason it's done like this:
// C: -> C:\ -> C:\ (issue that this is trying to fix)
// C:\somedir -> C:\somedir\ -> C:\somedir
// C:\somedir\ -> C:\somedir\\ -> C:\somedir
// This way in the tests, we get away without OS specific separators
// in the test configs.
folder.Path = filepath.Dir(folder.Path + string(filepath.Separator))
if folder.ID == "" {
folder.ID = "default"