Created
May 29, 2015 05:23
-
-
Save Shougo/97dec021f8c2646051d3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local helpers = require('test.functional.helpers') | |
local clear, feed, execute = helpers.clear, helpers.feed, helpers.execute | |
local eval, eq, neq = helpers.eval, helpers.eq, helpers.neq | |
local execute, source = helpers.execute, helpers.source | |
describe("completion", function() | |
before_each(function() | |
clear() | |
end) | |
describe("completeopt", function() | |
it('inserts the first candidate if default', function() | |
execute('set completeopt+=menuone') | |
feed('ifoo<ESC>o<C-x><C-n>bar<ESC>') | |
eq('foobar', eval('getline(2)')) | |
end) | |
it('selects the first candidate if noinsert', function() | |
execute('set completeopt+=menuone,noinsert') | |
feed('ifoo<ESC>o<C-x><C-n><C-y><ESC>') | |
eq('foo', eval('getline(2)')) | |
end) | |
it('does not insert the first candidate if noselect', function() | |
execute('set completeopt+=menuone,noselect') | |
feed('ifoo<ESC>o<C-x><C-n>bar<ESC>') | |
eq('bar', eval('getline(2)')) | |
end) | |
it('does not select/insert the first candidate if noselect and noinsert', function() | |
execute('set completeopt+=menuone,noselect,noinsert') | |
feed('ifoo<ESC>o<C-x><C-n><ESC>') | |
eq('', eval('getline(2)')) | |
end) | |
end) | |
end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment