test(012_directory_spec): fix flakiness on Windows (#30920)

Problem:  012_directory_spec is flaky on Windows.
Solution: Use :%bwipe! instead :qall!.
This commit is contained in:
zeertzjq 2024-10-24 10:03:23 +08:00 committed by GitHub
parent 611c416359
commit fffcb88ad6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -15,7 +15,6 @@ local clear = n.clear
local insert = n.insert
local command = n.command
local write_file = t.write_file
local expect_exit = n.expect_exit
local mkdir = t.mkdir
local function ls_dir_sorted(dirname)
@ -44,7 +43,9 @@ describe("'directory' option", function()
clear()
end)
teardown(function()
expect_exit(command, 'qall!')
command('%bwipe!')
api.nvim_set_option_value('swapfile', false, {})
api.nvim_set_option_value('directory', '.', {})
n.rmdir('Xtest.je')
n.rmdir('Xtest2')
os.remove('Xtest1')
@ -57,7 +58,6 @@ describe("'directory' option", function()
line 3 Abcdefghij
end of testfile]])
api.nvim_set_option_value('swapfile', true, {})
api.nvim_set_option_value('swapfile', true, {})
api.nvim_set_option_value('directory', '.', {})