mirror of
https://github.com/neovim/neovim.git
synced 2025-11-26 12:10:40 +00:00
test: 'nofsync' with deadly signal #26415
Problem:
The test for 'nofsync' swapfile preservation on a deadly signal, does
not actually assert anything.
followup to 1fd29a2884
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;
}
}
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user