Mercurial > vim
diff runtime/doc/eval.txt @ 13272:abaebba89fd4 v8.0.1510
patch 8.0.1510: cannot test if a command causes a beep
commit https://github.com/vim/vim/commit/b48e96f61c87a64e38e3ac50732c92a84a4833b8
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Feb 13 12:26:14 2018 +0100
patch 8.0.1510: cannot test if a command causes a beep
Problem: Cannot test if a command causes a beep.
Solution: Add assert_beeps().
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 13 Feb 2018 12:30:07 +0100 |
parents | dd3b2ecf91f6 |
children | fbda23eb0996 |
line wrap: on
line diff
--- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2017,6 +2017,7 @@ argidx() Number current index in the a 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 fi < 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}]) *ass 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