vim-patch:8.2.0243: insufficient code coverage for ex_docmd.c functions

Problem:    Insufficient code coverage for ex_docmd.c functions.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#5618)
9f6277bdde

Cherry-pick Test_window_only() from patch 8.2.0203.
Cherry-pick a memory leak fix from patch 8.2.0399.
This commit is contained in:
zeertzjq
2022-07-08 17:43:05 +08:00
parent eea6a4f2a0
commit 27fd17a79c
14 changed files with 325 additions and 48 deletions

View File

@@ -3,6 +3,7 @@
local helpers = require('test.functional.helpers')(after_each)
local clear, command, eq = helpers.clear, helpers.command, helpers.eq
local eval, exc_exec, neq = helpers.eval, helpers.exc_exec, helpers.neq
local pcall_err = helpers.pcall_err
describe('argument list commands', function()
before_each(clear)
@@ -206,7 +207,6 @@ describe('argument list commands', function()
command('%argd')
end)
it('test for autocommand that redefines the argument list, when doing ":all"', function()
command('autocmd BufReadPost Xxx2 next Xxx2 Xxx1')
command("call writefile(['test file Xxx1'], 'Xxx1')")
@@ -234,4 +234,9 @@ describe('argument list commands', function()
command('argdelete Xxx*')
command('bwipe! Xxx1 Xxx2 Xxx3')
end)
it('quitting Vim with unedited files in the argument list throws E173', function()
command('args a b c')
eq('Vim(quit):E173: 2 more files to edit', pcall_err(command, 'quit'))
end)
end)