|
1 | | -*eval.txt* For Vim version 7.4. Last change: 2015 Nov 29 |
| 1 | +*eval.txt* For Vim version 7.4. Last change: 2015 Nov 30 |
2 | 2 |
|
3 | 3 |
|
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -1380,7 +1380,7 @@ v:errmsg Last given error message. It's allowed to set this variable. |
1380 | 1380 | < "errmsg" also works, for backwards compatibility. |
1381 | 1381 |
|
1382 | 1382 | *v:errors* *errors-variable* |
1383 | | -v:errors Errors found by assert functions, such as |assertTrue()|. |
| 1383 | +v:errors Errors found by assert functions, such as |assert_true()|. |
1384 | 1384 | This is a list of strings. |
1385 | 1385 | The assert functions append an item when an assert fails. |
1386 | 1386 | To remove old results make it empty: > |
@@ -1742,13 +1742,13 @@ append( {lnum}, {string}) Number append {string} below line {lnum} |
1742 | 1742 | append( {lnum}, {list}) Number append lines {list} below line {lnum} |
1743 | 1743 | argc() Number number of files in the argument list |
1744 | 1744 | argidx() Number current index in the argument list |
1745 | | -arglistid( [{winnr}, [ {tabnr}]]) |
| 1745 | +arglistid( [{winnr} [, {tabnr}]]) |
1746 | 1746 | Number argument list id |
1747 | 1747 | argv( {nr}) String {nr} entry of the argument list |
1748 | 1748 | argv( ) List the argument list |
1749 | | -assertEqual( {exp}, {act}) none assert that {exp} equals {act} |
1750 | | -assertFalse( {actual}) none assert that {actual} is false |
1751 | | -assertTrue( {actual}) none assert that {actual} is true |
| 1749 | +assert_equal( {exp}, {act} [, {msg}]) none assert that {exp} equals {act} |
| 1750 | +assert_false( {actual} [, {msg}]) none assert that {actual} is false |
| 1751 | +assert_true( {actual} [, {msg}]) none assert that {actual} is true |
1752 | 1752 | asin( {expr}) Float arc sine of {expr} |
1753 | 1753 | atan( {expr}) Float arc tangent of {expr} |
1754 | 1754 | atan2( {expr}, {expr}) Float arc tangent of {expr1} / {expr2} |
@@ -2166,30 +2166,36 @@ argv([{nr}]) The result is the {nr}th file in the argument list of the |
2166 | 2166 | < Without the {nr} argument a |List| with the whole |arglist| is |
2167 | 2167 | returned. |
2168 | 2168 |
|
2169 | | - *assertEqual()* |
2170 | | -assertEqual({expected}, {actual}) |
| 2169 | + *assert_equal()* |
| 2170 | +assert_equal({expected}, {actual}, [, {msg}]) |
2171 | 2171 | When {expected} and {actual} are not equal an error message is |
2172 | 2172 | added to |v:errors|. |
2173 | 2173 | There is no automatic conversion, the String "4" is different |
2174 | 2174 | from the Number 4. And the number 4 is different from the |
2175 | 2175 | Float 4.0. The value of 'ignorecase' is not used here, case |
2176 | 2176 | always matters. |
| 2177 | + When {msg} is omitted an error in the form "Expected |
| 2178 | + {expected} but got {actual}" is produced. |
2177 | 2179 | Example: > |
2178 | | - assertEqual('foo', 'bar') |
| 2180 | + assert_equal('foo', 'bar') |
2179 | 2181 | < Will result in a string to be added to |v:errors|: |
2180 | 2182 | test.vim line 12: Expected 'foo' but got 'bar' ~ |
2181 | 2183 |
|
2182 | | -assertFalse({actual}) *assertFalse()* |
| 2184 | +assert_false({actual}, [, {msg}]) *assert_false()* |
2183 | 2185 | When {actual} is not false an error message is added to |
2184 | | - |v:errors|, like with |assertEqual()|.. |
| 2186 | + |v:errors|, like with |assert_equal()|.. |
2185 | 2187 | A value is false when it is zero. When "{actual}" is not a |
2186 | 2188 | number the assert fails. |
| 2189 | + When {msg} is omitted an error in the form "Expected False but |
| 2190 | + got {actual}" is produced. |
2187 | 2191 |
|
2188 | | -assertTrue({actual}) *assertTrue()* |
| 2192 | +assert_true({actual}, [, {msg}]) *assert_true()* |
2189 | 2193 | When {actual} is not true an error message is added to |
2190 | | - |v:errors|, like with |assertEqual()|.. |
| 2194 | + |v:errors|, like with |assert_equal()|.. |
2191 | 2195 | A value is true when it is a non-zeron number. When {actual} |
2192 | 2196 | is not a number the assert fails. |
| 2197 | + When {msg} is omitted an error in the form "Expected True but |
| 2198 | + got {actual}" is produced. |
2193 | 2199 |
|
2194 | 2200 | asin({expr}) *asin()* |
2195 | 2201 | Return the arc sine of {expr} measured in radians, as a |Float| |
|
0 commit comments