Merge #10061 from janlazo/vim-8.1.0188

vim-patch:8.1.{188,317}
This commit is contained in:
Justin M. Keyes
2019-05-25 18:41:52 +02:00
committed by GitHub

View File

@@ -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()