summaryrefslogtreecommitdiff
path: root/src/testdir/test_syntax.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-01-17 17:19:00 +0100
committerBram Moolenaar <Bram@vim.org>2017-01-17 17:19:00 +0100
commit58f60ca2fcd2858faac84e386b3ccf5ced75084d (patch)
tree2448e57474c40fa8ead15953a71ebc8de38fb893 /src/testdir/test_syntax.vim
parent6d721c7e10251ad8c89a461eed99d8cf2659c1df (diff)
downloadvim-git-58f60ca2fcd2858faac84e386b3ccf5ced75084d.tar.gz
patch 8.0.0200: some syntax arguments are not testedv8.0.0200
Problem: Some syntax arguments are not tested. Solution: Add more syntax command tests.
Diffstat (limited to 'src/testdir/test_syntax.vim')
-rw-r--r--src/testdir/test_syntax.vim34
1 files changed, 32 insertions, 2 deletions
diff --git a/src/testdir/test_syntax.vim b/src/testdir/test_syntax.vim
index 43155d6b7..c93f8b76d 100644
--- a/src/testdir/test_syntax.vim
+++ b/src/testdir/test_syntax.vim
@@ -186,6 +186,10 @@ func Test_syntax_arg_skipped()
call assert_match('conceal on', execute('syntax conceal'))
syn clear
call assert_match('conceal off', execute('syntax conceal'))
+
+ syntax conceal on
+ syntax conceal off
+ call assert_match('conceal off', execute('syntax conceal'))
endif
syntax region Tar start=/</ end=/>/
@@ -283,8 +287,7 @@ func Test_syntax_arg_skipped()
endif
call assert_match('on C-style comments', execute('syntax sync'))
call assert_match('maximal 5 lines', execute('syntax sync'))
- syn clear
- syn keyword Foo foo
+ syn sync clear
if 0
syn sync ccomment
endif
@@ -293,3 +296,30 @@ func Test_syntax_arg_skipped()
syn clear
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