Skip to content

Commit 58f60ca

Browse files
committed
patch 8.0.0200: some syntax arguments are not tested
Problem: Some syntax arguments are not tested. Solution: Add more syntax command tests.
1 parent 6d721c7 commit 58f60ca

2 files changed

Lines changed: 34 additions & 2 deletions

File tree

src/testdir/test_syntax.vim

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,10 @@ func Test_syntax_arg_skipped()
186186
call assert_match('conceal on', execute('syntax conceal'))
187187
syn clear
188188
call assert_match('conceal off', execute('syntax conceal'))
189+
190+
syntax conceal on
191+
syntax conceal off
192+
call assert_match('conceal off', execute('syntax conceal'))
189193
endif
190194

191195
syntax region Tar start=/</ end=/>/
@@ -283,8 +287,7 @@ func Test_syntax_arg_skipped()
283287
endif
284288
call assert_match('on C-style comments', execute('syntax sync'))
285289
call assert_match('maximal 5 lines', execute('syntax sync'))
286-
syn clear
287-
syn keyword Foo foo
290+
syn sync clear
288291
if 0
289292
syn sync ccomment
290293
endif
@@ -293,3 +296,30 @@ func Test_syntax_arg_skipped()
293296
syn clear
294297
endfunc
295298

299+
func Test_invalid_arg()
300+
call assert_fails('syntax case asdf', 'E390:')
301+
call assert_fails('syntax conceal asdf', 'E390:')
302+
call assert_fails('syntax spell asdf', 'E390:')
303+
endfunc
304+
305+
func Test_syn_sync()
306+
syntax region HereGroup start=/this/ end=/that/
307+
syntax sync match SyncHere grouphere HereGroup "pattern"
308+
call assert_match('SyncHere', execute('syntax sync'))
309+
syn sync clear
310+
call assert_notmatch('SyncHere', execute('syntax sync'))
311+
syn clear
312+
endfunc
313+
314+
func Test_syn_clear()
315+
syntax keyword Foo foo
316+
syntax keyword Tar tar
317+
call assert_match('Foo', execute('syntax'))
318+
call assert_match('Tar', execute('syntax'))
319+
syn clear Foo
320+
call assert_notmatch('Foo', execute('syntax'))
321+
call assert_match('Tar', execute('syntax'))
322+
syn clear Foo Tar
323+
call assert_notmatch('Foo', execute('syntax'))
324+
call assert_notmatch('Tar', execute('syntax'))
325+
endfunc

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+
200,
767769
/**/
768770
199,
769771
/**/

0 commit comments

Comments
 (0)