aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-11-05 12:41:36 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-11-05 12:45:43 +0800
commit02f80d9a8a560a93142bcebf324ba14cde4dd1b5 (patch)
tree3a581c5518bdd20b09a70afa944b3325c96fe824 /runtime
parent8ba7a966a1339767b19a5ca4449b38ef0cae49c7 (diff)
downloadrneovim-02f80d9a8a560a93142bcebf324ba14cde4dd1b5.tar.gz
rneovim-02f80d9a8a560a93142bcebf324ba14cde4dd1b5.tar.bz2
rneovim-02f80d9a8a560a93142bcebf324ba14cde4dd1b5.zip
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. https://github.com/vim/vim/commit/9bd5d879c2ecfbdbb168b090e12f4b89724a302e Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/testing.txt6
1 files changed, 5 insertions, 1 deletions
diff --git a/runtime/doc/testing.txt b/runtime/doc/testing.txt
index 6d138de6c0..56e0dad656 100644
--- a/runtime/doc/testing.txt
+++ b/runtime/doc/testing.txt
@@ -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.