aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorShougo Matsushita <Shougo.Matsu@gmail.com>2015-06-15 22:09:33 +0900
committerJustin M. Keyes <justinkz@gmail.com>2015-06-20 11:53:13 -0400
commit8b200f904f33ea55c11735ec2abcf0ab3925a537 (patch)
treeba136b42b4e8522b172122584dcd94d75281c684 /test
parent7b87dc9299993003ea9cd2e0f0f38b881010501d (diff)
downloadrneovim-8b200f904f33ea55c11735ec2abcf0ab3925a537.tar.gz
rneovim-8b200f904f33ea55c11735ec2abcf0ab3925a537.tar.bz2
rneovim-8b200f904f33ea55c11735ec2abcf0ab3925a537.zip
completion: Initialize v:completed_item #2839
v:completed_item should always be a dict (not empty string), even before the first completion.
Diffstat (limited to 'test')
-rw-r--r--test/functional/viml/completion_spec.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/functional/viml/completion_spec.lua b/test/functional/viml/completion_spec.lua
index 7fd36c64fa..5e3d4a6658 100644
--- a/test/functional/viml/completion_spec.lua
+++ b/test/functional/viml/completion_spec.lua
@@ -10,6 +10,13 @@ describe('completion', function()
end)
describe('v:completed_item', function()
+ it('is empty dict until completion', function()
+ eq({}, eval('v:completed_item'))
+ end)
+ it('is empty dict if the candidate is not inserted', function()
+ feed('ifoo<ESC>o<C-x><C-n><C-e><ESC>')
+ eq({}, eval('v:completed_item'))
+ end)
it('returns expected dict in normal completion', function()
feed('ifoo<ESC>o<C-x><C-n><ESC>')
eq('foo', eval('getline(2)'))