fix: process deletes in dir before moving dir
This commit is contained in:
parent
a632c898fb
commit
349bca8c3e
2 changed files with 23 additions and 4 deletions
|
|
@ -216,6 +216,26 @@ a.describe("mutator", function()
|
|||
assert.are.same({ move1, move2 }, ordered_actions)
|
||||
end)
|
||||
|
||||
it("Handles a delete inside a moved folder", function()
|
||||
-- delete in directory and move directory
|
||||
-- DELETE /a/b.txt
|
||||
-- MOVE /a/ -> /b/
|
||||
local del = {
|
||||
type = "delete",
|
||||
url = "oil-test:///a/b.txt",
|
||||
entry_type = "file",
|
||||
}
|
||||
local move = {
|
||||
type = "move",
|
||||
src_url = "oil-test:///a",
|
||||
dest_url = "oil-test:///b",
|
||||
entry_type = "directory",
|
||||
}
|
||||
local actions = { move, del }
|
||||
local ordered_actions = mutator.enforce_action_order(actions)
|
||||
assert.are.same({ del, move }, ordered_actions)
|
||||
end)
|
||||
|
||||
it("Detects move directory loops", function()
|
||||
local move = {
|
||||
type = "move",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue