From c84af395e88ba143c19f7e34674bd222622e08ee Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Wed, 6 Dec 2023 07:11:36 -0800 Subject: test: 'nofsync' with deadly signal #26415 Problem: The test for 'nofsync' swapfile preservation on a deadly signal, does not actually assert anything. followup to 1fd29a28841dee3d25ff079eb24fc160eb02cb3c Solution: Check that swapfile contents are present after getting SIGTERM. TODO: this doesn't really verify that 'fsync' was called; it still passes with this patch: diff --git a/src/nvim/main.c b/src/nvim/main.c index 216e39f3e81c..7a635520401d 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -838,7 +838,7 @@ void preserve_exit(const char *errmsg) if (errmsg != NULL) { os_errmsg("Vim: preserving files...\r\n"); } - ml_sync_all(false, false, true); // preserve all swap files + ml_sync_all(false, false, false); // preserve all swap files break; } } However it correctly fails with this patch, at least: diff --git a/src/nvim/main.c b/src/nvim/main.c index 216e39f3e81c..f2306c310ddc 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -838,7 +838,6 @@ void preserve_exit(const char *errmsg) if (errmsg != NULL) { os_errmsg("Vim: preserving files...\r\n"); } - ml_sync_all(false, false, true); // preserve all swap files break; } } --- test/functional/ui/screen_basic_spec.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/functional/ui') diff --git a/test/functional/ui/screen_basic_spec.lua b/test/functional/ui/screen_basic_spec.lua index 4ef7565ec5..0406cc9771 100644 --- a/test/functional/ui/screen_basic_spec.lua +++ b/test/functional/ui/screen_basic_spec.lua @@ -12,7 +12,7 @@ describe('screen', function() helpers.nvim_prog, '-u', 'NONE', '-i', 'NONE', - '-N', + '-n', '--cmd', 'set shortmess+=I background=light noswapfile belloff= noshowcmd noruler', '--cmd', 'colorscheme vim', '--embed', -- cgit