lib/model: Accept scan requests of paths ending in slash (fixes #3804)
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3805
This commit is contained in:
@@ -2166,6 +2166,21 @@ func TestIssue3496(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestIssue3804(t *testing.T) {
|
||||
dbi := db.OpenMemory()
|
||||
m := NewModel(defaultConfig, protocol.LocalDeviceID, "device", "syncthing", "dev", dbi, nil)
|
||||
m.AddFolder(defaultFolderConfig)
|
||||
m.StartFolder("default")
|
||||
m.ServeBackground()
|
||||
defer m.Stop()
|
||||
|
||||
// Subdirs ending in slash should be accepted
|
||||
|
||||
if err := m.ScanFolderSubdirs("default", []string{"baz/", "foo"}); err != nil {
|
||||
t.Error("Unexpected error:", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRootedJoinedPath(t *testing.T) {
|
||||
type testcase struct {
|
||||
root string
|
||||
|
||||
Reference in New Issue
Block a user