Skip to content

Commit

Permalink
patch 9.0.0034: spell tests do not always clear the word list
Browse files Browse the repository at this point in the history
Problem:    Spell tests do not always clear the word list.
Solution:   Clear the word list in TearDown(). (closes #10659)
  • Loading branch information
zeertzjq authored and brammool committed Jul 4, 2022
1 parent 4dd9252 commit 288ed23
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
9 changes: 6 additions & 3 deletions src/testdir/test_spell.vim
Expand Up @@ -14,6 +14,8 @@ func TearDown()
call delete('Xtest.latin1.add.spl')
call delete('Xtest.latin1.spl')
call delete('Xtest.latin1.sug')
" set 'encoding' to clear the word list
set encoding=utf-8
endfunc

func Test_wrap_search()
Expand Down Expand Up @@ -781,6 +783,10 @@ func Test_zz_sal_and_addition()
set spl=Xtest_ca.latin1.spl
call assert_equal("elequint", FirstSpellWord())
call assert_equal("elekwint", SecondSpellWord())

bwipe!
set spellfile=
set spl&
endfunc

func Test_spellfile_value()
Expand Down Expand Up @@ -864,9 +870,6 @@ func Test_spell_good_word_invalid()
sil! norm z=

bwipe!
" clear the internal word list
set enc=latin1
set enc=utf-8
endfunc

func LoadAffAndDic(aff_contents, dic_contents)
Expand Down
7 changes: 3 additions & 4 deletions src/testdir/test_spell_utf8.vim
Expand Up @@ -13,6 +13,8 @@ func TearDown()
call delete('Xtest.utf-8.add.spl')
call delete('Xtest.utf-8.spl')
call delete('Xtest.utf-8.sug')
" set 'encoding' to clear the word list
set encoding=utf-8
endfunc

let g:test_data_aff1 = [
Expand Down Expand Up @@ -484,7 +486,6 @@ let g:test_data_aff_sal = [
\ ]

func LoadAffAndDic(aff_contents, dic_contents)
set enc=utf-8
set spellfile=
call writefile(a:aff_contents, "Xtest.aff")
call writefile(a:dic_contents, "Xtest.dic")
Expand Down Expand Up @@ -759,6 +760,7 @@ func Test_spell_sal_and_addition()
call assert_equal("elequint", FirstSpellWord())
call assert_equal("elekwint", SecondSpellWord())

bwipe!
set spellfile=
set spl&
endfunc
Expand Down Expand Up @@ -802,8 +804,6 @@ func Test_word_index()
sil norm z=

bwipe!
" clear the word list
set enc=utf-8
call delete('Xtmpfile')
endfunc

Expand All @@ -816,7 +816,6 @@ func Test_check_empty_line()
sil! norm P]svc
norm P]s

" TODO: should we clear the word list?
bwipe!
endfunc

Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -735,6 +735,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
34,
/**/
33,
/**/
Expand Down

0 comments on commit 288ed23

Please sign in to comment.