Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tmain(client): add test for vista.vim #2875

Merged
merged 3 commits into from
Feb 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Tmain/client-vista-vim-fields-expectation.d/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
If your change breaks this test case, notify the change
to https://github.com/liuchengxu/vista.vim.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
12 changes: 12 additions & 0 deletions Tmain/client-vista-vim-fields-expectation.d/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright: 2021 <https://github.com/liuchengxu>
# License: GPL-2

CTAGS=$1

. ../utils.sh

liuchengxu marked this conversation as resolved.
Show resolved Hide resolved
is_feature_available "${CTAGS}" json

$CTAGS --format=2 --excmd=pattern --fields=+nksSaf --extras=+F --sort=no --append=no --extras= --language-force=vim --vim-kinds=acfvmn --output-format=json --fields=-PF -f- test.vim

exit $?
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{"_type": "tag", "name": "s:cur_dir", "line": 1, "kind": "variable"}
{"_type": "tag", "name": "vista#FindItemsUnderDirectory", "line": 3, "signature": "(dir)", "kind": "function"}
5 changes: 5 additions & 0 deletions Tmain/client-vista-vim-fields-expectation.d/test.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
let s:cur_dir = fnamemodify(resolve(expand('<sfile>:p')), ':h')

function! vista#FindItemsUnderDirectory(dir) abort
return map(split(globpath(a:dir, '*'), '\n'), 'fnamemodify(v:val, '':t:r'')')
endfunction