Browse Source

Add test for #1262

Jakob Borg 10 years ago
parent
commit
69e3824840
2 changed files with 22 additions and 0 deletions
  1. 18 0
      internal/config/config_test.go
  2. 4 0
      internal/config/testdata/issue-1262.xml

+ 18 - 0
internal/config/config_test.go

@@ -19,6 +19,7 @@ import (
 	"fmt"
 	"os"
 	"reflect"
+	"runtime"
 	"testing"
 
 	"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) {
 	path := "testdata/temp.xml"
 	os.Remove(path)

+ 4 - 0
internal/config/testdata/issue-1262.xml

@@ -0,0 +1,4 @@
+<configuration version="7">
+    <folder id="test" path="e:" ro="true" ignorePerms="false" rescanIntervalS="600">
+    </folder>
+</configuration>