aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-05-25 18:41:52 +0200
committerGitHub <noreply@github.com>2019-05-25 18:41:52 +0200
commit5d6a18f238cfed745e9ad693640e640daef0a522 (patch)
tree227dc6655ecc4e9124f456d43a3ff4b43ad1a846
parent2f023f40b275a904c96d5b287e9e9abe6df1aec7 (diff)
parente6c48ecef2a2db4dab034a84bfe1d9c2bf845033 (diff)
downloadrneovim-5d6a18f238cfed745e9ad693640e640daef0a522.tar.gz
rneovim-5d6a18f238cfed745e9ad693640e640daef0a522.tar.bz2
rneovim-5d6a18f238cfed745e9ad693640e640daef0a522.zip
Merge #10061 from janlazo/vim-8.1.0188
vim-patch:8.1.{188,317}
-rw-r--r--src/nvim/testdir/test_cscope.vim23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_cscope.vim b/src/nvim/testdir/test_cscope.vim
index 01a9a3f9ad..bcb0d0dec5 100644
--- a/src/nvim/testdir/test_cscope.vim
+++ b/src/nvim/testdir/test_cscope.vim
@@ -254,7 +254,30 @@ 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')
+
+ " Cscope doesn't handle symlinks, so this needs to be resolved in case a
+ " shadow directory is being used.
+ let memfile = resolve('./samples/memfile_test.c')
+ call system('cscope -bk -fXcscopedir/cscope.out ' . memfile)
+
+ 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()