summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominique Pelle <dominique.pelle@gmail.com>2021-05-24 19:37:26 +0200
committerBram Moolenaar <Bram@vim.org>2021-05-24 19:37:26 +0200
commit1e469c72ee2914fcffbcd49258036acdabd6f500 (patch)
treeec653ececd884c65bbe6010a9f7292271914d9a9
parente97c7c962ca0fd7cad0d157f1762eb5cc5887fca (diff)
patch 8.2.2884: not enough cscope code is covered by testsv8.2.2884
Problem: Not enough cscope code is covered by tests. Solution: Add a few test cases. (Dominique Pellé, closes #8246)
-rw-r--r--src/testdir/test_cscope.vim14
-rw-r--r--src/version.c2
2 files changed, 15 insertions, 1 deletions
diff --git a/src/testdir/test_cscope.vim b/src/testdir/test_cscope.vim
index 9ffe9566f4..c01ca3243e 100644
--- a/src/testdir/test_cscope.vim
+++ b/src/testdir/test_cscope.vim
@@ -119,6 +119,7 @@ func Test_cscopeWithCscopeConnections()
endfor
" Test: Invalid find command
+ call assert_fails('cs find', 'E560:')
call assert_fails('cs find x', 'E560:')
if has('float')
@@ -180,12 +181,19 @@ func Test_cscopeWithCscopeConnections()
let a = execute('cstag TEST_COUNT')
call assert_match('(1 of 1): <<TEST_COUNT>> #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): <<index_to_key>> #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 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): <<index_to_key>> #define index_to_key(i) ((i) ^ 15167)', a)
+ let &tags = save_tags
" Test: 'cst' option
set nocst
@@ -209,12 +217,16 @@ func Test_cscopeWithCscopeConnections()
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\<CR>", 't')
" Test: cscope kill
+ call assert_fails('cscope kill', 'E560:')
call assert_fails('cscope kill 2', 'E261:')
call assert_fails('cscope kill xxx', 'E261:')
diff --git a/src/version.c b/src/version.c
index 517e832611..c0729b2cbf 100644
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2884,
+/**/
2883,
/**/
2882,