]> granicus.if.org Git - vim/commitdiff
patch 9.0.0034: spell tests do not always clear the word list v9.0.0034
authorzeertzjq <zeertzjq@outlook.com>
Mon, 4 Jul 2022 10:03:07 +0000 (11:03 +0100)
committerBram Moolenaar <Bram@vim.org>
Mon, 4 Jul 2022 10:03:07 +0000 (11:03 +0100)
Problem:    Spell tests do not always clear the word list.
Solution:   Clear the word list in TearDown(). (closes #10659)

src/testdir/test_spell.vim
src/testdir/test_spell_utf8.vim
src/version.c

index 0187a175a8264084d8581f723391e0a06590da10..d3f56d8d1498f206909cd33f9e548234335c0d4a 100644 (file)
@@ -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()
@@ -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()
@@ -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)
index c71308be563f9e6acd455bf913a86456e0f1bef4..07cb87af6ce99d8946e79b4b05ea506aa14a5f9b 100644 (file)
@@ -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 = [
@@ -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")
@@ -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
@@ -802,8 +804,6 @@ func Test_word_index()
   sil norm z=
 
   bwipe!
-  " clear the word list
-  set enc=utf-8
   call delete('Xtmpfile')
 endfunc
 
@@ -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
 
index 419e25f6d31fcfb1a50ade922d246ff97cb266a0..180a4cf8c97742f8c1c58c70d04a76cb1080d8cc 100644 (file)
@@ -735,6 +735,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    34,
 /**/
     33,
 /**/