mirror of
https://github.com/neovim/neovim.git
synced 2025-09-05 19:08:15 +00:00
test: unreliable swapfile_preserve_recover_spec
Problem: Test sometimes fails on bsd (cirrus ci): test/functional/ex_cmds/swapfile_preserve_recover_spec.lua:589: retry() attempts: 464 test/functional/ex_cmds/swapfile_preserve_recover_spec.lua:590: Expected objects to be the same. Passed in: (table: 0x0d5f1aa44070) { [1] = '' *[2] = '' [3] = '[Process exited 1]' } Expected: (table: 0x0d5ea3eb8718) { [1] = '' *[2] = '[Process exited 1]' [3] = '' } stack traceback: test/testutil.lua:104: in function 'retry' test/functional/ex_cmds/swapfile_preserve_recover_spec.lua:589: in function <test/functional/ex_cmds/swapfile_preserve_recover_spec.lua:556> Solution: Filter out empty items to avoid irrelevant redraw-timing assumptions.
This commit is contained in:
@@ -152,6 +152,9 @@ describe('swapfile detection', function()
|
||||
|
||||
it('redrawing during prompt does not break treesitter', function()
|
||||
local testfile = 'Xtest_swapredraw.lua'
|
||||
finally(function()
|
||||
os.remove(testfile)
|
||||
end)
|
||||
write_file(
|
||||
testfile,
|
||||
[[
|
||||
@@ -589,7 +592,9 @@ describe('quitting swapfile dialog on startup stops TUI properly', function()
|
||||
retry(nil, nil, function()
|
||||
eq(
|
||||
{ '[Process exited 1]' },
|
||||
eval("[1, 2, '$']->map({_, lnum -> getline(lnum)->trim(' ', 2)})->filter({_, s -> !empty(trim(s))})")
|
||||
eval(
|
||||
"[1, 2, '$']->map({_, lnum -> getline(lnum)->trim(' ', 2)})->filter({_, s -> !empty(trim(s))})"
|
||||
)
|
||||
)
|
||||
end)
|
||||
end)
|
||||
|
Reference in New Issue
Block a user