mirror of
https://github.com/neovim/neovim.git
synced 2025-10-17 15:21:47 +00:00
vim-patch:8.2.1631: test_fails() does not check the context of the line number
Problem: test_fails() does not check the context of the line number.
Solution: Use another argument to specify the context of the line number.
9bd5d879c2
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -100,7 +100,7 @@ assert_exception({error} [, {msg}]) *assert_exception()*
|
||||
endtry
|
||||
<
|
||||
*assert_fails()*
|
||||
assert_fails({cmd} [, {error} [, {msg} [, {lnum}]]])
|
||||
assert_fails({cmd} [, {error} [, {msg} [, {lnum} [, {context}]]]])
|
||||
Run {cmd} and add an error message to |v:errors| if it does
|
||||
NOT produce an error or when {error} is not found in the
|
||||
error message. Also see |assert-return|.
|
||||
@@ -127,6 +127,10 @@ assert_fails({cmd} [, {error} [, {msg} [, {lnum}]]])
|
||||
the line number at which the error was reported. That can be
|
||||
the line number in a function or in a script.
|
||||
|
||||
When {context} is present it is used as a pattern and matched
|
||||
against the context (script name or function name) where
|
||||
{lnum} is located in.
|
||||
|
||||
Note that beeping is not considered an error, and some failing
|
||||
commands only beep. Use |assert_beeps()| for those.
|
||||
|
||||
|
Reference in New Issue
Block a user