0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

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)
This commit is contained in:
Bram Moolenaar 2017-04-10 22:45:30 +02:00
parent 478af67dd6
commit ea588154d0
3 changed files with 30 additions and 1 deletions

View File

@ -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')

View File

@ -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

View File

@ -764,6 +764,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
562,
/**/
561,
/**/