From bf10cdfcc086692e0ce3d478f3cb62c99b114de6 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 25 May 2019 11:58:55 -0400 Subject: vim-patch:8.1.0188: no test for ":cscope add" Problem: No test for ":cscope add". Solution: Add a test. (Dominique Pelle, closes vim/vim#3212) https://github.com/vim/vim/commit/2196bca7377ff245866cc3cee65b0adb48432ac3 --- src/nvim/testdir/test_cscope.vim | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src') diff --git a/src/nvim/testdir/test_cscope.vim b/src/nvim/testdir/test_cscope.vim index 01a9a3f9ad..5aae3d52b5 100644 --- a/src/nvim/testdir/test_cscope.vim +++ b/src/nvim/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() -- cgit From 6fae4608671900ca1d55cbed64015369c93b2a9e Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 25 May 2019 12:00:04 -0400 Subject: vim-patch:8.1.0317: Cscope test fails when using shadow directory Problem: Cscope test fails when using shadow directory. Solution: Resolve symlink in Vim. (James McCoy, closes vim/vim#3364) https://github.com/vim/vim/commit/320bf2d85e9e2924d896b3072979598c954922e7 --- src/nvim/testdir/test_cscope.vim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/testdir/test_cscope.vim b/src/nvim/testdir/test_cscope.vim index 5aae3d52b5..af8776377e 100644 --- a/src/nvim/testdir/test_cscope.vim +++ b/src/nvim/testdir/test_cscope.vim @@ -259,7 +259,12 @@ 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') + + " Cscope doesn't handle symlinks, so this needs to be resolved in case a + " shadow directory is being used. + let memfile = resolve('../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) -- cgit From e6c48ecef2a2db4dab034a84bfe1d9c2bf845033 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 25 May 2019 12:20:56 -0400 Subject: Fix memfile_test.c path --- src/nvim/testdir/test_cscope.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/testdir/test_cscope.vim b/src/nvim/testdir/test_cscope.vim index af8776377e..bcb0d0dec5 100644 --- a/src/nvim/testdir/test_cscope.vim +++ b/src/nvim/testdir/test_cscope.vim @@ -262,7 +262,7 @@ func Test_cscope_add_dir() " Cscope doesn't handle symlinks, so this needs to be resolved in case a " shadow directory is being used. - let memfile = resolve('../memfile_test.c') + let memfile = resolve('./samples/memfile_test.c') call system('cscope -bk -fXcscopedir/cscope.out ' . memfile) cs add Xcscopedir -- cgit