diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-07-12 17:02:46 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-12 17:02:46 +0800 |
commit | d8360e90333186ebb3a205a1ae64c1cbb531f0b9 (patch) | |
tree | eff7937a6f68e013a131891dfd3ebeeb121c4ee1 /test/functional/legacy/arglist_spec.lua | |
parent | 0f1b17788eb584f41d59c12c968f5e1886655334 (diff) | |
parent | aa373e3abb17a5265b1afa8c119207980e90001a (diff) | |
download | rneovim-d8360e90333186ebb3a205a1ae64c1cbb531f0b9.tar.gz rneovim-d8360e90333186ebb3a205a1ae64c1cbb531f0b9.tar.bz2 rneovim-d8360e90333186ebb3a205a1ae64c1cbb531f0b9.zip |
Merge pull request #19334 from zeertzjq/vim-8.2.0275
vim-patch:8.2.{0275,0293,5050}
Diffstat (limited to 'test/functional/legacy/arglist_spec.lua')
-rw-r--r-- | test/functional/legacy/arglist_spec.lua | 38 |
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) |