comparison src/testdir/test_spell_utf8.vim @ 29383:e76e18a20d9c v9.0.0034

patch 9.0.0034: spell tests do not always clear the word list Commit: https://github.com/vim/vim/commit/288ed23e3929ff55a8ae30db0ba3f57b6f119dc8 Author: zeertzjq <zeertzjq@outlook.com> Date: Mon Jul 4 11:03:07 2022 +0100 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 https://github.com/vim/vim/issues/10659)
author Bram Moolenaar <Bram@vim.org>
date Mon, 04 Jul 2022 12:15:02 +0200
parents dd76820a4d60
children 6d93f09815c1
comparison
equal deleted inserted replaced
29382:289171b6aba3 29383:e76e18a20d9c
11 call delete('Xtest.dic') 11 call delete('Xtest.dic')
12 call delete('Xtest.utf-8.add') 12 call delete('Xtest.utf-8.add')
13 call delete('Xtest.utf-8.add.spl') 13 call delete('Xtest.utf-8.add.spl')
14 call delete('Xtest.utf-8.spl') 14 call delete('Xtest.utf-8.spl')
15 call delete('Xtest.utf-8.sug') 15 call delete('Xtest.utf-8.sug')
16 " set 'encoding' to clear the word list
17 set encoding=utf-8
16 endfunc 18 endfunc
17 19
18 let g:test_data_aff1 = [ 20 let g:test_data_aff1 = [
19 \"SET ISO8859-1", 21 \"SET ISO8859-1",
20 \"TRY esianrtolcdugmphbyfvkwjkqxz-ëéèêïîäàâöüû'ESIANRTOLCDUGMPHBYFVKWJKQXZ", 22 \"TRY esianrtolcdugmphbyfvkwjkqxz-ëéèêïîäàâöüû'ESIANRTOLCDUGMPHBYFVKWJKQXZ",
482 \"SAL ZZ- _", 484 \"SAL ZZ- _",
483 \"SAL Z S", 485 \"SAL Z S",
484 \ ] 486 \ ]
485 487
486 func LoadAffAndDic(aff_contents, dic_contents) 488 func LoadAffAndDic(aff_contents, dic_contents)
487 set enc=utf-8
488 set spellfile= 489 set spellfile=
489 call writefile(a:aff_contents, "Xtest.aff") 490 call writefile(a:aff_contents, "Xtest.aff")
490 call writefile(a:dic_contents, "Xtest.dic") 491 call writefile(a:dic_contents, "Xtest.dic")
491 " Generate a .spl file from a .dic and .aff file. 492 " Generate a .spl file from a .dic and .aff file.
492 mkspell! Xtest Xtest 493 mkspell! Xtest Xtest
757 758
758 set spl=Xtest_ca.utf-8.spl 759 set spl=Xtest_ca.utf-8.spl
759 call assert_equal("elequint", FirstSpellWord()) 760 call assert_equal("elequint", FirstSpellWord())
760 call assert_equal("elekwint", SecondSpellWord()) 761 call assert_equal("elekwint", SecondSpellWord())
761 762
763 bwipe!
762 set spellfile= 764 set spellfile=
763 set spl& 765 set spl&
764 endfunc 766 endfunc
765 767
766 func Test_spellfile_value() 768 func Test_spellfile_value()
800 norm R0 802 norm R0
801 spellgood! fl0 803 spellgood! fl0
802 sil norm z= 804 sil norm z=
803 805
804 bwipe! 806 bwipe!
805 " clear the word list
806 set enc=utf-8
807 call delete('Xtmpfile') 807 call delete('Xtmpfile')
808 endfunc 808 endfunc
809 809
810 func Test_check_empty_line() 810 func Test_check_empty_line()
811 " This was using freed memory 811 " This was using freed memory
814 norm z= 814 norm z=
815 norm yy 815 norm yy
816 sil! norm P]svc 816 sil! norm P]svc
817 norm P]s 817 norm P]s
818 818
819 " TODO: should we clear the word list?
820 bwipe! 819 bwipe!
821 endfunc 820 endfunc
822 821
823 822
824 " vim: shiftwidth=2 sts=2 expandtab 823 " vim: shiftwidth=2 sts=2 expandtab