Hi

Attached patch improves test coverage for
the following items not currently covered
according to coveralls [1]:
- :syntime command
- :syntax list command
- :syntax completion

I did not test ":syntax list @{cluster-name} described
at ":help :syn-list" as I did not understand what cluster
name to give to make it work.

[1] https://coveralls.io/builds/9214454/source?filename=src%2Fsyntax.c

Regards
Dominique

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.
diff --git a/src/testdir/test_syntax.vim b/src/testdir/test_syntax.vim
index 4b88fe3..14ac0d3 100644
--- a/src/testdir/test_syntax.vim
+++ b/src/testdir/test_syntax.vim
@@ -80,3 +80,79 @@ func Test_syntax_after_reload()
   call assert_true(exists('g:gotit'))
   call delete('Xsomefile')
 endfunc
+
+func Test_syntime()
+  if !has('profile')
+    finish
+  endif
+
+  syntax on
+  syntime on
+  let a=execute('syntime report')
+  call assert_equal("\nNo Syntax items defined for this buffer", a)
+
+  view ../memfile_test.c
+  setfiletype cpp
+  redraw
+  let a=execute('syntime report')
+  call assert_match('^  TOTAL *COUNT *MATCH *SLOWEST *AVERAGE *NAME *PATTERN', a)
+  call assert_match(' \d*\.\d* \+[^0]\d* .* cppRawString ', a)
+  call assert_match(' \d*\.\d* \+[^0]\d* .* cppNumber ', a)
+
+  syntime off
+  syntime clear
+  let a=execute('syntime report')
+  call assert_match('^  TOTAL *COUNT *MATCH *SLOWEST *AVERAGE *NAME *PATTERN', a)
+  call assert_notmatch('.* cppRawString *', a)
+  call assert_notmatch('.* cppNumber*', a)
+  call assert_notmatch('[1-9]', a)
+
+  call assert_fails('syntime abc', 'E475')
+
+  syntax clear
+  let a=execute('syntime report')
+  call assert_equal("\nNo Syntax items defined for this buffer", a)
+
+  bd
+endfunc
+
+func Test_syntax_list()
+  syntax on
+  let a=execute('syntax list')
+  call assert_equal("\nNo Syntax items defined for this buffer", a)
+
+  view ../memfile_test.c
+  setfiletype c
+
+  let a=execute('syntax list')
+  call assert_match('cInclude*', a)
+  call assert_match('cDefine', a)
+
+  let a=execute('syntax list cDefine')
+  call assert_notmatch('cInclude*', a)
+  call assert_match('cDefine', a)
+  call assert_match(' links to Macro$', a)
+
+  call assert_fails('syntax list ABCD', 'E28:')
+  call assert_fails('syntax list @ABCD', 'E392:')
+
+  syntax clear
+  let a=execute('syntax list')
+  call assert_equal("\nNo Syntax items defined for this buffer", a)
+
+  bd
+endfunc
+
+func Test_syntax_completion()
+  call feedkeys(":syn \<C-A>\<C-B>\"\<CR>", 'tx')
+  call assert_equal('"syn case clear cluster conceal enable include iskeyword keyword list manual match off on region reset spell sync', @:)
+
+  call feedkeys(":syn case \<C-A>\<C-B>\"\<CR>", 'tx')
+  call assert_equal('"syn case ignore match', @:)
+
+  call feedkeys(":syn list \<C-A>\<C-B>\"\<CR>", 'tx')
+  call assert_match('^"syn list Boolean Character ', @:)
+
+  call feedkeys(":syn match \<C-A>\<C-B>\"\<CR>", 'tx')
+  call assert_match('^"syn match Boolean Character ', @:)
+endfunc

Raspunde prin e-mail lui