|
@@ -19,6 +19,7 @@ import (
|
|
|
"fmt"
|
|
"fmt"
|
|
|
"os"
|
|
"os"
|
|
|
"reflect"
|
|
"reflect"
|
|
|
|
|
+ "runtime"
|
|
|
"testing"
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/syncthing/protocol"
|
|
"github.com/syncthing/protocol"
|
|
@@ -261,6 +262,23 @@ func TestVersioningConfig(t *testing.T) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+func TestIssue1262(t *testing.T) {
|
|
|
|
|
+ cfg, err := Load("testdata/issue-1262.xml", device4)
|
|
|
|
|
+ if err != nil {
|
|
|
|
|
+ t.Error(err)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ actual := cfg.Folders()["test"].Path
|
|
|
|
|
+ expected := "e:/"
|
|
|
|
|
+ if runtime.GOOS == "windows" {
|
|
|
|
|
+ expected = `e:\`
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if actual != expected {
|
|
|
|
|
+ t.Errorf("%q != %q", actual, expected)
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
func TestNewSaveLoad(t *testing.T) {
|
|
func TestNewSaveLoad(t *testing.T) {
|
|
|
path := "testdata/temp.xml"
|
|
path := "testdata/temp.xml"
|
|
|
os.Remove(path)
|
|
os.Remove(path)
|