Patch 8.2.1659
Problem:    Spellfile code not completely tested.
Solution:   Add a few more test cases. (Yegappan Lakshmanan, closes #6929)
Files:      src/testdir/test_spell.vim, src/testdir/test_spellfile.vim


*** ../vim-8.2.1658/src/testdir/test_spell.vim  2020-07-11 22:14:54.318422203 
+0200
--- src/testdir/test_spell.vim  2020-09-11 18:09:21.278635466 +0200
***************
*** 112,117 ****
--- 112,118 ----
  
    set spelllang=
    call assert_fails("call spellbadword('maxch')", 'E756:')
+   call assert_fails("spelldump", 'E756:')
  
    call delete('Xwords.spl')
    call delete('Xwords')
*** ../vim-8.2.1658/src/testdir/test_spellfile.vim      2020-09-09 
22:43:15.358693369 +0200
--- src/testdir/test_spellfile.vim      2020-09-11 18:09:21.278635466 +0200
***************
*** 307,312 ****
--- 307,315 ----
    " SN_SOFO: empty sofofrom and sofoto
    call Spellfile_Test(0z06000000000400000000FF000000000000000000000000, '')
  
+   " SN_SOFO: multi-byte characters in sofofrom and sofoto
+   call 
Spellfile_Test(0z0600000000080002CF810002CF82FF000000000000000000000000, '')
+ 
    " SN_COMPOUND: compmax is less than 2
    call Spellfile_Test(0z08000000000101, 'E759:')
  
***************
*** 550,557 ****
--- 553,566 ----
  " Test for the :mkspell command
  func Test_mkspell()
    call assert_fails('mkspell Xtest_us.spl', 'E751:')
+   call assert_fails('mkspell Xtest.spl abc', 'E484:')
    call assert_fails('mkspell a b c d e f g h i j k', 'E754:')
  
+   " create a .aff file but not the .dic file
+   call writefile([], 'Xtest.aff')
+   call assert_fails('mkspell Xtest.spl Xtest', 'E484:')
+   call delete('Xtest.aff')
+ 
    call writefile([], 'Xtest.spl')
    call writefile([], 'Xtest.dic')
    call assert_fails('mkspell Xtest.spl Xtest.dic', 'E13:')
***************
*** 772,777 ****
--- 781,794 ----
    call assert_fails('mkspell! Xtest.spl Xtest', 'E761:')
    let &encoding = save_encoding
  
+   " missing UPP entry
+   call writefile(["FOL abc", "LOW abc"], 'Xtest.aff')
+   let save_encoding = &encoding
+   set encoding=cp949
+   let output = execute('mkspell! Xtest.spl Xtest')
+   call assert_match('Missing FOL/LOW/UPP line in Xtest.aff', output)
+   let &encoding = save_encoding
+ 
    " duplicate word in the .dic file
    call writefile(['2', 'good', 'good', 'good'], 'Xtest.dic')
    call writefile(['NAME vim'], 'Xtest.aff')
***************
*** 779,784 ****
--- 796,815 ----
    call assert_match('First duplicate word in Xtest.dic line 3: good', output)
    call assert_match('2 duplicate word(s) in Xtest.dic', output)
  
+   " use multiple .aff files with different values for COMPOUNDWORDMAX and
+   " MIDWORD (number and string)
+   call writefile(['1', 'world'], 'Xtest_US.dic')
+   call writefile(['1', 'world'], 'Xtest_CA.dic')
+   call writefile(["COMPOUNDWORDMAX 3", "MIDWORD '-"], 'Xtest_US.aff')
+   call writefile(["COMPOUNDWORDMAX 4", "MIDWORD '="], 'Xtest_CA.aff')
+   let output = execute('mkspell! Xtest.spl Xtest_US Xtest_CA')
+   call assert_match('COMPOUNDWORDMAX value differs from what is used in 
another .aff file', output)
+   call assert_match('MIDWORD value differs from what is used in another .aff 
file', output)
+   call delete('Xtest_US.dic')
+   call delete('Xtest_CA.dic')
+   call delete('Xtest_US.aff')
+   call delete('Xtest_CA.aff')
+ 
    call delete('Xtest.dic')
    call delete('Xtest.aff')
    call delete('Xtest.spl')
*** ../vim-8.2.1658/src/version.c       2020-09-11 17:59:19.032235034 +0200
--- src/version.c       2020-09-11 18:09:42.830591205 +0200
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     1659,
  /**/

-- 
Sorry, no fortune today.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            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/202009111612.08BGCU36912862%40masaka.moolenaar.net.

Raspunde prin e-mail lui