To: vim_dev@googlegroups.com Subject: Patch 8.0.0131 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.0131 Problem: Not enough test coverage for syntax commands. Solution: Add more tests. (Dominique Pelle) Files: src/testdir/test_syntax.vim *** ../vim-8.0.0130/src/testdir/test_syntax.vim 2016-04-20 12:30:11.000000000 +0200 --- src/testdir/test_syntax.vim 2016-12-11 15:11:04.248529676 +0100 *************** *** 54,60 **** setlocal isk-=_ call assert_equal('DLTD_BY', GetSyntaxItem('DLTD')) /\/:norm! ygn ! let b2=@0 call assert_equal('DLTD', @0) syn iskeyword clear --- 54,60 ---- setlocal isk-=_ call assert_equal('DLTD_BY', GetSyntaxItem('DLTD')) /\/:norm! ygn ! let b2 = @0 call assert_equal('DLTD', @0) syn iskeyword clear *************** *** 80,82 **** --- 80,158 ---- 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 \\\"\", '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 \\\"\", 'tx') + call assert_equal('"syn case ignore match', @:) + + call feedkeys(":syn list \\\"\", 'tx') + call assert_match('^"syn list Boolean Character ', @:) + + call feedkeys(":syn match \\\"\", 'tx') + call assert_match('^"syn match Boolean Character ', @:) + endfunc *** ../vim-8.0.0130/src/version.c 2016-12-09 20:11:22.371819553 +0100 --- src/version.c 2016-12-11 14:57:30.105830445 +0100 *************** *** 766,767 **** --- 766,769 ---- { /* Add new patch number below this line */ + /**/ + 131, /**/ -- hundred-and-one symptoms of being an internet addict: 92. It takes you two hours to check all 14 of your mailboxes. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///