summaryrefslogtreecommitdiff
path: root/src/testdir/test_tagjump.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-10-26 20:21:44 +0200
committerBram Moolenaar <Bram@vim.org>2017-10-26 20:21:44 +0200
commit15993ce9210e8b8d4bc11e1d640f6447b18d3e6c (patch)
tree1c1558bba5fb9a3bd1cfa6d8d494aeca2bd83097 /src/testdir/test_tagjump.vim
parent235dddf1f4afe3a40047dbf2aca1bd177b7be18b (diff)
downloadvim-git-15993ce9210e8b8d4bc11e1d640f6447b18d3e6c.tar.gz
patch 8.0.1221: still too many old style testsv8.0.1221
Problem: Still too many old style tests. Solution: Convert a few more tests to new style. (Yegappan Lakshmanan, closes #2256)
Diffstat (limited to 'src/testdir/test_tagjump.vim')
-rw-r--r--src/testdir/test_tagjump.vim37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/testdir/test_tagjump.vim b/src/testdir/test_tagjump.vim
index bac413dac..dbab8d9e2 100644
--- a/src/testdir/test_tagjump.vim
+++ b/src/testdir/test_tagjump.vim
@@ -137,4 +137,41 @@ function Test_keyword_jump()
call delete('Xinclude')
endfunction
+" Test for jumping to a tag with 'hidden' set, with symbolic link in path of
+" tag. This only works for Unix, because of the symbolic link.
+func Test_tag_symbolic()
+ if !has('unix')
+ return
+ endif
+ set hidden
+ call delete("Xtest.dir", "rf")
+ call system("ln -s . Xtest.dir")
+ " Create a tags file with the current directory name inserted.
+ call writefile([
+ \ "SECTION_OFF " . getcwd() . "/Xtest.dir/Xtest.c /^#define SECTION_OFF 3$/",
+ \ '',
+ \ ], 'Xtags')
+ call writefile(['#define SECTION_OFF 3',
+ \ '#define NUM_SECTIONS 3'], 'Xtest.c')
+
+ " Try jumping to a tag, but with a path that contains a symbolic link. When
+ " wrong, this will give the ATTENTION message. The next space will then be
+ " eaten by hit-return, instead of moving the cursor to 'd'.
+ set tags=Xtags
+ enew!
+ call append(0, 'SECTION_OFF')
+ call cursor(1,1)
+ exe "normal \<C-]> "
+ call assert_equal('Xtest.c', expand('%:t'))
+ call assert_equal(2, col('.'))
+
+ set hidden&
+ set tags&
+ enew!
+ call delete('Xtags')
+ call delete('Xtest.c')
+ call delete("Xtest.dir", "rf")
+ %bwipe!
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab