Feat: use sync.pool to obtain new FileSystem instance
This commit is contained in:
@@ -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("指针不一致")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user