aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorerw7 <erw7.github@gmail.com>2019-07-29 08:25:54 +0900
committerJustin M. Keyes <justinkz@gmail.com>2019-07-29 01:25:54 +0200
commit505f47403ba6a95179ae854c80db07ae77d70947 (patch)
tree16819e4f6a988b7983ea006676291a11c081be0f /src/nvim/testdir
parent16727dcf1e76b5a0b47a3b3b499780d58f4a043a (diff)
downloadrneovim-505f47403ba6a95179ae854c80db07ae77d70947.tar.gz
rneovim-505f47403ba6a95179ae854c80db07ae77d70947.tar.bz2
rneovim-505f47403ba6a95179ae854c80db07ae77d70947.zip
vim-patch:8.1.0017: shell command completion has duplicates #10616
Problem: Shell command completion has duplicates. (Yegappan Lakshmanan) Solution: Use a hash table to avoid duplicates. (Ozaki Kiichi, closes vim/vim#539, closes vim/vim#2733) https://github.com/vim/vim/commit/62fe66f251263715968442e237742d9d3dfd5fa1
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_cmdline.vim12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim
index e0d4df48a9..eb18284b4a 100644
--- a/src/nvim/testdir/test_cmdline.vim
+++ b/src/nvim/testdir/test_cmdline.vim
@@ -232,6 +232,15 @@ func Test_getcompletion()
let l = getcompletion('not', 'mapclear')
call assert_equal([], l)
+ let l = getcompletion('.', 'shellcmd')
+ call assert_equal(['./', '../'], l[0:1])
+ call assert_equal(-1, match(l[2:], '^\.\.\?/$'))
+ let root = has('win32') ? 'C:\\' : '/'
+ let l = getcompletion(root, 'shellcmd')
+ let expected = map(filter(glob(root . '*', 0, 1),
+ \ 'isdirectory(v:val) || executable(v:val)'), 'isdirectory(v:val) ? v:val . ''/'' : v:val')
+ call assert_equal(expected, l)
+
if has('cscope')
let l = getcompletion('', 'cscope')
let cmds = ['add', 'find', 'help', 'kill', 'reset', 'show']
@@ -273,8 +282,7 @@ func Test_getcompletion()
call assert_equal([], l)
" For others test if the name is recognized.
- let names = ['buffer', 'environment', 'file_in_path',
- \ 'mapping', 'shellcmd', 'tag', 'tag_listfiles', 'user']
+ let names = ['buffer', 'environment', 'file_in_path', 'mapping', 'tag', 'tag_listfiles', 'user']
if has('cmdline_hist')
call add(names, 'history')
endif