aboutsummaryrefslogtreecommitdiff
path: root/test/functional/viml/completion_spec.lua
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2018-08-20 18:51:25 +0200
committerBjörn Linse <bjorn.linse@gmail.com>2018-08-27 15:15:49 +0200
commit3d88287e3016aacae64e2ddcd11a37e024557e45 (patch)
tree241711e8f052f02b0e465a42f6d47af302c8743b /test/functional/viml/completion_spec.lua
parent03978a0f296aa8638a578698ea0a6cceedb34527 (diff)
downloadrneovim-3d88287e3016aacae64e2ddcd11a37e024557e45.tar.gz
rneovim-3d88287e3016aacae64e2ddcd11a37e024557e45.tar.bz2
rneovim-3d88287e3016aacae64e2ddcd11a37e024557e45.zip
tests: introduce screen:expect{...} form
Diffstat (limited to 'test/functional/viml/completion_spec.lua')
-rw-r--r--test/functional/viml/completion_spec.lua101
1 files changed, 0 insertions, 101 deletions
diff --git a/test/functional/viml/completion_spec.lua b/test/functional/viml/completion_spec.lua
index c14f7fc1a6..3222e5783d 100644
--- a/test/functional/viml/completion_spec.lua
+++ b/test/functional/viml/completion_spec.lua
@@ -873,107 +873,6 @@ describe('completion', function()
{3:-- Keyword Local completion (^N^P) }{4:match 1 of 7} |
]])
end)
-end)
-
-describe('ui/ext_popupmenu', function()
- local screen
- local items, selected, anchor
- before_each(function()
- clear()
- screen = Screen.new(60, 8)
- screen:attach({rgb=true, ext_popupmenu=true})
- screen:set_default_attr_ids({
- [1] = {bold=true, foreground=Screen.colors.Blue},
- [2] = {bold = true},
- })
- screen:set_on_event_handler(function(name, data)
- if name == "popupmenu_show" then
- local row, col
- items, selected, row, col = unpack(data)
- anchor = {row, col}
- elseif name == "popupmenu_select" then
- selected = data[1]
- elseif name == "popupmenu_hide" then
- items = nil
- end
- end)
- end)
-
- it('works', function()
- source([[
- function! TestComplete() abort
- call complete(1, ['foo', 'bar', 'spam'])
- return ''
- endfunction
- ]])
- local expected = {
- {'foo', '', '', ''},
- {'bar', '', '', ''},
- {'spam', '', '', ''},
- }
- feed('o<C-r>=TestComplete()<CR>')
- screen:expect([[
- |
- foo^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {2:-- INSERT --} |
- ]], nil, nil, function()
- eq(expected, items)
- eq(0, selected)
- eq({1,0}, anchor)
- end)
-
- feed('<c-p>')
- screen:expect([[
- |
- ^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {2:-- INSERT --} |
- ]], nil, nil, function()
- eq(expected, items)
- eq(-1, selected)
- eq({1,0}, anchor)
- end)
-
- -- down moves the selection in the menu, but does not insert anything
- feed('<down><down>')
- screen:expect([[
- |
- ^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {2:-- INSERT --} |
- ]], nil, nil, function()
- eq(expected, items)
- eq(1, selected)
- eq({1,0}, anchor)
- end)
-
- feed('<cr>')
- screen:expect([[
- |
- bar^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {2:-- INSERT --} |
- ]], nil, nil, function()
- eq(nil, items) -- popupmenu was hidden
- end)
- end)
it('TextChangedP autocommand', function()
curbufmeths.set_lines(0, 1, false, { 'foo', 'bar', 'foobar'})