From 01afd43bc90408b43db906845245a4959c8ee3a0 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 12 Jul 2022 13:28:17 +0800 Subject: 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) https://github.com/vim/vim/commit/406cd90f1963ca60813db91c413eef4b1b78ee44 --- test/functional/legacy/arglist_spec.lua | 37 +++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'test/functional/legacy/arglist_spec.lua') diff --git a/test/functional/legacy/arglist_spec.lua b/test/functional/legacy/arglist_spec.lua index 46a016ab1c..6acbaf03b2 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() @@ -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) -- cgit From 4aa4675fbface275224d178ebb436bc214dd1056 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 12 Jul 2022 14:45:36 +0800 Subject: vim-patch:8.2.0293: various Ex commands not sufficiently tested Problem: Various Ex commands not sufficiently tested. Solution: Add more test cases. (Yegappan Lakshmanan, closes vim/vim#5673) https://github.com/vim/vim/commit/818fc9ad143911b2faa0d7cee86724aa70a02080 Needs to assert E170 instead of E580 because patch 8.2.3486 has been ported but patch 8.2.1183 hasn't. --- test/functional/legacy/arglist_spec.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'test/functional/legacy/arglist_spec.lua') diff --git a/test/functional/legacy/arglist_spec.lua b/test/functional/legacy/arglist_spec.lua index 6acbaf03b2..8379e426e0 100644 --- a/test/functional/legacy/arglist_spec.lua +++ b/test/functional/legacy/arglist_spec.lua @@ -238,6 +238,7 @@ 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) -- cgit