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:
zeertzjq
2022-07-12 13:28:17 +08:00
parent 0f1b17788e
commit 01afd43bc9
7 changed files with 167 additions and 3 deletions

View File

@@ -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)