mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
legacy tests: migrate test25
This commit is contained in:
committed by
Thiago de Arruda
parent
8ca8a0da08
commit
963a146e8b
@@ -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
|
||||
@@ -1 +0,0 @@
|
||||
#efine SECTION_OFF 3
|
||||
50
test/functional/legacy/025_jump_tag_hidden_spec.lua
Normal file
50
test/functional/legacy/025_jump_tag_hidden_spec.lua
Normal file
@@ -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)
|
||||
Reference in New Issue
Block a user