diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-08-15 22:17:05 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-15 22:17:05 +0800 |
| commit | 6b686e7e1e09a048bd8e99e86d052d713f9ec30e (patch) | |
| tree | 77bbeb8298ce2bb4483f748ddd40808889776239 /src/nvim/testdir/test_spellfile.vim | |
| parent | cbb2e634c9da7cc6e5fe6f18539ab7deb9d67915 (diff) | |
| parent | 747dec7925e130e754cf5ef1db87dd8747923514 (diff) | |
| download | rneovim-6b686e7e1e09a048bd8e99e86d052d713f9ec30e.tar.gz rneovim-6b686e7e1e09a048bd8e99e86d052d713f9ec30e.tar.bz2 rneovim-6b686e7e1e09a048bd8e99e86d052d713f9ec30e.zip | |
Merge pull request #19785 from zeertzjq/vim-8.2.1803
vim-patch:8.2.{1803,3345,3392}
Diffstat (limited to 'src/nvim/testdir/test_spellfile.vim')
| -rw-r--r-- | src/nvim/testdir/test_spellfile.vim | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_spellfile.vim b/src/nvim/testdir/test_spellfile.vim index ef475a99e7..dbffbafed9 100644 --- a/src/nvim/testdir/test_spellfile.vim +++ b/src/nvim/testdir/test_spellfile.vim @@ -919,6 +919,33 @@ func Test_spellfile_COMMON() call delete('XtestCOMMON-utf8.spl') endfunc +" Test NOSUGGEST (see :help spell-COMMON) +func Test_spellfile_NOSUGGEST() + call writefile(['2', 'foo/X', 'fog'], 'XtestNOSUGGEST.dic') + call writefile(['NOSUGGEST X'], 'XtestNOSUGGEST.aff') + + mkspell! XtestNOSUGGEST-utf8.spl XtestNOSUGGEST + set spell spelllang=XtestNOSUGGEST-utf8.spl + + for goodword in ['foo', 'Foo', 'FOO', 'fog', 'Fog', 'FOG'] + call assert_equal(['', ''], spellbadword(goodword), goodword) + endfor + for badword in ['foO', 'fOO', 'fooo', 'foog', 'foofog', 'fogfoo'] + call assert_equal([badword, 'bad'], spellbadword(badword)) + endfor + + call assert_equal(['fog'], spellsuggest('fooo', 1)) + call assert_equal(['fog'], spellsuggest('fOo', 1)) + call assert_equal(['fog'], spellsuggest('foG', 1)) + call assert_equal(['fog'], spellsuggest('fogg', 1)) + + set spell& spelllang& + call delete('XtestNOSUGGEST.dic') + call delete('XtestNOSUGGEST.aff') + call delete('XtestNOSUGGEST-utf8.spl') +endfunc + + " Test CIRCUMFIX (see: :help spell-CIRCUMFIX) func Test_spellfile_CIRCUMFIX() " Example taken verbatim from https://github.com/hunspell/hunspell/tree/master/tests |