summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-02-13 12:26:14 +0100
committerBram Moolenaar <Bram@vim.org>2018-02-13 12:26:14 +0100
commitb48e96f61c87a64e38e3ac50732c92a84a4833b8 (patch)
tree170cf91f5865fda3f985328c50b5d009e5296a3b /runtime
parent294959528e02403cd7ef6541208835f0c621c63b (diff)
patch 8.0.1510: cannot test if a command causes a beepv8.0.1510
Problem: Cannot test if a command causes a beep. Solution: Add assert_beeps().
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/eval.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 9158f3850a..8f14ddd321 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -2017,6 +2017,7 @@ argidx() Number current index in the argument list
arglistid([{winnr} [, {tabnr}]]) Number argument list id
argv({nr}) String {nr} entry of the argument list
argv() List the argument list
+assert_beeps({cmd}) none assert {cmd} causes a beep
assert_equal({exp}, {act} [, {msg}])
none assert {exp} is equal to {act}
assert_exception({error} [, {msg}])
@@ -2568,6 +2569,11 @@ argv([{nr}]) The result is the {nr}th file in the argument list of the
< Without the {nr} argument a |List| with the whole |arglist| is
returned.
+assert_beeps({cmd}) *assert_beeps()*
+ Run {cmd} and add an error message to |v:errors| if it does
+ NOT produce a beep or visual bell.
+ Also see |assert_fails()|.
+
*assert_equal()*
assert_equal({expected}, {actual} [, {msg}])
When {expected} and {actual} are not equal an error message is
@@ -2600,6 +2606,8 @@ assert_fails({cmd} [, {error}]) *assert_fails()*
Run {cmd} and add an error message to |v:errors| if it does
NOT produce an error.
When {error} is given it must match in |v:errmsg|.
+ Note that beeping is not considered an error, and some failing
+ commands only beep. Use |assert_beeps()| for those.
assert_false({actual} [, {msg}]) *assert_false()*
When {actual} is not false an error message is added to