Mercurial > vim
comparison runtime/doc/eval.txt @ 8831:6f41d68aa68e v7.4.1703
commit https://github.com/vim/vim/commit/b50e5f56861deb867478997397f7c784a7043233
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Apr 3 20:57:20 2016 +0200
patch 7.4.1703
Problem: Can't assert for not equal and not matching.
Solution: Add assert_notmatch() and assert_notequal().
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 03 Apr 2016 21:00:05 +0200 |
parents | aba2d0a01290 |
children | 47f17f66da3d |
comparison
equal
deleted
inserted
replaced
8830:d15abeac22c6 | 8831:6f41d68aa68e |
---|---|
1799 argidx() Number current index in the argument list | 1799 argidx() Number current index in the argument list |
1800 arglistid( [{winnr} [, {tabnr}]]) | 1800 arglistid( [{winnr} [, {tabnr}]]) |
1801 Number argument list id | 1801 Number argument list id |
1802 argv( {nr}) String {nr} entry of the argument list | 1802 argv( {nr}) String {nr} entry of the argument list |
1803 argv() List the argument list | 1803 argv() List the argument list |
1804 assert_equal( {exp}, {act} [, {msg}]) none assert {exp} equals {act} | 1804 assert_equal( {exp}, {act} [, {msg}]) none assert {exp} is equal to {act} |
1805 assert_exception( {error} [, {msg}]) none assert {error} is in v:exception | 1805 assert_exception( {error} [, {msg}]) none assert {error} is in v:exception |
1806 assert_fails( {cmd} [, {error}]) none assert {cmd} fails | 1806 assert_fails( {cmd} [, {error}]) none assert {cmd} fails |
1807 assert_false( {actual} [, {msg}]) none assert {actual} is false | 1807 assert_false( {actual} [, {msg}]) none assert {actual} is false |
1808 assert_match( {pat}, {text} [, {msg}]) none assert {pat} matches {text} | 1808 assert_match( {pat}, {text} [, {msg}]) none assert {pat} matches {text} |
1809 assert_notequal( {exp}, {act} [, {msg}]) none assert {exp} is not equal {act} | |
1810 assert_notmatch( {pat}, {text} [, {msg}]) none assert {pat} not matches {text} | |
1809 assert_true( {actual} [, {msg}]) none assert {actual} is true | 1811 assert_true( {actual} [, {msg}]) none assert {actual} is true |
1810 asin( {expr}) Float arc sine of {expr} | 1812 asin( {expr}) Float arc sine of {expr} |
1811 atan( {expr}) Float arc tangent of {expr} | 1813 atan( {expr}) Float arc tangent of {expr} |
1812 atan2( {expr}, {expr}) Float arc tangent of {expr1} / {expr2} | 1814 atan2( {expr}, {expr}) Float arc tangent of {expr1} / {expr2} |
1813 browse( {save}, {title}, {initdir}, {default}) | 1815 browse( {save}, {title}, {initdir}, {default}) |
2336 Example: > | 2338 Example: > |
2337 assert_match('^f.*o$', 'foobar') | 2339 assert_match('^f.*o$', 'foobar') |
2338 < Will result in a string to be added to |v:errors|: | 2340 < Will result in a string to be added to |v:errors|: |
2339 test.vim line 12: Pattern '^f.*o$' does not match 'foobar' ~ | 2341 test.vim line 12: Pattern '^f.*o$' does not match 'foobar' ~ |
2340 | 2342 |
2343 *assert_notequal()* | |
2344 assert_notequal({expected}, {actual} [, {msg}]) | |
2345 The opposite of `assert_equal()`: add an error message to | |
2346 |v:errors| when {expected} and {actual} are equal. | |
2347 | |
2348 *assert_notmatch()* | |
2349 assert_notmatch({pattern}, {actual} [, {msg}]) | |
2350 The opposite of `assert_match()`: add an error message to | |
2351 |v:errors| when {pattern} matches {actual}. | |
2352 | |
2341 assert_true({actual} [, {msg}]) *assert_true()* | 2353 assert_true({actual} [, {msg}]) *assert_true()* |
2342 When {actual} is not true an error message is added to | 2354 When {actual} is not true an error message is added to |
2343 |v:errors|, like with |assert_equal()|. | 2355 |v:errors|, like with |assert_equal()|. |
2344 A value is true when it is a non-zero number. When {actual} | 2356 A value is true when it is a non-zero number. When {actual} |
2345 is not a number the assert fails. | 2357 is not a number the assert fails. |