# HG changeset patch # User Christian Brabandt # Date 1531669505 -7200 # Node ID 72afa726867033413d4d645aa0b253e84262fa75 # Parent 956a3583df76c76a67dd0ff6be8a50158bedd310 patch 8.1.0188: no test for ":cscope add" commit https://github.com/vim/vim/commit/2196bca7377ff245866cc3cee65b0adb48432ac3 Author: Bram Moolenaar Date: Sun Jul 15 17:36:32 2018 +0200 patch 8.1.0188: no test for ":cscope add" Problem: No test for ":cscope add". Solution: Add a test. (Dominique Pelle, closes https://github.com/vim/vim/issues/3212) diff --git a/src/testdir/test_cscope.vim b/src/testdir/test_cscope.vim --- a/src/testdir/test_cscope.vim +++ b/src/testdir/test_cscope.vim @@ -254,7 +254,25 @@ func Test_cscopeWithCscopeConnections() " CleanUp call CscopeSetupOrClean(0) +endfunc +" Test ":cs add {dir}" (add the {dir}/cscope.out database) +func Test_cscope_add_dir() + call mkdir('Xcscopedir', 'p') + call system('cscope -bk -fXcscopedir/cscope.out ../memfile_test.c') + cs add Xcscopedir + let a = execute('cscope show') + let lines = split(a, "\n", 1) + call assert_equal(3, len(lines)) + call assert_equal(' # pid database name prepend path', lines[0]) + call assert_equal('', lines[1]) + call assert_match('^ 0 \d\+.*Xcscopedir/cscope.out\s\+$', lines[2]) + + cs kill -1 + call delete('Xcscopedir/cscope.out') + call assert_fails('cs add Xcscopedir', 'E563:') + + call delete('Xcscopedir', 'd') endfunc func Test_cscopequickfix() diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -790,6 +790,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 188, +/**/ 187, /**/ 186,