0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

patch 8.0.0200: some syntax arguments are not tested

Problem:    Some syntax arguments are not tested.
Solution:   Add more syntax command tests.
This commit is contained in:
Bram Moolenaar
2017-01-17 17:19:00 +01:00
parent 6d721c7e10
commit 58f60ca2fc
2 changed files with 34 additions and 2 deletions

View File

@@ -186,6 +186,10 @@ func Test_syntax_arg_skipped()
call assert_match('conceal on', execute('syntax conceal')) call assert_match('conceal on', execute('syntax conceal'))
syn clear syn clear
call assert_match('conceal off', execute('syntax conceal')) call assert_match('conceal off', execute('syntax conceal'))
syntax conceal on
syntax conceal off
call assert_match('conceal off', execute('syntax conceal'))
endif endif
syntax region Tar start=/</ end=/>/ syntax region Tar start=/</ end=/>/
@@ -283,8 +287,7 @@ func Test_syntax_arg_skipped()
endif endif
call assert_match('on C-style comments', execute('syntax sync')) call assert_match('on C-style comments', execute('syntax sync'))
call assert_match('maximal 5 lines', execute('syntax sync')) call assert_match('maximal 5 lines', execute('syntax sync'))
syn clear syn sync clear
syn keyword Foo foo
if 0 if 0
syn sync ccomment syn sync ccomment
endif endif
@@ -293,3 +296,30 @@ func Test_syntax_arg_skipped()
syn clear syn clear
endfunc endfunc
func Test_invalid_arg()
call assert_fails('syntax case asdf', 'E390:')
call assert_fails('syntax conceal asdf', 'E390:')
call assert_fails('syntax spell asdf', 'E390:')
endfunc
func Test_syn_sync()
syntax region HereGroup start=/this/ end=/that/
syntax sync match SyncHere grouphere HereGroup "pattern"
call assert_match('SyncHere', execute('syntax sync'))
syn sync clear
call assert_notmatch('SyncHere', execute('syntax sync'))
syn clear
endfunc
func Test_syn_clear()
syntax keyword Foo foo
syntax keyword Tar tar
call assert_match('Foo', execute('syntax'))
call assert_match('Tar', execute('syntax'))
syn clear Foo
call assert_notmatch('Foo', execute('syntax'))
call assert_match('Tar', execute('syntax'))
syn clear Foo Tar
call assert_notmatch('Foo', execute('syntax'))
call assert_notmatch('Tar', execute('syntax'))
endfunc

View File

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