Skip to content

Commit

Permalink
Tmain(client): add test for vista.vim (#2875)
Browse files Browse the repository at this point in the history
Tmain(client): add test for vista.vim (#2875)

Ref liuchengxu/vista.vim#386 (comment)
  • Loading branch information
liuchengxu committed Feb 17, 2021
1 parent bf27b48 commit 4b54332
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 0 deletions.
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

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

0 comments on commit 4b54332

Please sign in to comment.