]> granicus.if.org Git - vim/commitdiff
patch 8.1.0188: no test for ":cscope add" v8.1.0188
authorBram Moolenaar <Bram@vim.org>
Sun, 15 Jul 2018 15:36:32 +0000 (17:36 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 15 Jul 2018 15:36:32 +0000 (17:36 +0200)
Problem:    No test for ":cscope add".
Solution:   Add a test. (Dominique Pelle, closes #3212)

src/testdir/test_cscope.vim
src/version.c

index c6e54d73ec12d55f0ed75e2e0dd2e23994c97070..71d5487ce35ce594c3c09e61ef46c7dff054c089 100644 (file)
@@ -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\+<none>$', 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()
index 559d8bed535d7c0a7075b87772c4060d6f3120a5..892b9aea1d2dc5098fec8c23de5846373072700b 100644 (file)
@@ -789,6 +789,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    188,
 /**/
     187,
 /**/