Skip to content

Commit 2196bca

Browse files
committed
patch 8.1.0188: no test for ":cscope add"
Problem: No test for ":cscope add". Solution: Add a test. (Dominique Pelle, closes #3212)
1 parent 7132ddc commit 2196bca

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/testdir/test_cscope.vim

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,25 @@ func Test_cscopeWithCscopeConnections()
254254

255255
" CleanUp
256256
call CscopeSetupOrClean(0)
257+
endfunc
258+
259+
" Test ":cs add {dir}" (add the {dir}/cscope.out database)
260+
func Test_cscope_add_dir()
261+
call mkdir('Xcscopedir', 'p')
262+
call system('cscope -bk -fXcscopedir/cscope.out ../memfile_test.c')
263+
cs add Xcscopedir
264+
let a = execute('cscope show')
265+
let lines = split(a, "\n", 1)
266+
call assert_equal(3, len(lines))
267+
call assert_equal(' # pid database name prepend path', lines[0])
268+
call assert_equal('', lines[1])
269+
call assert_match('^ 0 \d\+.*Xcscopedir/cscope.out\s\+<none>$', lines[2])
270+
271+
cs kill -1
272+
call delete('Xcscopedir/cscope.out')
273+
call assert_fails('cs add Xcscopedir', 'E563:')
257274

275+
call delete('Xcscopedir', 'd')
258276
endfunc
259277

260278
func Test_cscopequickfix()

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,8 @@ static char *(features[]) =
789789

790790
static int included_patches[] =
791791
{ /* Add new patch number below this line */
792+
/**/
793+
188,
792794
/**/
793795
187,
794796
/**/

0 commit comments

Comments
 (0)