To: vim_dev@googlegroups.com Subject: Patch 8.2.2884 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.2884 Problem: Not enough cscope code is covered by tests. Solution: Add a few test cases. (Dominique Pellé, closes #8246) Files: src/testdir/test_cscope.vim *** ../vim-8.2.2883/src/testdir/test_cscope.vim 2020-09-04 21:18:40.480161935 +0200 --- src/testdir/test_cscope.vim 2021-05-24 19:31:08.550709092 +0200 *************** *** 119,124 **** --- 119,125 ---- endfor " Test: Invalid find command + call assert_fails('cs find', 'E560:') call assert_fails('cs find x', 'E560:') if has('float') *************** *** 180,191 **** let a = execute('cstag TEST_COUNT') call assert_match('(1 of 1): <> #define TEST_COUNT 50000', a) call assert_equal('#define TEST_COUNT 50000', getline('.')) set csto=1 let a = execute('cstag index_to_key') call assert_match('(1 of 1): <> #define index_to_key(i) ((i) ^ 15167)', a) call assert_equal('#define index_to_key(i) ((i) ^ 15167)', getline('.')) ! call assert_fails('cstag xxx', 'E257:') call assert_fails('cstag', 'E562:') " Test: 'cst' option set nocst --- 181,199 ---- let a = execute('cstag TEST_COUNT') call assert_match('(1 of 1): <> #define TEST_COUNT 50000', a) call assert_equal('#define TEST_COUNT 50000', getline('.')) + call assert_fails('cstag DOES_NOT_EXIST', 'E257:') set csto=1 let a = execute('cstag index_to_key') call assert_match('(1 of 1): <> #define index_to_key(i) ((i) ^ 15167)', a) call assert_equal('#define index_to_key(i) ((i) ^ 15167)', getline('.')) ! call assert_fails('cstag DOES_NOT_EXIST', 'E257:') call assert_fails('cstag', 'E562:') + let save_tags = &tags + set tags= + call assert_fails('cstag DOES_NOT_EXIST', 'E257:') + let a = execute('cstag index_to_key') + call assert_match('(1 of 1): <> #define index_to_key(i) ((i) ^ 15167)', a) + let &tags = save_tags " Test: 'cst' option set nocst *************** *** 209,220 **** --- 217,232 ---- cd .. call delete('Xcscoperelative', 'd') + " Test: E259: no match found + call assert_fails('cscope find g DOES_NOT_EXIST', 'E259:') + " Test: this should trigger call to cs_print_tags() " Unclear how to check result though, we just exercise the code. set cst cscopequickfix=s0 call feedkeys(":cs find s main\", 't') " Test: cscope kill + call assert_fails('cscope kill', 'E560:') call assert_fails('cscope kill 2', 'E261:') call assert_fails('cscope kill xxx', 'E261:') *** ../vim-8.2.2883/src/version.c 2021-05-24 18:48:00.756582853 +0200 --- src/version.c 2021-05-24 19:29:41.398907084 +0200 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2884, /**/ -- DENNIS: Listen -- strange women lying in ponds distributing swords is no basis for a system of government. Supreme executive power derives from a mandate from the masses, not from some farcical aquatic ceremony. The Quest for the Holy Grail (Monty Python) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///