Skip to content

Commit ea58815

Browse files
committed
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)
1 parent 478af67 commit ea58815

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

src/testdir/test_cmdline.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ func Test_highlight_completion()
6565
hi Aardig ctermfg=green
6666
call feedkeys(":hi \<Tab>\<Home>\"\<CR>", 'xt')
6767
call assert_equal('"hi Aardig', getreg(':'))
68+
call feedkeys(":hi default \<Tab>\<Home>\"\<CR>", 'xt')
69+
call assert_equal('"hi default Aardig', getreg(':'))
70+
call feedkeys(":hi clear Aa\<Tab>\<Home>\"\<CR>", 'xt')
71+
call assert_equal('"hi clear Aardig', getreg(':'))
6872
call feedkeys(":hi li\<S-Tab>\<Home>\"\<CR>", 'xt')
6973
call assert_equal('"hi link', getreg(':'))
7074
call feedkeys(":hi d\<S-Tab>\<Home>\"\<CR>", 'xt')

src/testdir/test_syntax.vim

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,12 +304,18 @@ func Test_syntax_arg_skipped()
304304
syn clear
305305
endfunc
306306

307-
func Test_invalid_arg()
307+
func Test_syntax_invalid_arg()
308308
call assert_fails('syntax case asdf', 'E390:')
309309
if has('conceal')
310310
call assert_fails('syntax conceal asdf', 'E390:')
311311
endif
312312
call assert_fails('syntax spell asdf', 'E390:')
313+
call assert_fails('syntax clear @ABCD', 'E391:')
314+
call assert_fails('syntax include @Xxx', 'E397:')
315+
call assert_fails('syntax region X start="{"', 'E399:')
316+
call assert_fails('syntax sync x', 'E404:')
317+
call assert_fails('syntax keyword Abc a[', 'E789:')
318+
call assert_fails('syntax keyword Abc a[bc]d', 'E890:')
313319
endfunc
314320

315321
func Test_syn_sync()
@@ -378,3 +384,20 @@ func Test_ownsyntax_completion()
378384
call feedkeys(":ownsyntax java\<C-A>\<C-B>\"\<CR>", 'tx')
379385
call assert_equal('"ownsyntax java javacc javascript', @:)
380386
endfunc
387+
388+
func Test_highlight_invalid_arg()
389+
if has('gui_running')
390+
call assert_fails('hi XXX guifg=xxx', 'E254:')
391+
endif
392+
call assert_fails('hi DoesNotExist', 'E411:')
393+
call assert_fails('hi link', 'E412:')
394+
call assert_fails('hi link a', 'E412:')
395+
call assert_fails('hi link a b c', 'E413:')
396+
call assert_fails('hi XXX =', 'E415:')
397+
call assert_fails('hi XXX cterm', 'E416:')
398+
call assert_fails('hi XXX cterm=', 'E417:')
399+
call assert_fails('hi XXX cterm=DoesNotExist', 'E418:')
400+
call assert_fails('hi XXX ctermfg=DoesNotExist', 'E421:')
401+
call assert_fails('hi XXX xxx=White', 'E423:')
402+
endfunc
403+

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,8 @@ static char *(features[]) =
764764

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
562,
767769
/**/
768770
561,
769771
/**/

0 commit comments

Comments
 (0)