diff options
| author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-08-01 12:17:39 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-01 12:17:39 -0400 |
| commit | 337b1b31ac12ee4351668e32fe116282efd3dcc3 (patch) | |
| tree | 1c9c98a10406590e5d65a9500664e600d7c45d32 /src/nvim/testdir | |
| parent | 51251e1dc74ce17bb083c002c2e5d5b34ce4e402 (diff) | |
| parent | de74fcc74cee4e4b35335bff6cecea46f36a78f6 (diff) | |
| download | rneovim-337b1b31ac12ee4351668e32fe116282efd3dcc3.tar.gz rneovim-337b1b31ac12ee4351668e32fe116282efd3dcc3.tar.bz2 rneovim-337b1b31ac12ee4351668e32fe116282efd3dcc3.zip | |
Merge pull request #15234 from janlazo/vim-8.2.3164
vim-patch:8.2.{3164,3167,3192,3208,3213,3214,3225,3231,3243,3246,3247,3250,3253,3256,3260}
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_functions.vim | 3 | ||||
| -rw-r--r-- | src/nvim/testdir/test_spellfile.vim | 46 |
2 files changed, 49 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_functions.vim b/src/nvim/testdir/test_functions.vim index bcf2edcc93..48f97be96b 100644 --- a/src/nvim/testdir/test_functions.vim +++ b/src/nvim/testdir/test_functions.vim @@ -1006,6 +1006,9 @@ func Test_Executable() if catcmd =~ '\<sbin\>' && result =~ '\<bin\>' call assert_equal('/' .. substitute(catcmd, '\<sbin\>', 'bin', ''), result) else + " /bin/cat and /usr/bin/cat may be hard linked, we could get either + let result = substitute(result, '/usr/bin/cat', '/bin/cat', '') + let catcmd = substitute(catcmd, 'usr/bin/cat', 'bin/cat', '') call assert_equal('/' .. catcmd, result) endif bwipe diff --git a/src/nvim/testdir/test_spellfile.vim b/src/nvim/testdir/test_spellfile.vim index 729467b556..0f48ab8f6f 100644 --- a/src/nvim/testdir/test_spellfile.vim +++ b/src/nvim/testdir/test_spellfile.vim @@ -210,6 +210,52 @@ func Test_spellfile_CHECKCOMPOUNDPATTERN() call delete('XtestCHECKCOMPOUNDPATTERN-utf8.spl') endfunc +" Test NOCOMPOUNDSUGS (see :help spell-NOCOMPOUNDSUGS) +func Test_spellfile_NOCOMPOUNDSUGS() + call writefile(['3', + \ 'one/c', + \ 'two/c', + \ 'three/c'], 'XtestNOCOMPOUNDSUGS.dic') + + " pass 0 tests without NOCOMPOUNDSUGS, pass 1 tests with NOCOMPOUNDSUGS + for pass in [0, 1] + if pass == 0 + call writefile(['COMPOUNDFLAG c'], 'XtestNOCOMPOUNDSUGS.aff') + else + call writefile(['NOCOMPOUNDSUGS', + \ 'COMPOUNDFLAG c'], 'XtestNOCOMPOUNDSUGS.aff') + endif + + mkspell! XtestNOCOMPOUNDSUGS-utf8.spl XtestNOCOMPOUNDSUGS + set spell spelllang=XtestNOCOMPOUNDSUGS-utf8.spl + + for goodword in ['one', 'two', 'three', + \ 'oneone', 'onetwo', 'onethree', + \ 'twoone', 'twotwo', 'twothree', + \ 'threeone', 'threetwo', 'threethree', + \ 'onetwothree', 'onethreetwo', 'twothreeone', 'oneoneone'] + call assert_equal(['', ''], spellbadword(goodword), goodword) + endfor + + for badword in ['four', 'onetwox', 'onexone'] + call assert_equal([badword, 'bad'], spellbadword(badword)) + endfor + + if pass == 0 + call assert_equal(['one', 'oneone'], spellsuggest('onne', 2)) + call assert_equal(['onethree', 'one three'], spellsuggest('onethre', 2)) + else + call assert_equal(['one', 'one one'], spellsuggest('onne', 2)) + call assert_equal(['one three'], spellsuggest('onethre', 2)) + endif + endfor + + set spell& spelllang& + call delete('XtestNOCOMPOUNDSUGS.dic') + call delete('XtestNOCOMPOUNDSUGS.aff') + call delete('XtestNOCOMPOUNDSUGS-utf8.spl') +endfunc + " Test COMMON (better suggestions with common words, see :help spell-COMMON) func Test_spellfile_COMMON() call writefile(['7', |