Mercurial > vim
comparison src/testdir/test_cscope.vim @ 14345:72afa7268670 v8.1.0188
patch 8.1.0188: no test for ":cscope add"
commit https://github.com/vim/vim/commit/2196bca7377ff245866cc3cee65b0adb48432ac3
Author: Bram Moolenaar <Bram@vim.org>
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)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 15 Jul 2018 17:45:05 +0200 |
parents | 741b1feeac9f |
children | 73001276abce |
comparison
equal
deleted
inserted
replaced
14344:956a3583df76 | 14345:72afa7268670 |
---|---|
252 call assert_equal(cscope_connection(3, 'out', '.'), 1) | 252 call assert_equal(cscope_connection(3, 'out', '.'), 1) |
253 call assert_equal(cscope_connection(4, 'out', '.'), 0) | 253 call assert_equal(cscope_connection(4, 'out', '.'), 0) |
254 | 254 |
255 " CleanUp | 255 " CleanUp |
256 call CscopeSetupOrClean(0) | 256 call CscopeSetupOrClean(0) |
257 | 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:') | |
274 | |
275 call delete('Xcscopedir', 'd') | |
258 endfunc | 276 endfunc |
259 | 277 |
260 func Test_cscopequickfix() | 278 func Test_cscopequickfix() |
261 set cscopequickfix=s-,g-,d+,c-,t+,e-,f0,i-,a- | 279 set cscopequickfix=s-,g-,d+,c-,t+,e-,f0,i-,a- |
262 call assert_equal('s-,g-,d+,c-,t+,e-,f0,i-,a-', &cscopequickfix) | 280 call assert_equal('s-,g-,d+,c-,t+,e-,f0,i-,a-', &cscopequickfix) |