changeset 11354:129077fb57e6 v8.0.0562

patch 8.0.0562: not enough test coverage for syntax commands commit https://github.com/vim/vim/commit/ea588154d00aec288e48b344b2685e46bea99cd6 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Apr 10 22:45:30 2017 +0200 patch 8.0.0562: not enough test coverage for syntax commands Problem: Not enough test coverage for syntax commands. Solution: Add a few more tests. (Dominique Pelle, closes https://github.com/vim/vim/issues/1624)
author Christian Brabandt <cb@256bit.org>
date Mon, 10 Apr 2017 23:00:03 +0200
parents 251fea7703a7
children 9847289fc7a3
files src/testdir/test_cmdline.vim src/testdir/test_syntax.vim src/version.c
diffstat 3 files changed, 30 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/testdir/test_cmdline.vim
+++ b/src/testdir/test_cmdline.vim
@@ -65,6 +65,10 @@ func Test_highlight_completion()
   hi Aardig ctermfg=green
   call feedkeys(":hi \<Tab>\<Home>\"\<CR>", 'xt')
   call assert_equal('"hi Aardig', getreg(':'))
+  call feedkeys(":hi default \<Tab>\<Home>\"\<CR>", 'xt')
+  call assert_equal('"hi default Aardig', getreg(':'))
+  call feedkeys(":hi clear Aa\<Tab>\<Home>\"\<CR>", 'xt')
+  call assert_equal('"hi clear Aardig', getreg(':'))
   call feedkeys(":hi li\<S-Tab>\<Home>\"\<CR>", 'xt')
   call assert_equal('"hi link', getreg(':'))
   call feedkeys(":hi d\<S-Tab>\<Home>\"\<CR>", 'xt')
--- a/src/testdir/test_syntax.vim
+++ b/src/testdir/test_syntax.vim
@@ -304,12 +304,18 @@ func Test_syntax_arg_skipped()
   syn clear
 endfunc
 
-func Test_invalid_arg()
+func Test_syntax_invalid_arg()
   call assert_fails('syntax case asdf', 'E390:')
   if has('conceal')
     call assert_fails('syntax conceal asdf', 'E390:')
   endif
   call assert_fails('syntax spell asdf', 'E390:')
+  call assert_fails('syntax clear @ABCD', 'E391:')
+  call assert_fails('syntax include @Xxx', 'E397:')
+  call assert_fails('syntax region X start="{"', 'E399:')
+  call assert_fails('syntax sync x', 'E404:')
+  call assert_fails('syntax keyword Abc a[', 'E789:')
+  call assert_fails('syntax keyword Abc a[bc]d', 'E890:')
 endfunc
 
 func Test_syn_sync()
@@ -378,3 +384,20 @@ func Test_ownsyntax_completion()
   call feedkeys(":ownsyntax java\<C-A>\<C-B>\"\<CR>", 'tx')
   call assert_equal('"ownsyntax java javacc javascript', @:)
 endfunc
+
+func Test_highlight_invalid_arg()
+  if has('gui_running')
+    call assert_fails('hi XXX guifg=xxx', 'E254:')
+  endif
+  call assert_fails('hi DoesNotExist', 'E411:')
+  call assert_fails('hi link', 'E412:')
+  call assert_fails('hi link a', 'E412:')
+  call assert_fails('hi link a b c', 'E413:')
+  call assert_fails('hi XXX =', 'E415:')
+  call assert_fails('hi XXX cterm', 'E416:')
+  call assert_fails('hi XXX cterm=', 'E417:')
+  call assert_fails('hi XXX cterm=DoesNotExist', 'E418:')
+  call assert_fails('hi XXX ctermfg=DoesNotExist', 'E421:')
+  call assert_fails('hi XXX xxx=White', 'E423:')
+endfunc
+
--- a/src/version.c
+++ b/src/version.c
@@ -765,6 +765,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    562,
+/**/
     561,
 /**/
     560,