@@ -1750,9 +1750,10 @@ arglistid( [{winnr} [, {tabnr}]])
17501750 Number argument list id
17511751argv( {nr} ) String {nr} entry of the argument list
17521752argv( ) List the argument list
1753- assert_equal( {exp} , {act} [, {msg} ]) none assert that {exp} equals {act}
1754- assert_false( {actual} [, {msg} ]) none assert that {actual} is false
1755- assert_true( {actual} [, {msg} ]) none assert that {actual} is true
1753+ assert_equal( {exp} , {act} [, {msg} ]) none assert {exp} equals {act}
1754+ assert_exception({error} [, {msg} ]) none assert {error} is in v:exception
1755+ assert_false( {actual} [, {msg} ]) none assert {actual} is false
1756+ assert_true( {actual} [, {msg} ]) none assert {actual} is true
17561757asin( {expr} ) Float arc sine of {expr}
17571758atan( {expr} ) Float arc tangent of {expr}
17581759atan2( {expr} , {expr} ) Float arc tangent of {expr1} / {expr2}
@@ -2179,7 +2180,7 @@ argv([{nr}]) The result is the {nr}th file in the argument list of the
21792180 returned.
21802181
21812182 *assert_equal()*
2182- assert_equal({expected} , {actual} , [, {msg} ])
2183+ assert_equal({expected} , {actual} [, {msg} ])
21832184 When {expected} and {actual} are not equal an error message is
21842185 added to | v:errors | .
21852186 There is no automatic conversion, the String "4" is different
@@ -2193,18 +2194,31 @@ assert_equal({expected}, {actual}, [, {msg}])
21932194< Will result in a string to be added to | v:errors | :
21942195 test.vim line 12: Expected 'foo' but got 'bar' ~
21952196
2196- assert_false({actual} , [, {msg} ]) *assert_false()*
2197+ assert_exception({error} [, {msg} ]) *assert_exception()*
2198+ When v:exception does not contain the string {error} an error
2199+ message is added to | v:errors | .
2200+ This can be used to assert that a command throws an exception.
2201+ Using the error number, followed by a colon, avoids problems
2202+ with translations: >
2203+ try
2204+ commandthatfails
2205+ call assert_false(1, 'command should have failed')
2206+ catch
2207+ call assert_exception('E492:')
2208+ endtry
2209+
2210+ assert_false({actual} [, {msg} ]) *assert_false()*
21972211 When {actual} is not false an error message is added to
2198- | v:errors | , like with | assert_equal() | ..
2212+ | v:errors | , like with | assert_equal() | .
21992213 A value is false when it is zero. When "{actual} " is not a
22002214 number the assert fails.
22012215 When {msg} is omitted an error in the form "Expected False but
22022216 got {actual} " is produced.
22032217
2204- assert_true({actual} , [, {msg} ]) *assert_true()*
2218+ assert_true({actual} [, {msg} ]) *assert_true()*
22052219 When {actual} is not true an error message is added to
2206- | v:errors | , like with | assert_equal() | ..
2207- A value is true when it is a non-zeron number. When {actual}
2220+ | v:errors | , like with | assert_equal() | .
2221+ A value is true when it is a non-zero number. When {actual}
22082222 is not a number the assert fails.
22092223 When {msg} is omitted an error in the form "Expected True but
22102224 got {actual} " is produced.
0 commit comments