1
0
forked from aniani/vim

patch 7.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.
This commit is contained in:
Bram Moolenaar
2016-01-15 20:48:22 +01:00
parent 3d6d5cc3a4
commit a260b87d9d
6 changed files with 71 additions and 28 deletions

View File

@@ -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()|.