Browse files

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 #1624)
  • Loading branch information...
brammool committed Apr 10, 2017
1 parent 478af67 commit ea588154d00aec288e48b344b2685e46bea99cd6
Showing with 30 additions and 1 deletion.
  1. +4 −0 src/testdir/test_cmdline.vim
  2. +24 −1 src/testdir/test_syntax.vim
  3. +2 −0 src/version.c
@@ -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')
@@ -304,12 +304,18 @@ func Test_syntax_arg_skipped()
syn clear
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:')
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:')
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', @:)
func Test_highlight_invalid_arg()
if has('gui_running')
call assert_fails('hi XXX guifg=xxx', 'E254:')
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:')
@@ -764,6 +764,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */

0 comments on commit ea58815

Please sign in to comment.