Feat: use sync.pool to obtain new FileSystem instance

This commit is contained in:
HFO4
2019-12-29 14:31:03 +08:00
parent de4793aacb
commit 5b9de0e097
8 changed files with 75 additions and 10 deletions

View File

@@ -133,3 +133,18 @@ func TestNewAnonymousFileSystem(t *testing.T) {
asserts.Nil(fs)
}
}
func TestFileSystem_Recycle(t *testing.T) {
fs := &FileSystem{
User: &model.User{},
Policy: &model.Policy{},
FileTarget: []model.File{model.File{}},
DirTarget: []model.Folder{model.Folder{}},
AfterUpload: []Hook{GenericAfterUpdate},
}
fs.Recycle()
newFS := getEmptyFS()
if fs != newFS {
t.Error("指针不一致")
}
}