diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-06-27 06:45:00 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-27 06:45:00 +0800 |
| commit | a0a815ec57ec241bd9d7db139eb2591bf5ef24ac (patch) | |
| tree | 6ceb4a9e5b6656b0ca835ebf322d78f3d6ee32f8 /src/nvim/testdir | |
| parent | 516d6318b78c6e7f4734ea155591aa457016aa81 (diff) | |
| parent | 6711d001c59a0b5f6cf3f5d53d837d41f1ec78a5 (diff) | |
| download | rneovim-a0a815ec57ec241bd9d7db139eb2591bf5ef24ac.tar.gz rneovim-a0a815ec57ec241bd9d7db139eb2591bf5ef24ac.tar.bz2 rneovim-a0a815ec57ec241bd9d7db139eb2591bf5ef24ac.zip | |
Merge pull request #18716 from zeertzjq/vim-8.2.5007
vim-patch:8.2.{3484,5007,5123}: spell suggestion fixes
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_spell.vim | 10 | ||||
| -rw-r--r-- | src/nvim/testdir/test_spell_utf8.vim | 42 |
2 files changed, 46 insertions, 6 deletions
diff --git a/src/nvim/testdir/test_spell.vim b/src/nvim/testdir/test_spell.vim index ce21b8bdc9..215d4387d6 100644 --- a/src/nvim/testdir/test_spell.vim +++ b/src/nvim/testdir/test_spell.vim @@ -72,6 +72,16 @@ func Test_z_equal_on_invalid_utf8_word() bwipe! endfunc +func Test_z_equal_on_single_character() + " this was decrementing the index below zero + new + norm a0\Ê + norm zW + norm z= + + bwipe! +endfunc + " Test spellbadword() with argument func Test_spellbadword() set spell diff --git a/src/nvim/testdir/test_spell_utf8.vim b/src/nvim/testdir/test_spell_utf8.vim index 1d323df67e..3c07e0782b 100644 --- a/src/nvim/testdir/test_spell_utf8.vim +++ b/src/nvim/testdir/test_spell_utf8.vim @@ -576,7 +576,6 @@ endfunc "Compound words func Test_spell_compound() - throw 'skipped: TODO: ' call LoadAffAndDic(g:test_data_aff3, g:test_data_dic3) call RunGoodBad("foo m\u00EF foobar foofoobar barfoo barbarfoo", \ "bad: bar la foom\u00EF barm\u00EF m\u00EFfoo m\u00EFbar m\u00EFm\u00EF lala m\u00EFla lam\u00EF foola labar", @@ -624,14 +623,14 @@ endfunc " Test affix flags with two characters func Test_spell_affix() - throw 'skipped: TODO: ' + CheckNotMSWindows " FIXME: Why does this fail with MSVC? call LoadAffAndDic(g:test_data_aff5, g:test_data_dic5) call RunGoodBad("fooa1 fooa\u00E9 bar prebar barbork prebarbork startprebar start end startend startmiddleend nouend", \ "bad: foo fooa2 prabar probarbirk middle startmiddle middleend endstart startprobar startnouend", \ ["bar", "barbork", "end", "fooa1", "fooa\u00E9", "nouend", "prebar", "prebarbork", "start"], \ [ \ ["bad", ["bar", "end", "fooa1"]], - \ ["foo", ["fooa1", "fooa\u00E9", "bar"]], + \ ["foo", ["fooa1", "bar", "end"]], \ ["fooa2", ["fooa1", "fooa\u00E9", "bar"]], \ ["prabar", ["prebar", "bar", "bar bar"]], \ ["probarbirk", ["prebarbork"]], @@ -649,7 +648,7 @@ func Test_spell_affix() \ ["bar", "barbork", "end", "lead", "meea1", "meea\u00E9", "prebar", "prebarbork"], \ [ \ ["bad", ["bar", "end", "lead"]], - \ ["mee", ["meea1", "meea\u00E9", "bar"]], + \ ["mee", ["meea1", "bar", "end"]], \ ["meea2", ["meea1", "meea\u00E9", "lead"]], \ ["prabar", ["prebar", "bar", "leadbar"]], \ ["probarbirk", ["prebarbork"]], @@ -666,7 +665,7 @@ func Test_spell_affix() \ ["bar", "barmeat", "lead", "meea1", "meea\u00E9", "meezero", "prebar", "prebarmeat", "tail"], \ [ \ ["bad", ["bar", "lead", "tail"]], - \ ["mee", ["meea1", "meea\u00E9", "bar"]], + \ ["mee", ["meea1", "bar", "lead"]], \ ["meea2", ["meea1", "meea\u00E9", "lead"]], \ ["prabar", ["prebar", "bar", "leadbar"]], \ ["probarmaat", ["prebarmeat"]], @@ -700,7 +699,6 @@ endfunc " Affix flags func Test_spell_affix_flags() - throw 'skipped: TODO: ' call LoadAffAndDic(g:test_data_aff10, g:test_data_dic10) call RunGoodBad("drink drinkable drinkables drinktable drinkabletable", \ "bad: drinks drinkstable drinkablestable", @@ -761,11 +759,30 @@ func Test_spell_sal_and_addition() set spl=Xtest_ca.utf-8.spl call assert_equal("elequint", FirstSpellWord()) call assert_equal("elekwint", SecondSpellWord()) + + set spellfile= + set spl& endfunc func Test_spellfile_value() set spellfile=Xdir/Xtest.utf-8.add set spellfile=Xdir/Xtest.utf-8.add,Xtest_other.add + set spellfile= +endfunc + +func Test_no_crash_with_weird_text() + new + let lines =<< trim END + r<sfile> + € + + + € + END + call setline(1, lines) + exe "%norm \<C-v>ez=>\<C-v>wzG" + + bwipe! endfunc " Invalid bytes may cause trouble when creating the word list. @@ -773,5 +790,18 @@ func Test_check_for_valid_word() call assert_fails("spellgood! 0\xac", 'E1280:') endfunc +" This was going over the end of the word +func Test_word_index() + new + norm R0 + spellgood! fl0 + sil norm z= + + bwipe! + " clear the word list + set enc=utf-8 + call delete('Xtmpfile') +endfunc + " vim: shiftwidth=2 sts=2 expandtab |