mirror of
https://github.com/cloudreve/cloudreve.git
synced 2025-11-01 10:36:30 +08:00
Fix: trigger err when move folder into itself (#1128)
This commit is contained in:
@ -493,7 +493,8 @@ func TestFolder_MoveOrCopyFolderTo_Move(t *testing.T) {
|
||||
}
|
||||
// 目标目录
|
||||
dstFolder := Folder{
|
||||
Model: gorm.Model{ID: 10},
|
||||
Model: gorm.Model{ID: 10},
|
||||
OwnerID: 1,
|
||||
}
|
||||
|
||||
// 成功
|
||||
@ -507,6 +508,12 @@ func TestFolder_MoveOrCopyFolderTo_Move(t *testing.T) {
|
||||
asserts.NoError(mock.ExpectationsWereMet())
|
||||
asserts.NoError(err)
|
||||
}
|
||||
|
||||
// 移动自己到自己内部,失败
|
||||
{
|
||||
err := parFolder.MoveFolderTo([]uint{10, 2}, &dstFolder)
|
||||
asserts.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFolder_FileInfoInterface(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user