summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-09-06 21:47:48 +0200
committerBram Moolenaar <Bram@vim.org>2020-09-06 21:47:48 +0200
commit9bd5d879c2ecfbdbb168b090e12f4b89724a302e (patch)
treee9c9a342ba1d31c884d65edcbe864ba35518cf51 /runtime
parentc98cdb3bc970f04f93b4c394b4ec94c2eb5546c3 (diff)
patch 8.2.1631: test_fails() does not check the context of the line numberv8.2.1631
Problem: test_fails() does not check the context of the line number. Solution: Use another argument to specify the context of the line number.
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 52d1d7f13f..23d3e36378 100644
--- a/runtime/doc/testing.txt
+++ b/runtime/doc/testing.txt
@@ -293,7 +293,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|.
@@ -320,6 +320,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.