1- *eval.txt* For Vim version 7.4. Last change: 2016 Jan 09
1+ *eval.txt* For Vim version 7.4. Last change: 2016 Jan 15
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1750,9 +1750,11 @@ 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_fails( {cmd} [, {error} ]) none assert {cmd} fails
1756+ assert_false( {actual} [, {msg} ]) none assert {actual} is false
1757+ assert_true( {actual} [, {msg} ]) none assert {actual} is true
17561758asin( {expr} ) Float arc sine of {expr}
17571759atan( {expr} ) Float arc tangent of {expr}
17581760atan2( {expr} , {expr} ) Float arc tangent of {expr1} / {expr2}
@@ -2179,7 +2181,7 @@ argv([{nr}]) The result is the {nr}th file in the argument list of the
21792181 returned.
21802182
21812183 *assert_equal()*
2182- assert_equal({expected} , {actual} , [, {msg} ])
2184+ assert_equal({expected} , {actual} [, {msg} ])
21832185 When {expected} and {actual} are not equal an error message is
21842186 added to | v:errors | .
21852187 There is no automatic conversion, the String "4" is different
@@ -2193,18 +2195,36 @@ assert_equal({expected}, {actual}, [, {msg}])
21932195< Will result in a string to be added to | v:errors | :
21942196 test.vim line 12: Expected 'foo' but got 'bar' ~
21952197
2196- assert_false({actual} , [, {msg} ]) *assert_false()*
2198+ assert_exception({error} [, {msg} ]) *assert_exception()*
2199+ When v:exception does not contain the string {error} an error
2200+ message is added to | v:errors | .
2201+ This can be used to assert that a command throws an exception.
2202+ Using the error number, followed by a colon, avoids problems
2203+ with translations: >
2204+ try
2205+ commandthatfails
2206+ call assert_false(1, 'command should have failed')
2207+ catch
2208+ call assert_exception('E492:')
2209+ endtry
2210+
2211+ assert_fails({cmd} [, {error} ]) *assert_fails()*
2212+ Run {cmd} and add an error message to | v:errors | if it does
2213+ NOT produce an error.
2214+ When {error} is given it must match | v:errmsg | .
2215+
2216+ assert_false({actual} [, {msg} ]) *assert_false()*
21972217 When {actual} is not false an error message is added to
2198- | v:errors | , like with | assert_equal() | ..
2218+ | v:errors | , like with | assert_equal() | .
21992219 A value is false when it is zero. When "{actual} " is not a
22002220 number the assert fails.
22012221 When {msg} is omitted an error in the form "Expected False but
22022222 got {actual} " is produced.
22032223
2204- assert_true({actual} , [, {msg} ]) *assert_true()*
2224+ assert_true({actual} [, {msg} ]) *assert_true()*
22052225 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}
2226+ | v:errors | , like with | assert_equal() | .
2227+ A value is true when it is a non-zero number. When {actual}
22082228 is not a number the assert fails.
22092229 When {msg} is omitted an error in the form "Expected True but
22102230 got {actual} " is produced.
@@ -3477,7 +3497,7 @@ getcmdwintype() *getcmdwintype()*
34773497 *getcurpos()*
34783498getcurpos() Get the position of the cursor. This is like getpos('.'), but
34793499 includes an extra item in the list:
3480- [bufnum, lnum, col, off, curswant]
3500+ [bufnum, lnum, col, off, curswant] ~
34813501 The "curswant" number is the preferred column when moving the
34823502 cursor vertically.
34833503 This can be used to save and restore the cursor position: >
0 commit comments