diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-01-15 20:48:22 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-01-15 20:48:22 +0100 |
commit | a260b87d9da17f605666630f18c1ed909c2b8bae (patch) | |
tree | 03fb7aaf4b31ace780c4b040537e65c695b63457 /runtime | |
parent | 3d6d5cc3a417c04d9772596ea83f8e6b41321781 (diff) |
patch 7.4.1096v7.4.1096
Problem: Need several lines to verify a command produces an error.
Solution: Add assert_fails(). (suggested by Nikolay Pavlov)
Make the quickfix alloc test actually work.
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/eval.txt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 906a8691e2..8340bf2fee 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1752,6 +1752,7 @@ argv( {nr}) String {nr} entry of the argument list argv( ) List the argument list assert_equal( {exp}, {act} [, {msg}]) none assert {exp} equals {act} assert_exception({error} [, {msg}]) none assert {error} is in v:exception +assert_fails( {cmd} [, {error}]) none assert {cmd} fails assert_false( {actual} [, {msg}]) none assert {actual} is false assert_true( {actual} [, {msg}]) none assert {actual} is true asin( {expr}) Float arc sine of {expr} @@ -2207,6 +2208,11 @@ assert_exception({error} [, {msg}]) *assert_exception()* call assert_exception('E492:') endtry +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 |v:errmsg|. + assert_false({actual} [, {msg}]) *assert_false()* When {actual} is not false an error message is added to |v:errors|, like with |assert_equal()|. |