Patch 8.2.3213
Problem: NOCOMPOUNDSUGS entry in spell file not tested.
Solution: Add a test. (Dominique Pellé, closes #8624)
Files: src/testdir/test_spellfile.vim
*** ../vim-8.2.3212/src/testdir/test_spellfile.vim 2021-05-31
20:04:00.553171007 +0200
--- src/testdir/test_spellfile.vim 2021-07-24 20:49:37.176426285 +0200
***************
*** 943,948 ****
--- 943,994 ----
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',
*** ../vim-8.2.3212/src/version.c 2021-07-24 19:32:07.800733149 +0200
--- src/version.c 2021-07-24 20:51:01.424207325 +0200
***************
*** 757,758 ****
--- 757,760 ----
{ /* Add new patch number below this line */
+ /**/
+ 3213,
/**/
--
hundred-and-one symptoms of being an internet addict:
228. You spend Saturday night making the counter on your home page
pass that 2000 mark.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202107241852.16OIqmW9883493%40masaka.moolenaar.net.