Skip to content

Commit 288ed23

Browse files
zeertzjqbrammool
authored andcommitted
patch 9.0.0034: spell tests do not always clear the word list
Problem: Spell tests do not always clear the word list. Solution: Clear the word list in TearDown(). (closes #10659)
1 parent 4dd9252 commit 288ed23

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

src/testdir/test_spell.vim

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ func TearDown()
1414
call delete('Xtest.latin1.add.spl')
1515
call delete('Xtest.latin1.spl')
1616
call delete('Xtest.latin1.sug')
17+
" set 'encoding' to clear the word list
18+
set encoding=utf-8
1719
endfunc
1820

1921
func Test_wrap_search()
@@ -781,6 +783,10 @@ func Test_zz_sal_and_addition()
781783
set spl=Xtest_ca.latin1.spl
782784
call assert_equal("elequint", FirstSpellWord())
783785
call assert_equal("elekwint", SecondSpellWord())
786+
787+
bwipe!
788+
set spellfile=
789+
set spl&
784790
endfunc
785791

786792
func Test_spellfile_value()
@@ -864,9 +870,6 @@ func Test_spell_good_word_invalid()
864870
sil! norm z=
865871

866872
bwipe!
867-
" clear the internal word list
868-
set enc=latin1
869-
set enc=utf-8
870873
endfunc
871874

872875
func LoadAffAndDic(aff_contents, dic_contents)

src/testdir/test_spell_utf8.vim

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ func TearDown()
1313
call delete('Xtest.utf-8.add.spl')
1414
call delete('Xtest.utf-8.spl')
1515
call delete('Xtest.utf-8.sug')
16+
" set 'encoding' to clear the word list
17+
set encoding=utf-8
1618
endfunc
1719

1820
let g:test_data_aff1 = [
@@ -484,7 +486,6 @@ let g:test_data_aff_sal = [
484486
\ ]
485487

486488
func LoadAffAndDic(aff_contents, dic_contents)
487-
set enc=utf-8
488489
set spellfile=
489490
call writefile(a:aff_contents, "Xtest.aff")
490491
call writefile(a:dic_contents, "Xtest.dic")
@@ -759,6 +760,7 @@ func Test_spell_sal_and_addition()
759760
call assert_equal("elequint", FirstSpellWord())
760761
call assert_equal("elekwint", SecondSpellWord())
761762

763+
bwipe!
762764
set spellfile=
763765
set spl&
764766
endfunc
@@ -802,8 +804,6 @@ func Test_word_index()
802804
sil norm z=
803805

804806
bwipe!
805-
" clear the word list
806-
set enc=utf-8
807807
call delete('Xtmpfile')
808808
endfunc
809809

@@ -816,7 +816,6 @@ func Test_check_empty_line()
816816
sil! norm P]svc
817817
norm P]s
818818

819-
" TODO: should we clear the word list?
820819
bwipe!
821820
endfunc
822821

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,8 @@ static char *(features[]) =
735735

736736
static int included_patches[] =
737737
{ /* Add new patch number below this line */
738+
/**/
739+
34,
738740
/**/
739741
33,
740742
/**/

0 commit comments

Comments
 (0)