comparison src/testdir/test_syntax.vim @ 10622:bcacc849852a v8.0.0200

patch 8.0.0200: some syntax arguments are not tested commit https://github.com/vim/vim/commit/58f60ca2fcd2858faac84e386b3ccf5ced75084d Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jan 17 17:19:00 2017 +0100 patch 8.0.0200: some syntax arguments are not tested Problem: Some syntax arguments are not tested. Solution: Add more syntax command tests.
author Christian Brabandt <cb@256bit.org>
date Tue, 17 Jan 2017 17:30:05 +0100
parents 4ee16e5e2e26
children 5ac9d7920f11
comparison
equal deleted inserted replaced
10621:c1a829524ffe 10622:bcacc849852a
184 syntax conceal off 184 syntax conceal off
185 endif 185 endif
186 call assert_match('conceal on', execute('syntax conceal')) 186 call assert_match('conceal on', execute('syntax conceal'))
187 syn clear 187 syn clear
188 call assert_match('conceal off', execute('syntax conceal')) 188 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'))
189 endif 193 endif
190 194
191 syntax region Tar start=/</ end=/>/ 195 syntax region Tar start=/</ end=/>/
192 if 0 196 if 0
193 syntax region NotTest start=/</ end=/>/ contains=@Spell 197 syntax region NotTest start=/</ end=/>/ contains=@Spell
281 if 0 285 if 0
282 syn sync maxlines=11 286 syn sync maxlines=11
283 endif 287 endif
284 call assert_match('on C-style comments', execute('syntax sync')) 288 call assert_match('on C-style comments', execute('syntax sync'))
285 call assert_match('maximal 5 lines', execute('syntax sync')) 289 call assert_match('maximal 5 lines', execute('syntax sync'))
286 syn clear 290 syn sync clear
287 syn keyword Foo foo
288 if 0 291 if 0
289 syn sync ccomment 292 syn sync ccomment
290 endif 293 endif
291 call assert_notmatch('on C-style comments', execute('syntax sync')) 294 call assert_notmatch('on C-style comments', execute('syntax sync'))
292 295
293 syn clear 296 syn clear
294 endfunc 297 endfunc
295 298
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