]> granicus.if.org Git - vim/commitdiff
patch 8.1.0340: no test for :spellinfo v8.1.0340
authorBram Moolenaar <Bram@vim.org>
Fri, 31 Aug 2018 20:26:53 +0000 (22:26 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 31 Aug 2018 20:26:53 +0000 (22:26 +0200)
Problem:    No test for :spellinfo.
Solution:   Add a test. (Dominique Pelle, closes #3394)

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

index d9d8f6062e7a842d46ba59fa75c2a0394f9d87e8..1230c206d955d20252e6cd6f77558c65f93363c1 100644 (file)
@@ -126,6 +126,35 @@ func Test_spellreall()
   bwipe!
 endfunc
 
+func Test_spellinfo()
+  new
+
+  set enc=latin1 spell spelllang=en
+  call assert_match("^\nfile: .*/runtime/spell/en.latin1.spl\n$", execute('spellinfo'))
+
+  set enc=cp1250 spell spelllang=en
+  call assert_match("^\nfile: .*/runtime/spell/en.ascii.spl\n$", execute('spellinfo'))
+
+  if has('multi_byte')
+    set enc=utf-8 spell spelllang=en
+    call assert_match("^\nfile: .*/runtime/spell/en.utf-8.spl\n$", execute('spellinfo'))
+  endif
+
+  set enc=latin1 spell spelllang=en_us,en_nz
+  call assert_match("^\n" .
+                 \  "file: .*/runtime/spell/en.latin1.spl\n" .
+                 \  "file: .*/runtime/spell/en.latin1.spl\n$", execute('spellinfo'))
+
+  set spell spelllang=
+  call assert_fails('spellinfo', 'E756:')
+
+  set nospell spelllang=en
+  call assert_fails('spellinfo', 'E756:')
+
+  set enc& spell& spelllang&
+  bwipe
+endfunc
+
 func Test_zz_basic()
   call LoadAffAndDic(g:test_data_aff1, g:test_data_dic1)
   call RunGoodBad("wrong OK puts. Test the end",
index ec13271baf24c95aa644665965d3f9d623aca930..d5daaf42bfcb0125bac9ff2952cdb7d6382b6553 100644 (file)
@@ -794,6 +794,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    340,
 /**/
     339,
 /**/