From 69e3824840abec3d83d1d7b8fe96c7a6abe5e9c1 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Thu, 22 Jan 2015 15:34:22 -0800 Subject: [PATCH] Add test for #1262 --- internal/config/config_test.go | 18 ++++++++++++++++++ internal/config/testdata/issue-1262.xml | 4 ++++ 2 files changed, 22 insertions(+) create mode 100644 internal/config/testdata/issue-1262.xml diff --git a/internal/config/config_test.go b/internal/config/config_test.go index 05773962..17b0a66d 100644 --- a/internal/config/config_test.go +++ b/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) diff --git a/internal/config/testdata/issue-1262.xml b/internal/config/testdata/issue-1262.xml new file mode 100644 index 00000000..a2aaaa9e --- /dev/null +++ b/internal/config/testdata/issue-1262.xml @@ -0,0 +1,4 @@ + + + +