aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2025-02-26 22:51:48 +0100
committerJustin M. Keyes <justinkz@gmail.com>2025-02-26 23:06:22 +0100
commit4a997a1732fdb7a1c99cadf780b789f1ac84d990 (patch)
tree0c40b6f8c3569e339d375cb5842820590c5f3103
parentbe1fbe38b31b6046d396407c4efbf238941c6b08 (diff)
downloadrneovim-4a997a1732fdb7a1c99cadf780b789f1ac84d990.tar.gz
rneovim-4a997a1732fdb7a1c99cadf780b789f1ac84d990.tar.bz2
rneovim-4a997a1732fdb7a1c99cadf780b789f1ac84d990.zip
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.
-rw-r--r--test/functional/ex_cmds/swapfile_preserve_recover_spec.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/functional/ex_cmds/swapfile_preserve_recover_spec.lua b/test/functional/ex_cmds/swapfile_preserve_recover_spec.lua
index 38e6707a3b..8eec02524e 100644
--- a/test/functional/ex_cmds/swapfile_preserve_recover_spec.lua
+++ b/test/functional/ex_cmds/swapfile_preserve_recover_spec.lua
@@ -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)