summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-10-07 12:58:44 +0200
committerBram Moolenaar <Bram@vim.org>2020-10-07 12:58:44 +0200
commitf12f0022e6698831681f0931a4e7e5298f6ef0d8 (patch)
tree5868bf0492eb5b2c375f7bd0608d764c677bea9d
parent349f609f8990a3aca9a4b8faa0585d75e03116db (diff)
downloadvim-git-f12f0022e6698831681f0931a4e7e5298f6ef0d8.tar.gz
patch 8.2.1808: no test coverage for ":spelldump!"v8.2.1808
Problem: No test coverage for ":spelldump!". Solution: Add a test. (Dominique Pellé, closes #7089)
-rw-r--r--src/testdir/test_spell.vim38
-rw-r--r--src/version.c2
2 files changed, 40 insertions, 0 deletions
diff --git a/src/testdir/test_spell.vim b/src/testdir/test_spell.vim
index dd68e0c09..a3a9621cb 100644
--- a/src/testdir/test_spell.vim
+++ b/src/testdir/test_spell.vim
@@ -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()
diff --git a/src/version.c b/src/version.c
index daac37215..678672784 100644
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1808,
+/**/
1807,
/**/
1806,