# HG changeset patch # User Christian Brabandt # Date 1491858003 -7200 # Node ID 129077fb57e6e51c4c984167ffba3d3ca9c0b7bc # Parent 251fea7703a73870684973f15bb1e294357f24dd patch 8.0.0562: not enough test coverage for syntax commands commit https://github.com/vim/vim/commit/ea588154d00aec288e48b344b2685e46bea99cd6 Author: Bram Moolenaar 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) diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim --- 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 \\\"\", 'xt') call assert_equal('"hi Aardig', getreg(':')) + call feedkeys(":hi default \\\"\", 'xt') + call assert_equal('"hi default Aardig', getreg(':')) + call feedkeys(":hi clear Aa\\\"\", 'xt') + call assert_equal('"hi clear Aardig', getreg(':')) call feedkeys(":hi li\\\"\", 'xt') call assert_equal('"hi link', getreg(':')) call feedkeys(":hi d\\\"\", 'xt') diff --git a/src/testdir/test_syntax.vim b/src/testdir/test_syntax.vim --- 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\\\"\", '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 + diff --git a/src/version.c b/src/version.c --- 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,