]> granicus.if.org Git - vim/commitdiff
patch 8.2.1808: no test coverage for ":spelldump!" v8.2.1808
authorBram Moolenaar <Bram@vim.org>
Wed, 7 Oct 2020 10:58:44 +0000 (12:58 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 7 Oct 2020 10:58:44 +0000 (12:58 +0200)
Problem:    No test coverage for ":spelldump!".
Solution:   Add a test. (Dominique PellĂ©, closes #7089)

src/testdir/test_spell.vim
src/version.c

index dd68e0c0908c4987e4553fadb33339ee6d8b9f4b..a3a9621cb0fff8a83a21a3282f9a25b629f295a9 100644 (file)
@@ -143,6 +143,44 @@ func Test_spell_file_missing()
   %bwipe!
 endfunc
 
+func Test_spelldump()
+  set spell spelllang=en
+  spellrare! emacs
+
+  spelldump
+
+  " Check assumption about region: 1: us, 2: au, 3: ca, 4: gb, 5: nz.
+  call assert_equal('/regions=usaucagbnz', getline(1))
+  call assert_notequal(0, search('^theater/1$'))    " US English only.
+  call assert_notequal(0, search('^theatre/2345$')) " AU, CA, GB or NZ English.
+
+  call assert_notequal(0, search('^emacs/?$'))      " ? for a rare word.
+  call assert_notequal(0, search('^the the/!$'))    " ! for a wrong word.
+
+  bwipe
+  set spell&
+endfunc
+
+func Test_spelldump_bang()
+  new
+  call setline(1, 'This is a sample sentence.')
+  redraw
+  set spell
+  redraw
+  spelldump!
+
+  " :spelldump! includes the number of times a word was found while updating
+  " the screen.
+  " Common word count starts at 10, regular word count starts at 0.
+  call assert_notequal(0, search("^is\t11$"))    " common word found once.
+  call assert_notequal(0, search("^the\t10$"))   " common word never found.
+  call assert_notequal(0, search("^sample\t1$")) " regular word found once.
+  call assert_equal(0, search("^screen\t"))      " regular word never found.
+
+  %bwipe!
+  set spell&
+endfunc
+
 func Test_spelllang_inv_region()
   set spell spelllang=en_xx
   let messages = GetMessages()
index daac37215c728c027f54535d139bea8ee7a28b2d..67867278497294c2f11984979f5929f1d6e8cceb 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1808,
 /**/
     1807,
 /**/