Fix cmdline confirmation
This commit is contained in:
39
lua/cmp/utils/api_spec.lua
Normal file
39
lua/cmp/utils/api_spec.lua
Normal file
@@ -0,0 +1,39 @@
|
||||
local spec = require('cmp.utils.spec')
|
||||
local keymap = require('cmp.utils.keymap')
|
||||
local feedkeys = require('cmp.utils.feedkeys')
|
||||
local api = require('cmp.utils.api')
|
||||
|
||||
describe('api', function()
|
||||
describe('get_cursor', function()
|
||||
before_each(spec.before)
|
||||
it('insert-mode', function()
|
||||
feedkeys.call(keymap.t('i\t1234567890'), 'n', function()
|
||||
assert.are.same(api.get_cursor()[2], 10)
|
||||
end)
|
||||
feedkeys.call('', 'nx')
|
||||
end)
|
||||
it('cmdline-mode', function()
|
||||
feedkeys.call(keymap.t(':\t1234567890'), 'n', function()
|
||||
assert.are.same(api.get_cursor()[2], 10)
|
||||
end)
|
||||
feedkeys.call('', 'nx')
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('get_cursor_before_line', function()
|
||||
before_each(spec.before)
|
||||
it('insert-mode', function()
|
||||
feedkeys.call(keymap.t(':\t1234567890<Left><Left>'), 'n', function()
|
||||
assert.are.same(api.get_cursor_before_line(), '\t12345678')
|
||||
end)
|
||||
feedkeys.call('', 'nx')
|
||||
end)
|
||||
it('cmdline-mode', function()
|
||||
feedkeys.call(keymap.t(':\t1234567890<Left><Left>'), 'n', function()
|
||||
assert.are.same(api.get_cursor_before_line(), '\t12345678')
|
||||
end)
|
||||
feedkeys.call('', 'nx')
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user