aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/arglist_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/legacy/arglist_spec.lua')
-rw-r--r--test/functional/legacy/arglist_spec.lua38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/functional/legacy/arglist_spec.lua b/test/functional/legacy/arglist_spec.lua
index 46a016ab1c..8379e426e0 100644
--- a/test/functional/legacy/arglist_spec.lua
+++ b/test/functional/legacy/arglist_spec.lua
@@ -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()
@@ -236,7 +238,43 @@ describe('argument list commands', function()
end)
it('quitting Vim with unedited files in the argument list throws E173', function()
+ command('set nomore')
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)