diff options
-rw-r--r-- | src/nvim/testdir/test25.in | 31 | ||||
-rw-r--r-- | src/nvim/testdir/test25.ok | 1 | ||||
-rw-r--r-- | test/functional/legacy/025_jump_tag_hidden_spec.lua | 50 |
3 files changed, 50 insertions, 32 deletions
diff --git a/src/nvim/testdir/test25.in b/src/nvim/testdir/test25.in deleted file mode 100644 index 4139865daf..0000000000 --- a/src/nvim/testdir/test25.in +++ /dev/null @@ -1,31 +0,0 @@ -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. - -STARTTEST -:so small.vim -:set hidden -:" Create a link from test25.dir to the current directory. -:!rm -f test25.dir -:!ln -s . test25.dir -:" Create tags.text, with the current directory name inserted. -/tags line -:r !pwd -d$/test -hP:.w! tags.test -:" Try jumping to a tag in the current file, 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=tags.test -G x:.w! test.out -:!rm -f test25.dir tags.test -:qa! -ENDTEST - -tags line: -SECTION_OFF /test25.dir/test25.in /^#define SECTION_OFF 3$/ - -/*tx.c*/ -#define SECTION_OFF 3 -#define NUM_SECTIONS 3 - -SECTION_OFF diff --git a/src/nvim/testdir/test25.ok b/src/nvim/testdir/test25.ok deleted file mode 100644 index 08fc070b7b..0000000000 --- a/src/nvim/testdir/test25.ok +++ /dev/null @@ -1 +0,0 @@ -#efine SECTION_OFF 3 diff --git a/test/functional/legacy/025_jump_tag_hidden_spec.lua b/test/functional/legacy/025_jump_tag_hidden_spec.lua new file mode 100644 index 0000000000..bd434c013c --- /dev/null +++ b/test/functional/legacy/025_jump_tag_hidden_spec.lua @@ -0,0 +1,50 @@ +-- 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. + +local helpers = require('test.functional.helpers') +local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert +local execute, expect = helpers.execute, helpers.expect + +describe('jump to a tag with hidden set', function() + setup(clear) + + it('is working', function() + insert([[ + tags line: + SECTION_OFF /test25.dir/Xxx /^#define SECTION_OFF 3$/ + + /*tx.c*/ + #define SECTION_OFF 3 + #define NUM_SECTIONS 3 + + SECTION_OFF]]) + + execute('w! Xxx') + execute('set hidden') + + -- Create a link from test25.dir to the current directory. + execute('!rm -f test25.dir') + execute('!ln -s . test25.dir') + + -- Create tags.text, with the current directory name inserted. + execute('/tags line') + execute('r !pwd') + feed('d$/test<cr>') + feed('hP:.w! tags.test<cr>') + + -- Try jumping to a tag in the current file, 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'. + execute('set tags=tags.test') + feed('G<C-]> x:yank a<cr>') + execute('!rm -f Xxx test25.dir tags.test') + + -- Put @a and remove empty line + execute('%d') + execute('0put a') + execute('$d') + + -- Assert buffer contents. + expect("#efine SECTION_OFF 3") + end) +end) |