mirror of
https://github.com/neovim/neovim.git
synced 2026-02-20 09:19:43 +10:00
vim-patch:8.2.0275: some Ex code not covered by tests
Problem: Some Ex code not covered by tests.
Solution: Add test cases. (Yegappan Lakshmanan, closes vim/vim#5659)
406cd90f19
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
-- Test argument list commands
|
||||
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
local clear, command, eq = helpers.clear, helpers.command, helpers.eq
|
||||
local eval, exc_exec, neq = helpers.eval, helpers.exc_exec, helpers.neq
|
||||
local feed = helpers.feed
|
||||
local pcall_err = helpers.pcall_err
|
||||
|
||||
describe('argument list commands', function()
|
||||
@@ -239,4 +241,39 @@ describe('argument list commands', function()
|
||||
command('args a b c')
|
||||
eq('Vim(quit):E173: 2 more files to edit', pcall_err(command, 'quit'))
|
||||
end)
|
||||
|
||||
it(':confirm quit with unedited files in arglist', function()
|
||||
local screen = Screen.new(60, 6)
|
||||
screen:attach()
|
||||
command('set nomore')
|
||||
command('args a b c')
|
||||
feed(':confirm quit\n')
|
||||
screen:expect([[
|
||||
|
|
||||
~ |
|
||||
|
|
||||
:confirm quit |
|
||||
2 more files to edit. Quit anyway? |
|
||||
[Y]es, (N)o: ^ |
|
||||
]])
|
||||
feed('N')
|
||||
screen:expect([[
|
||||
^ |
|
||||
~ |
|
||||
~ |
|
||||
~ |
|
||||
~ |
|
||||
|
|
||||
]])
|
||||
feed(':confirm quit\n')
|
||||
screen:expect([[
|
||||
|
|
||||
~ |
|
||||
|
|
||||
:confirm quit |
|
||||
2 more files to edit. Quit anyway? |
|
||||
[Y]es, (N)o: ^ |
|
||||
]])
|
||||
feed('Y')
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user