aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-10-15 16:52:25 +0800
committerGitHub <noreply@github.com>2022-10-15 16:52:25 +0800
commit9d05b28f75ccf8691fb33291ac60b0092eb70f37 (patch)
tree91e4b7bbf302a699629d59652e73a365ccafe3a1 /src/nvim/testdir
parente26b48bde6e116eb288893454d2876cdad2db1f9 (diff)
parenta9452cf3d5e2904ff355daf660e8e56bcb2433eb (diff)
downloadrneovim-9d05b28f75ccf8691fb33291ac60b0092eb70f37.tar.gz
rneovim-9d05b28f75ccf8691fb33291ac60b0092eb70f37.tar.bz2
rneovim-9d05b28f75ccf8691fb33291ac60b0092eb70f37.zip
Merge pull request #20662 from zeertzjq/vim-9.0.0614
vim-patch:8.1.0342,9.0.{0614,0616}: SpellFileMissing autocmd may delete buffer
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_autocmd.vim10
-rw-r--r--src/nvim/testdir/test_spell.vim2
2 files changed, 11 insertions, 1 deletions
diff --git a/src/nvim/testdir/test_autocmd.vim b/src/nvim/testdir/test_autocmd.vim
index 025bda4515..63ed3ff435 100644
--- a/src/nvim/testdir/test_autocmd.vim
+++ b/src/nvim/testdir/test_autocmd.vim
@@ -2752,6 +2752,16 @@ func Test_FileType_spell()
setglobal spellfile=
endfunc
+" this was wiping out the current buffer and using freed memory
+func Test_SpellFileMissing_bwipe()
+ next 0
+ au SpellFileMissing 0 bwipe
+ call assert_fails('set spell spelllang=0', 'E937:')
+
+ au! SpellFileMissing
+ bwipe
+endfunc
+
" Test closing a window or editing another buffer from a FileChangedRO handler
" in a readonly buffer
func Test_FileChangedRO_winclose()
diff --git a/src/nvim/testdir/test_spell.vim b/src/nvim/testdir/test_spell.vim
index 8ab8204b10..e421d21de1 100644
--- a/src/nvim/testdir/test_spell.vim
+++ b/src/nvim/testdir/test_spell.vim
@@ -147,7 +147,7 @@ func Test_spell_file_missing()
augroup TestSpellFileMissing
autocmd! SpellFileMissing * bwipe
augroup END
- call assert_fails('set spell spelllang=ab_cd', 'E797:')
+ call assert_fails('set spell spelllang=ab_cd', 'E937:')
" clean up
augroup TestSpellFileMissing